From 2d6ca25d35f83bccaa9c06cdc21d6929a6ffa4b9 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 1 Aug 2022 20:50:11 +0200 Subject: Misc. --- rules.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'rules.js') diff --git a/rules.js b/rules.js index 026a9fb..3ebac16 100644 --- a/rules.js +++ b/rules.js @@ -5,15 +5,14 @@ // TODO: legal pass withdrawal moves (reduce supply net, withdraw from fortress attack) // TODO: fortress combat in pass turns (must withdraw) -// TODO: highlight selected/active/assault battles - // TODO: group move from queue holding box to base // TODO: 1942 malta group (reinforce, reduce supply card draw) -// TODO: multi-select deployment // TODO: log summaries (deploy, rebuild, move, etc) // TODO: put initial deployment stack somewhere more accessible (spread out along the top?) +// UI: pause after all fires (in case 0 hits the dialog disappears fast) + // RULES: may units redeploying out of battle hex cross enemy controlled hexsides? (yes / doesn't matter) // RULES: can fortress supplied units be part of supply lines for non-fortress supplied units for withdrawals to base? @@ -1840,6 +1839,8 @@ function apply_turn_option(option) { game.turn_option = option + log_br() + let n = game.commit[0] + game.commit[1] if (n === 0) log(`Played zero supply cards.`) @@ -1961,7 +1962,6 @@ function union_axis_line() { function union_allied_line() { let net = allied_supply_network() let line = allied_supply_line().slice() - console.log("Xa") if (net[BARDIA] === 0 && is_fortress_allied_controlled(BARDIA)) union_fortress_line(line, bardia_supply_line()) if (net[BENGHAZI] === 0 && is_fortress_allied_controlled(BENGHAZI)) @@ -2379,6 +2379,7 @@ states.regroup_move_command_point = { for (let x of all_hexes) { if (!is_enemy_hex(x)) { let n = count_hex_or_adjacent_has_undisrupted_and_unmoved_friendly_unit(x) + // TODO: allow one-hex regroup moves? (failed forced march abuse) if (n >= 2) gen_action_hex(x) } @@ -3549,9 +3550,9 @@ function end_rout() { function is_mandatory_combat(fortress) { if (is_battle_hex(fortress)) { if (game.phasing === AXIS) - return is_fortress_allied_controlled() + return is_fortress_allied_controlled(fortress) else - return is_fortress_axis_controlled() + return is_fortress_axis_controlled(fortress) } return false } @@ -3590,7 +3591,7 @@ states.select_active_battles = { inactive: "combat phase (select active battles)", prompt() { view.prompt = `Select active battles.` - view.active_battles = game.active_battles + view.selected_hexes = game.active_battles for (let x of all_hexes) if (!set_has(game.active_battles, x) && is_battle_hex(x)) gen_action_hex(x) @@ -3617,8 +3618,7 @@ states.select_assault_battles = { inactive: "combat phase (select assault battles)", prompt() { view.prompt = `Select assault battles.` - view.active_battles = game.active_battles - view.assault_battles = game.assault_battles + view.selected_hexes = game.assault_battles for (let x of game.active_battles) if (!set_has(game.assault_battles, x)) gen_action_hex(x) @@ -3886,7 +3886,7 @@ function gen_battle_target() { // only artillery may target artillery if other units are alive if (hp[ARTILLERY] > 0) { if (fc === ARTILLERY || - (hp[ARTILLERY] <= 0 && hp[INFANTRY] <= 0 && hp[ANTITANK] <= 0)) + (hp[ARMOR] <= 0 && hp[INFANTRY] <= 0 && hp[ANTITANK] <= 0)) gen_action('artillery') } } @@ -3976,7 +3976,7 @@ states.battle_hits = { function end_battle_hits() { if (is_friendly_rout_hex(game.battle)) { goto_rout(game.battle, false, end_battle) - } else if (game.active === game.phasing) { + } else if (game.active === game.phasing && has_friendly_units_in_battle()) { // goto offensive fire game.state = 'battle_fire' game.hits = [ 0, 0, 0, 0 ] -- cgit v1.2.3