diff options
author | Tor Andersson <tor@ccxvii.net> | 2024-08-02 15:01:52 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-08-02 15:01:52 +0200 |
commit | fbe353694a1bf36a16555982cc380c24cfeec8d5 (patch) | |
tree | 415668290197d70bfe4ae92268a7ab6a5fb96b9a | |
parent | 2b9e11c62498dff3bfff318d67d5e16e99b64969 (diff) | |
download | plantagenet-fbe353694a1bf36a16555982cc380c24cfeec8d5.tar.gz |
fix "England is my Home"
no IP penalty when using it instead of going into exile
-rw-r--r-- | rules.js | 11 | ||||
-rw-r--r-- | rules.ts | 12 |
2 files changed, 12 insertions, 11 deletions
@@ -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); }, @@ -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) |