靶子组件优化

This commit is contained in:
kron
2025-07-16 09:33:33 +08:00
parent 9db88fb945
commit d5bc1a6a89
13 changed files with 38 additions and 108 deletions

View File

@@ -321,8 +321,6 @@ async function onReceiveMessage(messages = []) {
if (msg.constructor === MESSAGETYPES.ToSomeoneShoot) {
if (room.value.battleType === 1) {
if (currentShooterId.value !== msg.userId) {
scores.value = [];
blueScores.value = [];
seq.value += 1;
currentShooterId.value = msg.userId;
if (redTeam.value[0].id === currentShooterId.value) {
@@ -341,8 +339,8 @@ async function onReceiveMessage(messages = []) {
if (msg.constructor === MESSAGETYPES.ShootResult) {
if (room.value.battleType === 1) {
const isRed = redTeam.value.find((item) => item.id === msg.userId);
if (isRed) scores.value = [msg.target];
else blueScores.value = [msg.target];
if (isRed) scores.value.push(msg.target);
else blueScores.value.push(msg.target);
if (roundResults.value[currentRound.value - 1]) {
if (isRed && roundResults.value[currentRound.value - 1].redArrows) {
roundResults.value[currentRound.value - 1].redArrows.push(
@@ -551,7 +549,6 @@ onUnmounted(() => {
/>
<BowTarget
:mode="room.battleType ? 'team' : 'solo'"
:showE="start && user.id === currentShooterId"
:power="start ? power : 0"
:currentRound="currentRound"
:totalRound="totalRounds"