-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(game): idiot spared life event (#618)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added a confirm dialog before starting a game. - Disabled player cards based on the current play type. - Introduced new "Idiot" role with specific game events and interactions. - Added sound effect "dumb-huh." - **Bug Fixes** - Fixed player card targetability based on play type. - **Tests** - Added unit and acceptance tests for new "Idiot" role and game events. - **Chores** - Updated dependencies, including prettier-plugin-gherkin and tsx. - Incremented application version to 1.25.0. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
- Loading branch information
1 parent
b84e26e
commit b5b77d1
Showing
25 changed files
with
72,758 additions
and
69,780 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<component name="ProjectRunConfigurationManager"> | ||
<configuration default="false" name="Idiot Role" type="cucumber.js" factoryName="Cucumber.js" folderName="Tags"> | ||
<option name="myFilePath" value="$PROJECT_DIR$/tests/acceptance" /> | ||
<option name="myNameFilter" value="" /> | ||
<option name="cucumberJsArguments" value="--config config/cucumber/cucumber.json --parallel 1 --tags @idiot-role" /> | ||
<option name="workingDirectory" value="$PROJECT_DIR$" /> | ||
<envs> | ||
<env name="NODE_OPTIONS" value="--import tsx/esm" /> | ||
</envs> | ||
<method v="2" /> | ||
</configuration> | ||
</component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
...tsMonitor/GameEventsMonitorCurrentEvent/GameIdiotIsSparedEvent/GameIdiotIsSparedEvent.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<template> | ||
<GameEventWithTexts | ||
id="game-idiot-is-spared-event" | ||
:texts="gameIdiotIsSparedEventTexts" | ||
@game-event-text-change="onGameEventTextChangeFromGameEventWithTexts" | ||
> | ||
<div class="flex h-full items-center justify-center"> | ||
<GameEventFlippingPlayerCard | ||
v-if="idiotInPlayers" | ||
id="game-event-flipping-idiot-card" | ||
:players="[idiotInPlayers]" | ||
svg-icon-path="/svg/game/player/player-attribute/seen.svg" | ||
/> | ||
</div> | ||
</GameEventWithTexts> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { storeToRefs } from "pinia"; | ||
import GameEventFlippingPlayerCard from "~/components/shared/game/game-event/GameEventFlippingPlayerCard/GameEventFlippingPlayerCard.vue"; | ||
import GameEventWithTexts from "~/components/shared/game/game-event/GameEventWithTexts/GameEventWithTexts.vue"; | ||
import type { Player } from "~/composables/api/game/types/players/player.class"; | ||
import { useGamePlayers } from "~/composables/api/game/useGamePlayers"; | ||
import { useAudioStore } from "~/stores/audio/useAudioStore"; | ||
import { useGameStore } from "~/stores/game/useGameStore"; | ||
const gameStore = useGameStore(); | ||
const { game } = storeToRefs(gameStore); | ||
const { getPlayersWithCurrentRole } = useGamePlayers(game); | ||
const audioStore = useAudioStore(); | ||
const { playSoundEffect } = audioStore; | ||
const { t } = useI18n(); | ||
const idiotInPlayers = computed<Player | undefined>(() => getPlayersWithCurrentRole("idiot")[0]); | ||
const gameIdiotIsSparedEventTexts = computed<string[]>(() => { | ||
if (!idiotInPlayers.value) { | ||
return [t("components.GameIdiotIsSparedEvent.cantFindIdiot")]; | ||
} | ||
return [ | ||
t("components.GameIdiotIsSparedEvent.playerDies", { playerName: idiotInPlayers.value.name }), | ||
t("components.GameIdiotIsSparedEvent.playerIsActuallyIdiot", { playerName: idiotInPlayers.value.name }), | ||
t("components.GameIdiotIsSparedEvent.idiotIsSpared"), | ||
]; | ||
}); | ||
function onGameEventTextChangeFromGameEventWithTexts(newGameEventText: string | undefined): void { | ||
if (newGameEventText === gameIdiotIsSparedEventTexts.value[0]) { | ||
playSoundEffect("death"); | ||
} else if (newGameEventText === gameIdiotIsSparedEventTexts.value[1]) { | ||
playSoundEffect("dumb-huh"); | ||
} | ||
} | ||
playSoundEffect("death"); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Oops, something went wrong.