diff options
-rw-r--r-- | rules.js | 30 |
1 files changed, 26 insertions, 4 deletions
@@ -6143,7 +6143,7 @@ states.spending_bps = { if (game.selected < 0) { if (game.month >= 11 && has_friendly_unit_in_raw_hex(MALTA)) gen_action_hex(MALTA) - if (count_friendly_minefields() >= 2 || bps >= 15) + if (count_friendly_minefields() >= 1 || bps >= 15) gen_action('minefield') if (bps >= 10) gen_action('extra_supply_card') @@ -6284,7 +6284,7 @@ states.minefield = { prompt() { view.prompt = `Buildup: Build a minefield.` let mfs = friendly_minefields() - if (count_friendly_minefields() >= 2) + if (count_friendly_minefields() >= 1) gen_action('dismantle') if (available_bps() >= 15) { let net = friendly_buildup_network() @@ -6295,7 +6295,10 @@ states.minefield = { }, dismantle() { push_undo() - game.state = 'dismantle1' + if (count_friendly_minefields() >= 2) + game.state = 'dismantle1' + else + game.state = 'dismantle0' }, hex(x) { let mfs = friendly_minefields() @@ -6306,6 +6309,25 @@ states.minefield = { } } +states.dismantle0 = { + inactive: "buildup", + prompt() { + view.prompt = `Buildup: Dismantle minefield.` + let net = friendly_buildup_network() + for (let x of friendly_minefields()) + if (net[x] && !is_battle_hex(x)) + gen_action_hex(x) + for (let x of game.minefields[MF_VISIBLE]) + if (net[x] && !is_battle_hex(x)) + gen_action_hex(x) + }, + hex(x) { + set_delete(friendly_minefields(), x) + set_delete(game.minefields[MF_VISIBLE], x) + game.state = 'spending_bps' + }, +} + states.dismantle1 = { inactive: "buildup", prompt() { @@ -6347,7 +6369,7 @@ states.dismantle2 = { states.dismantle3 = { inactive: "buildup", prompt() { - view.prompt = `Buildup: Build a new minefield.` + view.prompt = `Buildup: Build a new minefield at no cost.` let mfs = friendly_minefields() let net = friendly_buildup_network() for (let x of all_hexes) |