rename discard to make_discard; put all effects buttons inside their card
This commit is contained in:
@@ -38,16 +38,15 @@ watch(
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div :class="`card ${childCount > 0 ? 'active' : ''} ${wrapped ? 'wrapped' : ''}`" @contextmenu.prevent="false"
|
||||
@click.left="cardClick" :style="`rotate:${rotation}deg;`">
|
||||
<div :class="`card ${childCount > 0 ? 'active' : ''} ${wrapped ? 'wrapped' : ''} ${props.locked ? 'locked' : ''}`"
|
||||
@contextmenu.prevent="false" @click.left="cardClick" :style="`rotate:${rotation}deg;`">
|
||||
<div id="contextMenuButtons" :ref="(el) => { childCount = ((el as Element)?.childElementCount ?? 0) }">
|
||||
<slot></slot>
|
||||
</div>
|
||||
<img :class="`card_image ${props.locked ? 'locked' : ''}`" v-if="props.data"
|
||||
<img :class="`card_image`" v-if="props.data"
|
||||
:src="'/cards/' + data?.card_id?.toString().padStart(3, '0') + '.png'" draggable="false">
|
||||
|
||||
<img :class="`card_image ${props.locked ? 'locked' : ''}`" v-if="!props.data" :src="'/cards/background.png'"
|
||||
draggable="false">
|
||||
<img :class="`card_image`" v-if="!props.data" :src="'/cards/background.png'" draggable="false">
|
||||
|
||||
</div>
|
||||
|
||||
@@ -84,7 +83,7 @@ watch(
|
||||
outline-offset: -2px;
|
||||
}
|
||||
|
||||
.card_image.locked {
|
||||
.card.locked {
|
||||
/* filter: brightness(0.5); */
|
||||
filter: drop-shadow(5px 15px 2px rgba(0, 0, 0, .60));
|
||||
}
|
||||
@@ -111,5 +110,6 @@ watch(
|
||||
#contextMenuButtons>* {
|
||||
flex: 1;
|
||||
border-radius: 10px;
|
||||
min-height: 50px;
|
||||
}
|
||||
</style>
|
||||
+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>
|
||||
|
||||
@@ -9,8 +9,8 @@ const isTurn = computed(() => goStore.self?.team == goStore.game?.current_turn)
|
||||
<template>
|
||||
<div :class="'player ' + (isTurn ? 'turn' : '')">
|
||||
<button v-if="goStore.self && goStore.self?.team != goStore.self?.team"
|
||||
@click="useEffect(goStore.self!.turn.find_effect(CardEffects.DISCARD)!, goStore.self)"
|
||||
:disabled="!goStore.self!.turn.find_effect(CardEffects.DISCARD)">
|
||||
@click="useEffect(goStore.self!.turn.find_effect(CardEffects.MAKE_DISCARD)!, goStore.self)"
|
||||
:disabled="!goStore.self!.turn.find_effect(CardEffects.MAKE_DISCARD)">
|
||||
make Discard</button>
|
||||
<div id="turn_data">
|
||||
<button id="end_turn" v-if="isTurn" @click="endTurn">END TURN</button>
|
||||
|
||||
Reference in New Issue
Block a user