diff options
author | Tor Andersson <tor@ccxvii.net> | 2024-05-30 00:33:36 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-05-30 21:59:25 +0200 |
commit | 8bb5f1e3a67d7efa5fd22a3bdeadb39bc87ce6f7 (patch) | |
tree | fedd1bb875113671b3df95af8bc8c637303369bf | |
parent | 84e488f8b16b9dfa2a29076369a223a956f0f8ad (diff) | |
download | friedrich-8bb5f1e3a67d7efa5fd22a3bdeadb39bc87ce6f7.tar.gz |
polish retired text
-rw-r--r-- | play.js | 4 | ||||
-rw-r--r-- | rules.js | 12 |
2 files changed, 10 insertions, 6 deletions
@@ -1167,9 +1167,9 @@ function on_log(text) { if (text.match(/^\$(\d+)/)) { let fx = parseInt(text.substring(1)) if (fx < 48 + 6) - text = `<p class="q">${fate_flavor_text[fx]}<p>${fate_effect_text[fx]}` + text = `<div class="q">${fate_flavor_text[fx]}</div><div></div><div>${fate_effect_text[fx]}</div><div></div>` else - text = `<p class="q">${fate_flavor_text[fx]}` + text = `<div class="q">${fate_flavor_text[fx]}</div><div></div>` } else if (text.match(/^# /)) { p.className = "h fate" @@ -803,8 +803,6 @@ function remove_one_troop(p) { } function retire_general(p) { - log("P" + p + " retired.") - // save troops if possible let s = game.pos[p] let n = game.troops[p] @@ -820,8 +818,14 @@ function retire_general(p) { n -= x } } - if (n > 0) - log("Lost " + n + " troops.") + if (n > 1) + log("P" + p + " retired with " + n + " troops.") + else if (n === 1) + log("P" + p + " retired with 1 troop.") + else + log("P" + p + " retired.") + } else { + log("P" + p + " retired.") } } |