share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/shadow.lua
changeset 14490 f37910a73c19
parent 14406 6c21bd8547dd
child 14491 f8c2b995c009
equal deleted inserted replaced
14489:764ba6182389 14490:f37910a73c19
    91 choiceAccept = 1
    91 choiceAccept = 1
    92 choiceRefuse = 2
    92 choiceRefuse = 2
    93 choiceAttack = 3
    93 choiceAttack = 3
    94 
    94 
    95 HogNames = {loc("Brainiac"), loc("Corpsemonger"), loc("Femur Lover"), loc("Glark"), loc("Bonely"), loc("Rot Molester"), loc("Bloodrocutor"), loc("Muscle Dissolver"), loc("Bloodsucker")}
    95 HogNames = {loc("Brainiac"), loc("Corpsemonger"), loc("Femur Lover"), loc("Glark"), loc("Bonely"), loc("Rot Molester"), loc("Bloodrocutor"), loc("Muscle Dissolver"), loc("Bloodsucker")}
       
    96 
       
    97 nativesTeamName = nil
       
    98 weaklingsTeamName = nil
    96 
    99 
    97 ---POSITIONS---
   100 ---POSITIONS---
    98 
   101 
    99 cannibalPos = {{3108, 1127}, 
   102 cannibalPos = {{3108, 1127}, 
   100                {2559, 1080}, {3598, 1270}, {3293, 1177}, {2623, 1336}, 
   103                {2559, 1080}, {3598, 1270}, {3293, 1177}, {2623, 1336}, 
   612   SetGearMessage(ramon, 0)
   615   SetGearMessage(ramon, 0)
   613   SetGearMessage(spiky, 0)
   616   SetGearMessage(spiky, 0)
   614 end
   617 end
   615 
   618 
   616 function AddHogs()
   619 function AddHogs()
   617 	AddTeam(loc("Natives"), -2, "Bone", "Island", "HillBilly", "cm_birdy")
   620   nativesTeamName = AddTeam(loc("Natives"), -2, "Bone", "Island", "HillBilly", "cm_birdy")
   618   ramon = AddHog(loc("Ramon"), 0, 100, "rasta")
   621   ramon = AddHog(loc("Ramon"), 0, 100, "rasta")
   619 	leaks = AddHog(loc("Leaks A Lot"), 0, 100, "Rambo")
   622 	leaks = AddHog(loc("Leaks A Lot"), 0, 100, "Rambo")
   620   dense = AddHog(loc("Dense Cloud"), 0, 100, "RobinHood")
   623   dense = AddHog(loc("Dense Cloud"), 0, 100, "RobinHood")
   621   spiky = AddHog(loc("Spiky Cheese"), 0, 100, "hair_yellow")
   624   spiky = AddHog(loc("Spiky Cheese"), 0, 100, "hair_yellow")
   622 
   625 
   623   AddTeam(loc("Weaklings"), -1, "skull", "Island", "Pirate","cm_vampire")
   626   weaklingsTeamName = AddTeam(loc("Weaklings"), -1, "skull", "Island", "Pirate","cm_vampire")
   624   cannibals = {}
   627   cannibals = {}
   625   cannibals[1] = AddHog(loc("Brainiac"), 5, 20, "Zombi")
   628   cannibals[1] = AddHog(loc("Brainiac"), 5, 20, "Zombi")
   626 
   629 
   627   for i = 2, 5 do
   630   for i = 2, 5 do
   628     cannibals[i] = AddHog(HogNames[i], 5, 20, "Zombi")
   631     cannibals[i] = AddHog(HogNames[i], 5, 20, "Zombi")
   792   end
   795   end
   793   SetGearMessage(CurrentHedgehog, 0)
   796   SetGearMessage(CurrentHedgehog, 0)
   794   AddAnim(stronglingsAnim)
   797   AddAnim(stronglingsAnim)
   795   AddFunction({func = AfterStronglingsAnim, args = {}})
   798   AddFunction({func = AfterStronglingsAnim, args = {}})
   796   stage = interWeakStage
   799   stage = interWeakStage
   797   DismissTeam(loc("Weaklings"))
   800   DismissTeam(weaklingsTeamName)
   798 end
   801 end
   799 
   802 
   800 function CheckRefuse()
   803 function CheckRefuse()
   801   return GetX(dense) > 1400 and StoppedGear(dense)
   804   return GetX(dense) > 1400 and StoppedGear(dense)
   802 end
   805 end
  1001   if stage == loseStage then
  1004   if stage == loseStage then
  1002     return
  1005     return
  1003   end
  1006   end
  1004   AddCaption(loc("...and so the cyborgs took over the world..."))
  1007   AddCaption(loc("...and so the cyborgs took over the world..."))
  1005   stage = loseStage
  1008   stage = loseStage
  1006   DismissTeam(loc("Natives"))
  1009   DismissTeam(nativesTeamName)
  1007 end
  1010 end
  1008 
  1011 
  1009 function CheckDenseDead()
  1012 function CheckDenseDead()
  1010   return denseDead and choice ~= choiceAttack 
  1013   return denseDead and choice ~= choiceAttack 
  1011 end
  1014 end
  1086     end
  1089     end
  1087   end
  1090   end
  1088 end
  1091 end
  1089 
  1092 
  1090 function onGearAdd(gear)
  1093 function onGearAdd(gear)
  1091   if GetGearType(gear) == gtGrenade and GetHogTeamName(CurrentHedgehog) == loc("Natives") then
  1094   if GetGearType(gear) == gtGrenade and GetHogTeamName(CurrentHedgehog) == nativesTeamName then
  1092     grenadeUsed = true
  1095     grenadeUsed = true
  1093   elseif GetGearType(gear) == gtShotgunShot and GetHogTeamName(CurrentHedgehog) == loc("Natives") then
  1096   elseif GetGearType(gear) == gtShotgunShot and GetHogTeamName(CurrentHedgehog) == nativesTeamName then
  1094     shotgunUsed = true
  1097     shotgunUsed = true
  1095   end
  1098   end
  1096 end
  1099 end
  1097 
  1100 
  1098 function onAmmoStoreInit()
  1101 function onAmmoStoreInit()