share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/family.lua
changeset 13473 bc5a086a91dc
parent 13169 6869d27a2f3f
child 13583 141cdfe0f3ca
equal deleted inserted replaced
13472:d3209e0caf12 13473:bc5a086a91dc
   434     RemoveEventFunc(CheckFriendsEscaped)
   434     RemoveEventFunc(CheckFriendsEscaped)
   435     RemoveEventFunc(CheckCloseToPrincess)
   435     RemoveEventFunc(CheckCloseToPrincess)
   436     RemoveEventFunc(CheckPrincessFreed)
   436     RemoveEventFunc(CheckPrincessFreed)
   437     AddCaption(loc("So the princess was never heard of again ..."))
   437     AddCaption(loc("So the princess was never heard of again ..."))
   438     DismissTeam(loc("Natives"))
   438     DismissTeam(loc("Natives"))
   439     DismissTeam(loc("011101001"))
   439     DismissTeam(loc("Princess"))
   440     EndTurn(true)
   440     EndTurn(true)
   441   end
   441   end
   442 end
   442 end
   443 
   443 
   444 function CheckOutOfCluster()
   444 function CheckOutOfCluster()
   517   AddAmmo(cyborgs[1], amAirAttack, 2)
   517   AddAmmo(cyborgs[1], amAirAttack, 2)
   518   AddAmmo(cyborgs[1], amDrillStrike, 1)
   518   AddAmmo(cyborgs[1], amDrillStrike, 1)
   519 end
   519 end
   520 
   520 
   521 function AddHogs()
   521 function AddHogs()
   522 	AddTeam(loc("Natives"), 29439, "Bone", "Island", "HillBilly", "cm_birdy")
   522   AddTeam(loc("Princess"), 0x0072FF, "Bone", "Island", "HillBilly", "cm_birdy")
       
   523   princess = AddHog(loc("Fell From Heaven"), 0, 333, "tiara")
       
   524   SetGearAIHints(princess, aihDoesntMatter)
       
   525   gearDead[princess] = false
       
   526 
       
   527   AddTeam(loc("Natives"), 0x0072FF, "Bone", "Island", "HillBilly", "cm_birdy")
   523   for i = 7, 9 do
   528   for i = 7, 9 do
   524     natives[i-6] = AddHog(nativeNames[i], 0, 100, nativeHats[i])
   529     natives[i-6] = AddHog(nativeNames[i], 0, 100, nativeHats[i])
   525     gearDead[natives[i-6]] = false
   530     gearDead[natives[i-6]] = false
   526   end
   531   end
   527 
   532 
   528   AddTeam(loc("011101001"), 14483456, "ring", "UFO", "Robot", "cm_binary")
   533   AddTeam(loc("011101001"), 0xDD0000, "ring", "UFO", "Robot", "cm_binary")
   529   cyborg = AddHog(loc("Unit 334a$7%;.*"), 0, 200, "cyborg1")
   534   cyborg = AddHog(loc("Unit 334a$7%;.*"), 0, 200, "cyborg1")
   530   princess = AddHog(loc("Fell From Heaven"), 0, 333, "tiara")
       
   531   gearDead[cyborg] = false
   535   gearDead[cyborg] = false
   532   gearDead[princess] = false
       
   533 
   536 
   534   AddTeam(loc("Biomechanic Team"), 14483456, "ring", "UFO", "Robot", "cm_cyborg")
   537   AddTeam(loc("Biomechanic Team"), 14483456, "ring", "UFO", "Robot", "cm_cyborg")
   535   for i = 1, cyborgsNum do
   538   for i = 1, cyborgsNum do
   536     cyborgs[i] = AddHog(cyborgNames[i], cyborgsDif[i], cyborgsHealth[i], "cyborg2")
   539     cyborgs[i] = AddHog(cyborgNames[i], cyborgsDif[i], cyborgsHealth[i], "cyborg2")
   537     gearDead[cyborgs[i]] = false
   540     gearDead[cyborgs[i]] = false
   568 
   571 
   569 -----------------------------Main Functions----------------------------
   572 -----------------------------Main Functions----------------------------
   570 
   573 
   571 function onGameInit()
   574 function onGameInit()
   572 	Seed = 0
   575 	Seed = 0
   573 	GameFlags = gfSolidLand + gfDisableLandObjects + gfDisableGirders
   576 	-- Using gfTagTeam makes it far easier to skip the Princess team
       
   577 	GameFlags = gfSolidLand + gfDisableLandObjects + gfDisableGirders + gfTagTeam
   574 	TurnTime = 60000 
   578 	TurnTime = 60000 
   575 	CaseFreq = 0
   579 	CaseFreq = 0
   576 	MinesNum = 0
   580 	MinesNum = 0
   577 	MinesTime = 3000
   581 	MinesTime = 3000
   578 	Explosives = 0
   582 	Explosives = 0
   633 function onNewTurn()
   637 function onNewTurn()
   634   if AnimInProgress() then
   638   if AnimInProgress() then
   635     TurnTimeLeft = -1
   639     TurnTimeLeft = -1
   636     return
   640     return
   637   end
   641   end
   638   if GetHogTeamName(CurrentHedgehog) == loc("011101001") then
   642   if CurrentHedgehog == cyborg then
   639     if CheckCyborgsDead() ~= true then
   643     if CheckCyborgsDead() ~= true then
   640       for i = 1, 3 do
   644       for i = 1, 3 do
   641         if gearDead[natives[i]] ~= true then
   645         if gearDead[natives[i]] ~= true then
   642           HideHedge(natives[i])
   646           HideHedge(natives[i])
   643         end
   647         end
   644       end
   648       end
   645     end
   649     end
   646     EndTurn(true)
   650     EndTurn(true)
       
   651   elseif CurrentHedgehog == princess then
       
   652     -- Princess is passive
       
   653     EndTurn(true)
   647   else
   654   else
   648     for i = 1, 3 do
   655     for i = 1, 3 do
   649       if gearDead[natives[i]] ~= true then
   656       if gearDead[natives[i]] ~= true then
   650         RestoreHedge(natives[i])
   657         RestoreHedge(natives[i])
   651       end
   658       end