-
-
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-playground): bury dead bodies playground (#230)
- Loading branch information
1 parent
fbe47b1
commit 4dce309
Showing
30 changed files
with
22,474 additions
and
19,429 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
...round/GamePlaygroundContent/GameBuryDeadBodiesPlayground/GameBuryDeadBodiesPlayground.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,42 @@ | ||
<template> | ||
<div | ||
id="game-bury-dead-bodies-playground" | ||
class="flex items-center justify-center" | ||
> | ||
<GameDevotedServantStealsRolePlayground | ||
v-if="eligibleStolenRoleByDevotedServantPlayer" | ||
id="game-devoted-servant-steals-role-playground" | ||
/> | ||
|
||
<NoActionNeeded | ||
v-else | ||
id="no-action-needed" | ||
/> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { storeToRefs } from "pinia"; | ||
import GameDevotedServantStealsRolePlayground from "~/components/pages/game/GamePlaying/GamePlayground/GamePlaygroundContent/GameBuryDeadBodiesPlayground/GameDevotedServantStealsRolePlayground/GameDevotedServantStealsRolePlayground.vue"; | ||
import NoActionNeeded from "~/components/shared/game/game-play/NoNeededAction/NoActionNeeded.vue"; | ||
import { useGamePlay } from "~/composables/api/game/game-play/useGamePlay"; | ||
import { PlayerInteraction } from "~/composables/api/game/types/game-play/game-play-eligible-targets/interactable-player/player-interaction/player-interaction.class"; | ||
import type { Player } from "~/composables/api/game/types/players/player.class"; | ||
import { RoleNames } from "~/composables/api/role/enums/role.enums"; | ||
import { useGameStore } from "~/stores/game/useGameStore"; | ||
const gameStore = useGameStore(); | ||
const { game } = storeToRefs(gameStore); | ||
const { getPlayerWithInteractionInCurrentGamePlay } = useGamePlay(game); | ||
const eligibleStolenRoleByDevotedServantPlayer = computed<Player | undefined>(() => { | ||
const stolenRoleByDevotedServantInteraction = PlayerInteraction.create({ | ||
source: RoleNames.DEVOTED_SERVANT, | ||
type: "steal-role", | ||
}); | ||
return getPlayerWithInteractionInCurrentGamePlay(stolenRoleByDevotedServantInteraction); | ||
}); | ||
</script> |
85 changes: 85 additions & 0 deletions
85
...yground/GameDevotedServantStealsRolePlayground/GameDevotedServantStealsRolePlayground.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,85 @@ | ||
<template> | ||
<div | ||
id="game-devoted-servant-steal-role-playground" | ||
class="flex flex-col items-center" | ||
> | ||
<GlowCapture> | ||
<GlowElement> | ||
<RoleImage | ||
class="glow:border-gray-400" | ||
definition="normal" | ||
:role-name="RoleNames.DEVOTED_SERVANT" | ||
sizes="175px" | ||
/> | ||
</GlowElement> | ||
</GlowCapture> | ||
|
||
<h3 | ||
id="devoted-servant-steals-role-question" | ||
class="my-4" | ||
> | ||
{{ devotedServantStealsRoleQuestion }} | ||
</h3> | ||
|
||
<VuePrimeToggleButton | ||
id="does-devoted-servant-steal-role-button" | ||
v-model="doesDevotedServantStealRole" | ||
class="w-9rem" | ||
off-icon="fa fa-thumbs-down me-4" | ||
:off-label="$t('components.GameDevotedServantStealsRolePlayground.sheDoesntStealRole')" | ||
on-icon="fa fa-thumbs-up me-4 !text-white" | ||
:on-label="$t('components.GameDevotedServantStealsRolePlayground.sheStealsRole')" | ||
@change="handleDoesDevotedServantStealRoleChange" | ||
/> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { storeToRefs } from "pinia"; | ||
import RoleImage from "~/components/shared/role/RoleImage/RoleImage.vue"; | ||
import { useGamePlay } from "~/composables/api/game/game-play/useGamePlay"; | ||
import { PlayerInteraction } from "~/composables/api/game/types/game-play/game-play-eligible-targets/interactable-player/player-interaction/player-interaction.class"; | ||
import type { Player } from "~/composables/api/game/types/players/player.class"; | ||
import { RoleNames } from "~/composables/api/role/enums/role.enums"; | ||
import { useMakeGamePlayDtoStore } from "~/stores/game/make-game-play-dto/useMakeGamePlayDtoStore"; | ||
import { useGameStore } from "~/stores/game/useGameStore"; | ||
const { t } = useI18n(); | ||
const gameStore = useGameStore(); | ||
const { game } = storeToRefs(gameStore); | ||
const makeGamePlayDtoStore = useMakeGamePlayDtoStore(); | ||
const { | ||
addMakeGamePlayTargetDto, | ||
removeMakeGamePlayTargetDto, | ||
} = makeGamePlayDtoStore; | ||
const { getPlayerWithInteractionInCurrentGamePlay } = useGamePlay(game); | ||
const doesDevotedServantStealRole = ref<boolean>(false); | ||
const eliminatedPlayer = computed<Player | undefined>(() => getPlayerWithInteractionInCurrentGamePlay(PlayerInteraction.create({ | ||
source: RoleNames.DEVOTED_SERVANT, | ||
type: "steal-role", | ||
}))); | ||
const devotedServantStealsRoleQuestion = computed<string>(() => { | ||
const playerName = eliminatedPlayer.value?.name; | ||
return t("components.GameDevotedServantStealsRolePlayground.doesDevotedServantStealRole", { playerName }); | ||
}); | ||
function handleDoesDevotedServantStealRoleChange(): void { | ||
if (eliminatedPlayer.value?._id === undefined) { | ||
throw createError("Eliminated player is not found."); | ||
} | ||
if (doesDevotedServantStealRole.value) { | ||
addMakeGamePlayTargetDto({ playerId: eliminatedPlayer.value._id }); | ||
return; | ||
} | ||
removeMakeGamePlayTargetDto(eliminatedPlayer.value._id); | ||
} | ||
</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
14 changes: 14 additions & 0 deletions
14
components/shared/game/game-play/NoNeededAction/NoActionNeeded.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,14 @@ | ||
<template> | ||
<div id="no-action-needed"> | ||
<h2 | ||
id="no-action-needed-message" | ||
class="flex flex-col items-center justify-center text-gray-300" | ||
> | ||
<i class="fa fa-2x fa-thumbs-up mb-3 text-success"/> | ||
|
||
<span> | ||
{{ $t("components.NoActionNeeded.noActionNeeded") }} | ||
</span> | ||
</h2> | ||
</div> | ||
</template> |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-510 Bytes
(99%)
tests/acceptance/screenshots/darwin/Game Lobby Page with 40 players.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file modified
BIN
-3.03 KB
(98%)
tests/acceptance/screenshots/linux/Game Lobby Page with 40 players.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.