summaryrefslogtreecommitdiffstats
path: root/lib/colonial_twilight/actions/fln/attack.rb
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2026-03-15 21:42:14 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2026-03-15 21:42:14 +0100
commitf0c2066e3ffffe3212658313cd6e30d85028412c (patch)
tree7fffcf8fcde438d1a565e154a52909fa6c054832 /lib/colonial_twilight/actions/fln/attack.rb
parente4e09f936d38a89082f40354fdf451ad875baffa (diff)
downloadcolonial-twilight-f0c2066e3ffffe3212658313cd6e30d85028412c.zip
colonial-twilight-f0c2066e3ffffe3212658313cd6e30d85028412c.tar.gz
implement FLN action & operations
Diffstat (limited to 'lib/colonial_twilight/actions/fln/attack.rb')
-rw-r--r--lib/colonial_twilight/actions/fln/attack.rb57
1 files changed, 57 insertions, 0 deletions
diff --git a/lib/colonial_twilight/actions/fln/attack.rb b/lib/colonial_twilight/actions/fln/attack.rb
new file mode 100644
index 0000000..298f28e
--- /dev/null
+++ b/lib/colonial_twilight/actions/fln/attack.rb
@@ -0,0 +1,57 @@
+# frozen_string_literal: true
+
+require_relative 'fln_action'
+require_relative 'ambush'
+
+module ColonialTwilight
+ module Actions
+ module FLN
+ # Attack 3.3.3
+ class Attack < FlnAction
+ def initialize(space)
+ super(space, {}, cost: 1)
+ @ambush = nil
+ end
+
+ # can be combined with Ambush (replaces Attack procedure)
+ def ambush!
+ raise 'ambush! called twice' unless @ambush.nil?
+
+ @ambush = Ambush.new(space)
+ self
+ end
+
+
+ # def validate!
+ # super
+ # raise 'select conduct mode' unless mode.key?(:conduct)
+ # end
+
+ # Activate all Guerrillas in the space
+ # Roll 1d6: if result is less than or equal to number of Guerrillas
+ # remove up to 2 Gov pieces (Police first, then Troops, then Base) into casualties
+ # If result is a 1, add 1 underground Guerrillas
+ # Attrition (not Ambush) : for each French piece removed : remove 1 FLN Guerrillas (alternate available / casualties)
+ # -1 Commitment per French Base removed
+ def apply!(board)
+ raise NotImplementedError
+ end
+
+ class << self
+ def op?
+ true
+ end
+
+ # any space with FLN cubes and Gov pieces
+ def applicable?(space)
+ space.guerrillas.positive? && space.gov.positive?
+ end
+
+ # def available_modes(_space)
+ # { conduct: 1 }
+ # end
+ end
+ end
+ end
+ end
+end