diff options
author | iainp5 <iain.pearce.ip@gmail.com> | 2024-11-27 18:34:35 +0000 |
---|---|---|
committer | iainp5 <iain.pearce.ip@gmail.com> | 2024-11-27 18:34:35 +0000 |
commit | 2c500cc15f81a577b470643c5b92c4522b7d185b (patch) | |
tree | 6b9a1d5bf0e6f4598d06ea8218e26d0e82bb59c6 | |
parent | 577c7fa0e30f7dfca85b4de670274725e1ddce7d (diff) | |
download | 1989-dawn-of-freedom-2c500cc15f81a577b470643c5b92c4522b7d185b.tar.gz |
Fix Ligachev when Gorbachev played not for event
-rw-r--r-- | rules.js | 37 |
1 files changed, 36 insertions, 1 deletions
@@ -640,6 +640,7 @@ states.play_card ={ }, event() { push_undo() + check_ligachev_event() log_gap(`Played C${game.played_card} for the event`) game.vm_infl_to_do = false game.return = game.active @@ -663,6 +664,7 @@ states.play_card ={ }, influence() { push_undo() + check_ligachev_non_event() log_gap(`Played C${game.played_card} to place SPs`) finish_play_card() @@ -675,12 +677,14 @@ states.play_card ={ }, tst() { push_undo() + check_ligachev_non_event() log_gap(`Played C${game.played_card} to the Tiananmen Square Track`) finish_play_card() game.state='tiananmen_square_attempt' }, support_check() { push_undo() + check_ligachev_non_event() log_gap(`Played C${game.played_card} for support checks`) finish_play_card() game.available_ops = 2 @@ -689,6 +693,7 @@ states.play_card ={ }, tst_7() { /*Cancel opponent event */ push_undo() + check_ligachev_non_event() log(`Played C${game.played_card}. Event cancelled using TST Award`) game.tst_7 = true game.vm_infl_to_do = true @@ -730,6 +735,7 @@ states.resolve_opponent_event = { }, influence(){ push_undo() + check_ligachev_non_event() log_gap(`Played C${game.played_card} to place SPs`) // If ABHR - Set AHBR tracker to true if (game.persistent_events.includes(58)) { @@ -740,6 +746,7 @@ states.resolve_opponent_event = { }, support_check() { push_undo() + check_ligachev_non_event() log_gap(`Played C${game.played_card} for support checks`) game.available_ops = 2 game.state = 'support_check_prep' @@ -2974,8 +2981,9 @@ function select_card(card){ game.democrat_hand.splice(find_card, 1) } game.available_ops = get_card_ops(card) +} - //Check Ligachev +function check_ligachev_non_event() { if (game.active === DEM && game.persistent_events.includes(99) && card !== C_GORBACHEV_CHARMS_THE_WEST) { log(`-3 VP from C${C_LIGACHEV}`) game.vp -= 3 @@ -2988,6 +2996,32 @@ function select_card(card){ game.state = 'play_card' } +function check_ligachev_non_event() { + if (game.active === DEM && game.persistent_events.includes(C_LIGACHEV)) { + log(`-3 VP from C${C_LIGACHEV}`) + game.vp -= 3 + if (check_vp()) { + return + } + game.persistent_events = game.persistent_events.filter(n => n !== C_LIGACHEV) + game.strategy_removed.push(C_LIGACHEV) + } + game.state = 'play_card' +} + +function check_ligachev_event() { + if (game.active === DEM && game.persistent_events.includes(C_LIGACHEV) && card !== C_GORBACHEV_CHARMS_THE_WEST) { + log(`-3 VP from C${C_LIGACHEV}`) + game.vp -= 3 + if (check_vp()) { + return + } + game.persistent_events = game.persistent_events.filter(n => n !== C_LIGACHEV) + game.strategy_removed.push(C_LIGACHEV) + } + game.state = 'play_card' +} + function is_auto_resolve(card) { let ceausecu_events = [10, 41, 69, 101, 107] if (auto_resolve_events.includes(card)) { @@ -7833,6 +7867,7 @@ states.vm_tst_8 = { }, event() { push_undo() + check_ligachev_event() log(`C${game.played_card}:`) game.vm_event_to_do = false game.return_state = 'vm_tst_8' |