From d8aa3a523ce28ec3e3e616ad2c090bd3f4f835fa Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 21 Jun 2023 17:58:55 +0200 Subject: Castra. --- rules.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/rules.js b/rules.js index 335ae87..7c2d3e3 100644 --- a/rules.js +++ b/rules.js @@ -37,9 +37,9 @@ TODO [x] remove at start [x] remove when move/attack [ ] move militia to general at end of turn - [ ] take hits in battle + [ ] remove when retreat -[ ] support check +[x] support check [ ] gain legacy [ ] emperor @@ -2004,11 +2004,20 @@ states.battle = { game.misc.dhits = roll_attacker_dice() game.misc.dtaken = 0 + if (game.misc.type === "militia" && has_militia_castra(game.misc.where)) { + log("Castra reduces 1 hit") + if (game.misc.dhits > 0) + game.misc.dhits -= 1 + } + if (game.misc.type === "general" && has_general_castra(game.misc.target)) { + log("Castra reduces 1 hit") + if (game.misc.dhits > 0) + game.misc.dhits -= 1 + } + game.misc.ahits = roll_defender_dice() game.misc.ataken = 0 - // TODO: castra - if (game.misc.ahits > 0) game.state = "assign_hits_on_attacker" else if (game.misc.dhits > 0) -- cgit v1.2.3