46 lines
977 B
TypeScript
46 lines
977 B
TypeScript
export type Route = 'deliver' | 'return' | 'archive' | 'quarantine';
|
|
|
|
export interface Letter {
|
|
id: string;
|
|
day: number;
|
|
sender: string;
|
|
recipient: string;
|
|
address: string;
|
|
postmark: string;
|
|
body: string;
|
|
marks: string[];
|
|
correctRoute: Route;
|
|
explanation: string;
|
|
correctConsequence?: string;
|
|
wrongConsequences?: Partial<Record<Route, string>>;
|
|
penalty?: Partial<Record<Route, { composure?: number; suspicion?: number }>>;
|
|
}
|
|
|
|
export interface Regulation {
|
|
id: string;
|
|
fromDay: number;
|
|
number: string;
|
|
text: string;
|
|
note?: string;
|
|
}
|
|
|
|
export interface Decision {
|
|
letterId: string;
|
|
route: Route;
|
|
correct: boolean;
|
|
consequence: string;
|
|
composureCost: number;
|
|
suspicionCost: number;
|
|
}
|
|
|
|
export interface GameState {
|
|
phase: 'intro' | 'playing' | 'day-end' | 'won' | 'lost';
|
|
day: number;
|
|
letterIndex: number;
|
|
accuracy: number;
|
|
composure: number;
|
|
suspicion: number;
|
|
decisions: Decision[];
|
|
lastDecision: Decision | null;
|
|
}
|