summaryrefslogtreecommitdiff
path: root/types.d.ts
diff options
context:
space:
mode:
authorFrans Bongers <fransbongers@franss-mbp.home>2024-12-01 20:07:32 +0100
committerFrans Bongers <fransbongers@franss-mbp.home>2024-12-01 20:07:32 +0100
commite32cc3efe1c1ef5378cef422555e8c8289449938 (patch)
tree8635f5131bd3b261b1b690df9d9f72626cfdf440 /types.d.ts
parent74e1497d50a6ff81c74c593f2d0f7018d2995fd8 (diff)
downloadland-and-freedom-e32cc3efe1c1ef5378cef422555e8c8289449938.tar.gz
add card effects
Diffstat (limited to 'types.d.ts')
-rw-r--r--types.d.ts46
1 files changed, 45 insertions, 1 deletions
diff --git a/types.d.ts b/types.d.ts
index a79c951..b470acc 100644
--- a/types.d.ts
+++ b/types.d.ts
@@ -37,7 +37,7 @@ export interface Game {
medaillons: Array<number | null>;
tableaus: Record<FactionId, CardId[]>;
tracks: number[];
-
+ triggered_track_effects: number[][];
result?: string;
victory?: string;
@@ -93,4 +93,48 @@ export interface LeafNode {
p: FactionId; // Player
a?: any; // args
r?: 0 | 1; // 1 if resolved
+}
+
+export interface CardBase {
+ id: number;
+ title: string;
+}
+
+export type Card = EventCard | PlayerCard;
+
+export interface EventCard extends CardBase {
+ type: 'ec';
+ year: number;
+ effects: Effect[];
+}
+
+export interface PlayerCard extends CardBase {
+ type: 'pc';
+ strength: number;
+ effects: Effect[];
+}
+
+export interface Effect {
+ type: 'attack' | 'track' | 'bonus' | 'hero_points' | 'front' | 'medaillon' | 'draw_card' | 'swap_card_tableau_hand' | 'add_to_tableau' | 'remove_blank_marker' | 'return_card';
+ target: string | number;
+ value: number;
+}
+
+export interface StaticData {
+ cards: Card[];
+ fronts: Array<{
+ id: string;
+ name: string;
+ left: number;
+ top: number;
+ }>;
+ medaillons: Array<{
+ id: number;
+ name: string;
+ }>;
+ tracks: Array<{
+ id: number;
+ name: string;
+ triggers: Array<null | Effect>;
+ }>;
} \ No newline at end of file