feat: fire gem warning
This commit is contained in:
@@ -30,6 +30,7 @@ const isPlayerTurn = computed(() => props.player.team === goStore.current_game?.
|
||||
const isSelf = computed(() => props.player.uuid === goStore.self?.uuid);
|
||||
const isSelfTurn = computed(() => goStore.self?.team === goStore.current_game?.current_turn)
|
||||
const isPlayerEnemy = computed(() => goStore.self?.team !== props.player.team)
|
||||
const warningText = ref("Effets restants!")
|
||||
|
||||
function run_effect(
|
||||
effect_type: CardEffects,
|
||||
@@ -58,13 +59,17 @@ let warning = ref(false)
|
||||
|
||||
function has_actions_remaining(): boolean {
|
||||
return (goStore.self?.turn?.damage_reserve ? goStore.self?.turn?.damage_reserve > 0 : false)
|
||||
|| (goStore.self?.turn?.gold_reserve ? goStore.self?.turn?.gold_reserve > 0 : false)
|
||||
|| (goStore.self?.turn?.gold_reserve ? goStore.self?.turn?.gold_reserve >= goStore.current_game?.market.reduce((min, card) => Math.min(min, card?.cost ?? Infinity), Infinity) : false)
|
||||
|| (goStore.self?.turn?.fuck_u_markers ? goStore.self?.turn?.fuck_u_markers > 0 : false)
|
||||
|| !goStore.self?.turn?.effects_availables.every(e => !e.usable)
|
||||
|| !goStore.self?.board.every(c => (c.uuid in (goStore.self?.turn?.cards_locked ?? {})))
|
||||
|| false
|
||||
}
|
||||
|
||||
function can_buy_fire_gem(): boolean {
|
||||
return (goStore.self?.turn?.gold_reserve ? goStore.self?.turn?.gold_reserve >= 2 : false)
|
||||
}
|
||||
|
||||
function checkEndTurn() {
|
||||
// TODO: Add a confirmation dialog if resources are left
|
||||
console.log("Checking end turn")
|
||||
@@ -75,7 +80,12 @@ function checkEndTurn() {
|
||||
// Display an alert somehow using this warning flag
|
||||
warning.value = true
|
||||
}
|
||||
else if (!warning.value && can_buy_fire_gem()) {
|
||||
warningText.value = "P'tite Fire gem?"
|
||||
warning.value = true
|
||||
}
|
||||
else {
|
||||
warningText.value = "Effets restants!"
|
||||
warning.value = false
|
||||
endTurn()
|
||||
}
|
||||
@@ -141,7 +151,7 @@ function damage_team_all(team: Team) {
|
||||
</PlayerStats>
|
||||
<template v-if="!hide_stack_and_discard">
|
||||
<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>
|
||||
<div class="warning" v-if="warning" :class="{'warning-fire-gem': warningText == 'P\'tite Fire gem?'}">/!\<br>{{warningText}}</div>
|
||||
</template>
|
||||
|
||||
</template>
|
||||
@@ -236,11 +246,15 @@ function damage_team_all(team: Team) {
|
||||
color: white;
|
||||
padding: 5px;
|
||||
border-radius: 5px;
|
||||
width: 85px;
|
||||
width: 90px;
|
||||
font-size: 0.85em;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
.warning-fire-gem {
|
||||
background-color: rgba(255, 165, 0, 0.7);
|
||||
}
|
||||
|
||||
#end_turn {
|
||||
z-index: 10;
|
||||
height: 100%;
|
||||
|
||||
Reference in New Issue
Block a user