Feat: disable damage button when guard is present
release-tag / release-image (push) Successful in 32s
release-tag / release-image (push) Successful in 32s
Closes #52
This commit is contained in:
@@ -97,7 +97,9 @@ function damage_team_all(team: Team) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function check_for_guard(player: Player) {
|
||||||
|
return player.board.some(c => c.guard === true)
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -167,12 +169,13 @@ function damage_team_all(team: Team) {
|
|||||||
<div class="other_player_buttons_container">
|
<div class="other_player_buttons_container">
|
||||||
<button @click.stop="damage_team(props.player.team)"
|
<button @click.stop="damage_team(props.player.team)"
|
||||||
v-if="isSelfTurn && isPlayerEnemy && goStore.self?.turn && props.player.team" class="damage_button"
|
v-if="isSelfTurn && isPlayerEnemy && goStore.self?.turn && props.player.team" class="damage_button"
|
||||||
:disabled="(goStore.self?.turn.damage_reserve ?? 0) <= 0">
|
:disabled="(goStore.self?.turn.damage_reserve ?? 0) <= 0 || check_for_guard(props.player)">
|
||||||
Damage
|
Damage
|
||||||
</button>
|
</button>
|
||||||
<button @click.stop="damage_team_all(props.player.team)"
|
<button @click.stop="damage_team_all(props.player.team)"
|
||||||
v-if="isSelfTurn && isPlayerEnemy && goStore.self?.turn && props.player.team"
|
v-if="isSelfTurn && isPlayerEnemy && goStore.self?.turn && props.player.team"
|
||||||
class="damage_button all_damage_button" :disabled="(goStore.self?.turn.damage_reserve ?? 0) <= 0">
|
class="damage_button all_damage_button"
|
||||||
|
:disabled="(goStore.self?.turn.damage_reserve ?? 0) <= 0 || check_for_guard(props.player)">
|
||||||
(All)
|
(All)
|
||||||
</button>
|
</button>
|
||||||
<button v-if="goStore.self && isSelfTurn && isPlayerEnemy && goStore.self?.turn"
|
<button v-if="goStore.self && isSelfTurn && isPlayerEnemy && goStore.self?.turn"
|
||||||
@@ -230,13 +233,13 @@ function damage_team_all(team: Team) {
|
|||||||
<template
|
<template
|
||||||
v-if="c && goStore.self?.turn && isPlayerEnemy && isSelfTurn && (c.health_as_champion ?? 0) > 0">
|
v-if="c && goStore.self?.turn && isPlayerEnemy && isSelfTurn && (c.health_as_champion ?? 0) > 0">
|
||||||
<button class="enemy_action"
|
<button class="enemy_action"
|
||||||
:disabled="(goStore.self?.turn.damage_reserve ?? 0) < (c.health_as_champion ?? Infinity)"
|
:disabled="(goStore.self?.turn.damage_reserve ?? 0) < (c.health_as_champion ?? Infinity) || (check_for_guard(props.player) && !c.guard)"
|
||||||
@click.stop="damage_champion(c)">
|
@click.stop="damage_champion(c)">
|
||||||
DAMAGE ({{ c.health_as_champion }})
|
DAMAGE ({{ c.health_as_champion }})
|
||||||
</button>
|
</button>
|
||||||
<button class="enemy_action"
|
<button class="enemy_action"
|
||||||
v-if="goStore.self?.turn.effects_availables.find((e: Effect) => (e.effect == CardEffects.STUN) && e.usable)"
|
v-if="goStore.self?.turn.effects_availables.find((e: Effect) => (e.effect == CardEffects.STUN) && e.usable)"
|
||||||
@click.stop="stun(c)">
|
@click.stop="stun(c)" :disabled="(check_for_guard(props.player) && !c.guard)">
|
||||||
STUN
|
STUN
|
||||||
</button>
|
</button>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
Reference in New Issue
Block a user