diff options
author | Tor Andersson <tor@ccxvii.net> | 2024-04-22 20:26:46 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-04-22 20:26:46 +0200 |
commit | 48ac91c140ccbd63b065c35ad99852afaddae71c (patch) | |
tree | d2e46b33227fe61d2f3b413e5ad48c57aa0bb93b | |
parent | 65fd21b9ba818e837230aa5d5b1f0aea91bb54ff (diff) | |
download | plantagenet-48ac91c140ccbd63b065c35ad99852afaddae71c.tar.gz |
Fix Capture of the King.
-rw-r--r-- | play.css | 5 | ||||
-rw-r--r-- | play.js | 5 | ||||
-rw-r--r-- | rules.ts | 12 |
3 files changed, 14 insertions, 8 deletions
@@ -509,7 +509,10 @@ body.shift .exhausted { .locale.sea { border-radius: 50% } .locale.exile { border-radius: 0 0 50% 50% } -.locale.action { border-color: white; box-shadow: 0 0 4px white; } +.locale.action { + border-color: white; + z-index: 100; +} .locale.selected { border-color: cyan; @@ -757,7 +757,6 @@ function build_map() { e.style.top = y + "px" e.style.width = w + "px" e.style.height = h + "px" - e.style.zIndex = "-10" register_action(e, "locale", ix, "laden_march") register_tooltip(e, get_locale_tip(ix)) document.getElementById("locales").appendChild(e) @@ -1231,7 +1230,7 @@ function update_lord_mat(ix) { function update_lord(ix) { let locale = get_lord_locale(ix) - if (locale < 0) { + if (locale < 0 || locale > CALENDAR_EXILE + 16) { ui.lord_cylinder[ix].classList.add("hide") ui.lord_mat[ix].classList.remove("action") return @@ -1241,7 +1240,7 @@ function update_lord(ix) { ui.lord_cylinder[ix].classList.remove("hide") update_lord_mat(ix) ui.lord_exile[ix].classList.add("hide") - } else { + } else if (locale <= CALENDAR_EXILE + 16) { let t = locale > CALENDAR_EXILE ? locale - CALENDAR_EXILE : locale - CALENDAR calendar_layout_cylinder[t].push(ui.lord_cylinder[ix]) ui.lord_cylinder[ix].classList.remove("hide") @@ -2586,6 +2586,8 @@ function disband_lord(lord: Lord, permanently = false) { for_each_vassal_with_lord(lord, v => { disband_vassal(v) }) + + check_capture_of_the_king() } function exile_lord(lord: Lord) { @@ -7447,8 +7449,10 @@ function gen_each_friendly_routed_vassal() { function goto_death_check() { game.who = NOBODY - if (is_capture_of_the_king_triggered()) + if (is_capture_of_the_king_triggered()) { goto_capture_of_the_king() + return + } log_h4("Death Check") @@ -7657,10 +7661,10 @@ states.capture_of_the_king = { }, lord(lord) { push_undo() - disband_lord(LORD_HENRY_VI, true) log(`L${LORD_HENRY_VI} captured by L${lord}.`) - set_delete(game.battle.routed, lord) - set_delete(game.battle.fled, lord) + set_delete(game.battle.routed, LORD_HENRY_VI) + set_delete(game.battle.fled, LORD_HENRY_VI) + disband_lord(LORD_HENRY_VI, true) set_lord_locale(LORD_HENRY_VI, CAPTURE_OF_THE_KING + lord as Locale) // Note: the other 10 influence were already gained from normal battle victory goto_death_check() |