summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2021-05-01 23:44:47 +0200
committerTor Andersson <tor@ccxvii.net>2022-11-17 12:53:17 +0100
commit3968626c16517f16c98974de4b274a80c11342c1 (patch)
tree32604da1fba8d4f64453140c460e9b5a334c3617 /rules.js
parent6862f1347df3a9a7df6628724ae749ebac5f132b (diff)
downloadhammer-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.js21
1 files changed, 16 insertions, 5 deletions
diff --git a/rules.js b/rules.js
index eb7447d..4809c82 100644
--- a/rules.js
+++ b/rules.js
@@ -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;