diff options
author | Tor Andersson <tor@ccxvii.net> | 2025-03-28 17:44:47 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2025-03-28 17:44:47 +0100 |
commit | 93e9fab572ce3a90ad18ac83504ec3d05f3b60c2 (patch) | |
tree | ac19775c70c64ca9495e3583f4524d58448759c9 | |
parent | 06a568626ee3294d02779294a87a6249df19a8b9 (diff) | |
download | land-and-freedom-93e9fab572ce3a90ad18ac83504ec3d05f3b60c2.tar.gz |
Log when skipping toggling bonuses and moving tracks.
-rw-r--r-- | rules.js | 12 | ||||
-rw-r--r-- | rules.ts | 12 |
2 files changed, 20 insertions, 4 deletions
@@ -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(); }, }; @@ -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(); }, }; |