summaryrefslogtreecommitdiffstats
path: root/lib/colonial_twilight/fln_bot/fln_extort.rb
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2026-03-11 15:16:47 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2026-03-11 15:16:47 +0100
commit9458b6413e3609e12f563dcb321d493b5f317017 (patch)
tree0e8bb866639541ee1e5b9c669b964054d9da8aa6 /lib/colonial_twilight/fln_bot/fln_extort.rb
parent96eba00d76af7fe662bc7f26d8962ada3bfa15b2 (diff)
downloadcolonial-twilight-9458b6413e3609e12f563dcb321d493b5f317017.zip
colonial-twilight-9458b6413e3609e12f563dcb321d493b5f317017.tar.gz
update FlnBot infrastructure
Diffstat (limited to 'lib/colonial_twilight/fln_bot/fln_extort.rb')
-rw-r--r--lib/colonial_twilight/fln_bot/fln_extort.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/colonial_twilight/fln_bot/fln_extort.rb b/lib/colonial_twilight/fln_bot/fln_extort.rb
new file mode 100644
index 0000000..5889e24
--- /dev/null
+++ b/lib/colonial_twilight/fln_bot/fln_extort.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+module ColonialTwilight
+ module FLNBotExtort
+ def extort(except: nil, to_agitate_in: nil)
+ return false if available_resources > 4
+ return false unless @turn.may_special_activity?(:extort)
+ return false if (space = extort_priority(extortable(except: except)).sample).nil?
+
+ apply_action @turn.special_activity_in(:extort, space, -1, to_agitate_in: to_agitate_in).extort
+ end
+
+ def extortable(except: nil)
+ @board.search { |s| may_extort_0_in?(s) }.reject { |s| @turn.special_activity_selected?(s) || s == except }
+ end
+ end
+end