From 716f3cf018c0bf09c1a28dd5f733c87e056ec82e Mon Sep 17 00:00:00 2001 From: legonzaur Date: Fri, 3 May 2024 00:37:09 +0200 Subject: [PATCH] factorization : turn find_effect --- components/GameBoard.vue | 31 +++++++++++++------------------ components/PlayerSlot.vue | 13 ++++++------- components/SelfView.vue | 29 ++++++++++++++--------------- netcode/Turn.ts | 11 +++++++++-- 4 files changed, 42 insertions(+), 42 deletions(-) diff --git a/components/GameBoard.vue b/components/GameBoard.vue index 1b91544..06a550e 100644 --- a/components/GameBoard.vue +++ b/components/GameBoard.vue @@ -21,37 +21,32 @@ const isTurn = computed(() => goStore.self && goStore.game?.started && (goStore. BUY - + @click="useEffect(goStore.self!.turn.find_effect(CardEffects.STACK_NEXT_CARD_BOUGHT)!, goStore.game.gem_stack.at(-1))" + :disabled="(goStore.self === undefined || goStore.game.gem_stack.at(-1)?.cost === undefined || (goStore.self?.turn.gold_reserve ?? 0) < (goStore.game.gem_stack.at(-1)?.cost ?? Infinity)) || !goStore.self!.turn.find_effect(CardEffects.STACK_NEXT_CARD_BOUGHT)"> + BUY IN STACK(generic) +
- + diff --git a/components/PlayerSlot.vue b/components/PlayerSlot.vue index de4b183..b66372c 100644 --- a/components/PlayerSlot.vue +++ b/components/PlayerSlot.vue @@ -30,8 +30,8 @@ const discard_unwrapped = ref(false) Damage
@@ -94,10 +94,9 @@ const discard_unwrapped = ref(false) :disabled="c.uuid in props.player.turn.cards_locked"> LOCK - + @click="useEffect(props.player.turn.find_effect(CardEffects.SACRIFICE)!, c)">SACRIFICE
{{ c.health_as_champion }}
@@ -106,8 +105,8 @@ const discard_unwrapped = ref(false) :disabled="(goStore.self?.turn.damage_reserve ?? 0) <= 0" @click="damage_champion(c)">DAMAGE + v-if="!isSelf && !isTurn && goStore.self?.team == props.player.turn.find_effect(CardEffects.STUN) && (c.health_as_champion ?? 0) > 0" + @click="useEffect(props.player.turn.find_effect(CardEffects.STUN)!, c)">STUN
diff --git a/components/SelfView.vue b/components/SelfView.vue index 756376d..64f0874 100644 --- a/components/SelfView.vue +++ b/components/SelfView.vue @@ -17,8 +17,8 @@ const discard_unwrapped = ref(false) Heal
@@ -62,7 +62,7 @@ const discard_unwrapped = ref(false) discard_markers = {{ goStore.self?.turn.discard_markers }}
effects_availables =
@@ -77,15 +77,14 @@ const discard_unwrapped = ref(false) :disabled="c.uuid in goStore.self?.turn.cards_locked"> LOCK - + @click="useEffect(goStore.self!.turn.find_effect(CardEffects.SACRIFICE)!, c)">SACRIFICE + @click="useEffect(goStore.self!.turn.find_effect(CardEffects.PREPARE)!, c)">PREPARE
{{ c.health_as_champion }}
@@ -99,23 +98,23 @@ const discard_unwrapped = ref(false)
-