summaryrefslogtreecommitdiff
path: root/rules.js
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-04-15 00:01:18 +0200
committerTor Andersson <tor@ccxvii.net>2023-05-03 18:48:16 +0200
commitd195265a93d05a8466355c54ac4d211714d75014 (patch)
tree7b514be92e31062f0c20e351fa2ce12efa61e538 /rules.js
parent42ef73422399c6ed4e30f7538547c3cf3ef44383 (diff)
downloadandean-abyss-d195265a93d05a8466355c54ac4d211714d75014.tar.gz
Automate shaded event 64.
Diffstat (limited to 'rules.js')
-rw-r--r--rules.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/rules.js b/rules.js
index ffda1b4..e46a1e5 100644
--- a/rules.js
+++ b/rules.js
@@ -631,6 +631,14 @@ function count_matching_spaces(f) {
return n
}
+function count_matching_pieces(f) {
+ let n = 0
+ for (let p = all_first_piece; p <= all_last_piece; ++p)
+ if (f(p, piece_space(p)))
+ ++n
+ return n
+}
+
function count_faction_pieces(s, faction) {
switch (faction) {
case GOVT: