好像修好了血条的bug

This commit is contained in:
Fang_Zhijian 2024-06-01 17:24:20 +08:00
parent 7367c9047f
commit 9f6b3acf9a

View File

@ -112,6 +112,7 @@ const warnWindowCountdown = ref(5);
//
const showTestWindow = ref(false)
const maxHP = ref(1000)
const HP = ref(maxHP.value)
//
const gameState = ref(false)
@ -159,6 +160,10 @@ watch(showWarnWindow, (newVal) => {
}
});
watch(waveCounter, () => {
HP.value = Math.max(0, HP.value - channelAStrength.value)
});
const fansMedal = computed({
get: () => settings.value.fansMedal,
set: (value) => { settings.value.fansMedal = value === 'true' }
@ -460,7 +465,7 @@ const guardLevelText = computed(() => {
<h2>测试界面</h2>
<hr />
<p>绿色背景方便用色度键抠像最大 HP <input v-model="maxHP" size="2" /></p>
<p><button @click="waveCounter = 0">重置伤害</button> <button @click="waveCounter++">造成伤害</button></p>
<p><button @click="HP = maxHP">重置伤害</button> <button @click="HP -= 10">造成伤害</button></p>
<hr />
<div class="attack-box" style="padding-top: 25px;">
<div style="display: flex;">
@ -492,8 +497,8 @@ const guardLevelText = computed(() => {
HP
</div>
<div class="attribute-hp-board">
<div class="attribute-hp-bg" :style="{ width: ((maxHP - channelAStrength*waveCounter) / maxHP) * 100 + '%' }">
{{ (maxHP - channelAStrength*waveCounter) + "/" + maxHP }}
<div class="attribute-hp-bg" :style="{ width: (HP / maxHP) * 100 + '%' }">
{{ HP + "/" + maxHP }}
</div>
</div>
</div>