summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--play.html78
-rw-r--r--play.js4
-rw-r--r--rules.js12
3 files changed, 48 insertions, 46 deletions
diff --git a/play.html b/play.html
index 538c1a7..ea54426 100644
--- a/play.html
+++ b/play.html
@@ -68,51 +68,51 @@
<div id="marker_french_moves" class="marker large y2 hide" style="top:1857px;left:129px"></div>
<div id="marker_prussian_moves" class="marker large y4 hide" style="top:1857px;left:129px"></div>
-<div id="french_hq_1" class="french large y1"></div>
-<div id="french_hq_2" class="french large y2"></div>
-<div id="french_hq_3" class="french large y3"></div>
-<div id="anglo_hq_1" class="anglo large y1"></div>
-<div id="prussian_hq_1" class="prussian large y1"></div>
+<div id="french_hq_1" class="hide french large y1"></div>
+<div id="french_hq_2" class="hide french large y2"></div>
+<div id="french_hq_3" class="hide french large y3"></div>
+<div id="anglo_hq_1" class="hide anglo large y1"></div>
+<div id="prussian_hq_1" class="hide prussian large y1"></div>
-<div id="french_corps_1" class="french large y4"></div>
-<div id="french_corps_2" class="french large y5"></div>
-<div id="french_corps_3" class="french large y6"></div>
-<div id="french_corps_4" class="french large y7"></div>
-<div id="french_corps_5" class="french large y8"></div>
-<div id="french_corps_6" class="french large y9"></div>
-<div id="french_corps_7" class="french large y10"></div>
-<div id="french_corps_8" class="french large y11"></div>
+<div id="french_corps_1" class="hide french large y4"></div>
+<div id="french_corps_2" class="hide french large y5"></div>
+<div id="french_corps_3" class="hide french large y6"></div>
+<div id="french_corps_4" class="hide french large y7"></div>
+<div id="french_corps_5" class="hide french large y8"></div>
+<div id="french_corps_6" class="hide french large y9"></div>
+<div id="french_corps_7" class="hide french large y10"></div>
+<div id="french_corps_8" class="hide french large y11"></div>
-<div id="anglo_corps_1" class="anglo large y2"></div>
-<div id="anglo_corps_2" class="anglo large y3"></div>
-<div id="anglo_corps_3" class="anglo large y4"></div>
-<div id="anglo_corps_4" class="anglo large y5"></div>
-<div id="anglo_corps_5" class="anglo large y6"></div>
+<div id="anglo_corps_1" class="hide anglo large y2"></div>
+<div id="anglo_corps_2" class="hide anglo large y3"></div>
+<div id="anglo_corps_3" class="hide anglo large y4"></div>
+<div id="anglo_corps_4" class="hide anglo large y5"></div>
+<div id="anglo_corps_5" class="hide anglo large y6"></div>
-<div id="prussian_corps_1" class="prussian large y2"></div>
-<div id="prussian_corps_2" class="prussian large y3"></div>
-<div id="prussian_corps_3" class="prussian large y4"></div>
-<div id="prussian_corps_4" class="prussian large y5"></div>
-<div id="prussian_corps_5" class="prussian large y6"></div>
+<div id="prussian_corps_1" class="hide prussian large y2"></div>
+<div id="prussian_corps_2" class="hide prussian large y3"></div>
+<div id="prussian_corps_3" class="hide prussian large y4"></div>
+<div id="prussian_corps_4" class="hide prussian large y5"></div>
+<div id="prussian_corps_5" class="hide prussian large y6"></div>
-<div id="french_detachment_1" class="french small y1"></div>
-<div id="french_detachment_2" class="french small y2"></div>
-<div id="french_detachment_3" class="french small y3"></div>
-<div id="french_detachment_4" class="french small y4"></div>
-<div id="french_detachment_5" class="french small y5"></div>
-<div id="french_detachment_6" class="french small y6"></div>
+<div id="french_detachment_1" class="hide french small y1"></div>
+<div id="french_detachment_2" class="hide french small y2"></div>
+<div id="french_detachment_3" class="hide french small y3"></div>
+<div id="french_detachment_4" class="hide french small y4"></div>
+<div id="french_detachment_5" class="hide french small y5"></div>
+<div id="french_detachment_6" class="hide french small y6"></div>
-<div id="anglo_detachment_1" class="anglo small y1"></div>
-<div id="anglo_detachment_2" class="anglo small y2"></div>
-<div id="anglo_detachment_3" class="anglo small y3"></div>
-<div id="anglo_detachment_4" class="anglo small y4"></div>
+<div id="anglo_detachment_1" class="hide anglo small y1"></div>
+<div id="anglo_detachment_2" class="hide anglo small y2"></div>
+<div id="anglo_detachment_3" class="hide anglo small y3"></div>
+<div id="anglo_detachment_4" class="hide anglo small y4"></div>
-<div id="prussian_detachment_1" class="prussian small y1"></div>
-<div id="prussian_detachment_2" class="prussian small y2"></div>
-<div id="prussian_detachment_3" class="prussian small y3"></div>
-<div id="prussian_detachment_4" class="prussian small y4"></div>
-<div id="prussian_detachment_5" class="prussian small y5"></div>
-<div id="prussian_detachment_6" class="prussian small y6"></div>
+<div id="prussian_detachment_1" class="hide prussian small y1"></div>
+<div id="prussian_detachment_2" class="hide prussian small y2"></div>
+<div id="prussian_detachment_3" class="hide prussian small y3"></div>
+<div id="prussian_detachment_4" class="hide prussian small y4"></div>
+<div id="prussian_detachment_5" class="hide prussian small y5"></div>
+<div id="prussian_detachment_6" class="hide prussian small y6"></div>
</div>
</div>
diff --git a/play.js b/play.js
index 1285cb9..5d38bd3 100644
--- a/play.js
+++ b/play.js
@@ -166,10 +166,6 @@ function on_click_action(evt) {
}
}
-function toggle_pieces() {
- document.getElementById("pieces").classList.toggle("hide")
-}
-
var _move_path = []
function hide_move_path() {
diff --git a/rules.js b/rules.js
index 5cdf8fa..51b70e9 100644
--- a/rules.js
+++ b/rules.js
@@ -2,8 +2,10 @@
// TODO - auto-update ZOC
-// TODO: active prompts
-// TODO: inactive prompts
+// TODO: tooltips and log coloring?
+// TODO: map names
+// TODO: unit names
+// TODO: fix counters and map graphics
const P1 = "French"
const P2 = "Coalition"
@@ -2187,6 +2189,7 @@ states.blown_attacker = {
gen_action_piece(game.who)
},
piece(p) {
+ eliminate_detachments_stacked_with_corps(p)
blow_unit(p, 2)
next_attack()
},
@@ -2199,6 +2202,7 @@ states.eliminated_attacker = {
gen_action_piece(game.who)
},
piece(p) {
+ eliminate_detachments_stacked_with_corps(p)
eliminate_unit(p)
next_attack()
},
@@ -2211,6 +2215,7 @@ states.blown_defender = {
gen_action_piece(game.target)
},
piece(p) {
+ eliminate_detachments_stacked_with_corps(p)
blow_unit(p, 2)
set_next_player()
goto_pursuit()
@@ -2224,6 +2229,7 @@ states.eliminated_defender = {
gen_action_piece(game.target)
},
piece(p) {
+ eliminate_detachments_stacked_with_corps(p)
eliminate_unit(p)
set_next_player()
goto_pursuit()
@@ -2612,7 +2618,7 @@ exports.action = function (state, player, action, arg) {
game = state
let S = states[game.state]
if (action in S)
- S[action](arg, player)
+ S[action](arg)
else if (action === "undo" && game.undo && game.undo.length > 0)
pop_undo()
else