summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--play.html23
-rw-r--r--rules.js10
-rw-r--r--ui.js14
3 files changed, 28 insertions, 19 deletions
diff --git a/play.html b/play.html
index 176706c..7ec0e98 100644
--- a/play.html
+++ b/play.html
@@ -231,30 +231,25 @@ body.shift .block.known:hover {
.battle .battle_message { background-color: gainsboro; }
.battle .battle_header { background-color: #224467; color: white; font-weight: bold; }
#EC .battle_menu_list { min-height: 0; }
-.battle_line > td { min-width: 800px; }
+.battle_line > td { min-width: 700px; }
.battle td { border: none; }
-#FA, #FB, #FC, #FD, #FR, #EA, #EB, #EC, #ER { margin: 0px; padding: 5px; }
+#FA, #FB, #FC, #FD, #FR, #EA, #EB, #EC, #ER { margin: 0px auto; padding: 5px; }
.battle .battle_menu { margin: 10px 5px; }
-#FC { min-height: 120px; }
-#EC { min-height: 80px; }
-#FF, #EF { min-height: 120px; }
-#FC, #EC {
- background-color: gray;
- margin-left: auto;
- margin-right: auto;
- border-top: 5px dashed tan;
-}
+#ER { background-image: linear-gradient(to bottom, skyblue, tan); }
+#FR { background-image: linear-gradient(to bottom, tan, darkseagreen); }
+#FC, #EC { background-color: gray; border-top: 5px dashed tan; }
+
+#FC, #EC, #FF, #EF { min-height: 120px; }
+#FR, #ER { min-height: 40px; }
+
#FC.c0, #EC.c0 { display: none; }
#FC.c1, #EC.c1 { width: 90px; display: block; }
#FC.c2, #EC.c2 { width: 180px; display: block; }
#FC.c3, #EC.c3 { width: 270px; display: block; }
#FC.c4, #EC.c4 { width: 360px; display: block; }
-#ER { background-image: linear-gradient(to bottom, skyblue, tan); min-height: 40px; }
-#FR { background-image: linear-gradient(to bottom, tan, darkseagreen); min-height: 40px; }
-
/* CARD AND BLOCK IMAGES */
.card_back{background-image:url('cards/card_back.jpg')}
diff --git a/rules.js b/rules.js
index a476fe1..02f4398 100644
--- a/rules.js
+++ b/rules.js
@@ -1600,7 +1600,8 @@ states.combat_phase = {
},
town: function (where) {
remove_from_array(game.combat_list, where);
- if (game.attacker[where] == game.jihad) {
+ let attacker = game.attacker[where] || besieging_player(where);
+ if (attacker == game.jihad) {
game.active = game.attacker[where];
game.state = 'use_jihad_event';
game.where = where;
@@ -2225,6 +2226,13 @@ function resume_storm_battle() {
return next_combat_round();
}
+ if (game.storming.length == 0) {
+ console.log("STORM BATTLE WON BY DEFENDER", ENEMY[game.active]);
+ game.halfhit = null;
+ log("Storming repulsed.");
+ return next_combat_round();
+ }
+
game.state = 'storm_battle';
pump_battle_step(is_storm_attacker, is_storm_defender);
}
diff --git a/ui.js b/ui.js
index 7b73462..b5a0e02 100644
--- a/ui.js
+++ b/ui.js
@@ -119,8 +119,10 @@ function on_focus_battle_block(evt) {
if (game.actions && game.actions.battle_fire && game.actions.battle_fire.includes(b))
msg = "Fire with " + msg;
- else if (game.actions && game.actions.battle_retreat && game.actions.battle_retreat.includes(b))
- msg = "Retreat with " + msg;
+ else if (game.actions && game.actions.battle_storm && game.actions.battle_storm.includes(b))
+ msg = "Storm with " + msg;
+ else if (game.actions && game.actions.battle_sally && game.actions.battle_sally.includes(b))
+ msg = "Sally with " + msg;
else if (game.actions && game.actions.battle_hit && game.actions.battle_hit.includes(b))
msg = "Take hit on " + msg;
@@ -142,8 +144,12 @@ function on_focus_battle_fire(evt) {
}
function on_focus_battle_retreat(evt) {
- document.getElementById("status").textContent =
- "Retreat with " + block_name(evt.target.block);
+ if (game.battle.storming.includes(evt.target.block))
+ document.getElementById("status").textContent =
+ "Withdraw with " + block_name(evt.target.block);
+ else
+ document.getElementById("status").textContent =
+ "Retreat with " + block_name(evt.target.block);
}
function on_focus_battle_harry(evt) {