diff options
author | Tor Andersson <tor@ccxvii.net> | 2023-01-28 17:15:02 +0100 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2023-02-18 13:02:39 +0100 |
commit | 3b5ca4cd1416f2458db156757bec76fdc3019626 (patch) | |
tree | 796d8b1d0f14d2eeac92060730429e6f376e5ef1 /rules.js | |
parent | a808049398cdb100d8f557cff0663aeb10c78d78 (diff) | |
download | nevsky-3b5ca4cd1416f2458db156757bec76fdc3019626.tar.gz |
Remove Serfs immediately when assigned hits.
Diffstat (limited to 'rules.js')
-rw-r--r-- | rules.js | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -8859,6 +8859,11 @@ function rout_unit(lord, type) { } } +function remove_serf(lord) { + add_lord_forces(lord, SERFS, -1) + game.pieces.smerdi++ +} + function use_warrior_monks(lord, type) { if (type === KNIGHTS) { let bit = 1 << lord @@ -8925,9 +8930,12 @@ function action_assign_hits(lord, type) { rout_unit(lord, type) } } - } else { + } else if (type !== SERFS) { logi(`${FORCE_TYPE_NAME[type]} unprotected`) rout_unit(lord, type) + } else { + logi(`${FORCE_TYPE_NAME[type]} removed`) + remove_serf(lord, type) } if (game.battle.xhits) @@ -9504,8 +9512,6 @@ function action_losses(lord, type) { } else { logi(`${FORCE_TYPE_NAME[type]} ${range(target)}: ${HIT[die]}`) add_lord_routed_forces(lord, type, -1) - if (type === SERFS) - game.pieces.smerdi++ } resume_battle_losses() |