This commit is contained in:
@@ -13,7 +13,7 @@ const discard_unwrapped = ref<boolean>(false)
|
|||||||
<MarketCards></MarketCards>
|
<MarketCards></MarketCards>
|
||||||
</div>
|
</div>
|
||||||
<div id="player_list">
|
<div id="player_list">
|
||||||
<PlayerListElement v-for="[l, p] in goStore.players" :player="p">
|
<PlayerListElement v-for="p in goStore.current_game?.players" :player="p">
|
||||||
</PlayerListElement>
|
</PlayerListElement>
|
||||||
</div>
|
</div>
|
||||||
<div id="current_player">
|
<div id="current_player">
|
||||||
|
|||||||
+28
-15
@@ -10,7 +10,7 @@ import goStore, {
|
|||||||
damage_team,
|
damage_team,
|
||||||
|
|
||||||
} from "~/netcode";
|
} from "~/netcode";
|
||||||
import type { Card } from "~/netcode/Card";
|
import { CardType, type Card } from "~/netcode/Card";
|
||||||
import type { Player } from "~/netcode/Player";
|
import type { Player } from "~/netcode/Player";
|
||||||
import { CardEffects, type Effect } from "@/netcode/Effect";
|
import { CardEffects, type Effect } from "@/netcode/Effect";
|
||||||
|
|
||||||
@@ -34,6 +34,9 @@ function run_effect(
|
|||||||
effect_type: CardEffects,
|
effect_type: CardEffects,
|
||||||
target: Player | Card
|
target: Player | Card
|
||||||
) {
|
) {
|
||||||
|
if (!goStore.self?.turn) {
|
||||||
|
return
|
||||||
|
}
|
||||||
const effect = goStore.self?.turn.find_effect(effect_type);
|
const effect = goStore.self?.turn.find_effect(effect_type);
|
||||||
if (!effect) {
|
if (!effect) {
|
||||||
return;
|
return;
|
||||||
@@ -47,6 +50,7 @@ const sacrifice = (target: Card) => run_effect(CardEffects.SACRIFICE, target);
|
|||||||
const stun = (target: Card) => run_effect(CardEffects.STUN, target)
|
const stun = (target: Card) => run_effect(CardEffects.STUN, target)
|
||||||
const restack_discarded_champion = (target: Card) => run_effect(CardEffects.RESTACK_DISCARDED_CHAMPION, target)
|
const restack_discarded_champion = (target: Card) => run_effect(CardEffects.RESTACK_DISCARDED_CHAMPION, target)
|
||||||
const restack_discarded_card = (target: Card) => run_effect(CardEffects.RESTACK_DISCARDED_CARD, target)
|
const restack_discarded_card = (target: Card) => run_effect(CardEffects.RESTACK_DISCARDED_CARD, target)
|
||||||
|
const prepare_champion = (target: Card) => run_effect(CardEffects.PREPARE, target)
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -63,7 +67,7 @@ const restack_discarded_card = (target: Card) => run_effect(CardEffects.RESTACK_
|
|||||||
<div :class="`discard ${discard_unwrapped ? 'unwrapped' : ''}`">
|
<div :class="`discard ${discard_unwrapped ? 'unwrapped' : ''}`">
|
||||||
<CardsGrouped :stack="props.player.discard_pile" v-if="!props.discard_unwrapped"> </CardsGrouped>
|
<CardsGrouped :stack="props.player.discard_pile" v-if="!props.discard_unwrapped"> </CardsGrouped>
|
||||||
<CardPreview v-if="props.discard_unwrapped" :data="c" v-for="c in props.player.discard_pile">
|
<CardPreview v-if="props.discard_unwrapped" :data="c" v-for="c in props.player.discard_pile">
|
||||||
<template v-if="c && isSelf && isPlayerTurn">
|
<template v-if="goStore.self?.turn && c && isSelf && isPlayerTurn">
|
||||||
|
|
||||||
<button v-if="goStore.self?.turn.find_effect(CardEffects.SACRIFICE)" @click.stop="sacrifice(c)">
|
<button v-if="goStore.self?.turn.find_effect(CardEffects.SACRIFICE)" @click.stop="sacrifice(c)">
|
||||||
SACRIFICE
|
SACRIFICE
|
||||||
@@ -91,11 +95,13 @@ const restack_discarded_card = (target: Card) => run_effect(CardEffects.RESTACK_
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="current_player_board">
|
<div id="current_player_board">
|
||||||
<button @click.stop="damage_team(props.player.team)" v-if="isSelfTurn && isPlayerEnemy"
|
<button @click.stop="damage_team(props.player.team)"
|
||||||
|
v-if="isSelfTurn && isPlayerEnemy && goStore.self?.turn && props.player.team"
|
||||||
:disabled="(goStore.self?.turn.damage_reserve ?? 0) <= 0">
|
:disabled="(goStore.self?.turn.damage_reserve ?? 0) <= 0">
|
||||||
Damage
|
Damage
|
||||||
</button>
|
</button>
|
||||||
<button v-if="goStore.self && isSelfTurn && isPlayerEnemy" @click.stop="make_discard(props.player)"
|
<button v-if="goStore.self && isSelfTurn && isPlayerEnemy && goStore.self?.turn"
|
||||||
|
@click.stop="make_discard(props.player)"
|
||||||
:disabled="!goStore.self!.turn.find_effect(CardEffects.MAKE_DISCARD)">
|
:disabled="!goStore.self!.turn.find_effect(CardEffects.MAKE_DISCARD)">
|
||||||
make Discard
|
make Discard
|
||||||
</button>
|
</button>
|
||||||
@@ -105,29 +111,35 @@ const restack_discarded_card = (target: Card) => run_effect(CardEffects.RESTACK_
|
|||||||
<!-- HAND -->
|
<!-- HAND -->
|
||||||
<CardPreview :data="c" v-for="c in props.player.hand" @click="c && playCard(c)">
|
<CardPreview :data="c" v-for="c in props.player.hand" @click="c && playCard(c)">
|
||||||
<button
|
<button
|
||||||
v-if="c && isSelf && (props.player.turn.discard_markers + props.player.turn.fuck_u_markers) > 0"
|
v-if="props.player.turn && c && isSelf && (props.player.turn.discard_markers + props.player.turn.fuck_u_markers) > 0"
|
||||||
@click.stop="discard(c)">
|
@click.stop="discard(c)">
|
||||||
DISCARD
|
DISCARD
|
||||||
</button>
|
</button>
|
||||||
</CardPreview>
|
</CardPreview>
|
||||||
<!-- BOARD -->
|
<!-- BOARD -->
|
||||||
<CardPreview :data="c" v-for="c in props.player.board" @click="lockCard(c)"
|
<CardPreview :data="c" v-for="c in props.player.board" @click="lockCard(c)"
|
||||||
:locked="c.uuid in props.player.turn.cards_locked">
|
:locked="props.player.turn && c.uuid in props.player.turn.cards_locked">
|
||||||
|
|
||||||
<template v-if="c && isSelf && isPlayerTurn">
|
<template v-if="c && isSelf && isPlayerTurn && props.player.turn">
|
||||||
<template v-if="c.uuid in props.player.turn.cards_locked"
|
<!-- Card Locked -->
|
||||||
v-for="e in props.player.turn.effects_availables">
|
<template v-if="c.uuid in props.player.turn.cards_locked">
|
||||||
<button v-if="e.card == c" @click.stop="useEffect(e)" :disabled="!e.usable">
|
<template v-for="e in props.player.turn.effects_availables">
|
||||||
EFFECT<br>
|
<button v-if="e.card == c" @click.stop="useEffect(e)" :disabled="!e.usable">
|
||||||
{{ e.effect + " " + (e.effect_type ?? '') }}
|
EFFECT<br>
|
||||||
</button>
|
{{ e.effect + " " + (e.effect_type ?? '') }}
|
||||||
|
</button>
|
||||||
|
</template>
|
||||||
|
<button
|
||||||
|
v-if="props.player.turn.find_effect(CardEffects.PREPARE) && c.card_type == CardType.CHAMPION"
|
||||||
|
@click.stop="prepare_champion(c)">PREPARE</button>
|
||||||
</template>
|
</template>
|
||||||
|
<!-- Card Unlocked -->
|
||||||
<template v-if="!(c.uuid in props.player.turn.cards_locked)">
|
<template v-if="!(c.uuid in props.player.turn.cards_locked)">
|
||||||
<button v-if="(props.player.turn.discard_markers + props.player.turn.fuck_u_markers) > 0"
|
<button v-if="(props.player.turn.discard_markers + props.player.turn.fuck_u_markers) > 0"
|
||||||
@click.stop="discard(c)">
|
@click.stop="discard(c)">
|
||||||
DISCARD
|
DISCARD
|
||||||
</button>
|
</button>
|
||||||
<button v-if="goStore.self?.turn.find_effect(CardEffects.SACRIFICE)"
|
<button v-if="props.player.turn.find_effect(CardEffects.SACRIFICE)"
|
||||||
@click.stop="sacrifice(c)">
|
@click.stop="sacrifice(c)">
|
||||||
SACRIFICE
|
SACRIFICE
|
||||||
</button>
|
</button>
|
||||||
@@ -137,7 +149,8 @@ const restack_discarded_card = (target: Card) => run_effect(CardEffects.RESTACK_
|
|||||||
</button>
|
</button>
|
||||||
</template>
|
</template>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="isPlayerEnemy && isSelfTurn && (c.health_as_champion ?? 0) > 0">
|
<template
|
||||||
|
v-if="c && goStore.self?.turn && isPlayerEnemy && isSelfTurn && (c.health_as_champion ?? 0) > 0">
|
||||||
<button class="enemy_action"
|
<button class="enemy_action"
|
||||||
:disabled="(goStore.self?.turn.damage_reserve ?? 0) < (c.health_as_champion ?? Infinity)"
|
:disabled="(goStore.self?.turn.damage_reserve ?? 0) < (c.health_as_champion ?? Infinity)"
|
||||||
@click.stop="damage_champion(c)">
|
@click.stop="damage_champion(c)">
|
||||||
|
|||||||
+1
-1
@@ -15,7 +15,7 @@ export interface GameNetcode extends GameObjectNetcode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export type Game = Omit<GameNetcode, 'market_stack' | 'market' | 'gem_stack' | 'current_turn' | 'player'> & {
|
export type Game = Omit<GameNetcode, 'market_stack' | 'market' | 'gem_stack' | 'current_turn' | 'players'> & {
|
||||||
market_stack: Array<Card>
|
market_stack: Array<Card>
|
||||||
market: Array<Card | null>
|
market: Array<Card | null>
|
||||||
gem_stack: Array<Card>
|
gem_stack: Array<Card>
|
||||||
|
|||||||
Reference in New Issue
Block a user