share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/family.lua
changeset 14485 f37910a73c19
parent 14401 6c21bd8547dd
child 14486 f8c2b995c009
equal deleted inserted replaced
14484:764ba6182389 14485:f37910a73c19
   102 cyborgsNum = 6
   102 cyborgsNum = 6
   103 cyborgsPos = {{2243, 1043}, {3588, 1227}, {2781, 1388},
   103 cyborgsPos = {{2243, 1043}, {3588, 1227}, {2781, 1388},
   104               {3749, 1040}, {2475, 1338}, {3853, 881}}
   104               {3749, 1040}, {2475, 1338}, {3853, 881}}
   105 cyborgsDir = {"Left", "Left", "Left", "Left", "Left", "Right"}
   105 cyborgsDir = {"Left", "Left", "Left", "Left", "Left", "Right"}
   106 
   106 
       
   107 princessTeamName = nil
       
   108 nativesTeamName = nil
       
   109 biomechanicTeamName = nil
       
   110 cyborgTeamName = nil
       
   111 
   107 princessPos = {3737, 1181}
   112 princessPos = {3737, 1181}
   108 crateConsts = {}
   113 crateConsts = {}
   109 reactions = {}
   114 reactions = {}
   110 
   115 
   111 nativeMidPos = {1991, 841}
   116 nativeMidPos = {1991, 841}
   377   if not princessFreed then
   382   if not princessFreed then
   378     if progress and progress<7 then
   383     if progress and progress<7 then
   379       SaveCampaignVar("Progress", "7")
   384       SaveCampaignVar("Progress", "7")
   380     end
   385     end
   381     princessFreed = true
   386     princessFreed = true
   382     DismissTeam(loc("011101001"))
   387     DismissTeam(cyborgTeamName)
   383     EndTurn(true)
   388     EndTurn(true)
   384   end
   389   end
   385 end
   390 end
   386 
   391 
   387 function CheckCyborgsDead()
   392 function CheckCyborgsDead()
   433   if not princessFreed then
   438   if not princessFreed then
   434     RemoveEventFunc(CheckFriendsEscaped)
   439     RemoveEventFunc(CheckFriendsEscaped)
   435     RemoveEventFunc(CheckCloseToPrincess)
   440     RemoveEventFunc(CheckCloseToPrincess)
   436     RemoveEventFunc(CheckPrincessFreed)
   441     RemoveEventFunc(CheckPrincessFreed)
   437     AddCaption(loc("So the princess was never heard of again ..."))
   442     AddCaption(loc("So the princess was never heard of again ..."))
   438     DismissTeam(loc("Natives"))
   443     DismissTeam(nativesTeamName)
   439     DismissTeam(loc("Princess"))
   444     DismissTeam(princessTeamName)
   440     EndTurn(true)
   445     EndTurn(true)
   441   end
   446   end
   442 end
   447 end
   443 
   448 
   444 function CheckOutOfCluster()
   449 function CheckOutOfCluster()
   517   AddAmmo(cyborgs[1], amAirAttack, 2)
   522   AddAmmo(cyborgs[1], amAirAttack, 2)
   518   AddAmmo(cyborgs[1], amDrillStrike, 1)
   523   AddAmmo(cyborgs[1], amDrillStrike, 1)
   519 end
   524 end
   520 
   525 
   521 function AddHogs()
   526 function AddHogs()
   522   AddTeam(loc("Princess"), -2, "Bone", "Island", "HillBilly", "cm_birdy")
   527   princessTeamName = AddTeam(loc("Princess"), -2, "Bone", "Island", "HillBilly", "cm_birdy")
   523   princess = AddHog(loc("Fell From Heaven"), 0, 333, "tiara")
   528   princess = AddHog(loc("Fell From Heaven"), 0, 333, "tiara")
   524   SetGearAIHints(princess, aihDoesntMatter)
   529   SetGearAIHints(princess, aihDoesntMatter)
   525   gearDead[princess] = false
   530   gearDead[princess] = false
   526 
   531 
   527   AddTeam(loc("Natives"), -2, "Bone", "Island", "HillBilly", "cm_birdy")
   532   nativesTeamName = AddTeam(loc("Natives"), -2, "Bone", "Island", "HillBilly", "cm_birdy")
   528   for i = 7, 9 do
   533   for i = 7, 9 do
   529     natives[i-6] = AddHog(nativeNames[i], 0, 100, nativeHats[i])
   534     natives[i-6] = AddHog(nativeNames[i], 0, 100, nativeHats[i])
   530     gearDead[natives[i-6]] = false
   535     gearDead[natives[i-6]] = false
   531   end
   536   end
   532 
   537 
   533   AddTeam(loc("011101001"), -1, "ring", "UFO", "Robot", "cm_binary")
   538   cyborgTeamName = AddTeam(loc("011101001"), -1, "ring", "UFO", "Robot", "cm_binary")
   534   cyborg = AddHog(loc("Unit 334a$7%;.*"), 0, 200, "cyborg1")
   539   cyborg = AddHog(loc("Unit 334a$7%;.*"), 0, 200, "cyborg1")
   535   gearDead[cyborg] = false
   540   gearDead[cyborg] = false
   536 
   541 
   537   AddTeam(loc("Biomechanic Team"), -1, "ring", "UFO", "Robot", "cm_cyborg")
   542   biomechanicTeamName = AddTeam(loc("Biomechanic Team"), -1, "ring", "UFO", "Robot", "cm_cyborg")
   538   for i = 1, cyborgsNum do
   543   for i = 1, cyborgsNum do
   539     cyborgs[i] = AddHog(cyborgNames[i], cyborgsDif[i], cyborgsHealth[i], "cyborg2")
   544     cyborgs[i] = AddHog(cyborgNames[i], cyborgsDif[i], cyborgsHealth[i], "cyborg2")
   540     gearDead[cyborgs[i]] = false
   545     gearDead[cyborgs[i]] = false
   541   end
   546   end
   542   cyborgsLeft = cyborgsNum
   547   cyborgsLeft = cyborgsNum
   611 end
   616 end
   612 
   617 
   613 function onGearDelete(gear)
   618 function onGearDelete(gear)
   614   gearDead[gear] = true
   619   gearDead[gear] = true
   615   if GetGearType(gear) == gtHedgehog then
   620   if GetGearType(gear) == gtHedgehog then
   616     if GetHogTeamName(gear) == loc("Biomechanic Team") then
   621     if GetHogTeamName(gear) == biomechanicTeamName then
   617       cyborgsLeft = cyborgsLeft - 1
   622       cyborgsLeft = cyborgsLeft - 1
   618     end
   623     end
   619   end
   624   end
   620 end
   625 end
   621 
   626