summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2022-10-04 00:18:02 +0200
committerTor Andersson <tor@ccxvii.net>2022-11-17 13:11:27 +0100
commit0163e0aef0055802cd86f8afaff0fd94fa7d0777 (patch)
tree17196a855a68bd1c4c93da73d019271223553786
parent39b805a7da253435c5c8c694cb60b49f43adc83e (diff)
downloadrommel-in-the-desert-0163e0aef0055802cd86f8afaff0fd94fa7d0777.tar.gz
Check available money for building minefields.
-rw-r--r--rules.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/rules.js b/rules.js
index adbf7d5..68c7181 100644
--- a/rules.js
+++ b/rules.js
@@ -6166,12 +6166,14 @@ states.minefield = {
prompt() {
view.prompt = `Buildup: Build a minefield.`
let mfs = friendly_minefields()
- let net = friendly_buildup_network()
if (mfs.length >= 2)
gen_action('dismantle')
- for (let x of all_hexes)
- if (net[x] && !is_battle_hex(x) && !set_has(mfs, x))
- gen_action_hex(x)
+ if (available_bps() >= 15) {
+ let net = friendly_buildup_network()
+ for (let x of all_hexes)
+ if (net[x] && !is_battle_hex(x) && !set_has(mfs, x))
+ gen_action_hex(x)
+ }
},
dismantle() {
push_undo()