Feat : allow damage champion
This commit is contained in:
@@ -28,7 +28,12 @@ const props = withDefaults(defineProps<Props>(), {
|
||||
championsKillable: () => false,
|
||||
});
|
||||
|
||||
const emit = defineEmits(["cardClick", "effectClick", "tokenClick"]);
|
||||
const emit = defineEmits([
|
||||
"cardClick",
|
||||
"effectClick",
|
||||
"tokenClick",
|
||||
"damageChampionClick",
|
||||
]);
|
||||
|
||||
const settingsStore = useSettingsStore();
|
||||
|
||||
@@ -115,7 +120,9 @@ function tokenClick(token: Effect, card: Card) {
|
||||
emit("tokenClick", { token, card });
|
||||
}
|
||||
|
||||
function damageChampion() {}
|
||||
function damageChampionClick(card: Card) {
|
||||
emit("damageChampionClick", card);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -167,7 +174,11 @@ function damageChampion() {}
|
||||
"
|
||||
></TokenComponent>
|
||||
</template>
|
||||
<button v-if="championsKillable && c.cardType == CardType.CHAMPION">
|
||||
<button
|
||||
v-if="championsKillable && c.cardType == CardType.CHAMPION"
|
||||
@click.stop="damageChampionClick(c)"
|
||||
@mousedown.left.stop=""
|
||||
>
|
||||
Damage
|
||||
</button>
|
||||
</CardPreview>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import {
|
||||
damageChampion,
|
||||
endTurn,
|
||||
joinGame,
|
||||
lockCard,
|
||||
@@ -138,6 +139,9 @@ function effectClick(cardUUID: string, effectIndex: number) {
|
||||
function tokenClick({ card, token }: { card: Card; token: Effect }) {
|
||||
useToken(props.game._id, token._id, card._id, props.player._id);
|
||||
}
|
||||
function damageChampionClick(card: Card) {
|
||||
damageChampion(props.game._id, props.player._id, card._id);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -199,6 +203,7 @@ function tokenClick({ card, token }: { card: Card; token: Effect }) {
|
||||
:tokens="cardTokens"
|
||||
@tokenClick="tokenClick"
|
||||
:championsKillable="!isSelf && isSelfTurn.value"
|
||||
@damageChampionClick="damageChampionClick"
|
||||
>
|
||||
</CardsGrouped>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user