diff options
author | iainp5 <iain.pearce.ip@gmail.com> | 2025-02-09 17:32:39 +0000 |
---|---|---|
committer | iainp5 <iain.pearce.ip@gmail.com> | 2025-02-09 17:32:39 +0000 |
commit | c8e3262bb0219ed43f0d647b9f92deaf0122303e (patch) | |
tree | 37bddeb9da42e31c3b759df6d760cac07ba73175 /rules.js | |
parent | 54ddff6bd490408c7fb692d4aadbcd3715a2489b (diff) | |
download | 1989-dawn-of-freedom-c8e3262bb0219ed43f0d647b9f92deaf0122303e.tar.gz |
Fix Crowd offering unusable options
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 35 |
1 files changed, 35 insertions, 0 deletions
@@ -1277,6 +1277,12 @@ states.vm_the_crowd_turns_against_ceausescu = { view.prompt = `You have ${game.vm_available_ops} Operations points. Play for:` gen_action('influence') gen_action('support_check') + if (crowd_infl_check()) + view.actions.influence = 0 + if (crowd_sc_check()) + view.actions.support_check = 0 + if (crowd_infl_check() && crowd_sc_check()) + gen_action('pass') }, influence() { push_undo() @@ -1293,6 +1299,15 @@ states.vm_the_crowd_turns_against_ceausescu = { game.available_ops = 2 log('Support Checks:') game.state = 'support_check_prep' + }, + pass() { + if (game.return !== game.active) { + change_player() + } + log('Passed.') + log_h5('Raise the Stakes') + log(`${game.active}:`) + game.state = 'raise_stakes_1' } } @@ -2753,6 +2768,26 @@ function check_com_control(space_id) { } } +function crowd_infl_check() { + for (let s of S_ROMANIA) { + if (game.demInfl[s] > 0) + return false + } + if (game.demInfl[S_SZEGED] > 0) + return false + if (game.demInfl[S_VARNA] > 0) + return false + return true +} + +function crowd_sc_check() { + for (let s of S_ROMANIA) { + if (game.comInfl[s] > 0) + return false + } + return true +} + function do_tst_attempt() { let roll = roll_d6() logi(`D${roll}`) |