rename discard to make_discard; put all effects buttons inside their card
This commit is contained in:
+28
-29
@@ -39,7 +39,7 @@ function run_effect(
|
||||
}
|
||||
|
||||
const make_discard = (target: Player) =>
|
||||
run_effect(CardEffects.DISCARD, target);
|
||||
run_effect(CardEffects.MAKE_DISCARD, target);
|
||||
const sacrifice = (target: Card) => run_effect(CardEffects.SACRIFICE, target);
|
||||
const stun = (target: Card) => run_effect(CardEffects.STUN, target)
|
||||
|
||||
@@ -68,16 +68,9 @@ const stun = (target: Card) => run_effect(CardEffects.STUN, target)
|
||||
Damage
|
||||
</button>
|
||||
<button v-if="isSelfTurn && isPlayerEnemy" @click="make_discard(props.player)"
|
||||
:disabled="!goStore.self?.turn.find_effect(CardEffects.DISCARD)">
|
||||
:disabled="!goStore.self?.turn.find_effect(CardEffects.MAKE_DISCARD)">
|
||||
make Discard
|
||||
</button>
|
||||
<span>effects_availables =
|
||||
<div v-for="e in props.player.turn.effects_availables">
|
||||
<button v-if="e" @click="useEffect(e)" :disabled="!e.usable">
|
||||
{{ e.effect + " " + e.effect_type }}
|
||||
</button>
|
||||
</div>
|
||||
</span>
|
||||
<br />
|
||||
|
||||
<div class="cards_container">
|
||||
@@ -90,30 +83,36 @@ const stun = (target: Card) => run_effect(CardEffects.STUN, target)
|
||||
<!-- BOARD -->
|
||||
<CardPreview :data="c" v-for="c in props.player.board" @click="lockCard(c)"
|
||||
:locked="c.uuid in props.player.turn.cards_locked">
|
||||
|
||||
<template v-if="c && isSelf && isPlayerTurn">
|
||||
<button v-if="props.player.turn.discard_markers > 0" @click="discard(c)">
|
||||
DISCARD
|
||||
<template v-if="c.uuid in props.player.turn.cards_locked"
|
||||
v-for="e in props.player.turn.effects_availables">
|
||||
<button v-if="e.card == c" @click="useEffect(e)" :disabled="!e.usable">
|
||||
EFFECT<br>
|
||||
{{ e.effect + " " + (e.effect_type ?? '') }}
|
||||
</button>
|
||||
</template>
|
||||
<template v-if="!(c.uuid in props.player.turn.cards_locked)">
|
||||
<button v-if="props.player.turn.discard_markers > 0" @click="discard(c)">
|
||||
DISCARD
|
||||
</button>
|
||||
<button v-if="goStore.self?.turn.find_effect(CardEffects.SACRIFICE)" @click="sacrifice(c)">
|
||||
SACRIFICE
|
||||
</button>
|
||||
<button @click="lockCard(c)">
|
||||
LOCK
|
||||
</button>
|
||||
</template>
|
||||
</template>
|
||||
<template v-if="isPlayerEnemy && isSelfTurn && (c.health_as_champion ?? 0) > 0">
|
||||
<button :disabled="(goStore.self?.turn.damage_reserve ?? 0) <= 0" @click="damage_champion(c)">
|
||||
DAMAGE
|
||||
</button>
|
||||
<button
|
||||
v-if="goStore.self?.turn.find_effect(CardEffects.SACRIFICE) && !(c.uuid in props.player.turn.cards_locked)"
|
||||
@click="sacrifice(c)">
|
||||
SACRIFICE
|
||||
</button>
|
||||
<button
|
||||
v-if="c && isSelf && isPlayerTurn && !(c.uuid in (goStore.self?.turn.cards_locked ?? []))"
|
||||
@click="lockCard(c)">
|
||||
LOCK
|
||||
<button v-if="goStore.self?.turn.find_effect(CardEffects.STUN)" @click="stun(c)">
|
||||
STUN
|
||||
</button>
|
||||
</template>
|
||||
<button v-if="isPlayerEnemy && isSelfTurn && (c.health_as_champion ?? 0) > 0"
|
||||
:disabled="(goStore.self?.turn.damage_reserve ?? 0) <= 0" @click="damage_champion(c)">
|
||||
DAMAGE
|
||||
</button>
|
||||
<button
|
||||
v-if="isPlayerEnemy && isSelfTurn && goStore.self?.turn.find_effect(CardEffects.STUN) && (c.health_as_champion ?? 0) > 0"
|
||||
@click="stun(c)">
|
||||
STUN
|
||||
</button>
|
||||
|
||||
</CardPreview>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user