summaryrefslogtreecommitdiff
path: root/types.d.ts
diff options
context:
space:
mode:
Diffstat (limited to 'types.d.ts')
-rw-r--r--types.d.ts62
1 files changed, 57 insertions, 5 deletions
diff --git a/types.d.ts b/types.d.ts
index d68a7e9..d55f03e 100644
--- a/types.d.ts
+++ b/types.d.ts
@@ -79,17 +79,23 @@ export interface View {
log: number | string[];
active?: string | null;
prompt: string | null;
+ state: Game['state'];
actions?: any;
victory?: string;
current: Player | 'Observer';
- selected_cards: CardId[];
- bag_of_glory: Game['bag_of_glory'];
+ current_player_faction: FactionId | null;
+ selected_cards: number[];
+ bag_of_glory: Game['bag_of_glory']; // TODO: remove
+ bag_of_glory_count: number;
bonuses: Game['bonuses'];
current_events: CardId[];
first_player: Game['first_player'];
fronts: Game['fronts'];
glory: Game['glory'];
- hand: CardId[];
+ hand: number[];
+ discard: number[];
+ deck: number[];
+ trash: number[];
hero_points: Game['hero_points'];
initiative: Game['initiative'];
medallions: Game['medallions'];
@@ -121,11 +127,11 @@ export interface SeqNode {
c: EngineNode[];
}
-export interface LeafNode {
+export interface LeafNode<T = any> {
t: 'l';
s: string; // State
p: FactionId | 'None'; // Player
- a?: any; // args
+ a?: T; // args
r?: 0 | 1; // 1 if resolved
}
@@ -171,6 +177,8 @@ export interface PlayerCard extends CardBase {
icons: Icon[];
}
+export type EffectSource = 'fascist_event' | 'fascist_test' | 'track_icon' | 'momentum';
+
export interface Effect {
type:
| 'attack'
@@ -211,3 +219,47 @@ export interface StaticData {
triggers: Array<null | Effect>;
}>;
}
+
+// #region engine node args
+
+export interface EngineNodeArgsBase {
+ /**
+ * If set, node was added to engine as result of given effect.
+ * Used for prompts
+ */
+ src?: EffectSource;
+}
+
+export interface ChooseCardArgs extends EngineNodeArgsBase {
+}
+
+export interface PlayerTurnArgs extends EngineNodeArgsBase {
+ /**
+ * When set to true, player can use current card
+ * for action points (using for ap sets it to false)
+ */
+ use_ap?: boolean;
+ /**
+ * When set to true, player can use current card for
+ * morale bonus if that is active (using morale bonus sets it to dalse)
+ */
+ use_morale_bonus?: boolean;
+ /**
+ * Set when starting to resolve event effect from card. Will be set to false
+ * after all effects have been resolved. Used to determine if momentum medallion
+ * can be used.
+ */
+ resolving_event?: boolean;
+ /**
+ * Strength of the current card
+ */
+ strength?: number;
+ /**
+ * Set to true if player got momentum medallion,
+ * but was not able to resolve directly as they were still
+ * resolving their current card
+ */
+ use_momentum?: boolean;
+}
+
+// #endregion \ No newline at end of file