share/hedgewars/Data/Missions/Campaign/A_Classic_Fairytale/backstab.lua
changeset 12361 05fe955e2763
parent 12263 2c8e7e73ef58
child 12364 5857936921ec
equal deleted inserted replaced
12360:a775a61e02ab 12361:05fe955e2763
    68 
    68 
    69 speakerHog = nil
    69 speakerHog = nil
    70 spyHog = nil
    70 spyHog = nil
    71 deployedHog = nil
    71 deployedHog = nil
    72 deployedDead = false
    72 deployedDead = false
       
    73 nativesTeleported = false
       
    74 nativesIsolated = false
       
    75 hogDeployed = false
    73 
    76 
    74 cyborgHidden = false
    77 cyborgHidden = false
    75 needToAct = 0
    78 needToAct = 0
    76 
    79 
    77 m2Choice = 0
    80 m2Choice = 0
   393   end
   396   end
   394   AddSkipFunction(wave2DeadAnim, SkipWave2DeadAnim, {})
   397   AddSkipFunction(wave2DeadAnim, SkipWave2DeadAnim, {})
   395 end
   398 end
   396 
   399 
   397 function IsolateNatives()
   400 function IsolateNatives()
   398   PlaceGirder(710, 299, 6)
   401   if not nativesIsolated then
   399   PlaceGirder(690, 299, 6)
   402     PlaceGirder(710, 299, 6)
   400   PlaceGirder(761, 209, 4)
   403     PlaceGirder(690, 299, 6)
   401   PlaceGirder(921, 209, 4)
   404     PlaceGirder(761, 209, 4)
   402   PlaceGirder(1081, 209, 4)
   405     PlaceGirder(921, 209, 4)
   403   PlaceGirder(761, 189, 4)
   406     PlaceGirder(1081, 209, 4)
   404   PlaceGirder(921, 189, 4)
   407     PlaceGirder(761, 189, 4)
   405   PlaceGirder(1081, 189, 4)
   408     PlaceGirder(921, 189, 4)
   406   PlaceGirder(761, 169, 4)
   409     PlaceGirder(1081, 189, 4)
   407   PlaceGirder(921, 169, 4)
   410     PlaceGirder(761, 169, 4)
   408   PlaceGirder(1081, 169, 4)
   411     PlaceGirder(921, 169, 4)
   409   PlaceGirder(761, 149, 4)
   412     PlaceGirder(1081, 169, 4)
   410   PlaceGirder(921, 149, 4)
   413     PlaceGirder(761, 149, 4)
   411   PlaceGirder(1081, 149, 4)
   414     PlaceGirder(921, 149, 4)
   412   PlaceGirder(761, 129, 4)
   415     PlaceGirder(1081, 149, 4)
   413   PlaceGirder(921, 129, 4)
   416     PlaceGirder(761, 129, 4)
   414   PlaceGirder(1081, 129, 4)
   417     PlaceGirder(921, 129, 4)
   415   PlaceGirder(1120, 261, 2)
   418     PlaceGirder(1081, 129, 4)
   416   PlaceGirder(1140, 261, 2)
   419     PlaceGirder(1120, 261, 2)
   417   PlaceGirder(1160, 261, 2)
   420     PlaceGirder(1140, 261, 2)
   418   AddAmmo(deployedHog, amDEagle, 0)
   421     PlaceGirder(1160, 261, 2)
   419   AddAmmo(deployedHog, amFirePunch, 0)
   422     AddAmmo(deployedHog, amDEagle, 0)
       
   423     AddAmmo(deployedHog, amFirePunch, 0)
       
   424     nativesIsolated = true
       
   425   end
   420 end
   426 end
   421 
   427 
   422 function PutCGI()
   428 function PutCGI()
   423   AddVisualGear(710, 299, vgtExplosion, 0, true)
   429   AddVisualGear(710, 299, vgtExplosion, 0, true)
   424   AddVisualGear(690, 299, vgtExplosion, 0, true)
   430   AddVisualGear(690, 299, vgtExplosion, 0, true)
   441   AddVisualGear(1140, 261, vgtExplosion, 0, true)
   447   AddVisualGear(1140, 261, vgtExplosion, 0, true)
   442   AddVisualGear(1160, 261, vgtExplosion, 0, true)
   448   AddVisualGear(1160, 261, vgtExplosion, 0, true)
   443 end
   449 end
   444 
   450 
   445 function TeleportNatives()
   451 function TeleportNatives()
   446   nativePos[waterNum] = {1100, 288}
   452   if not nativesTeleported then
   447   for i = 1, 7 do
   453      nativePos[waterNum] = {1100, 288}
   448     if nativeDead[i] ~= true then 
   454      for i = 1, 7 do
   449       AnimTeleportGear(natives[i], unpack(nativePos[i]))
   455        if nativeDead[i] ~= true then 
   450     end
   456          AnimTeleportGear(natives[i], unpack(nativePos[i]))
       
   457        end
       
   458      end
       
   459      nativesTeleported = true
   451   end
   460   end
   452 end
   461 end
   453 
   462 
   454 function TurnNatives(hog)
   463 function TurnNatives(hog)
   455   for i = 1, 7 do
   464   for i = 1, 7 do
   462     end
   471     end
   463   end
   472   end
   464 end
   473 end
   465 
   474 
   466 function DeployHog()
   475 function DeployHog()
   467   AnimSwitchHog(deployedHog)
   476   if not hogDeployed then
   468   AnimTeleportGear(deployedHog, unpack(deployedPos))
   477      AnimSwitchHog(deployedHog)
   469   if deployedHog ~= natives[wiseNum] then
   478      AnimTeleportGear(deployedHog, unpack(deployedPos))
   470     AnimSay(deployedHog, loc("Why me?!"), SAY_THINK, 2000)
   479      if deployedHog ~= natives[wiseNum] then
       
   480         AnimSay(deployedHog, loc("Why me?!"), SAY_THINK, 2000)
       
   481      end
       
   482      hogDeployed = true
   471   end
   483   end
   472 end
   484 end
   473 
   485 
   474 function SetupAfterChoiceAnim()
   486 function SetupAfterChoiceAnim()
   475   for i = 7, 1, -1 do
   487   for i = 7, 1, -1 do
   544   TurnTimeLeft = TurnTime
   556   TurnTimeLeft = TurnTime
   545 end
   557 end
   546 
   558 
   547 function SkipWave2DeadAnim()
   559 function SkipWave2DeadAnim()
   548   TeleportNatives()
   560   TeleportNatives()
       
   561   PutCircles()
       
   562   DeployHog()
   549   IsolateNatives()
   563   IsolateNatives()
   550   DeployHog()
       
   551   HideCyborg()
   564   HideCyborg()
   552   PutCircles()
       
   553 end
   565 end
   554 
   566 
   555 function SpawnPlatformCrates()
   567 function SpawnPlatformCrates()
   556   SpawnAmmoCrate(2494, 1262, amMine)
   568   SpawnAmmoCrate(2494, 1262, amMine)
   557   SpawnAmmoCrate(2574, 1279, amSMine)
   569   SpawnAmmoCrate(2574, 1279, amSMine)
   840   end
   852   end
   841 end
   853 end
   842 
   854 
   843 function SetupPlace()
   855 function SetupPlace()
   844   startNativesNum = nativesNum
   856   startNativesNum = nativesNum
   845   HideHog(cyborg)
   857   HideCyborg()
   846   cyborgHidden = true
       
   847   for i = 1, 9 do
   858   for i = 1, 9 do
   848     HideHog(cannibals[i])
   859     HideHog(cannibals[i])
   849     cannibalHidden[i] = true
   860     cannibalHidden[i] = true
   850   end
   861   end
   851   if m4LeaksDead == 1 then
   862   if m4LeaksDead == 1 then