修复大乱斗返回游戏bug
This commit is contained in:
@@ -150,38 +150,27 @@ onLoad(async (options) => {
|
||||
}
|
||||
} else if (battleInfo.config.mode === 2) {
|
||||
players.value = [...battleInfo.blueTeam, ...battleInfo.redTeam];
|
||||
players.value.forEach((p) => {
|
||||
playersScores.value[p.id] = [];
|
||||
});
|
||||
if (battleInfo.startTime < 0) return;
|
||||
start.value = true;
|
||||
step.value = 3;
|
||||
players.value.forEach((p) => {
|
||||
playersScores.value[p.id] = p.arrows;
|
||||
playersScores.value[p.id] = [...p.arrows];
|
||||
if (p.id === user.value.id) {
|
||||
scores.value = p.arrows;
|
||||
scores.value = [...p.arrows];
|
||||
}
|
||||
});
|
||||
tips.value = `${
|
||||
scores.value.length ? "下半场-" : "上半场-"
|
||||
}请连续射6箭`;
|
||||
const remain = Date.now() / 1000 - battleInfo.startTime;
|
||||
console.log(`当前局剩余${remain}秒`);
|
||||
if (remain <= 90) {
|
||||
console.log(`当前局已进行${remain}秒`);
|
||||
if (battleInfo.status === 2) {
|
||||
tips.value = `${
|
||||
battleInfo.halfGame ? "下半场-" : "上半场-"
|
||||
}请连续射6箭`;
|
||||
setTimeout(() => {
|
||||
uni.$emit("update-ramain", remain);
|
||||
uni.$emit("update-ramain", 90 - remain);
|
||||
}, 300);
|
||||
} else if (remain > 90 && remain <= 110) {
|
||||
halfTimeTip.value = true;
|
||||
total.value = 20;
|
||||
} else if (battleInfo.status === 9) {
|
||||
startCount.value = false;
|
||||
tips.value = "准备下半场";
|
||||
setTimeout(() => {
|
||||
uni.$emit("update-ramain", 110 - remain);
|
||||
}, 300);
|
||||
} else if (remain > 110) {
|
||||
setTimeout(() => {
|
||||
uni.$emit("update-ramain", remain - 110);
|
||||
}, 300);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -405,11 +394,11 @@ async function onReceiveMessage(messages = []) {
|
||||
}
|
||||
}
|
||||
if (battleType.value === 2 && msg.userId === user.value.id) {
|
||||
scores.value.push(msg.target);
|
||||
scores.value.push({ ...msg.target });
|
||||
power.value = msg.target.battery;
|
||||
}
|
||||
if (playersScores.value[msg.userId])
|
||||
playersScores.value[msg.userId].push(msg.target);
|
||||
playersScores.value[msg.userId].push({ ...msg.target });
|
||||
}
|
||||
if (msg.constructor === MESSAGETYPES.CurrentRoundEnded) {
|
||||
if (battleType.value === 1) {
|
||||
|
||||
Reference in New Issue
Block a user