diff options
author | Tor Andersson <tor@ccxvii.net> | 2024-07-14 13:06:58 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-07-14 13:06:58 +0200 |
commit | 0779bd97f74d1b058af46eb3a28296553978dcc4 (patch) | |
tree | 89ddba031d1e8c4b8fe566ba5445d7135bef6341 | |
parent | 2196df5055d33e2780d7ea35605b7b3927bc7fcd (diff) | |
download | plantagenet-0779bd97f74d1b058af46eb3a28296553978dcc4.tar.gz |
fix death check events to only allow saving friendly lords
-rw-r--r-- | rules.js | 14 | ||||
-rw-r--r-- | rules.ts | 14 |
2 files changed, 18 insertions, 10 deletions
@@ -7437,7 +7437,8 @@ states.escape_ship = { prompt() { view.prompt = "Escape Ship: Choose lords to go to exile."; for (let lord of game.battle.routed) - gen_action_lord(lord); + if (is_friendly_lord(lord)) + gen_action_lord(lord); view.actions.done = 1; }, lord(lord) { @@ -7465,7 +7466,8 @@ states.talbot_to_the_rescue = { prompt() { view.prompt = "Talbot to the Rescue: Disband routed Lancastrians instead of rolling for death."; for (let lord of game.battle.routed) - gen_action_lord(lord); + if (is_friendly_lord(lord)) + gen_action_lord(lord); view.actions.done = 1; }, lord(lord) { @@ -7507,9 +7509,11 @@ states.warden_of_the_marches = { view.prompt = `Warden of the Marches: Move routed Lancastrians to ${locale_name[game.where]}.`; let done = true; for (let lord of game.battle.routed) { - if (is_move_allowed(lord, game.where)) { - gen_action_lord(lord); - done = false; + if (is_friendly_lord(lord)) { + if (is_move_allowed(lord, game.where)) { + gen_action_lord(lord); + done = false; + } } } if (done) @@ -8719,7 +8719,8 @@ states.escape_ship = { prompt() { view.prompt = "Escape Ship: Choose lords to go to exile." for (let lord of game.battle.routed) - gen_action_lord(lord) + if (is_friendly_lord(lord)) + gen_action_lord(lord) view.actions.done = 1 }, lord(lord) { @@ -8753,7 +8754,8 @@ states.talbot_to_the_rescue = { prompt() { view.prompt = "Talbot to the Rescue: Disband routed Lancastrians instead of rolling for death." for (let lord of game.battle.routed) - gen_action_lord(lord) + if (is_friendly_lord(lord)) + gen_action_lord(lord) view.actions.done = 1 }, lord(lord) { @@ -8798,9 +8800,11 @@ states.warden_of_the_marches = { view.prompt = `Warden of the Marches: Move routed Lancastrians to ${locale_name[game.where]}.` let done = true for (let lord of game.battle.routed) { - if (is_move_allowed(lord, game.where)) { - gen_action_lord(lord) - done = false + if (is_friendly_lord(lord)) { + if (is_move_allowed(lord, game.where)) { + gen_action_lord(lord) + done = false + } } } if (done) |