From 3b5d93cf0152bcc103f7260519d540cf0997867d Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sat, 8 Jul 2023 11:43:01 +0200 Subject: Create Army in Province or Capital. --- rules.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/rules.js b/rules.js index addb45e..b17bbd8 100644 --- a/rules.js +++ b/rules.js @@ -2170,7 +2170,7 @@ states.take_actions = { } if (game.selected_general >= 0) { if (get_general_location(game.selected_general) === AVAILABLE) - create_army(where) + create_army(where, false) else move_army_to(game.selected_general, where) } @@ -2178,7 +2178,9 @@ states.take_actions = { capital(where) { push_undo() - if (get_general_location(game.selected_general) !== where) + if (get_general_location(game.selected_general) === AVAILABLE) + create_army(where, true) + else if (get_general_location(game.selected_general) !== where) move_army_to(game.selected_general, where) enter_capital() resume_take_actions() @@ -2741,16 +2743,19 @@ states.becoming_populace_emperor = { function gen_create_army() { for (let i = 0; i < 6; ++i) { let where = get_governor_location(game.current * 6 + i) - if (is_province(where)) + if (is_province(where)) { gen_action_region(where) + if (can_enter_capital(where)) + gen_action_capital(where) + } } } -function create_army(where) { +function create_army(where, capital) { spend_military(1) log("Create Army in %" + where + ".") set_general_location(game.selected_general, where) - if (can_enter_capital(where)) + if (can_enter_capital(where) && capital) set_general_inside_capital(game.selected_general) set_legion_location(find_unused_legion(), ARMY + game.selected_general) } @@ -4431,7 +4436,6 @@ function goto_post_combat() { else if (game.combat.type === "general" && game.emperor === ARMY + game.combat.target) roll_military_emperor_check(game.combat.dtaken) - goto_free_increase_support_level() } @@ -4818,7 +4822,6 @@ function goto_buy_trash() { if (used_card_event(CARD_S2X)) game.pp += Math.min(2, game.sip) - game.mip = game.sip = game.pip = 0 for (let i = 0; i < 3; ++i) if (game.killed & (1 << i)) -- cgit v1.2.3