添加X环显示
This commit is contained in:
@@ -49,31 +49,34 @@ const updateSound = () => {
|
||||
async function onReceiveMessage(message) {
|
||||
if (ended.value) return;
|
||||
if (Array.isArray(message)) return;
|
||||
if (message.type === MESSAGETYPESV2.BattleStart) {
|
||||
melee.value = Boolean(message.mode > 3);
|
||||
totalShot.value = message.mode === 1 ? 3 : 2;
|
||||
const { type, mode, current, shootData } = message;
|
||||
if (type === MESSAGETYPESV2.BattleStart) {
|
||||
melee.value = Boolean(mode > 3);
|
||||
totalShot.value = mode === 1 ? 3 : 2;
|
||||
currentRoundEnded.value = true;
|
||||
audioManager.play("比赛开始");
|
||||
}
|
||||
if (message.type === MESSAGETYPESV2.BattleEnd) {
|
||||
if (type === MESSAGETYPESV2.BattleEnd) {
|
||||
audioManager.play("比赛结束");
|
||||
}
|
||||
if (message.type === MESSAGETYPESV2.ShootResult) {
|
||||
if (melee.value && message.current.playerId !== user.value.id) return;
|
||||
if (message.current.playerId === user.value.id) currentShot.value++;
|
||||
if (type === MESSAGETYPESV2.ShootResult) {
|
||||
if (melee.value && current.playerId !== user.value.id) return;
|
||||
if (current.playerId === user.value.id) currentShot.value++;
|
||||
if (message.shootData) {
|
||||
let key = [];
|
||||
key.push(
|
||||
message.shootData.ring ? `${message.shootData.ring}环` : "未上靶"
|
||||
shootData.ring
|
||||
? `${shootData.ringX ? "X" : shootData.ring}环`
|
||||
: "未上靶"
|
||||
);
|
||||
if (!message.shootData.ring)
|
||||
key.push(`向${getDirectionText(message.shootData.angle)}调整`);
|
||||
if (!shootData.ring)
|
||||
key.push(`向${getDirectionText(shootData.angle)}调整`);
|
||||
audioManager.play(key, false);
|
||||
}
|
||||
}
|
||||
if (message.type === MESSAGETYPESV2.NewRound) {
|
||||
if (type === MESSAGETYPESV2.NewRound) {
|
||||
currentShot.value = 0;
|
||||
currentRound.value = message.current.round;
|
||||
currentRound.value = current.round;
|
||||
currentRoundEnded.value = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user