summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2022-12-04 15:17:13 +0100
committerTor Andersson <tor@ccxvii.net>2023-02-18 13:02:38 +0100
commitd6d8c0a5ee9df15b1527b12e5f6def162dd124eb (patch)
treeaf343de4fa832bdbdeada814072ebcf702d48edc
parent2fe325b65b8107bb424b686855c2a1cc9dea4f2e (diff)
downloadnevsky-d6d8c0a5ee9df15b1527b12e5f6def162dd124eb.tar.gz
Ravage check.
-rw-r--r--rules.js11
1 files changed, 10 insertions, 1 deletions
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