From d6d8c0a5ee9df15b1527b12e5f6def162dd124eb Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sun, 4 Dec 2022 15:17:13 +0100 Subject: Ravage check. --- rules.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/rules.js b/rules.js index 463962d..b670014 100644 --- a/rules.js +++ b/rules.js @@ -2130,13 +2130,22 @@ function do_action_forage() { // === ACTION: RAVAGE === +function can_ravage_locale(loc) { + return ( + is_enemy_territory(loc) && + !has_conquered_marker(loc) && + !has_ravaged_marker(loc) && + !is_friendly_locale(loc) + ) +} + function can_action_ravage() { let where = get_lord_locale(game.who) // TODO: cost 2 if enemy lord is adjacent in 2nd ed // TODO: adjacent ability - if (is_enemy_territory(where) && !has_ravaged_marker(where)) + if (can_ravage_locale(loc)) return true return false -- cgit v1.2.3