share/hedgewars/Data/Missions/Campaign/A Classic Fairytale/family.lua
changeset 7520 dd0b68bbe456
parent 7512 cc3f036121fe
child 7675 58620e9e5ed5
equal deleted inserted replaced
7518:70babd9073a2 7520:dd0b68bbe456
   106   if dir == "Left" then
   106   if dir == "Left" then
   107     dif = 10
   107     dif = 10
   108   else
   108   else
   109     dif = -10
   109     dif = -10
   110   end
   110   end
   111   AnimInsertStepNext({func = AnimVisualGear, args = {native, GetX(native) + dif, GetY(native) + dif, vgtSteam, 0, true}, swh = false})
   111   AnimInsertStepNext({func = AnimVisualGear, args = {natives[1], GetX(natives[1]) + dif, GetY(natives[1]) + dif, vgtSteam, 0, true}, swh = false})
   112   AnimInsertStepNext({func = AnimVisualGear, args = {native, GetX(native) + dif, GetY(native) + dif, vgtSteam, 0, true}, swh = false})
   112   AnimInsertStepNext({func = AnimVisualGear, args = {natives[1], GetX(natives[1]) + dif, GetY(natives[1]) + dif, vgtSteam, 0, true}, swh = false})
   113   AnimInsertStepNext({func = AnimVisualGear, args = {native, GetX(native) + dif, GetY(native) + dif, vgtSteam, 0, true}, swh = false})
   113   AnimInsertStepNext({func = AnimVisualGear, args = {natives[1], GetX(natives[1]) + dif, GetY(natives[1]) + dif, vgtSteam, 0, true}, swh = false})
   114   AnimInsertStepNext({func = AnimWait, args = {native, 800}})
   114   AnimInsertStepNext({func = AnimWait, args = {natives[1], 800}})
   115   AnimInsertStepNext({func = AnimVisualGear, args = {native, GetX(native) + dif, GetY(native) + dif, vgtSteam, 0, true}, swh = false})
   115   AnimInsertStepNext({func = AnimVisualGear, args = {natives[1], GetX(natives[1]) + dif, GetY(natives[1]) + dif, vgtSteam, 0, true}, swh = false})
   116   AnimInsertStepNext({func = AnimVisualGear, args = {native, GetX(native) + dif, GetY(native) + dif, vgtSteam, 0, true}, swh = false})
   116   AnimInsertStepNext({func = AnimVisualGear, args = {natives[1], GetX(natives[1]) + dif, GetY(natives[1]) + dif, vgtSteam, 0, true}, swh = false})
   117   AnimInsertStepNext({func = AnimWait, args = {native, 800}})
   117   AnimInsertStepNext({func = AnimWait, args = {natives[1], 800}})
   118   AnimInsertStepNext({func = AnimVisualGear, args = {native, GetX(native) + dif, GetY(native) + dif, vgtSteam, 0, true}, swh = false})
   118   AnimInsertStepNext({func = AnimVisualGear, args = {natives[1], GetX(natives[1]) + dif, GetY(natives[1]) + dif, vgtSteam, 0, true}, swh = false})
   119 end
   119 end
   120 
   120 
   121 function AnimationSetup()
   121 function AnimationSetup()
   122   table.insert(startAnim, {func = AnimWait, args = {natives[1], 4000}})
   122   table.insert(startAnim, {func = AnimWait, args = {natives[1], 4000}})
   123   table.insert(startAnim, {func = AnimMove, args = {natives[1], "Right", unpack(nativePos2)}})
   123   table.insert(startAnim, {func = AnimMove, args = {natives[1], "Right", unpack(nativePos2)}})
   273 	SpawnUtilityCrate(530, 1747, amPortalGun, 1)
   273 	SpawnUtilityCrate(530, 1747, amPortalGun, 1)
   274 end
   274 end
   275 
   275 
   276 -----------------------------Events------------------------------------
   276 -----------------------------Events------------------------------------
   277 function CheckPrincessFreed()
   277 function CheckPrincessFreed()
   278   return math.abs(GetX(natives[1]) - GetX(princess)) <= 10 and math.abs(GetY(natives[1]) - GetY(princess)) <= 10 and StoppedGear(natives[1]) 
   278   return math.abs(GetX(natives[1]) - GetX(princess)) <= 15 and math.abs(GetY(natives[1]) - GetY(princess)) <= 15 and StoppedGear(natives[1]) 
   279         and GetY(natives[2]) < 1500 and GetY(natives[3]) < 1500 and StoppedGear(natives[2]) and StoppedGear(natives[3])
   279         and GetY(natives[2]) < 1500 and GetY(natives[3]) < 1500 and StoppedGear(natives[2]) and StoppedGear(natives[3])
   280 end
   280 end
   281 
   281 
   282 function DoPrincessFreed()
   282 function DoPrincessFreed()
   283   AnimSay(princess, loc("Thank you, my hero!"), SAY_SAY, 0)
   283   AnimSay(princess, loc("Thank you, my hero!"), SAY_SAY, 0)