summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js20
1 files changed, 14 insertions, 6 deletions
diff --git a/rules.js b/rules.js
index 30f92e3..9cbc2b0 100644
--- a/rules.js
+++ b/rules.js
@@ -1337,6 +1337,7 @@ function next_attack_cavalry_step() {
if (game.cmd.step === 0) {
goto_attack_cavalry(game.cmd.attacker)
} else if (game.cmd.step === 1) {
+ clear_undo()
goto_attack_cavalry(game.cmd.target)
} else {
game.cmd.a_hit = game.dice.slice(0,4).filter(d => d > 0 && d <= game.cmd.n_units[0] && d < 6).length
@@ -3143,6 +3144,13 @@ function piece_name(p) {
return PIECE_FACTION_TYPE_NAME[piece_faction(p)][piece_type(p)]
}
+function faction_type_symbol(f, t) {
+ if (PIECE_FACTION_TYPE_SYMBOL[f][t] !== null)
+ return PIECE_FACTION_TYPE_SYMBOL[f][t]
+ else
+ return PIECE_FACTION_TYPE_NAME[f][t]
+}
+
function piece_type(p) {
if (p >= first_piece[MI][TROOPS] && p <= last_piece[MI][TROOPS])
return TROOPS
@@ -4650,7 +4658,7 @@ function vm_mark_space() {
}
function vm_move() {
- log("Moved " + piece_name(game.vm.p) + " to S" + game.vm.s + " from S" + piece_space(game.vm.p) + ".")
+ log("Moved " + piece_symbol(game.vm.p) + " to S" + game.vm.s + " from S" + piece_space(game.vm.p) + ".")
place_piece(game.vm.p, game.vm.s)
vm_next()
}
@@ -4923,7 +4931,7 @@ function vm_auto_place() {
let faction = vm_operand(4)
let type = vm_operand(5)
if (auto_place_piece(game.vm.s, faction, type, is_rebel)) {
- log("Placed " + PIECE_FACTION_TYPE_NAME[faction][type] + " in S" + game.vm.s + ".")
+ log("Placed " + faction_type_symbol(faction, type) + " in S" + game.vm.s + ".")
vm_next()
} else {
vm_place()
@@ -5047,7 +5055,7 @@ states.vm_replace = {
if (rebel_p) {
to_rebel(p)
}
- log(`Replaced a ${piece_name(game.vm.p)} for a ${rebel_p ? "Rebelling " : ""}${piece_name(p)} in S${game.vm.m}.`)
+ log(`Replaced a ${piece_symbol(game.vm.p)} for a ${rebel_p ? "Rebelling " : ""}${pice_symbol(p)} in S${game.vm.m}.`)
if (vm_operand(4))
goto_rebel_or_obedient(game.vm.rs)
@@ -5261,7 +5269,7 @@ states.vm_steal_cavalry = {
c = find_cavalry(f2)
set_cavalry_faction(c, game.current)
}
- log(`${faction_name[game.current]} stole ${n} Cavalry token from ${faction_name[f2]}.`)
+ log(`${faction_flags[game.current]} stole ${n} Cavalry token from ${faction_flags[f2]}.`)
vm_next()
},
skip() {
@@ -5729,7 +5737,7 @@ states.shaded_6_2 = {
let n = Math.min(game.resources[f], 3)
add_resources(f, -n)
add_resources(DS, n)
- log(`${faction_name[game.current]} stole ${n} Resources from ${faction_name[f]}.`)
+ log(`${faction_flags[game.current]} stole ${n} Resources from ${faction_flags[f]}.`)
vm_next()
}
}
@@ -5813,7 +5821,7 @@ states.shaded_29 = {
},
next() {
if (game.cmd.count < 3) {
- log(`${faction_name[game.current]} spent ${3-game.cmd.count} Resources.`)
+ log(`${faction_flags[game.current]} spent ${3-game.cmd.count} Resources.`)
upop_summary()
} else {
game.summary = null