summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-01-05 21:57:54 +0100
committerTor Andersson <tor@ccxvii.net>2024-01-08 16:36:48 +0100
commit4b955e2222a58947693e689701601caeda2dbe5a (patch)
treed405ba8a4e32b40253b3a988892b17ccf7d13d0a /rules.js
parentbadf9b5b84863c64018336f6ca2361de5e35a79a (diff)
downloadtable-battles-4b955e2222a58947693e689701601caeda2dbe5a.tar.gz
Polish.
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js25
1 files changed, 14 insertions, 11 deletions
diff --git a/rules.js b/rules.js
index 9fbe89e..be6aefc 100644
--- a/rules.js
+++ b/rules.js
@@ -493,7 +493,7 @@ exports.setup = function (seed, scenario, options) {
log(".h1 " + info.name)
log(".h2 " + info.date)
- log(".img " + info.name.toLowerCase().replaceAll(" ", "_"))
+ log(".img")
log("")
if (info.players[0].tactical > 0 || info.players[1].tactical > 0) {
@@ -1634,7 +1634,6 @@ function end_roll_phase() {
game.selected = -1
if (game.placed.length > 0) {
- log("Placed")
for (let i = 0; i < game.placed.length; i += 2) {
let c = game.placed[i]
let s = []
@@ -1642,7 +1641,7 @@ function end_roll_phase() {
if (game.summary & (1 << d))
if (get_dice_location(d) === c)
s.push("D" + get_dice_value(d))
- log(">C" + c + "\n" + s.join(" "))
+ log("C" + c + "\n" + s.join(" "))
}
}
@@ -3039,14 +3038,18 @@ states.attack = {
function resume_attack() {
pay_for_action(game.selected)
- if (game.hits > 0 && game.self > 0) {
- log(">" + game.hits + " hits. " + game.self + " self.")
- }
- else if (game.hits > 0) {
- log(">" + game.hits + " hits.")
- }
- else if (game.self > 0) {
- log(">" + game.self + " self.")
+ if (game.hits === 1) {
+ if (game.self > 0)
+ log(">1 hit. " + game.self + " self.")
+ else
+ log(">1 hit.")
+ } else {
+ if (game.hits > 0 && game.self > 0)
+ log(">" + game.hits + " hits. " + game.self + " self.")
+ else if (game.hits > 0)
+ log(">" + game.hits + " hits.")
+ else if (game.self > 0)
+ log(">" + game.self + " self.")
}
if (game.hits > 0)