diff options
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 59 |
1 files changed, 55 insertions, 4 deletions
@@ -6103,10 +6103,12 @@ function goto_france_reduces_military_objectives() { !(game.flags & F_FRANCE_REDUCED) && count_french_victory_markers_in_core_austria() > 0 && france_has_no_generals_in_core_austria() - ) + ) { game.state = "france_reduces_military_objectives" - else + save_checkpoint() + } else { next_sequence_of_play() + } } function count_french_victory_markers_in_core_austria() { @@ -6155,7 +6157,7 @@ states.france_reduces_military_objectives = { game.state = "france_reduces_military_objectives_done" }, pass() { - next_sequence_of_play() + goto_validate_military() }, } @@ -6166,7 +6168,7 @@ states.france_reduces_military_objectives_done = { view.actions.next = 1 }, next() { - next_sequence_of_play() + goto_validate_military() }, } @@ -7282,6 +7284,55 @@ states.validate_winter_fail = { }, } +/* VALIDATE: REDUCE MILITARY OBJECTIVES */ + +function goto_validate_military() { + game.proposal = 0 + for (let other of all_powers) + if (should_validate_promise(game.power, other, V_MILITARY)) + game.proposal |= (1 << other) + resume_validate_military() +} + +function resume_validate_military() { + resume_validate_promise("validate_military", next_sequence_of_play) +} + +states.validate_military = { + dont_snap: true, + inactive: "confirm that promises were kept", + prompt() { + let other = current_sequence_of_play().power + prompt("Did " + power_name[other] + " keep their military objective promise?") + view.actions.keep = 1 + view.actions.break = 1 + view.actions.undo = 0 + }, + keep() { + next_sequence_of_play() + }, + break() { + let other = game.power + restore_checkpoint() + game.proposal = other + game.state = "validate_military_fail" + }, +} + +states.validate_military_fail = { + dont_snap: true, + inactive: "reduce military objectives", + prompt() { + prompt("Promise to " + power_name[game.proposal] + " was not kept.") + view.actions.resume = 1 + view.actions.undo = 0 + }, + resume() { + game.state = "france_reduces_military_objectives" + delete game.proposal + }, +} + /* VALIDATE: IMPERIAL ELECTION */ function goto_validate_election() { |