share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/desert02.lua
changeset 12575 0c5ce463949b
parent 12539 19192a3cb674
child 12586 7510fe66bfbb
equal deleted inserted replaced
12574:2a7cc304c8be 12575:0c5ce463949b
    90 
    90 
    91 function onGameStart()
    91 function onGameStart()
    92 	AnimWait(hero.gear, 3000)
    92 	AnimWait(hero.gear, 3000)
    93 	FollowGear(hero.gear)
    93 	FollowGear(hero.gear)
    94 
    94 
       
    95 	ShowMission(unpack(goals[dialog01]))
       
    96 	HideMission()
       
    97 
    95 	AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0)
    98 	AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0)
    96 	AddEvent(onHeroSafe, {hero.gear}, heroSafe, {hero.gear}, 0)
    99 	AddEvent(onHeroSafe, {hero.gear}, heroSafe, {hero.gear}, 0)
    97 
   100 
    98 	SpawnHealthCrate(healthX, health1Y)
   101 	SpawnHealthCrate(healthX, health1Y)
    99 	SpawnHealthCrate(healthX, health2Y)
   102 	SpawnHealthCrate(healthX, health2Y)
   111 	if ShowAnimation() == false then
   114 	if ShowAnimation() == false then
   112 		return
   115 		return
   113 	end
   116 	end
   114 	ExecuteAfterAnimations()
   117 	ExecuteAfterAnimations()
   115 	CheckEvents()
   118 	CheckEvents()
       
   119 end
       
   120 
       
   121 function onGearAdd(gear)
       
   122 	if GetGearType(gear) == gtRope then
       
   123 		HideMission()
       
   124 	end
   116 end
   125 end
   117 
   126 
   118 function onGearDelete(gear)
   127 function onGearDelete(gear)
   119 	if gear == hero.gear then
   128 	if gear == hero.gear then
   120 		hero.dead = true
   129 		hero.dead = true
   177 -------------- ANIMATIONS ------------------
   186 -------------- ANIMATIONS ------------------
   178 
   187 
   179 function Skipanim(anim)
   188 function Skipanim(anim)
   180 	if goals[anim] ~= nil then
   189 	if goals[anim] ~= nil then
   181 		ShowMission(unpack(goals[anim]))
   190 		ShowMission(unpack(goals[anim]))
   182     end
   191 	end
   183 	challengeStart()
   192 	challengeStart()
   184 end
   193 end
   185 
   194 
   186 function AnimationSetup()
   195 function AnimationSetup()
   187 	-- DIALOG 01 - Start
   196 	-- DIALOG 01 - Start
   189 	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 3000}})
   198 	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 3000}})
   190 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Many meters below the surface ..."), 5000}})
   199 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Many meters below the surface ..."), 5000}})
   191 	table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("The tunnel is about to get flooded!"), SAY_THINK, 4000}})
   200 	table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("The tunnel is about to get flooded!"), SAY_THINK, 4000}})
   192 	table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("I have to reach the surface as quickly as I can."), SAY_THINK, 4000}})
   201 	table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("I have to reach the surface as quickly as I can."), SAY_THINK, 4000}})
   193 	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 500}})
   202 	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 500}})
       
   203 	table.insert(dialog01, {func = ShowMission, args = goals[dialog01]})
   194 	table.insert(dialog01, {func = challengeStart, args = {hero.gear}})
   204 	table.insert(dialog01, {func = challengeStart, args = {hero.gear}})
   195 end
   205 end
   196 
   206 
   197 ------------------ Other Functions -------------------
   207 ------------------ Other Functions -------------------
   198 
   208