summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-06-21 17:58:55 +0200
committerTor Andersson <tor@ccxvii.net>2023-07-07 18:39:37 +0200
commitd8aa3a523ce28ec3e3e616ad2c090bd3f4f835fa (patch)
treed6cebfec85abd5914b26c1923e5b1bbc390150f6
parent6a6a356451aeb720a7e0cac4c1bb9eb1c99eef05 (diff)
downloadtime-of-crisis-d8aa3a523ce28ec3e3e616ad2c090bd3f4f835fa.tar.gz
Castra.
-rw-r--r--rules.js17
1 files 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)