diff options
-rw-r--r-- | play.css | 1 | ||||
-rw-r--r-- | play.js | 14 | ||||
-rw-r--r-- | rules.js | 5 |
3 files changed, 14 insertions, 6 deletions
@@ -245,7 +245,6 @@ body svg .sea.action { display: block; border: 5px solid white; box-shadow: 0 0 6px white, inset 0 0 6px black; - z-index: 2; } body.p3 #npg_hispania { display: block } @@ -972,6 +972,11 @@ function layout_stack(id, list, region, in_capital, dx, dy, z = 1) { stack_count[region] += 1 } + if (in_capital === 2) { + x += 36 + y += 18 + } + for (let i = list.length - 1; i >= 0; --i) { let item = list[i] item.style.left = x + "px" @@ -1283,10 +1288,13 @@ function on_update() { else layout_battle_stack(view.combat.attacker < 0, [ ui.militia[region] ], region, true) } else { + let inside = 1 + if (is_action("capital", region)) + inside = 2 if (has_militia_castra(region)) - layout_stack(-1, [ ui.mcastra[region], ui.militia[region] ], region, true, 16, 16) + layout_stack(-1, [ ui.mcastra[region], ui.militia[region] ], region, inside, 16, 16) else - layout_stack(-1, [ ui.militia[region] ], region, true, 16, 16) + layout_stack(-1, [ ui.militia[region] ], region, inside, 16, 16) } } } @@ -1357,7 +1365,7 @@ function on_update() { if (is_battle_stack(region, "general", pi * 6 + ai)) layout_battle_stack(pi * 6 + ai === view.combat.attacker, stack, region) else - layout_stack(pi * 6 + ai, stack, region, inside, 16, 16) + layout_stack(pi * 6 + ai, stack, region, inside ? 1 : 0, 16, 16) } else { avail_stack.push(e) } @@ -1773,7 +1773,7 @@ states.take_actions = { // Select Militia (if can Disperse Mobs or Initiate Battle) let loc = get_governor_location(id) if (is_province(loc) && has_lone_militia(loc) && loc !== game.selected_militia) { - if (game.mip >= 1 && (get_mobs(loc)) || can_militia_initiate_battle(loc)) + if (game.mip >= 1 && (get_mobs(loc) || can_militia_initiate_battle(loc))) gen_action_militia(loc) } } @@ -1908,7 +1908,8 @@ states.take_actions = { // Militia Actions if (game.selected_militia >= 0) { view.actions.disperse_mob = 0 - if (game.mip >= 1) + + if (game.mip >= 1 && get_mobs(where)) view.actions.disperse_mob = 1 // Initiate Battle with Militia not stacked with General |