diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-01-09 22:01:37 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-02-18 13:02:38 +0100 |
commit | f09b083c7d323890bdb7e790f51923ec691d5018 (patch) | |
tree | 2226e4203d2f96edbcc77247c713a56f77c74a9e /rules.js | |
parent | 3d98a7e7f83d06b4a2c45cb76510064e93af413e (diff) | |
download | nevsky-f09b083c7d323890bdb7e790f51923ec691d5018.tar.gz |
Clamp Veche VP. Tempest rounding.
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 21 |
1 files changed, 15 insertions, 6 deletions
@@ -7,11 +7,12 @@ // FIXME: lift_sieges / besieged needs checking! (automatic after disband_lord, manual after move/sail, extra careful manual after battle) // FIXME: remove_legate_if_endangered needs checking! (automatic after disband_lord, manual after move/sail, manual after battle) +// GUI: Remove battle mat. +// GUI: tucked map capabilities pop up on shift key +// GUI: show moved/fought markers on mats during Feed phase // GUI: show sally/relief sally as unbesieged on map // GUI: show siegeworks + walls on battle mat for protection indication // GUI: show feed x2 on lord mats with > 6 units -// GUI: battle mat - optional - either mat in middle, or garrison + siegeworks display -// GUI: array position - click on mat grid as well // GUI: battle event on lord mat (at top) - in client for Bridge and Field Organs // WONTFIX: choose crossbow/normal hit application order @@ -674,6 +675,14 @@ function get_lord_array_position(lord) { return -1 } +function add_veche_vp(amount) { + game.pieces.veche_vp += amount + if (game.pieces.veche_vp < 0) + game.pieces.veche_vp = 0 + if (game.pieces.veche_vp > 8) + game.pieces.veche_vp = 8 +} + // === GAME STATE HELPERS === function roll_die() { @@ -2181,7 +2190,7 @@ states.tempest = { logi(`Removed ships from L${lord}.`) let n = 0 if (lord_has_capability(lord, AOW_TEUTONIC_COGS)) - n = Math.ceil(get_lord_assets(lord, SHIP) / 2) + n = get_lord_assets(lord, SHIP) >> 1 set_lord_assets(lord, SHIP, n) end_immediate_event() }, @@ -3897,10 +3906,10 @@ states.novgorod_veche = { if (game.scenario === "Watland") { log("Decline of Andrey: Added 2VP to Veche.") - game.pieces.veche_vp += 2 + add_veche_vp(2) } else { log("Added 1VP to Veche.") - game.pieces.veche_vp += 1 + add_veche_vp(1) } if (is_lord_ready(LORD_ALEKSANDR)) { @@ -3915,7 +3924,7 @@ states.novgorod_veche = { lord(lord) { push_undo() log("Removed 1VP from Veche.") - game.pieces.veche_vp -= 1 + add_veche_vp(-1) game.state = "novgorod_veche_done" if (is_lord_ready(lord)) { |