summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-07-14 13:06:58 +0200
committerTor Andersson <tor@ccxvii.net>2024-07-14 13:06:58 +0200
commit0779bd97f74d1b058af46eb3a28296553978dcc4 (patch)
tree89ddba031d1e8c4b8fe566ba5445d7135bef6341
parent2196df5055d33e2780d7ea35605b7b3927bc7fcd (diff)
downloadplantagenet-0779bd97f74d1b058af46eb3a28296553978dcc4.tar.gz
fix death check events to only allow saving friendly lords
-rw-r--r--rules.js14
-rw-r--r--rules.ts14
2 files changed, 18 insertions, 10 deletions
diff --git a/rules.js b/rules.js
index 9b738e6..901bfea 100644
--- a/rules.js
+++ b/rules.js
@@ -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)
diff --git a/rules.ts b/rules.ts
index ed8ad65..8d67771 100644
--- a/rules.ts
+++ b/rules.ts
@@ -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)