summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js40
1 files changed, 35 insertions, 5 deletions
diff --git a/rules.js b/rules.js
index 2b7ade6..2bd3dcd 100644
--- a/rules.js
+++ b/rules.js
@@ -210,6 +210,13 @@ const S3201_DH_HILL = find_card(3201, "D.H. Hill")
const S3201_AP_HILL = find_card(3201, "A.P. Hill")
const S3201_LONGSTREET = find_card(3201, "Longstreet")
+const S9_ST_ALBANS = find_scenario(9)
+const S9_HENRY_VI = find_card(9, "Henry VI")
+const S9_SHROPSHIRE_LANE = find_card(9, "Shropshire Lane")
+const S9_SOPWELL_LANE = find_card(9, "Sopwell Lane")
+const S9_ARCHERS = find_card(9, "Archers")
+const S9_WARWICK = find_card(9, "Warwick")
+
const S12_TOWTON = find_scenario(12)
const S13_EDGECOTE_MOOR = find_scenario(13)
@@ -1421,6 +1428,15 @@ function goto_attack() {
}
}
+ if (game.scenario === S9_ST_ALBANS) {
+ // Defensive Works (negated by Archers)
+ if (game.target === S9_SHROPSHIRE_LANE || game.target === S9_SOPWELL_LANE) {
+ if (is_card_in_play(S9_HENRY_VI))
+ if (!has_any_cubes_on_card(S9_ARCHERS))
+ game.hits = Math.min(1, game.hits)
+ }
+ }
+
if (game.scenario === S15_TEWKESBURY) {
if (game.target === S15_SOMERSET) {
if (has_any_dice_on_card(S15_A_PLUMP_OF_SPEARS))
@@ -1806,6 +1822,7 @@ function get_attack_hits(c, a) {
default:
throw new Error("invalid attack effect: " + a.effect)
case "1 hit.":
+ case "1 hit. Warwick Retires upon completing this Attack Action.":
case "1 hit. 1 self per action.":
return 1
case "1 hit per die.":
@@ -1826,6 +1843,7 @@ function get_attack_self(c, a) {
default:
throw new Error("invalid attack effect: " + a.effect)
case "1 hit.":
+ case "1 hit. Warwick Retires upon completing this Attack Action.":
case "1 hit per die.":
case "1 hit per die. Ignore first target until it comes out of Reserve.":
case "1 hit per pair.":
@@ -1849,7 +1867,17 @@ function should_remove_card(c) {
return false
return true
}
+ return false
+}
+function should_retire_card(c) {
+ let retire_with = card_has_rule(c, "retire_with")
+ if (retire_with) {
+ for (let other of retire_with)
+ if (is_card_in_play(other))
+ return false
+ return true
+ }
return false
}
@@ -1895,10 +1923,10 @@ function resume_routing() {
game.state = "routing"
for (let p = 0; p <= 1; ++p) {
for (let c of game.front[p])
- if (should_rout_card(c) || should_remove_card(c))
+ if (should_rout_card(c) || should_remove_card(c) || should_retire_card(c))
return
for (let c of game.reserve[p])
- if (should_rout_card(c) || should_remove_card(c))
+ if (should_rout_card(c) || should_remove_card(c) || should_retire_card(c))
return
}
end_routing()
@@ -1965,13 +1993,13 @@ function find_card_owner(c) {
states.routing = {
prompt() {
- view.prompt = "Rout cards with no remaining sticks!"
+ view.prompt = "Rout and remove cards."
for (let p = 0; p <= 1; ++p) {
for (let c of game.front[p])
- if (should_rout_card(c) || should_remove_card(c))
+ if (should_rout_card(c) || should_remove_card(c) || should_retire_card(c))
gen_action_card(c)
for (let c of game.reserve[p])
- if (should_rout_card(c) || should_remove_card(c))
+ if (should_rout_card(c) || should_remove_card(c) || should_retire_card(c))
gen_action_card(c)
}
},
@@ -1983,6 +2011,8 @@ states.routing = {
game.routed[p] = 2
else
game.routed[p] = 1
+ } else if (should_retire_card(c)) {
+ log(card_name(c) + " retired.")
} else {
log(card_name(c) + " removed.")
}