diff options
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 56 |
1 files changed, 52 insertions, 4 deletions
@@ -2758,6 +2758,20 @@ function vm_decrease_prussian_collaboration() { vm_next() } +function vm_may_decrease_revolutionary_momentum() { + if (game.red_momentum > 0) + game.state = "vm_may_decrease_revolutionary_momentum" + else + vm_next() +} + +function vm_may_decrease_prussian_collaboration() { + if (game.blue_momentum > 0) + game.state = "vm_may_decrease_prussian_collaboration" + else + vm_next() +} + function vm_operand_spaces(x) { let s = vm_operand(x) if (typeof s === "number") @@ -2995,6 +3009,40 @@ states.vm_decrease_prussian_collaboration = { }, } +states.vm_may_decrease_revolutionary_momentum = { + inactive: "decrease Revolutionary Momentum", + prompt() { + event_prompt("Decrease Revolutionary Momentum.") + view.actions.red_momentum = 1 + view.actions.pass = 1 + }, + red_momentum() { + push_undo() + decrease_revolutionary_momentum() + }, + pass() { + push_undo() + vm_next() + }, +} + +states.vm_may_decrease_prussian_collaboration = { + inactive: "decrease Prussian Collaboration", + prompt() { + event_prompt("Decrease Prussian Collaboration.") + view.actions.blue_momentum = 1 + view.actions.pass = 1 + }, + blue_momentum() { + push_undo() + decrease_prussian_collaboration() + }, + pass() { + push_undo() + vm_next() + }, +} + function can_vm_place() { for (let s of game.vm.spaces) if (can_place_cube(s, game.vm.removed)) @@ -4292,9 +4340,9 @@ CODE[39] = [ // Léon Gambetta [ vm_prompt, "Replace up to 1 in Institutional." ], [ vm_replace_up_to, 1, INSTITUTIONAL ], [ vm_if, ()=>(game.active === COMMUNE) ], - [ vm_decrease_prussian_collaboration ], + [ vm_may_decrease_prussian_collaboration ], [ vm_else ], - [ vm_decrease_revolutionary_momentum ], + [ vm_may_decrease_revolutionary_momentum ], [ vm_endif ], [ vm_return ], ] @@ -4458,9 +4506,9 @@ CODE[52] = [ // Rise of Republicanism CODE[53] = [ // Legitimacy [ vm_ops, 3, POLITICAL ], [ vm_if, ()=>(game.active === COMMUNE) ], - [ vm_increase_revolutionary_momentum ], + [ vm_may_increase_revolutionary_momentum ], [ vm_else ], - [ vm_increase_prussian_collaboration ], + [ vm_may_increase_prussian_collaboration ], [ vm_endif ], [ vm_return ], ] |