summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2022-07-28 18:49:04 +0200
committerTor Andersson <tor@ccxvii.net>2022-11-17 13:11:26 +0100
commit6d47047daf88fef9f2cda7f060d33e571a88893f (patch)
treea1c24d0b719815bedfa468a7bfe45549b6729c15 /rules.js
parent1f3e8f7fcc6c283bfe31240475cdff3d5fc6b7fd (diff)
downloadrommel-in-the-desert-6d47047daf88fef9f2cda7f060d33e571a88893f.tar.gz
Malta and reinforcement tracks.
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js35
1 files changed, 27 insertions, 8 deletions
diff --git a/rules.js b/rules.js
index 52a0354..9697695 100644
--- a/rules.js
+++ b/rules.js
@@ -7,12 +7,13 @@
// TODO: gazala scenario
// TODO: legal pass withdrawal moves (reduce supply net, withdraw from fortress attack)
// TOOD: reveal/hide blocks (hexes)
-// TODO: malta units?
// TODO: group move from queue holding box to base
+// TODO: unit class/speed in battle flash
// TODO: redeployment
// TODO: return for refit
// TODO: replacements
+// TODO: malta units
// RULES: may units redeploying out of battles cross enemy controlled hexsides?
@@ -108,6 +109,9 @@ const ALLIED_REFIT = 48
const AXIS_QUEUE = 127
const ALLIED_QUEUE = 49
+// Off board optional 1942 Malta reinforcements
+const MALTA = 4
+
const EL_AGHEILA = 151
const ALEXANDRIA = 74
const BENGHAZI = 54
@@ -3805,11 +3809,10 @@ function end_buildup_discard() {
}
}
-function goto_buildup_supply_check() {
+function init_buildup() {
// TODO: fortress supply
// TODO: assign fortress supply
- // Remember supply networks throughout buildup.
game.buildup = {
// redeployment network
axis_network: axis_supply_network().slice(),
@@ -3822,6 +3825,10 @@ function goto_buildup_supply_check() {
benghazi: 2,
tobruk: 5,
}
+}
+
+function goto_buildup_supply_check() {
+ init_buildup()
for_each_axis_unit_on_map(u => {
let x = unit_hex(u)
@@ -4014,7 +4021,7 @@ function goto_buildup_resupply() {
shuffle_cards()
// Per-scenario allotment
- let axis_resupply = (game.month > 10 ? 2 : 3)
+ let axis_resupply = (game.month <= 10 || game.malta) ? 2 : 3
let allied_resupply = 3
// Extra cards purchased during buildup
@@ -4278,10 +4285,22 @@ function begin_game() {
set_add(game.minefields, TOBRUK)
}
+ if (game.scenario === "Gazala") {
+ // PreGame Buildup
+ game.phasing = ALLIED
+ init_buildup()
+ game.axis_bps = 30
+ game.allied_bps = 30
+ set_active_player()
+ goto_buildup_reinforcements()
+ return
+ }
+
// No buildup first month
// No initiative first month
- goto_player_turn()
+ // XXX goto_player_turn()
+ goto_buildup()
}
// === SETUP ===
@@ -4306,9 +4325,9 @@ function setup_reinforcements(m) {
for (let u = 0; u < units.length; ++u) {
if (units[u].appearance === m) {
if (m === 'M')
- set_unit_hex(u, 4)
+ set_unit_hex(u, MALTA)
else
- set_unit_hex(u, hexdeploy + (m > 10 ? m - 10 : m))
+ set_unit_hex(u, hexdeploy + m)
}
}
}
@@ -4649,7 +4668,7 @@ const SETUP = {
"10IN/21+25",
"70/14+16",
"8IN/18",
- "B",
+ "/B",
])
setup_units(DEPLOY, -1, [
"1/22",