diff options
-rw-r--r-- | rules.js | 64 |
1 files changed, 60 insertions, 4 deletions
@@ -3530,6 +3530,7 @@ function goto_winter_stage() { } function end_winter_stage() { + clear_checkpoint() if (++game.stage === 6) goto_end_turn() else @@ -3540,7 +3541,7 @@ function goto_recruit() { game.count = 0 if (!can_recruit_anything()) { - end_recruit() + end_recruit(false) return } @@ -3552,6 +3553,9 @@ function goto_recruit() { } game.state = "recruit" + + if (!game.special_saxony_recruit) + save_checkpoint() } function all_re_entry_cities_for_general(p) { @@ -3672,7 +3676,7 @@ states.recruit = { }, end_recruit() { push_undo() - end_recruit() + end_recruit(true) }, } @@ -3758,7 +3762,7 @@ states.re_enter_general_from_political_card = { }, } -function end_recruit() { +function end_recruit(validate) { if (game.recruit) { if (game.recruit.used.length > 0) { log_br() @@ -3784,7 +3788,10 @@ function end_recruit() { return } - end_winter_stage() + if (validate) + goto_validate_winter() + else + end_winter_stage() } /* COMBAT (CHOOSE TARGETS) */ @@ -7222,6 +7229,55 @@ states.validate_retreat_fail = { }, } +/* VALIDATE: WINTER */ + +function goto_validate_winter() { + game.proposal = 0 + for (let other of all_powers) + if (should_validate_promise(game.power, other, V_WINTER)) + game.proposal |= (1 << other) + resume_validate_winter() +} + +function resume_validate_winter() { + resume_validate_promise("validate_winter", end_winter_stage) +} + +states.validate_winter = { + dont_snap: true, + inactive: "confirm that promises were kept", + prompt() { + let other = current_sequence_of_play().power + prompt("Did " + power_name[other] + " keep their winter recruitment promise?") + view.actions.keep = 1 + view.actions.break = 1 + view.actions.undo = 0 + }, + keep() { + resume_validate_winter() + }, + break() { + let other = game.power + restore_checkpoint() + game.proposal = other + game.state = "validate_winter_fail" + }, +} + +states.validate_winter_fail = { + dont_snap: true, + inactive: "recruit", + prompt() { + prompt("Promise to " + power_name[game.proposal] + " was not kept.") + view.actions.resume = 1 + view.actions.undo = 0 + }, + resume() { + game.state = "recruit" + delete game.proposal + }, +} + /* SETUP */ const POWER_FROM_SETUP_STAGE = [ |