fix make discard behaviour
This commit is contained in:
+17
-13
@@ -34,7 +34,7 @@ function run_effect(
|
||||
effect_type: CardEffects,
|
||||
target: Player | Card
|
||||
) {
|
||||
const effect = goStore.self?.turn.find_effect(effect_type).value;
|
||||
const effect = goStore.self?.turn.find_effect(effect_type);
|
||||
if (!effect) {
|
||||
return;
|
||||
}
|
||||
@@ -65,15 +65,14 @@ const restack_discarded_card = (target: Card) => run_effect(CardEffects.RESTACK_
|
||||
<CardPreview v-if="props.discard_unwrapped" :data="c" v-for="c in props.player.discard_pile">
|
||||
<template v-if="c && isSelf && isPlayerTurn">
|
||||
|
||||
<button v-if="goStore.self?.turn.find_effect(CardEffects.SACRIFICE).value"
|
||||
@click.stop="sacrifice(c)">
|
||||
<button v-if="goStore.self?.turn.find_effect(CardEffects.SACRIFICE)" @click.stop="sacrifice(c)">
|
||||
SACRIFICE
|
||||
</button>
|
||||
<button v-if="goStore.self?.turn.find_effect(CardEffects.RESTACK_DISCARDED_CHAMPION).value"
|
||||
<button v-if="goStore.self?.turn.find_effect(CardEffects.RESTACK_DISCARDED_CHAMPION)"
|
||||
@click.stop="restack_discarded_champion(c)">
|
||||
RESTACK_DISCARDED_CHAMPION
|
||||
</button>
|
||||
<button v-if="goStore.self?.turn.find_effect(CardEffects.RESTACK_DISCARDED_CARD).value"
|
||||
<button v-if="goStore.self?.turn.find_effect(CardEffects.RESTACK_DISCARDED_CARD)"
|
||||
@click.stop="restack_discarded_card(c)">
|
||||
RESTACK_DISCARDED_CARD
|
||||
</button>
|
||||
@@ -96,8 +95,8 @@ const restack_discarded_card = (target: Card) => run_effect(CardEffects.RESTACK_
|
||||
:disabled="(goStore.self?.turn.damage_reserve ?? 0) <= 0">
|
||||
Damage
|
||||
</button>
|
||||
<button v-if="isSelfTurn && isPlayerEnemy" @click.stop="make_discard(props.player)"
|
||||
:disabled="!goStore.self?.turn.find_effect(CardEffects.MAKE_DISCARD).value">
|
||||
<button v-if="goStore.self && isSelfTurn && isPlayerEnemy" @click.stop="make_discard(props.player)"
|
||||
:disabled="!goStore.self!.turn.find_effect(CardEffects.MAKE_DISCARD)">
|
||||
make Discard
|
||||
</button>
|
||||
<br />
|
||||
@@ -105,7 +104,9 @@ const restack_discarded_card = (target: Card) => run_effect(CardEffects.RESTACK_
|
||||
<div class="cards_container">
|
||||
<!-- HAND -->
|
||||
<CardPreview :data="c" v-for="c in props.player.hand" @click="c && playCard(c)">
|
||||
<button v-if="c && isSelf && props.player.turn.discard_markers > 0" @click.stop="discard(c)">
|
||||
<button
|
||||
v-if="c && isSelf && (props.player.turn.discard_markers + props.player.turn.fuck_u_markers) > 0"
|
||||
@click.stop="discard(c)">
|
||||
DISCARD
|
||||
</button>
|
||||
</CardPreview>
|
||||
@@ -122,25 +123,28 @@ const restack_discarded_card = (target: Card) => run_effect(CardEffects.RESTACK_
|
||||
</button>
|
||||
</template>
|
||||
<template v-if="!(c.uuid in props.player.turn.cards_locked)">
|
||||
<button v-if="props.player.turn.discard_markers > 0" @click.stop="discard(c)">
|
||||
<button v-if="(props.player.turn.discard_markers + props.player.turn.fuck_u_markers) > 0"
|
||||
@click.stop="discard(c)">
|
||||
DISCARD
|
||||
</button>
|
||||
<button v-if="goStore.self?.turn.find_effect(CardEffects.SACRIFICE).value"
|
||||
<button v-if="goStore.self?.turn.find_effect(CardEffects.SACRIFICE)"
|
||||
@click.stop="sacrifice(c)">
|
||||
SACRIFICE
|
||||
</button>
|
||||
<button @click.stop="lockCard(c)"
|
||||
:disabled="(props.player.turn.discard_markers > 0 && c !== props.player.turn.discard_marker_card) || props.player.turn.fuck_u_markers > 0">
|
||||
:disabled="((props.player.turn.discard_markers + props.player.turn.fuck_u_markers) > 0 && c !== props.player.turn.discard_marker_card) || props.player.turn.fuck_u_markers > 0">
|
||||
LOCK
|
||||
</button>
|
||||
</template>
|
||||
</template>
|
||||
<template v-if="isPlayerEnemy && isSelfTurn && (c.health_as_champion ?? 0) > 0">
|
||||
<button :disabled="(goStore.self?.turn.damage_reserve ?? 0) <= 0"
|
||||
<button class="enemy_action"
|
||||
:disabled="(goStore.self?.turn.damage_reserve ?? 0) <= (c.health_as_champion ?? Infinity)"
|
||||
@click.stop="damage_champion(c)">
|
||||
DAMAGE
|
||||
</button>
|
||||
<button v-if="goStore.self?.turn.find_effect(CardEffects.STUN).value" @click.stop="stun(c)">
|
||||
<button class="enemy_action" v-if="goStore.self?.turn.find_effect(CardEffects.STUN)"
|
||||
@click.stop="stun(c)">
|
||||
STUN
|
||||
</button>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user