share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/ice02.lua
changeset 12575 0c5ce463949b
parent 12571 903a30fb49e6
child 12577 e2b5c6e805e8
equal deleted inserted replaced
12574:2a7cc304c8be 12575:0c5ce463949b
    25 	loc("Use the attack key twice to change the flying saucer while floating in mid-air.")
    25 	loc("Use the attack key twice to change the flying saucer while floating in mid-air.")
    26 -- dialogs
    26 -- dialogs
    27 local dialog01 = {}
    27 local dialog01 = {}
    28 -- mission objectives
    28 -- mission objectives
    29 local goals = {
    29 local goals = {
    30 	[dialog01] = {missionName, loc("Getting ready"), challengeObjectives, 1, 4500},
    30 	["init"] = {missionName, loc("Getting ready"), challengeObjectives, 1, 30000},
    31 }
    31 }
    32 -- hogs
    32 -- hogs
    33 local hero = {}
    33 local hero = {}
    34 local ally = {}
    34 local ally = {}
    35 -- teams
    35 -- teams
   100 end
   100 end
   101 
   101 
   102 function onGameStart()
   102 function onGameStart()
   103 	AnimWait(hero.gear, 3000)
   103 	AnimWait(hero.gear, 3000)
   104 	FollowGear(hero.gear)
   104 	FollowGear(hero.gear)
   105 	ShowMission(missionName, loc("Challenge objectives"), challengeObjectives, -amSkip, 0)
   105 	ShowMission(unpack(goals["init"]))
   106 
   106 
   107 	AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0)
   107 	AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0)
   108 
   108 
   109 	AddAmmo(hero.gear, amJetpack, 3)
   109 	AddAmmo(hero.gear, amJetpack, 3)
   110 
   110 
   173 	if gear == hero.gear then
   173 	if gear == hero.gear then
   174 		hero.dead = true
   174 		hero.dead = true
   175 	end
   175 	end
   176 end
   176 end
   177 
   177 
       
   178 function onGearAdd(gear)
       
   179 	if GetGearType(gear) == gtJetpack then
       
   180 		HideMission()
       
   181 	end
       
   182 end
       
   183 
   178 function onPrecise()
   184 function onPrecise()
   179 	if GameTime > 3000 then
   185 	if GameTime > 3000 then
   180 		SetAnimSkip(true)
   186 		SetAnimSkip(true)
   181 	end
   187 	end
   182 end
   188 end
   197 end
   203 end
   198 
   204 
   199 -------------- ANIMATIONS ------------------
   205 -------------- ANIMATIONS ------------------
   200 
   206 
   201 function Skipanim(anim)
   207 function Skipanim(anim)
   202 	if goals[anim] ~= nil then
   208 	startFlying()
   203 		ShowMission(unpack(goals[anim]))
       
   204     end
       
   205     startFlying()
       
   206 end
   209 end
   207 
   210 
   208 function AnimationSetup()
   211 function AnimationSetup()
   209 	-- DIALOG 01 - Start, some story telling
   212 	-- DIALOG 01 - Start, some story telling
   210 	AddSkipFunction(dialog01, Skipanim, {dialog01})
   213 	AddSkipFunction(dialog01, Skipanim, {dialog01})