summaryrefslogtreecommitdiffstats
path: root/lib/colonial_twilight/forces.rb
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/forces.rb
parent3011fbf0561570c0962e169a2d62d327edf19771 (diff)
downloadcolonial-twilight-d2a82f70866631968c570275d424336a3034dc09.zip
colonial-twilight-d2a82f70866631968c570275d424336a3034dc09.tar.gz
Forces _base -> _bases
Diffstat (limited to 'lib/colonial_twilight/forces.rb')
-rw-r--r--lib/colonial_twilight/forces.rb11
1 files changed, 6 insertions, 5 deletions
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