share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/shadow.lua
changeset 14490 f37910a73c19
parent 14406 6c21bd8547dd
child 14491 f8c2b995c009
--- a/share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/shadow.lua	Thu Dec 20 19:03:34 2018 +0100
+++ b/share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/shadow.lua	Fri Dec 21 01:04:24 2018 +0100
@@ -94,6 +94,9 @@
 
 HogNames = {loc("Brainiac"), loc("Corpsemonger"), loc("Femur Lover"), loc("Glark"), loc("Bonely"), loc("Rot Molester"), loc("Bloodrocutor"), loc("Muscle Dissolver"), loc("Bloodsucker")}
 
+nativesTeamName = nil
+weaklingsTeamName = nil
+
 ---POSITIONS---
 
 cannibalPos = {{3108, 1127}, 
@@ -614,13 +617,13 @@
 end
 
 function AddHogs()
-	AddTeam(loc("Natives"), -2, "Bone", "Island", "HillBilly", "cm_birdy")
+  nativesTeamName = AddTeam(loc("Natives"), -2, "Bone", "Island", "HillBilly", "cm_birdy")
   ramon = AddHog(loc("Ramon"), 0, 100, "rasta")
 	leaks = AddHog(loc("Leaks A Lot"), 0, 100, "Rambo")
   dense = AddHog(loc("Dense Cloud"), 0, 100, "RobinHood")
   spiky = AddHog(loc("Spiky Cheese"), 0, 100, "hair_yellow")
 
-  AddTeam(loc("Weaklings"), -1, "skull", "Island", "Pirate","cm_vampire")
+  weaklingsTeamName = AddTeam(loc("Weaklings"), -1, "skull", "Island", "Pirate","cm_vampire")
   cannibals = {}
   cannibals[1] = AddHog(loc("Brainiac"), 5, 20, "Zombi")
 
@@ -794,7 +797,7 @@
   AddAnim(stronglingsAnim)
   AddFunction({func = AfterStronglingsAnim, args = {}})
   stage = interWeakStage
-  DismissTeam(loc("Weaklings"))
+  DismissTeam(weaklingsTeamName)
 end
 
 function CheckRefuse()
@@ -1003,7 +1006,7 @@
   end
   AddCaption(loc("...and so the cyborgs took over the world..."))
   stage = loseStage
-  DismissTeam(loc("Natives"))
+  DismissTeam(nativesTeamName)
 end
 
 function CheckDenseDead()
@@ -1088,9 +1091,9 @@
 end
 
 function onGearAdd(gear)
-  if GetGearType(gear) == gtGrenade and GetHogTeamName(CurrentHedgehog) == loc("Natives") then
+  if GetGearType(gear) == gtGrenade and GetHogTeamName(CurrentHedgehog) == nativesTeamName then
     grenadeUsed = true
-  elseif GetGearType(gear) == gtShotgunShot and GetHogTeamName(CurrentHedgehog) == loc("Natives") then
+  elseif GetGearType(gear) == gtShotgunShot and GetHogTeamName(CurrentHedgehog) == nativesTeamName then
     shotgunUsed = true
   end
 end