细节完善

This commit is contained in:
kron
2025-07-16 17:55:11 +08:00
parent 5770fb2ce2
commit 0adc1fa73a
4 changed files with 16 additions and 12 deletions

View File

@@ -17,7 +17,7 @@ const props = defineProps({
},
total: {
type: Number,
default: 90,
default: 120,
},
seq: {
type: Number,
@@ -25,7 +25,7 @@ const props = defineProps({
},
currentRound: {
type: Number,
default: 90,
default: 0,
},
battleId: {
type: String,
@@ -45,6 +45,7 @@ const currentSound = ref("");
const currentRound = ref(props.currentRound);
const currentRoundEnded = ref(!props.battleId);
const ended = ref(false);
const halfTime = ref(false);
watch(
() => props.tips,
@@ -133,7 +134,7 @@ async function onReceiveMessage(messages = []) {
(!props.battleId && msg.constructor === MESSAGETYPES.ShootSyncMeArrowID)
) {
if (props.melee && msg.userId !== user.value.id) return;
if (msg.target) {
if (!halfTime.value && msg.target) {
currentSound.value = msg.target.ring
? `${msg.target.ring}`
: "未上靶";
@@ -142,10 +143,12 @@ async function onReceiveMessage(messages = []) {
} else if (msg.constructor === MESSAGETYPES.AllReady) {
audioManager.play("比赛开始");
} else if (msg.constructor === MESSAGETYPES.MeleeAllReady) {
halfTime.value = false;
audioManager.play("比赛开始");
} else if (msg.constructor === MESSAGETYPES.CurrentRoundEnded) {
currentRoundEnded.value = true;
} else if (msg.constructor === MESSAGETYPES.HalfTimeOver) {
halfTime.value = true;
audioManager.play("中场休息");
} else if (msg.constructor === MESSAGETYPES.MatchOver) {
audioManager.play("比赛结束");