diff options
Diffstat (limited to 'rules.ts')
-rw-r--r-- | rules.ts | 25 |
1 files changed, 4 insertions, 21 deletions
@@ -328,7 +328,6 @@ const engine_functions: Record<string, Function> = { end_of_player_turn, end_of_turn, end_of_year_cleanup, - end_resolving_event_effects, setup_bag_of_glory, setup_choose_card, setup_final_bid, @@ -1231,11 +1230,11 @@ states.play_card = { card(c: CardId) { const faction = get_active_faction(); game.selected_cards[faction].push(c); - + game.card_played = 0; // NOTE: I don't think we are using game.played_card in the UI at the moment? - game.played_card = game.selected_cards[faction][0]; - + game.played_card = game.selected_cards[faction][game.selected_cards[faction].length - 1]; + log_header("C" + game.played_card, faction); resolve_active_and_proceed(); }, }; @@ -1911,13 +1910,9 @@ states.player_turn = { const faction = get_active_faction(); log('Played for Event:'); const { effects } = play_card_for_event(faction); - update_active_node_args<PlayerTurnArgs>({ - resolving_event: true, - }); const node = create_effects_node(effects, 'player_event'); node.c.push(create_function_node('trash_card', faction)); - node.c.push(create_function_node('end_resolving_event_effects')); insert_before_active_node(node); next(); @@ -2728,18 +2723,6 @@ function end_of_year_cleanup() { next(); } -function end_resolving_event_effects() { - // Get player turn node - const node: StateNode<PlayerTurnArgs> = get_nodes_for_state('player_turn')[0]; - - // Update args - node.a = { - ...(node.a || {}), - resolving_event: false, - }; - resolve_active_and_proceed(); -} - function gain_hero_points_in_player_order(factions: FactionId[], value) { for (const f of get_player_order()) { if (factions.includes(f)) { @@ -3438,7 +3421,7 @@ function log(msg: string) { game.log.push(msg); } -function log_header(msg: string, prefix: string) { +function log_header(msg: string, prefix: string | number) { log_br(); log(`#${prefix} ${msg}`); log_br(); |