summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2025-03-28 17:44:47 +0100
committerTor Andersson <tor@ccxvii.net>2025-03-28 17:44:47 +0100
commit93e9fab572ce3a90ad18ac83504ec3d05f3b60c2 (patch)
treeac19775c70c64ca9495e3583f4524d58448759c9
parent06a568626ee3294d02779294a87a6249df19a8b9 (diff)
downloadland-and-freedom-93e9fab572ce3a90ad18ac83504ec3d05f3b60c2.tar.gz
Log when skipping toggling bonuses and moving tracks.
-rw-r--r--rules.js12
-rw-r--r--rules.ts12
2 files changed, 20 insertions, 4 deletions
diff --git a/rules.js b/rules.js
index 3fc16d0..645d7b7 100644
--- a/rules.js
+++ b/rules.js
@@ -956,7 +956,10 @@ states.change_bonus = {
game.bonuses[data_1.TEAMWORK_BONUS] === data_1.ON &&
game.bonuses[data_1.MORALE_BONUS] === data_1.ON) ||
(args.v === data_1.OFF && game.bonuses[args.t] === data_1.OFF)) {
- view.prompt = `${bonus_names[args.t]} is already ${args.v === data_1.OFF ? 'off' : 'on'}.`;
+ if (args.t === 'any')
+ view.prompt = `Both bonuses are already ${args.v === data_1.OFF ? 'off' : 'on'}.`;
+ else
+ view.prompt = `${bonus_names[args.t]} is already ${args.v === data_1.OFF ? 'off' : 'on'}.`;
gen_action('skip');
}
else if (args.t === data_1.ANY && args.v === data_1.ON) {
@@ -982,7 +985,7 @@ states.change_bonus = {
},
skip() {
const args = get_active_node_args();
- logi(`${bonus_names[args.t]} ${args.v === data_1.OFF ? 'off' : 'on'}`);
+ logi(`Bonus already ${args.v === data_1.OFF ? 'off' : 'on'}`);
resolve_active_and_proceed();
},
};
@@ -1483,6 +1486,11 @@ states.move_track = {
resolve_active_and_proceed();
},
skip() {
+ const node = get_active_node();
+ if (node.a.v >= 0)
+ logi(`${get_track_name(node.a.t)} cannot move +${node.a.v}`);
+ else
+ logi(`${get_track_name(node.a.t)} cannot move ${node.a.v}`);
resolve_active_and_proceed();
},
};
diff --git a/rules.ts b/rules.ts
index 73a2168..06c903e 100644
--- a/rules.ts
+++ b/rules.ts
@@ -1224,7 +1224,10 @@ states.change_bonus = {
game.bonuses[MORALE_BONUS] === ON) ||
(args.v === OFF && game.bonuses[args.t] === OFF)
) {
- view.prompt = `${bonus_names[args.t]} is already ${args.v === OFF ? 'off' : 'on'}.`;
+ if (args.t === 'any')
+ view.prompt = `Both bonuses are already ${args.v === OFF ? 'off' : 'on'}.`;
+ else
+ view.prompt = `${bonus_names[args.t]} is already ${args.v === OFF ? 'off' : 'on'}.`;
gen_action('skip');
}
else if (args.t === ANY && args.v === ON) {
@@ -1249,7 +1252,7 @@ states.change_bonus = {
},
skip() {
const args = get_active_node_args();
- logi(`${bonus_names[args.t]} ${args.v === OFF ? 'off' : 'on'}`);
+ logi(`Bonus already ${args.v === OFF ? 'off' : 'on'}`);
resolve_active_and_proceed();
},
};
@@ -1798,6 +1801,11 @@ states.move_track = {
resolve_active_and_proceed();
},
skip() {
+ const node = get_active_node();
+ if (node.a.v >= 0)
+ logi(`${get_track_name(node.a.t)} cannot move +${node.a.v}`);
+ else
+ logi(`${get_track_name(node.a.t)} cannot move ${node.a.v}`);
resolve_active_and_proceed();
},
};