summaryrefslogtreecommitdiffstats
path: root/lib/colonial_twilight
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2023-10-24 15:02:12 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2023-10-24 15:02:12 +0200
commitd2a82f70866631968c570275d424336a3034dc09 (patch)
tree679c39f678687d85363e55e1a57d727c135c342a /lib/colonial_twilight
parent3011fbf0561570c0962e169a2d62d327edf19771 (diff)
downloadcolonial-twilight-d2a82f70866631968c570275d424336a3034dc09.zip
colonial-twilight-d2a82f70866631968c570275d424336a3034dc09.tar.gz
Forces _base -> _bases
Diffstat (limited to 'lib/colonial_twilight')
-rw-r--r--lib/colonial_twilight/board.rb22
-rw-r--r--lib/colonial_twilight/forces.rb11
2 files changed, 17 insertions, 16 deletions
diff --git a/lib/colonial_twilight/board.rb b/lib/colonial_twilight/board.rb
index f080a54..d6abbdf 100644
--- a/lib/colonial_twilight/board.rb
+++ b/lib/colonial_twilight/board.rb
@@ -233,7 +233,7 @@ module ColonialTwilight
def set_space(idx, opts, align = nil)
s = @spaces[idx]
s.alignment = align unless align.nil?
- %i[gov_base fln_base french_troops french_police algerian_troops algerian_police
+ %i[gov_bases fln_bases french_troops french_police algerian_troops algerian_police
fln_underground].each { |sym| s.add(sym, opts[sym]) if opts.key? sym }
end
@@ -246,7 +246,7 @@ module ColonialTwilight
@france_track.v = 4
@border_zone_track.v = 3
@out_of_play.init({ fln_underground: 5 })
- @available.init({ gov_base: 2, french_police: 4, fln_base: 7, fln_underground: 8 })
+ @available.init({ gov_bases: 2, french_police: 4, fln_bases: 7, fln_underground: 8 })
resettle 'Setif'
resettle 'Tlemcen'
resettle 'Bordj Bou Arreridj'
@@ -257,25 +257,25 @@ module ColonialTwilight
set_space 5, { french_police: 1 }
set_space 6, { french_police: 1 }, :support
set_space 7, { fln_underground: 1 }
- set_space 8, { french_troops: 4, algerian_police: 1, gov_base: 1 }
- set_space 9, { french_troops: 1, algerian_police: 1, gov_base: 1, fln_underground: 1, fln_base: 1 }, :oppose
- set_space 10, { french_police: 1, fln_underground: 1, fln_base: 1 }, :oppose
+ set_space 8, { french_troops: 4, algerian_police: 1, gov_bases: 1 }
+ set_space 9, { french_troops: 1, algerian_police: 1, gov_bases: 1, fln_underground: 1, fln_bases: 1 }, :oppose
+ set_space 10, { french_police: 1, fln_underground: 1, fln_bases: 1 }, :oppose
set_space 11, { french_police: 1 }
- set_space 12, { french_police: 1, fln_underground: 1, fln_base: 1 }, :oppose
+ set_space 12, { french_police: 1, fln_underground: 1, fln_bases: 1 }, :oppose
set_space 13, { french_troops: 4, algerian_troops: 1, french_police: 1 }, :support
- set_space 14, { algerian_troops: 1, gov_base: 1 }
- set_space 15, { french_police: 1, algerian_police: 1, fln_underground: 1, fln_base: 1 }, :oppose
+ set_space 14, { algerian_troops: 1, gov_bases: 1 }
+ set_space 15, { french_police: 1, algerian_police: 1, fln_underground: 1, fln_bases: 1 }, :oppose
set_space 16, { algerian_troops: 1, french_police: 1, algerian_police: 1 }, :support
set_space 17, { french_police: 1, algerian_police: 1 }
set_space 18, { french_police: 2, fln_underground: 1 }
- set_space 19, { french_police: 1, gov_base: 1 }
+ set_space 19, { french_police: 1, gov_bases: 1 }
set_space 20, { french_police: 1 }
set_space 22, { french_police: 1 }
set_space 23, { french_police: 1 }
set_space 24, { french_police: 1 }
set_space 27, {}, :oppose
- set_space 28, { fln_underground: 4, fln_base: 2 }
- set_space 29, { fln_underground: 5, fln_base: 2 }
+ set_space 28, { fln_underground: 4, fln_bases: 2 }
+ set_space 29, { fln_underground: 5, fln_bases: 2 }
spaces[28].independent!
spaces[29].independent!
end
diff --git a/lib/colonial_twilight/forces.rb b/lib/colonial_twilight/forces.rb
index 5e21931..f2b4149 100644
--- a/lib/colonial_twilight/forces.rb
+++ b/lib/colonial_twilight/forces.rb
@@ -103,15 +103,16 @@ module ColonialTwilight
end
def add(type, num = 1)
+ type = :fln_underground if name == :available && type == :fln_active
case type
when :french_troops then @french_troops += num
when :french_police then @french_police += num
when :algerian_troops then @algerian_troops += num
when :algerian_police then @algerian_police += num
when :fln_underground then @fln_underground += num
- when :fln_active then @fln_active.nil? ? @fln_underground += num : @fln_active += num
- when :gov_base then add_base(:gov_base, num)
- when :fln_base then add_base(:fln_base, num)
+ when :fln_active then @fln_active += num
+ when :gov_bases then add_base(type, num)
+ when :fln_bases then add_base(type, num)
else
raise "unknown force type : #{type}"
end
@@ -125,8 +126,8 @@ module ColonialTwilight
raise "too much bases in #{@name} (#{bases} + #{num}) > #{@max_bases}"
end
- @gov_bases += num if type == :gov_base
- @fln_bases += num if type == :fln_base
+ @gov_bases += num if type == :gov_bases
+ @fln_bases += num if type == :fln_bases
end
def update_control