summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-08-02 15:01:52 +0200
committerTor Andersson <tor@ccxvii.net>2024-08-02 15:01:52 +0200
commitfbe353694a1bf36a16555982cc380c24cfeec8d5 (patch)
tree415668290197d70bfe4ae92268a7ab6a5fb96b9a
parent2b9e11c62498dff3bfff318d67d5e16e99b64969 (diff)
downloadplantagenet-fbe353694a1bf36a16555982cc380c24cfeec8d5.tar.gz
fix "England is my Home"
no IP penalty when using it instead of going into exile
-rw-r--r--rules.js11
-rw-r--r--rules.ts12
2 files changed, 12 insertions, 11 deletions
diff --git a/rules.js b/rules.js
index 2e052ec..39b2cf4 100644
--- a/rules.js
+++ b/rules.js
@@ -2314,7 +2314,7 @@ function disband_lord(lord) {
log(`Disband L${lord} to T${get_lord_calendar(lord)}.`);
clear_lord(lord);
}
-function exile_lord(lord) {
+function exile_lord(lord, penalty) {
if (lord_has_capability(lord, AOW_YORK_ENGLAND_IS_MY_HOME) && !is_event_in_play(EVENT_LANCASTER_BLOCKED_FORD)) {
logcap(AOW_YORK_ENGLAND_IS_MY_HOME);
log(`Disband L${lord} to T${current_turn() + 1}`);
@@ -2322,6 +2322,8 @@ function exile_lord(lord) {
clear_lord(lord);
}
else {
+ if (penalty)
+ reduce_influence(get_lord_influence(lord) + count_vassals_with_lord(lord));
set_lord_calendar(lord, current_turn() + 6 - get_lord_influence(lord));
set_lord_in_exile(lord);
log(`Exile L${lord} to T${get_lord_calendar(lord)}.`);
@@ -4815,8 +4817,7 @@ states.choose_exile = {
lord(lord) {
push_undo();
give_up_spoils(lord);
- reduce_influence(get_lord_influence(lord) + count_vassals_with_lord(lord));
- exile_lord(lord);
+ exile_lord(lord, true);
if (game.scenario === SCENARIO_II) {
if (lord === LORD_WARWICK_L)
foreign_haven_shift_lords();
@@ -7400,7 +7401,7 @@ states.foreign_haven = {
exile() {
log_br();
log("Foreign Haven.");
- exile_lord(LORD_EDWARD_IV);
+ exile_lord(LORD_EDWARD_IV, false);
set_delete(game.battle.routed, LORD_EDWARD_IV);
set_delete(game.battle.fled, LORD_EDWARD_IV);
goto_death_check();
@@ -7455,7 +7456,7 @@ states.escape_ship = {
lord(lord) {
push_undo();
// Note: locale must be friendly for this event, so no spoils.
- exile_lord(lord);
+ exile_lord(lord, false);
set_delete(game.battle.fled, lord);
set_delete(game.battle.routed, lord);
},
diff --git a/rules.ts b/rules.ts
index fdcd472..49d62e7 100644
--- a/rules.ts
+++ b/rules.ts
@@ -2881,13 +2881,15 @@ function disband_lord(lord: Lord) {
clear_lord(lord)
}
-function exile_lord(lord: Lord) {
+function exile_lord(lord: Lord, penalty: boolean) {
if (lord_has_capability(lord, AOW_YORK_ENGLAND_IS_MY_HOME) && !is_event_in_play(EVENT_LANCASTER_BLOCKED_FORD)) {
logcap(AOW_YORK_ENGLAND_IS_MY_HOME)
log(`Disband L${lord} to T${current_turn() + 1}`)
set_lord_calendar(lord, current_turn() + 1)
clear_lord(lord)
} else {
+ if (penalty)
+ reduce_influence(get_lord_influence(lord) + count_vassals_with_lord(lord))
set_lord_calendar(lord, current_turn() + 6 - get_lord_influence(lord))
set_lord_in_exile(lord)
log(`Exile L${lord} to T${get_lord_calendar(lord)}.`)
@@ -5774,9 +5776,7 @@ states.choose_exile = {
push_undo()
give_up_spoils(lord)
- reduce_influence(get_lord_influence(lord) + count_vassals_with_lord(lord))
-
- exile_lord(lord)
+ exile_lord(lord, true)
if (game.scenario === SCENARIO_II) {
if (lord === LORD_WARWICK_L)
@@ -8674,7 +8674,7 @@ states.foreign_haven = {
exile() {
log_br()
log("Foreign Haven.")
- exile_lord(LORD_EDWARD_IV)
+ exile_lord(LORD_EDWARD_IV, false)
set_delete(game.battle.routed, LORD_EDWARD_IV)
set_delete(game.battle.fled, LORD_EDWARD_IV)
goto_death_check()
@@ -8740,7 +8740,7 @@ states.escape_ship = {
push_undo()
// Note: locale must be friendly for this event, so no spoils.
- exile_lord(lord)
+ exile_lord(lord, false)
set_delete(game.battle.fled, lord)
set_delete(game.battle.routed, lord)