This commit is contained in:
+31
-23
@@ -38,7 +38,7 @@ function run_effect(
|
||||
if (!goStore.self?.turn) {
|
||||
return
|
||||
}
|
||||
const effect = goStore.self?.turn.find_effect(effect_type);
|
||||
const effect = goStore.self?.turn.effects_availables.find((e: Effect) => (e.effect == effect_type) && e.usable);
|
||||
if (!effect) {
|
||||
return;
|
||||
}
|
||||
@@ -108,15 +108,18 @@ function damage_team_all(team: Team) {
|
||||
v-for="c in props.player.discard_pile">
|
||||
<template v-if="goStore.self?.turn && c && isSelf && isPlayerTurn">
|
||||
|
||||
<button v-if="goStore.self?.turn.find_effect(CardEffects.SACRIFICE)"
|
||||
<button
|
||||
v-if="goStore.self?.turn.effects_availables.find((e: Effect) => (e.effect == CardEffects.SACRIFICE) && e.usable)"
|
||||
@click.stop="sacrifice(c)">
|
||||
SACRIFICE
|
||||
</button>
|
||||
<button v-if="goStore.self?.turn.find_effect(CardEffects.RESTACK_DISCARDED_CHAMPION)"
|
||||
<button
|
||||
v-if="goStore.self?.turn.effects_availables.find((e: Effect) => (e.effect == CardEffects.RESTACK_DISCARDED_CHAMPION) && e.usable)"
|
||||
@click.stop="restack_discarded_champion(c)">
|
||||
RESTACK_DISCARDED_CHAMPION
|
||||
</button>
|
||||
<button v-if="goStore.self?.turn.find_effect(CardEffects.RESTACK_DISCARDED_CARD)"
|
||||
<button
|
||||
v-if="goStore.self?.turn.effects_availables.find((e: Effect) => (e.effect == CardEffects.RESTACK_DISCARDED_CARD) && e.usable)"
|
||||
@click.stop="restack_discarded_card(c)">
|
||||
RESTACK_DISCARDED_CARD
|
||||
</button>
|
||||
@@ -140,7 +143,8 @@ function damage_team_all(team: Team) {
|
||||
<PlayerStats :player="props.player">
|
||||
</PlayerStats>
|
||||
<template v-if="!hide_stack_and_discard">
|
||||
<button id="end_turn" v-if="isSelfTurn" class="end_turn_button" @click="checkEndTurn">END TURN</button>
|
||||
<button id="end_turn" v-if="isSelfTurn" class="end_turn_button" @click="checkEndTurn">END
|
||||
TURN</button>
|
||||
<div class="warning" v-if="warning">/!\<br> Effets restants!</div>
|
||||
</template>
|
||||
|
||||
@@ -150,20 +154,17 @@ function damage_team_all(team: Team) {
|
||||
<div id="current_player_board">
|
||||
<div class="other_player_buttons_container">
|
||||
<button @click.stop="damage_team(props.player.team)"
|
||||
v-if="isSelfTurn && isPlayerEnemy && goStore.self?.turn && props.player.team"
|
||||
class="damage_button"
|
||||
v-if="isSelfTurn && isPlayerEnemy && goStore.self?.turn && props.player.team" class="damage_button"
|
||||
:disabled="(goStore.self?.turn.damage_reserve ?? 0) <= 0">
|
||||
Damage
|
||||
</button>
|
||||
<button @click.stop="damage_team_all(props.player.team)"
|
||||
v-if="isSelfTurn && isPlayerEnemy && goStore.self?.turn && props.player.team"
|
||||
class="damage_button all_damage_button"
|
||||
:disabled="(goStore.self?.turn.damage_reserve ?? 0) <= 0">
|
||||
class="damage_button all_damage_button" :disabled="(goStore.self?.turn.damage_reserve ?? 0) <= 0">
|
||||
(All)
|
||||
</button>
|
||||
<button v-if="goStore.self && isSelfTurn && isPlayerEnemy && goStore.self?.turn"
|
||||
@click.stop="make_discard(props.player)"
|
||||
class="make_discard_button"
|
||||
@click.stop="make_discard(props.player)" class="make_discard_button"
|
||||
:disabled="!goStore.self.turn.effects_availables.find((e: Effect) => (e.effect == CardEffects.MAKE_DISCARD) && e.usable)">
|
||||
make Discard
|
||||
</button>
|
||||
@@ -187,13 +188,14 @@ function damage_team_all(team: Team) {
|
||||
<!-- Card Locked -->
|
||||
<template v-if="c.uuid in props.player.turn.cards_locked">
|
||||
<template v-for="e in props.player.turn.effects_availables">
|
||||
<button v-if="e.card == c" @click.stop="useEffect(e)" :disabled="!e.usable" :class="{ 'suicide_effect': e.effect_type == EffectType.SUICIDE }" >
|
||||
<button v-if="e.card == c" @click.stop="useEffect(e)" :disabled="!e.usable"
|
||||
:class="{ 'suicide_effect': e.effect_type == EffectType.SUICIDE }">
|
||||
EFFECT<br>
|
||||
{{ e.effect + " " + (e.effect_type ?? '') }}
|
||||
</button>
|
||||
</template>
|
||||
<button
|
||||
v-if="props.player.turn.find_effect(CardEffects.PREPARE) && c.card_type == CardType.CHAMPION"
|
||||
v-if="props.player.turn.effects_availables.find((e: Effect) => (e.effect == CardEffects.PREPARE) && e.usable) && c.card_type == CardType.CHAMPION"
|
||||
@click.stop="prepare_champion(c)">PREPARE</button>
|
||||
</template>
|
||||
<!-- Card Unlocked -->
|
||||
@@ -202,7 +204,8 @@ function damage_team_all(team: Team) {
|
||||
@click.stop="discard(c)">
|
||||
DISCARD
|
||||
</button>
|
||||
<button v-if="props.player.turn.find_effect(CardEffects.SACRIFICE)"
|
||||
<button
|
||||
v-if="props.player.turn.effects_availables.find((e: Effect) => (e.effect == CardEffects.SACRIFICE) && e.usable)"
|
||||
@click.stop="sacrifice(c)">
|
||||
SACRIFICE
|
||||
</button>
|
||||
@@ -219,7 +222,8 @@ function damage_team_all(team: Team) {
|
||||
@click.stop="damage_champion(c)">
|
||||
DAMAGE ({{ c.health_as_champion }})
|
||||
</button>
|
||||
<button class="enemy_action" v-if="goStore.self?.turn.find_effect(CardEffects.STUN)"
|
||||
<button class="enemy_action"
|
||||
v-if="goStore.self?.turn.effects_availables.find((e: Effect) => (e.effect == CardEffects.STUN) && e.usable)"
|
||||
@click.stop="stun(c)">
|
||||
STUN
|
||||
</button>
|
||||
@@ -355,8 +359,8 @@ function damage_team_all(team: Team) {
|
||||
}
|
||||
|
||||
.damage_button:active {
|
||||
transform: translateY(2px);
|
||||
box-shadow: none;
|
||||
transform: translateY(2px);
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.all_damage_button {
|
||||
@@ -366,7 +370,7 @@ function damage_team_all(team: Team) {
|
||||
|
||||
.make_discard_button {
|
||||
background-color: #55b42f;
|
||||
color: white;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
padding: 5px 15px;
|
||||
@@ -376,7 +380,7 @@ function damage_team_all(team: Team) {
|
||||
text-transform: uppercase;
|
||||
cursor: pointer;
|
||||
transition: background-color 0.3s ease;
|
||||
box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.4);
|
||||
box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.4);
|
||||
}
|
||||
|
||||
.make_discard_button:disabled {
|
||||
@@ -447,7 +451,8 @@ function damage_team_all(team: Team) {
|
||||
}
|
||||
|
||||
.end_turn_button {
|
||||
background-color: #4CAF50; /* Green background color */
|
||||
background-color: #4CAF50;
|
||||
/* Green background color */
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
@@ -462,12 +467,15 @@ function damage_team_all(team: Team) {
|
||||
}
|
||||
|
||||
.end_turn_button:hover {
|
||||
background-color: #45a049; /* Darker green on hover */
|
||||
background-color: #45a049;
|
||||
/* Darker green on hover */
|
||||
}
|
||||
|
||||
.end_turn_button:active {
|
||||
transform: translateY(2px); /* Add a slight press effect on click */
|
||||
box-shadow: none; /* Remove shadow on click */
|
||||
transform: translateY(2px);
|
||||
/* Add a slight press effect on click */
|
||||
box-shadow: none;
|
||||
/* Remove shadow on click */
|
||||
}
|
||||
|
||||
.ready-bubble {
|
||||
|
||||
Reference in New Issue
Block a user