Merge branch 'main' of https://git.legonzaur.fr/legonzaur/heron-realms-front
release-tag / release-image (push) Successful in 31s
release-tag / release-image (push) Successful in 31s
This commit is contained in:
+13
-11
@@ -1,6 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import goStore, { buy, useEffect } from '@/netcode';
|
import goStore, { buy, useEffect } from '@/netcode';
|
||||||
import { CardEffects } from '@/netcode/Effect'
|
import { CardEffects, type Effect } from '@/netcode/Effect'
|
||||||
import { CardType } from '@/netcode/Card'
|
import { CardType } from '@/netcode/Card'
|
||||||
|
|
||||||
const isTurn = computed(() => goStore.self && goStore.current_game?.started && (goStore.self.team == goStore.current_game.current_turn))
|
const isTurn = computed(() => goStore.self && goStore.current_game?.started && (goStore.self.team == goStore.current_game.current_turn))
|
||||||
@@ -16,16 +16,18 @@ const isTurn = computed(() => goStore.self && goStore.current_game?.started && (
|
|||||||
<template
|
<template
|
||||||
v-if="isTurn && goStore.self?.turn && c && c.cost && (goStore.self?.turn.gold_reserve ?? 0) >= c.cost">
|
v-if="isTurn && goStore.self?.turn && c && c.cost && (goStore.self?.turn.gold_reserve ?? 0) >= c.cost">
|
||||||
<button @click.stop="buy(c)">BUY</button>
|
<button @click.stop="buy(c)">BUY</button>
|
||||||
<button @click.stop="useEffect(goStore.self!.turn.find_effect(CardEffects.PLAY_NEXT_CARD_BOUGHT)!, c)"
|
<button
|
||||||
v-if="goStore.self?.turn.find_effect(CardEffects.PLAY_NEXT_CARD_BOUGHT)">
|
@click.stop="useEffect(goStore.self!.turn.effects_availables.find((e: Effect) => (e.effect == CardEffects.PLAY_NEXT_CARD_BOUGHT) && e.usable)!, c)"
|
||||||
|
v-if="goStore.self?.turn.effects_availables.find((e: Effect) => (e.effect == CardEffects.PLAY_NEXT_CARD_BOUGHT) && e.usable)">
|
||||||
BUY IN HAND</button>
|
BUY IN HAND</button>
|
||||||
<button @click.stop="useEffect(goStore.self!.turn.find_effect(CardEffects.STACK_NEXT_CARD_BOUGHT)!, c)"
|
<button
|
||||||
v-if="goStore.self?.turn.find_effect(CardEffects.STACK_NEXT_CARD_BOUGHT)">
|
@click.stop="useEffect(goStore.self!.turn.effects_availables.find((e: Effect) => (e.effect == CardEffects.STACK_NEXT_CARD_BOUGHT) && e.usable)!, c)"
|
||||||
|
v-if="goStore.self?.turn.effects_availables.find((e: Effect) => (e.effect == CardEffects.STACK_NEXT_CARD_BOUGHT) && e.usable)">
|
||||||
BUY IN STACK (generic)</button>
|
BUY IN STACK (generic)</button>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
@click.stop="useEffect(goStore.self!.turn.find_effect(CardEffects.STACK_NEXT_ACTION_BOUGHT)!, c)"
|
@click.stop="useEffect(goStore.self!.turn.effects_availables.find((e: Effect) => (e.effect == CardEffects.STACK_NEXT_ACTION_BOUGHT) && e.usable)!, c)"
|
||||||
v-if="c.card_type == CardType.ACTION && goStore.self?.turn.find_effect(CardEffects.STACK_NEXT_ACTION_BOUGHT)">
|
v-if="c.card_type == CardType.ACTION && goStore.self?.turn.effects_availables.find((e: Effect) => (e.effect == CardEffects.STACK_NEXT_ACTION_BOUGHT) && e.usable)">
|
||||||
BUY IN STACK (actions)</button>
|
BUY IN STACK (actions)</button>
|
||||||
</template>
|
</template>
|
||||||
</CardPreview>
|
</CardPreview>
|
||||||
@@ -38,12 +40,12 @@ const isTurn = computed(() => goStore.self && goStore.current_game?.started && (
|
|||||||
BUY
|
BUY
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
@click.stop="useEffect(goStore.self!.turn.find_effect(CardEffects.PLAY_NEXT_CARD_BOUGHT)!, goStore.current_game.gem_stack.at(-1))"
|
@click.stop="useEffect(goStore.self!.turn.effects_availables.find((e: Effect) => (e.effect == CardEffects.PLAY_NEXT_CARD_BOUGHT) && e.usable)!, goStore.current_game.gem_stack.at(-1))"
|
||||||
v-if="goStore.self?.turn.find_effect(CardEffects.PLAY_NEXT_CARD_BOUGHT)">
|
v-if="goStore.self?.turn.effects_availables.find((e: Effect) => (e.effect == CardEffects.PLAY_NEXT_CARD_BOUGHT) && e.usable)">
|
||||||
BUY IN HAND</button>
|
BUY IN HAND</button>
|
||||||
<button
|
<button
|
||||||
@click.stop="useEffect(goStore.self!.turn.find_effect(CardEffects.STACK_NEXT_CARD_BOUGHT)!, goStore.current_game.gem_stack.at(-1))"
|
@click.stop="useEffect(goStore.self!.turn.effects_availables.find((e: Effect) => (e.effect == CardEffects.STACK_NEXT_CARD_BOUGHT) && e.usable)!, goStore.current_game.gem_stack.at(-1))"
|
||||||
v-if="goStore.self?.turn.find_effect(CardEffects.STACK_NEXT_CARD_BOUGHT)">
|
v-if="goStore.self?.turn.effects_availables.find((e: Effect) => (e.effect == CardEffects.STACK_NEXT_CARD_BOUGHT) && e.usable)">
|
||||||
BUY IN STACK(generic)
|
BUY IN STACK(generic)
|
||||||
</button>
|
</button>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
+31
-23
@@ -39,7 +39,7 @@ function run_effect(
|
|||||||
if (!goStore.self?.turn) {
|
if (!goStore.self?.turn) {
|
||||||
return
|
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) {
|
if (!effect) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -118,15 +118,18 @@ function damage_team_all(team: Team) {
|
|||||||
v-for="c in props.player.discard_pile">
|
v-for="c in props.player.discard_pile">
|
||||||
<template v-if="goStore.self?.turn && c && isSelf && isPlayerTurn">
|
<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)">
|
@click.stop="sacrifice(c)">
|
||||||
SACRIFICE
|
SACRIFICE
|
||||||
</button>
|
</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)">
|
@click.stop="restack_discarded_champion(c)">
|
||||||
RESTACK_DISCARDED_CHAMPION
|
RESTACK_DISCARDED_CHAMPION
|
||||||
</button>
|
</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)">
|
@click.stop="restack_discarded_card(c)">
|
||||||
RESTACK_DISCARDED_CARD
|
RESTACK_DISCARDED_CARD
|
||||||
</button>
|
</button>
|
||||||
@@ -150,7 +153,8 @@ function damage_team_all(team: Team) {
|
|||||||
<PlayerStats :player="props.player">
|
<PlayerStats :player="props.player">
|
||||||
</PlayerStats>
|
</PlayerStats>
|
||||||
<template v-if="!hide_stack_and_discard">
|
<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" :class="{'warning-fire-gem': warningText == 'P\'tite Fire gem?'}">/!\<br>{{warningText}}</div>
|
<div class="warning" v-if="warning" :class="{'warning-fire-gem': warningText == 'P\'tite Fire gem?'}">/!\<br>{{warningText}}</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -160,20 +164,17 @@ function damage_team_all(team: Team) {
|
|||||||
<div id="current_player_board">
|
<div id="current_player_board">
|
||||||
<div class="other_player_buttons_container">
|
<div class="other_player_buttons_container">
|
||||||
<button @click.stop="damage_team(props.player.team)"
|
<button @click.stop="damage_team(props.player.team)"
|
||||||
v-if="isSelfTurn && isPlayerEnemy && goStore.self?.turn && props.player.team"
|
v-if="isSelfTurn && isPlayerEnemy && goStore.self?.turn && props.player.team" class="damage_button"
|
||||||
class="damage_button"
|
|
||||||
:disabled="(goStore.self?.turn.damage_reserve ?? 0) <= 0">
|
:disabled="(goStore.self?.turn.damage_reserve ?? 0) <= 0">
|
||||||
Damage
|
Damage
|
||||||
</button>
|
</button>
|
||||||
<button @click.stop="damage_team_all(props.player.team)"
|
<button @click.stop="damage_team_all(props.player.team)"
|
||||||
v-if="isSelfTurn && isPlayerEnemy && goStore.self?.turn && props.player.team"
|
v-if="isSelfTurn && isPlayerEnemy && goStore.self?.turn && props.player.team"
|
||||||
class="damage_button all_damage_button"
|
class="damage_button all_damage_button" :disabled="(goStore.self?.turn.damage_reserve ?? 0) <= 0">
|
||||||
:disabled="(goStore.self?.turn.damage_reserve ?? 0) <= 0">
|
|
||||||
(All)
|
(All)
|
||||||
</button>
|
</button>
|
||||||
<button v-if="goStore.self && isSelfTurn && isPlayerEnemy && goStore.self?.turn"
|
<button v-if="goStore.self && isSelfTurn && isPlayerEnemy && goStore.self?.turn"
|
||||||
@click.stop="make_discard(props.player)"
|
@click.stop="make_discard(props.player)" class="make_discard_button"
|
||||||
class="make_discard_button"
|
|
||||||
:disabled="!goStore.self.turn.effects_availables.find((e: Effect) => (e.effect == CardEffects.MAKE_DISCARD) && e.usable)">
|
:disabled="!goStore.self.turn.effects_availables.find((e: Effect) => (e.effect == CardEffects.MAKE_DISCARD) && e.usable)">
|
||||||
make Discard
|
make Discard
|
||||||
</button>
|
</button>
|
||||||
@@ -197,13 +198,14 @@ function damage_team_all(team: Team) {
|
|||||||
<!-- Card Locked -->
|
<!-- Card Locked -->
|
||||||
<template v-if="c.uuid in props.player.turn.cards_locked">
|
<template v-if="c.uuid in props.player.turn.cards_locked">
|
||||||
<template v-for="e in props.player.turn.effects_availables">
|
<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>
|
EFFECT<br>
|
||||||
{{ e.effect + " " + (e.effect_type ?? '') }}
|
{{ e.effect + " " + (e.effect_type ?? '') }}
|
||||||
</button>
|
</button>
|
||||||
</template>
|
</template>
|
||||||
<button
|
<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>
|
@click.stop="prepare_champion(c)">PREPARE</button>
|
||||||
</template>
|
</template>
|
||||||
<!-- Card Unlocked -->
|
<!-- Card Unlocked -->
|
||||||
@@ -212,7 +214,8 @@ function damage_team_all(team: Team) {
|
|||||||
@click.stop="discard(c)">
|
@click.stop="discard(c)">
|
||||||
DISCARD
|
DISCARD
|
||||||
</button>
|
</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)">
|
@click.stop="sacrifice(c)">
|
||||||
SACRIFICE
|
SACRIFICE
|
||||||
</button>
|
</button>
|
||||||
@@ -229,7 +232,8 @@ function damage_team_all(team: Team) {
|
|||||||
@click.stop="damage_champion(c)">
|
@click.stop="damage_champion(c)">
|
||||||
DAMAGE ({{ c.health_as_champion }})
|
DAMAGE ({{ c.health_as_champion }})
|
||||||
</button>
|
</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)">
|
@click.stop="stun(c)">
|
||||||
STUN
|
STUN
|
||||||
</button>
|
</button>
|
||||||
@@ -369,8 +373,8 @@ function damage_team_all(team: Team) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.damage_button:active {
|
.damage_button:active {
|
||||||
transform: translateY(2px);
|
transform: translateY(2px);
|
||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.all_damage_button {
|
.all_damage_button {
|
||||||
@@ -380,7 +384,7 @@ function damage_team_all(team: Team) {
|
|||||||
|
|
||||||
.make_discard_button {
|
.make_discard_button {
|
||||||
background-color: #55b42f;
|
background-color: #55b42f;
|
||||||
color: white;
|
color: white;
|
||||||
border: none;
|
border: none;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
padding: 5px 15px;
|
padding: 5px 15px;
|
||||||
@@ -390,7 +394,7 @@ function damage_team_all(team: Team) {
|
|||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: background-color 0.3s ease;
|
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 {
|
.make_discard_button:disabled {
|
||||||
@@ -461,7 +465,8 @@ function damage_team_all(team: Team) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.end_turn_button {
|
.end_turn_button {
|
||||||
background-color: #4CAF50; /* Green background color */
|
background-color: #4CAF50;
|
||||||
|
/* Green background color */
|
||||||
color: white;
|
color: white;
|
||||||
border: none;
|
border: none;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
@@ -476,12 +481,15 @@ function damage_team_all(team: Team) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.end_turn_button:hover {
|
.end_turn_button:hover {
|
||||||
background-color: #45a049; /* Darker green on hover */
|
background-color: #45a049;
|
||||||
|
/* Darker green on hover */
|
||||||
}
|
}
|
||||||
|
|
||||||
.end_turn_button:active {
|
.end_turn_button:active {
|
||||||
transform: translateY(2px); /* Add a slight press effect on click */
|
transform: translateY(2px);
|
||||||
box-shadow: none; /* Remove shadow on click */
|
/* Add a slight press effect on click */
|
||||||
|
box-shadow: none;
|
||||||
|
/* Remove shadow on click */
|
||||||
}
|
}
|
||||||
|
|
||||||
.ready-bubble {
|
.ready-bubble {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ const isTurn = computed(() => goStore.self?.team == goStore.current_game?.curren
|
|||||||
<div class="cards_container" id="self_hand">
|
<div class="cards_container" id="self_hand">
|
||||||
<CardPreview :card_id="c?.card_id" v-for=" c in goStore.self?.hand " @click="c && playCard(c)">
|
<CardPreview :card_id="c?.card_id" v-for=" c in goStore.self?.hand " @click="c && playCard(c)">
|
||||||
<button v-if="c && goStore.self?.turn && (goStore.self.turn.fuck_u_markers ?? 0) > 0"
|
<button v-if="c && goStore.self?.turn && (goStore.self.turn.fuck_u_markers ?? 0) > 0"
|
||||||
@click="discard(c)">DISCARD</button>
|
@click.stop="discard(c)">DISCARD</button>
|
||||||
</CardPreview>
|
</CardPreview>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ export type Turn = Omit<TurnNetcode, 'cards_locked' | 'effects_availables' | 'ch
|
|||||||
effects_availables: Array<Effect>
|
effects_availables: Array<Effect>
|
||||||
champions_health: Map<string, number>
|
champions_health: Map<string, number>
|
||||||
discard_marker_card: Card
|
discard_marker_card: Card
|
||||||
find_effect: (card_effect: CardEffects) => Effect | undefined
|
|
||||||
}
|
}
|
||||||
export function create_turn(input: TurnNetcode, register: GameObjectRegister) {
|
export function create_turn(input: TurnNetcode, register: GameObjectRegister) {
|
||||||
const turn = new Proxy<any>(input, {
|
const turn = new Proxy<any>(input, {
|
||||||
@@ -38,11 +37,6 @@ export function create_turn(input: TurnNetcode, register: GameObjectRegister) {
|
|||||||
}
|
}
|
||||||
return healths
|
return healths
|
||||||
}
|
}
|
||||||
if (prop == "find_effect") {
|
|
||||||
return (card_effect: CardEffects) => {
|
|
||||||
return turn.effects_availables.find((e:Effect) => (e.effect == card_effect) && e.usable)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(prop == "discard_marker_card"){
|
if(prop == "discard_marker_card"){
|
||||||
return register.cards.get(target.discard_marker_card)
|
return register.cards.get(target.discard_marker_card)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user