summaryrefslogtreecommitdiffstats
path: root/lib/colonial_twilight
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2023-11-09 15:34:43 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2023-11-09 15:34:43 +0100
commit964cba1f5640113b55a386239b9b8c698c9fafdf (patch)
tree1cca3a414e0e17db2d4ef54312c93be16deb421d /lib/colonial_twilight
parent92d469aff0b7f02f692d37160e5d0230ce0beb87 (diff)
downloadcolonial-twilight-964cba1f5640113b55a386239b9b8c698c9fafdf.zip
colonial-twilight-964cba1f5640113b55a386239b9b8c698c9fafdf.tar.gz
FLNBotRules : add #pick_guerrillas_from
Diffstat (limited to 'lib/colonial_twilight')
-rw-r--r--lib/colonial_twilight/fln_bot_rules.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/colonial_twilight/fln_bot_rules.rb b/lib/colonial_twilight/fln_bot_rules.rb
index f82cb39..4294136 100644
--- a/lib/colonial_twilight/fln_bot_rules.rb
+++ b/lib/colonial_twilight/fln_bot_rules.rb
@@ -234,6 +234,12 @@ module ColonialTwilight
h.reject { |_k, v| v.zero? } # FIXME in empty? maybe hide active guerrillas ?
end
+ def pick_guerrillas_from(board = @board)
+ return :available if board.available_fln_underground.positive?
+
+ _remove_guerrillas_priority(board.spaces).sample
+ end
+
# 1) place: outofplay -> available | bases -> guerrillas if choice
# 2) place: underground first unless from map then place active first flipped as underground
# 3) march: underground -> active, unless march would activate then move active first