Better cards stacks and discard view
This commit is contained in:
+28
-25
@@ -14,8 +14,29 @@ const isTurn = computed(() => goStore.self && goStore.game?.started && (goStore.
|
||||
<div>
|
||||
market_amount = {{ goStore.game?.market_stack?.length }}
|
||||
<br>
|
||||
market =
|
||||
<div class="cards_container">
|
||||
<CardSlot :stack="goStore.game?.gem_stack">
|
||||
<template v-if="isTurn && goStore.game?.gem_stack.length && goStore.game?.gem_stack.length > 0">
|
||||
<button @click="buy(goStore.game.gem_stack.at(-1)!)">
|
||||
BUY
|
||||
</button>
|
||||
<button
|
||||
@click="useEffect(goStore.self!.turn.effects_availables.find(e => (e.effect == CardEffects.PLAY_NEXT_CARD_BOUGHT) && e.usable)!, goStore.game.gem_stack.at(-1))"
|
||||
:disabled="(goStore.self === undefined || goStore.game.gem_stack.at(-1)!.cost === undefined || (goStore.self?.turn.gold_reserve ?? 0) < goStore.game.gem_stack.at(-1)!.cost!) || !goStore.self!.turn.effects_availables.some(e => (e.effect == CardEffects.PLAY_NEXT_CARD_BOUGHT) && e.usable)">
|
||||
BUY IN HAND</button>
|
||||
<button
|
||||
@click="useEffect(goStore.self!.turn.effects_availables.find(e => (e.effect == CardEffects.STACK_NEXT_CARD_BOUGHT) && e.usable)!, goStore.game.gem_stack.at(-1))"
|
||||
:disabled="(goStore.self === undefined || goStore.game.gem_stack.at(-1)?.cost === undefined || (goStore.self?.turn.gold_reserve ?? 0) < (goStore.game.gem_stack.at(-1)?.cost ?? Infinity)) || !goStore.self!.turn.effects_availables.some(e => (e.effect == CardEffects.STACK_NEXT_CARD_BOUGHT) && e.usable)">
|
||||
BUY IN STACK (generic)</button>
|
||||
<!-- <button @click="buy_in_hand(props.game.gem_stack.at(-1))">
|
||||
BUY IN HAND
|
||||
</button>
|
||||
<button @click="buy_on_stack(props.game.gem_stack.at(-1))">
|
||||
BUY ON STACK
|
||||
</button> -->
|
||||
</template>
|
||||
</CardSlot>
|
||||
<div class="separator"></div>
|
||||
<CardPreview :data="c" v-for="c in goStore.game?.market" @click="c && buy(c)">
|
||||
<template v-if="isTurn && c">
|
||||
<button @click="buy(c)"
|
||||
@@ -34,31 +55,9 @@ const isTurn = computed(() => goStore.self && goStore.game?.started && (goStore.
|
||||
BUY IN STACK (actions)</button>
|
||||
</template>
|
||||
</CardPreview>
|
||||
|
||||
</div>
|
||||
|
||||
<br>
|
||||
gems =
|
||||
<CardSlot :stack="goStore.game?.gem_stack">
|
||||
<template v-if="isTurn && goStore.game?.gem_stack.length && goStore.game?.gem_stack.length > 0">
|
||||
<button @click="buy(goStore.game.gem_stack.at(-1)!)">
|
||||
BUY
|
||||
</button>
|
||||
<button
|
||||
@click="useEffect(goStore.self!.turn.effects_availables.find(e => (e.effect == CardEffects.PLAY_NEXT_CARD_BOUGHT) && e.usable)!, goStore.game.gem_stack.at(-1))"
|
||||
:disabled="(goStore.self === undefined || goStore.game.gem_stack.at(-1)!.cost === undefined || (goStore.self?.turn.gold_reserve ?? 0) < goStore.game.gem_stack.at(-1)!.cost!) || !goStore.self!.turn.effects_availables.some(e => (e.effect == CardEffects.PLAY_NEXT_CARD_BOUGHT) && e.usable)">
|
||||
BUY IN HAND</button>
|
||||
<button
|
||||
@click="useEffect(goStore.self!.turn.effects_availables.find(e => (e.effect == CardEffects.STACK_NEXT_CARD_BOUGHT) && e.usable)!, goStore.game.gem_stack.at(-1))"
|
||||
:disabled="(goStore.self === undefined || goStore.game.gem_stack.at(-1)?.cost === undefined || (goStore.self?.turn.gold_reserve ?? 0) < (goStore.game.gem_stack.at(-1)?.cost ?? Infinity)) || !goStore.self!.turn.effects_availables.some(e => (e.effect == CardEffects.STACK_NEXT_CARD_BOUGHT) && e.usable)">
|
||||
BUY IN STACK (generic)</button>
|
||||
<!-- <button @click="buy_in_hand(props.game.gem_stack.at(-1))">
|
||||
BUY IN HAND
|
||||
</button>
|
||||
<button @click="buy_on_stack(props.game.gem_stack.at(-1))">
|
||||
BUY ON STACK
|
||||
</button> -->
|
||||
</template>
|
||||
</CardSlot>
|
||||
</div>
|
||||
<div>
|
||||
<PlayerList>
|
||||
@@ -70,7 +69,11 @@ const isTurn = computed(() => goStore.self && goStore.game?.started && (goStore.
|
||||
<style>
|
||||
.cards_container {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-direction: row-reverse;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.separator {
|
||||
margin-left: 100px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user