summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoël Simoneau <simoneaujoel@gmail.com>2025-04-06 21:46:02 -0400
committerJoël Simoneau <simoneaujoel@gmail.com>2025-04-06 21:46:02 -0400
commitbe0b41b59f941750c8c4ada0148082b26360ef28 (patch)
tree70fb27efe674936c417fad5d0f41f825a2e56eed
parent2524d4deb4c30944d0cd32dee7e66792264df833 (diff)
downloadvijayanagara-be0b41b59f941750c8c4ada0148082b26360ef28.tar.gz
Better icons
-rw-r--r--play.css8
-rw-r--r--rules.js20
2 files changed, 18 insertions, 10 deletions
diff --git a/play.css b/play.css
index 7ee9835..a70a593 100644
--- a/play.css
+++ b/play.css
@@ -167,10 +167,10 @@ img.f {
#log .h2.ve { background-color: #e4ba6e }
#log .h2.mi { background-color: #ebc9be }
-#log img.d { height: 15px; vertical-align: -3px }
-#log img.c { height: 15px; vertical-align: -3px }
-#log img.f { height: 16px; vertical-align: -2px }
-#log img.h { height: 17px; vertical-align: -4px; margin: 0px 2px; }
+#log img.d { height: 15px; vertical-align: -4px; margin: 0px 1px; }
+#log img.c { height: 15px; vertical-align: -3px; margin: 0px 1px;}
+#log img.f { height: 16px; vertical-align: -2px; }
+#log img.h { height: 17px; vertical-align: -2px; margin: -1px 2px; }
#log img.i { height: 34px; vertical-align: -3px; margin: -10px; }
#log { font-variant-numeric: tabular-nums; }
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