diff options
| author | Jérémy Zurcher <jeremy@asynk.ch> | 2026-03-11 15:16:47 +0100 |
|---|---|---|
| committer | Jérémy Zurcher <jeremy@asynk.ch> | 2026-03-11 15:16:47 +0100 |
| commit | 9458b6413e3609e12f563dcb321d493b5f317017 (patch) | |
| tree | 0e8bb866639541ee1e5b9c669b964054d9da8aa6 /lib/colonial_twilight/fln_bot/fln_extort.rb | |
| parent | 96eba00d76af7fe662bc7f26d8962ada3bfa15b2 (diff) | |
| download | colonial-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.rb | 17 |
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 |
