summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js19
1 files changed, 14 insertions, 5 deletions
diff --git a/rules.js b/rules.js
index e205eed..29195d7 100644
--- a/rules.js
+++ b/rules.js
@@ -5,7 +5,7 @@
// TODO: legal pass withdrawal moves (reduce supply net, withdraw from fortress attack)
// TODO: fortress combat in pass turns (must withdraw)
-// TODO: highlight selected/active battles
+// TODO: highlight selected/active/assault battles
// TODO: group move from queue holding box to base
// TODO: 1942 malta group (reinforce, reduce supply card draw)
@@ -1887,9 +1887,11 @@ function end_player_turn() {
set_clear(game.partial_retreats)
// Reveal supply cards
- log_br()
- log(`Supply Cards Revealed:\n${game.commit[0]} real and ${game.commit[1]} dummy.`)
- log_br()
+ if (game.commit[0] + game.commit[1] > 0) {
+ log_br()
+ log(`Supply Cards Revealed:\n${game.commit[0]} real and ${game.commit[1]} dummy.`)
+ log_br()
+ }
game.commit = [ 0, 0 ]
@@ -3920,6 +3922,7 @@ function gen_battle_hits() {
}
function apply_battle_hit(who) {
+ game.flash = ""
game.hits[unit_class[who]] -= reduce_unit(who)
}
@@ -5721,7 +5724,6 @@ exports.view = function(state, current) {
if (current === game.active)
view.selected = game.selected
-
if (game.from1) view.from1 = game.from1
if (game.from2) view.from2 = game.from2
if (game.to1) view.to1 = game.to1
@@ -5734,6 +5736,13 @@ exports.view = function(state, current) {
view.flash = game.flash
}
+ if (game.fired.length > 0 && (game.battle || game.pursuit))
+ view.fired = game.fired
+ if (game.active_battles.length > 0)
+ view.battles = game.active_battles
+ if (game.assault_battles.length > 0)
+ view.assaults = game.assault_battles
+
return common_view(current)
}