Skip to content

Commit 963032a

Browse files
committed
Extract Tabu Imposter and Schaetzorama packages
1 parent 3af274c commit 963032a

34 files changed

Lines changed: 43 additions & 7521 deletions

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,19 @@ Public game catalog in this source cut:
4040
- Drift Racer
4141
- Chaos-Kommando
4242
- Draw & Guess
43-
- Schaetzorama
4443
- Word Tiles
4544
- Arena Survivor
4645
- MinionsTD
47-
- Imposter
48-
- Tabu
4946
- Light Trails
5047

5148
Optional local game repos:
5249

5350
- Tap Race (`local-games/tap-race` when cloned locally; the legacy `local-games/open-party-game-tap-race` folder still works)
5451
- Pantomime (`local-games/pantomime` when cloned locally)
5552
- Air Hockey (`local-games/air-hockey` when cloned locally)
53+
- Tabu (`local-games/tabu` when cloned locally)
54+
- Imposter (`local-games/imposter` when cloned locally)
55+
- Schaetzorama (`local-games/schaetzorama` when cloned locally)
5656

5757
## Quick Start
5858

@@ -120,6 +120,9 @@ Clone optional games:
120120
```bash
121121
git clone https://github.com/Hartwich/open-party-game-tap-race.git local-games/tap-race
122122
git clone https://github.com/Hartwich/air-hockey.git local-games/air-hockey
123+
git clone https://github.com/Hartwich/tabu.git local-games/tabu
124+
git clone https://github.com/Hartwich/imposter.git local-games/imposter
125+
git clone https://github.com/Hartwich/schaetzorama.git local-games/schaetzorama
123126
npm run games:sync-local
124127
```
125128

apps/controller/src/controller-ui/games/imposter/ImposterController.tsx

Lines changed: 0 additions & 142 deletions
This file was deleted.

apps/controller/src/controller-ui/games/imposter/imposterBindings.ts

Lines changed: 0 additions & 43 deletions
This file was deleted.

apps/controller/src/controller-ui/games/registry.tsx

Lines changed: 1 addition & 123 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import { buildLightTrailsControllerModel } from "./light-trails/LightTrailsContr
44
import { buildArenaSurvivorControllerModel } from "./arena-survivor/ArenaSurvivorController.js";
55
import { buildChaosKommandoControllerModel } from "./chaos-kommando/ChaosKommandoController.js";
66
import { buildMinionsTdControllerModel } from "./minions-td/MinionsTdController.js";
7-
import { buildImposterControllerModel } from "./imposter/ImposterController.js";
8-
import { createTabuCorrectInput } from "./tabu/tabuBindings.js";
97
import {
108
createDrawingClearInput,
119
createDrawingEndInput,
@@ -15,16 +13,12 @@ import {
1513
createGuessSubmitInput
1614
} from "./zeichnen-und-erraten/zeichnenUndErratenBindings.js";
1715
import { buildDriftRacerControllerModel } from "./drift-racer/DriftRacerController.js";
18-
import { buildSchaetzoramaControllerModel } from "./schaetzorama/SchaetzoramaController.js";
1916
import { buildWordTilesControllerModel } from "./word-tiles/WordTilesController.js";
2017
import type {
2118
ControllerLayoutModel,
22-
ChoiceLayoutModel,
2319
DrawingGuessLayoutModel,
24-
ReadyLayoutModel,
25-
SingleButtonLayoutModel
20+
ReadyLayoutModel
2621
} from "../layouts/models.js";
27-
import type { TabuControllerState } from "@open-party-lab/protocol";
2822
import { getControllerText } from "../../i18n/controllerText.js";
2923
import { externalControllerGameRegistrations } from "./.generated/externalGames.js";
3024

@@ -139,115 +133,6 @@ const internalControllerGameRegistry: Record<string, ControllerGameRegistration>
139133
return buildLightTrailsControllerModel(context);
140134
}
141135
},
142-
tabu: {
143-
id: "tabu",
144-
layoutKey: "choice",
145-
buildLayout(context) {
146-
const { state, onInput } = context;
147-
const text = getControllerText(state.room?.language ?? state.preferredLanguage);
148-
const en = state.room?.language === "en";
149-
const playerId = state.player?.id ?? "";
150-
const tabuState = (state.game?.state ?? {}) as TabuControllerState;
151-
const playerNames = new Map((state.room?.players ?? []).map((player) => [player.id, player.name]));
152-
const currentTurnPlayerId = tabuState.currentTurnPlayerId;
153-
const currentTurnPlayerName = currentTurnPlayerId
154-
? playerNames.get(currentTurnPlayerId) ?? currentTurnPlayerId
155-
: undefined;
156-
const currentTurnTeamId =
157-
tabuState.currentTurnTeamId ?? (currentTurnPlayerId ? tabuState.teamByPlayerId[currentTurnPlayerId] : undefined);
158-
const currentTurnTeamLabel =
159-
currentTurnTeamId === "team1" ? "Team 1" : currentTurnTeamId === "team2" ? "Team 2" : undefined;
160-
const solved = tabuState.solvedTerms ?? 0;
161-
const target = tabuState.targetTerms ?? 10;
162-
const isExplainer = tabuState.currentTurnPlayerId === playerId;
163-
const currentTerm = isExplainer ? tabuState.currentCardTerm ?? (en ? "Waiting for the first term" : "Warte auf den Startbegriff") : undefined;
164-
const remainingSeconds =
165-
tabuState.turnRemainingMs !== null ? Math.max(0, Math.ceil(tabuState.turnRemainingMs / 1000)) : null;
166-
const choices: ChoiceLayoutModel["choices"] = [];
167-
168-
if (isExplainer && tabuState.mode === "duel") {
169-
for (const otherPlayer of state.room?.players ?? []) {
170-
if (otherPlayer.id === playerId) {
171-
continue;
172-
}
173-
174-
choices.push({
175-
id: `tabu:duel:${otherPlayer.id}`,
176-
label: otherPlayer.name,
177-
description: en ? "Guessed the word" : "Hat das Wort erraten",
178-
disabled: state.game?.phase !== "playing",
179-
onSelect: () => onInput(createTabuCorrectInput(playerId, otherPlayer.id))
180-
});
181-
}
182-
}
183-
184-
if (isExplainer && tabuState.mode === "team") {
185-
choices.push({
186-
id: "tabu:team:solved",
187-
label: en ? "Solved" : "Geloest",
188-
description: en ? "Your team guessed the word" : "Euer Team hat das Wort geschafft",
189-
disabled: state.game?.phase !== "playing",
190-
onSelect: () => onInput(createTabuCorrectInput(playerId))
191-
});
192-
}
193-
194-
const model: ChoiceLayoutModel = {
195-
kind: "choice",
196-
title: "Tabu",
197-
subtitle:
198-
tabuState.mode === "team"
199-
? `${tabuState.currentModeLabel} | ${currentTurnTeamLabel ?? "Team"}: ${currentTurnPlayerName ?? text.unknown}`
200-
: `${tabuState.currentModeLabel} | ${en ? "Explainer" : "Erklaerer"}: ${currentTurnPlayerName ?? text.unknown}`,
201-
helperText: isExplainer
202-
? tabuState.mode === "team"
203-
? currentTerm
204-
? `${currentTerm}\n${en ? "Tap Solved once your team guessed the word." : "Tippe auf Geloest, wenn euer Team das Wort geschafft hat."}`
205-
: en ? "Tap Solved once your team guessed the word." : "Tippe auf Geloest, wenn euer Team das Wort geschafft hat."
206-
: currentTerm
207-
? `${en ? "Word" : "Wort"}: ${currentTerm}\n${en ? "Choose the player who guessed the word." : "Waehle den Spieler, der das Wort erraten hat."}`
208-
: en ? "Choose the player who guessed the word." : "Waehle den Spieler, der das Wort erraten hat."
209-
: currentTurnPlayerName
210-
? `${en ? "Waiting for" : "Warte auf"} ${currentTurnPlayerName}.`
211-
: en ? "Waiting for the explaining player." : "Warte auf die erklaerende Person.",
212-
disabled: state.game?.phase !== "playing" || !isExplainer,
213-
choices,
214-
stats: [
215-
{
216-
label: en ? "Progress" : "Fortschritt",
217-
value: `${solved}/${target}`
218-
},
219-
{
220-
label: en ? "Cards left" : "Karten uebrig",
221-
value: `${tabuState.remainingCards ?? 0}`
222-
},
223-
{
224-
label: en ? "Mode" : "Modus",
225-
value: tabuState.currentModeLabel
226-
},
227-
{
228-
label: en ? "Time" : "Zeit",
229-
value: remainingSeconds !== null ? `${remainingSeconds}s` : "-"
230-
},
231-
{
232-
label: en ? "Role" : "Rolle",
233-
value: isExplainer ? (en ? "Explainer" : "Erklaerer") : (en ? "Viewer" : "Zuschauer")
234-
},
235-
{
236-
label: "Team",
237-
value: currentTurnTeamLabel ?? "-"
238-
}
239-
],
240-
};
241-
return withAutoReady(model, context);
242-
}
243-
},
244-
imposter: {
245-
id: "imposter",
246-
layoutKey: "choice",
247-
buildLayout(context) {
248-
return withAutoReady(buildImposterControllerModel(context), context);
249-
}
250-
},
251136
"zeichnen-und-erraten": {
252137
id: "zeichnen-und-erraten",
253138
layoutKey: "drawing_guess",
@@ -296,13 +181,6 @@ const internalControllerGameRegistry: Record<string, ControllerGameRegistration>
296181
return withAutoReady(model, context);
297182
}
298183
},
299-
schaetzorama: {
300-
id: "schaetzorama",
301-
layoutKey: "schaetzorama",
302-
buildLayout(context) {
303-
return withAutoReady(buildSchaetzoramaControllerModel(context), context);
304-
}
305-
},
306184
"word-tiles": {
307185
id: "word-tiles",
308186
layoutKey: "word_tiles_board",

0 commit comments

Comments
 (0)