diff options
author | Tor Andersson <tor@ccxvii.net> | 2021-05-01 23:44:47 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2022-11-17 12:53:17 +0100 |
commit | 3968626c16517f16c98974de4b274a80c11342c1 (patch) | |
tree | 32604da1fba8d4f64453140c460e9b5a334c3617 /rules.js | |
parent | 6862f1347df3a9a7df6628724ae749ebac5f132b (diff) | |
download | hammer-of-the-scots-3968626c16517f16c98974de4b274a80c11342c1.tar.gz |
hammer: Show how many steps Wallace recovers. Don't ask if he's home.
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 21 |
1 files changed, 16 insertions, 5 deletions
@@ -2439,9 +2439,22 @@ states.english_disbanding = { undo: pop_undo } +function heal_wallace() { + let old = game.steps[WALLACE]; + game.steps[WALLACE] = Math.min(block_max_steps(WALLACE), game.steps[WALLACE] + 2); + let n = game.steps[WALLACE] - old; + if (n == 1) + log("Wallace gains 1 step."); + else if (n == 2) + log("Wallace gains 2 steps."); +} + function goto_wallace() { game.active = SCOTLAND; - if (is_on_map(WALLACE) && is_friendly_or_neutral_area("Selkirk")) { + if (game.location[WALLACE] == "Selkirk") { + heal_wallace(); + goto_scottish_disbanding(); + } else if (is_on_map(WALLACE) && is_friendly_or_neutral_area("Selkirk")) { game.state = 'wallace'; game.who = WALLACE; } else { @@ -2459,10 +2472,8 @@ states.wallace = { }, area: function (to) { if (to == "Selkirk") { - if (to != game.location[WALLACE]) - log("Wallace goes home to " + to + "."); - game.steps[WALLACE] = Math.min(block_max_steps(WALLACE), game.steps[WALLACE] + 2); - log("Wallace gains 2 steps."); + log("Wallace goes home to " + to + "."); + heal_wallace(); } game.location[WALLACE] = to; game.who = null; |