diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-08-03 01:57:34 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-08-03 01:58:26 +0200 |
commit | 0dd8ed93c2b7486888f63dbd5a5afd31e319dc70 (patch) | |
tree | 25bd338caaa692881847a0f1a3381aacebbc223d | |
parent | 618358a8d1d7bbd2fc26ddf99d311e3e610d39f7 (diff) | |
download | time-of-crisis-0dd8ed93c2b7486888f63dbd5a5afd31e319dc70.tar.gz |
Occupy Pretender Capital at start of turn.
-rw-r--r-- | rules.js | 40 |
1 files changed, 40 insertions, 0 deletions
@@ -1831,12 +1831,23 @@ function goto_take_actions() { game.count = 2 game.state = "frumentarii" resume_frumentarii() + } else { + resume_take_actions() } } +function is_occupied_pretender_capital(where) { + return is_pretender_province(where) && !is_own_province(where) && is_own_general(get_capital_general(where)) +} + function resume_take_actions() { game.state = "take_actions" + // Check if we occupy any pretender provinces + for (let where = 0; where < 12; ++where) + if (is_occupied_pretender_capital(where)) + game.state = "occupy_pretender_capital" + // If used Foederati (or other events) at sea if (game.selected_general && is_sea(get_general_location(game.selected_general))) game.state = "move_army_at_sea" @@ -2944,6 +2955,35 @@ function enter_capital() { resume_take_actions() } +// OCCUPATION OF A PRETENDER PROVINCIAL CAPITAL + +states.occupy_pretender_capital = { + prompt() { + prompt("Occupation of a Pretender Provincial Capital: Remove seat of power and breakaway markers and governor.") + view.color = POPULACE + for (let where = 0; where < 12; ++where) + if (is_occupied_pretender_capital(where)) + gen_action_region(where) + }, + region(where) { + push_undo() + log_h3("Occupied %" + where + ".") + game.where = where + if (is_seat_of_power(where)) { + log("Removed seat of power.") + remove_seat_of_power(where) + remove_governor(where, false) + resume_occupy_seat_of_power() + } else { + game.state = "occupy_breakaway" + log("Removed breakaway.") + remove_breakaway(where) + remove_governor(where, false) + goto_replace_pretender() + } + } +} + function resume_occupy_seat_of_power() { for (let where = 1; where < 12; ++where) { if (is_breakaway(where) && (get_province_governor(where) / 6 | 0) === game.count) { |