fix : tokens incorrectly showing on opponent's board

Closes #107
This commit is contained in:
2024-12-21 11:32:41 +01:00
parent c30d23e45f
commit 39e4855b91
+17 -21
View File
@@ -52,12 +52,19 @@ const isSelf = computed(
);
const isSelfTurn = computed(() => isSelf && isPlayerTurn);
const cardTokens = computed(() =>
props.game.currentTurn.tokens.filter(
(t) =>
[CardEffects.PREPARE, CardEffects.STUN].includes(t.effect) ||
(CardEffects.SACRIFICE == t.effect && isSelf)
)
const cardTokens = computed(() => {
if (!isPlayerTurn.value) {
return props.game.currentTurn.tokens.filter((t) => t.effect == CardEffects.STUN);
}
else {
return props.game.currentTurn.tokens.filter(
(t) =>
[CardEffects.PREPARE, CardEffects.SACRIFICE].includes(t.effect)
)
}
}
);
const warningText = ref("Effets restants!");
@@ -171,21 +178,10 @@ function discardCardClick(card: Card) {
</div> -->
<!-- <br /> -->
<GameCardGrouped
:container="player.board"
:wrapped="false"
:playingTurn="props.game.currentTurn"
@cardClick="boardCardClick"
@effectClick="effectClick"
:tokens="cardTokens"
@tokenClick="tokenClick"
:championsKillable="!isSelf && isSelfTurn.value"
:discardable="
(player.fuckUMarkers > 0 || player.discardMarkers > 0) && isSelf
"
@damageChampionClick="damageChampionClick"
@discardCardClick="discardCardClick"
>
<GameCardGrouped :container="player.board" :wrapped="false" :playingTurn="props.game.currentTurn"
@cardClick="boardCardClick" @effectClick="effectClick" :tokens="cardTokens" @tokenClick="tokenClick"
:championsKillable="!isSelf && isSelfTurn.value" :discardable="(player.fuckUMarkers > 0 || player.discardMarkers > 0) && isSelf
" @damageChampionClick="damageChampionClick" @discardCardClick="discardCardClick">
</GameCardGrouped>
<br />
<!-- <div class="cards_container"> -->