From c4086c04aa81379a045e5c7b1c0efe09ff38bb75 Mon Sep 17 00:00:00 2001 From: Jérémy Zurcher Date: Mon, 4 Dec 2023 14:37:27 +0100 Subject: FLNBotRules : add is_rallied block to rally_9_priority --- lib/colonial_twilight/fln_bot_rules.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') 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 -- cgit v1.2.3