fix many indicators

This commit is contained in:
Branden J Brown 2024-02-03 13:02:19 -06:00
parent 9a02235eba
commit 46f7d04e2c
3 changed files with 17 additions and 7 deletions

View File

@ -39,11 +39,6 @@ const themeIcon = computed(() => dark.value ? 'mdi-moon-waxing-crescent' : 'mdi-
const { status, data, send, open } = useWebSocket<string>(`wss://${window.location.host}/queue`, {
immediate: false,
onDisconnected: (_ws, evt) => {
console.warn('lost connection', { evt });
game.value = null;
dealer.value = null;
},
});
const game = ref<Game | null>(null);
const dealer = ref<boolean | null>(null);

View File

@ -6,13 +6,16 @@
</v-sheet>
</v-row>
<v-row class="d-flex flex-fill justify-center">
<v-alert :text="msg" class="mt-2 text-button" density="compact"></v-alert>
<v-alert :text="msg" class="d-flex justify-center mt-2 text-button" density="compact"></v-alert>
</v-row>
<v-row v-if="shellList.length > 0">
<v-sheet class="d-flex justify-center mt-2" :elevation="2">
{{ shellList }}
</v-sheet>
</v-row>
<v-row v-if="revealed != null">
<v-alert :text="revealed" class="d-flex justify-center mt-2 text-button" density="compact"></v-alert>
</v-row>
</v-container>
</template>
@ -37,7 +40,7 @@ const actionMessages: Record<Game["action"], (game: Game) => string> = {
Shoot: (game) => game.previous ? "THE PAIN..." : "A BLANK CLATTERS ON THE TABLE",
GameEnd: () => "THE DEALER RELOADS THE SHOTGUN",
BeerGameEnd: () => "THE LAST SHELL CLATTERS ON THE TABLE",
ChallengerWins: (game) => game.round < 3 ? "THE DEALER FALLS... BRIEFLY" : "THE DEALER FALLS... FOREVER",
ChallengerWins: (game) => game.winner != null ? "THE DEALER FALLS... BRIEFLY" : "THE DEALER FALLS... FOREVER",
DealerWins: () => "THE CHALLENGER FALLS",
Lens: (game) => `THE ${game.dealer ? "DEALER" : "CHALLENGER"} PEERS INTO THE CHAMBER`,
Cig: (game) => `THE ${game.dealer ? "DEALER" : "CHALLENGER"} TAKES A DRAG`,
@ -56,6 +59,16 @@ const msg = computed(() => {
return f(props.game);
});
const revealed = computed(() => {
if (props.game.shell === true) {
return 'INSIDE, YOU SEE 🟥';
}
if (props.game.shell === false) {
return 'INSIDE, YOU SEE 🟦';
}
return null;
})
const shellList = ref<string[]>([]);
watch(props.game, (game) => {
if (game.live == null || game.blank == null) {

View File

@ -1,7 +1,9 @@
<template>
<v-container>
<v-row :class="closeClass">
<v-sheet v-if="props.dealer && stats.cuffs" class="mr-4 text-button" :elevation="2">CUFFED</v-sheet>
<PlayerHP :hp="props.stats.hp" />
<v-sheet v-if="!props.dealer && stats.cuffs" class="ml-4 text-button" :elevation="2">CUFFED</v-sheet>
</v-row>
<v-row>
<v-col cols="4"></v-col>