summaryrefslogtreecommitdiffstats
path: root/lib/colonial_twilight/fln_bot_rules.rb
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2023-12-04 14:37:27 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2023-12-04 14:37:27 +0100
commitc4086c04aa81379a045e5c7b1c0efe09ff38bb75 (patch)
treed547961de60b621d9532538011ded85c78a955c7 /lib/colonial_twilight/fln_bot_rules.rb
parent420487be4001873a7168db25fc6a52f4fe6fabcd (diff)
downloadcolonial-twilight-c4086c04aa81379a045e5c7b1c0efe09ff38bb75.zip
colonial-twilight-c4086c04aa81379a045e5c7b1c0efe09ff38bb75.tar.gz
FLNBotRules : add is_rallied block to rally_9_priority
Diffstat (limited to 'lib/colonial_twilight/fln_bot_rules.rb')
-rw-r--r--lib/colonial_twilight/fln_bot_rules.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/colonial_twilight/fln_bot_rules.rb b/lib/colonial_twilight/fln_bot_rules.rb
index 463ea8c..a5e5540 100644
--- a/lib/colonial_twilight/fln_bot_rules.rb
+++ b/lib/colonial_twilight/fln_bot_rules.rb
@@ -150,9 +150,9 @@ module ColonialTwilight
r
end
- def rally_9_priority(spaces, resources)
- f = _filter(spaces) { |s| s.support? && (resources.zero? || resources > s.terror) }
- _filter(f) { |s| s.neutral? && (resources.zero? || resources > s.terror) }
+ def rally_9_priority(spaces, resources, &is_rallied)
+ f = _filter(spaces) { |s| s.support? && (resources.zero? || (resources - (is_rallied.call(s) ? 0 : 1)) > s.terror) }
+ _filter(f) { |s| s.neutral? && (resources.zero? || (resources - (is_rallied.call(s) ? 0 : 1)) > s.terror) }
end
# Extort