diff options
author | Frans Bongers <fransbongers@franss-mbp.home> | 2025-01-24 21:07:07 +0100 |
---|---|---|
committer | Frans Bongers <fransbongers@franss-mbp.home> | 2025-01-24 21:07:07 +0100 |
commit | fe446f34e98f87dfc8e7bdce27b082b50a81a9ff (patch) | |
tree | 8db913d3c2f65cbfe2e9643d300086095cad66b1 /types.d.ts | |
parent | b1a3b055df4472ff191f067f707c7722fb04d946 (diff) | |
download | land-and-freedom-fe446f34e98f87dfc8e7bdce27b082b50a81a9ff.tar.gz |
bugfixes and improvements
Diffstat (limited to 'types.d.ts')
-rw-r--r-- | types.d.ts | 62 |
1 files changed, 57 insertions, 5 deletions
@@ -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 |