细节修改

This commit is contained in:
kron
2025-07-18 15:04:29 +08:00
parent 4f4178b75d
commit b09f68789e
8 changed files with 50 additions and 28 deletions

View File

@@ -155,13 +155,15 @@ onLoad(async (options) => {
if (battleInfo.startTime < 0) return;
start.value = true;
step.value = 3;
tips.value = "请连续射出6支箭";
players.value.forEach((p) => {
playersScores.value[p.id] = p.arrows;
if (p.id === user.value.id) {
scores.value = p.arrows;
}
});
tips.value = `${
scores.value.length ? "下半场-" : "上半场-"
}请连续射出6支箭`;
const remain = Date.now() / 1000 - battleInfo.startTime;
if (remain <= 90) {
setTimeout(() => {
@@ -346,11 +348,17 @@ async function onReceiveMessage(messages = []) {
step.value = 3;
seq.value += 1;
timerSeq.value = 0;
tips.value = "请连续射出6支箭";
tips.value = `${
scores.value.length ? "下半场-" : "上半场-"
}请连续射出6支箭`;
total.value = 90;
halfTimeTip.value = false;
}
if (msg.constructor === MESSAGETYPES.ToSomeoneShoot) {
if (!start.value) {
start.value = true;
step.value = 3;
}
if (battleType.value === 1) {
if (currentShooterId.value !== msg.userId) {
seq.value += 1;
@@ -394,7 +402,7 @@ async function onReceiveMessage(messages = []) {
});
}
}
if (battleType.value === 2) {
if (battleType.value === 2 && msg.userId === user.value.id) {
scores.value.push(msg.target);
power.value = msg.target.battery;
}
@@ -590,13 +598,13 @@ onUnmounted(() => {
:currentShooterId="currentShooterId"
/>
<BowTarget
:mode="battleType ? 'team' : 'solo'"
:mode="battleType === 1 ? 'team' : 'solo'"
:power="start ? power : 0"
:currentRound="currentRound"
:totalRound="totalRounds"
:scores="scores"
:blueScores="blueScores"
:stop="halfTimeTip && !startCount"
:stop="!startCount"
/>
<BattleFooter
v-if="roundResults.length"