share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/desert03.lua
changeset 12575 0c5ce463949b
parent 12564 6a8c90a53249
child 12577 e2b5c6e805e8
equal deleted inserted replaced
12574:2a7cc304c8be 12575:0c5ce463949b
    16 local currentTarget = 1
    16 local currentTarget = 1
    17 -- dialogs
    17 -- dialogs
    18 local dialog01 = {}
    18 local dialog01 = {}
    19 -- mission objectives
    19 -- mission objectives
    20 local goals = {
    20 local goals = {
    21 	[dialog01] = {missionName, loc("Challenge objectives"), challengeObjectives, 1, 4500},
    21 	["init"] = {missionName, loc("Challenge objectives"), challengeObjectives, 1, 60000},
    22 }
    22 }
    23 -- hogs
    23 -- hogs
    24 local hero = {
    24 local hero = {
    25 	name = loc("Hog Solo"),
    25 	name = loc("Hog Solo"),
    26 	x = 100,
    26 	x = 100,
    84 end
    84 end
    85 
    85 
    86 function onGameStart()
    86 function onGameStart()
    87 	AnimWait(hero.gear, 3000)
    87 	AnimWait(hero.gear, 3000)
    88 	FollowGear(hero.gear)
    88 	FollowGear(hero.gear)
    89 	ShowMission(missionName, loc("Challenge objectives"), challengeObjectives, -amSkip, 0)
    89 	ShowMission(unpack(goals["init"]))
    90 
    90 
    91 	AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0)
    91 	AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0)
    92 	AddEvent(onLose, {hero.gear}, lose, {hero.gear}, 0)
    92 	AddEvent(onLose, {hero.gear}, lose, {hero.gear}, 0)
    93 
    93 
    94 	-- original crates and targets
    94 	-- original crates and targets
   128 
   128 
   129 function onGearAdd(gear)
   129 function onGearAdd(gear)
   130 	if GetGearType(gear) == gtFlame then
   130 	if GetGearType(gear) == gtFlame then
   131 		flameCounter = flameCounter + 1
   131 		flameCounter = flameCounter + 1
   132 	end
   132 	end
       
   133 	if GetGearType(gear) == gtRCPlane then
       
   134 		HideMission()
       
   135 	end
   133 end
   136 end
   134 
   137 
   135 function onGearDelete(gear)
   138 function onGearDelete(gear)
   136 	if GetGearType(gear) == gtFlame then
   139 	if GetGearType(gear) == gtFlame then
   137 		flameCounter = flameCounter - 1
   140 		flameCounter = flameCounter - 1
   172 	gameOver()
   175 	gameOver()
   173 end
   176 end
   174 
   177 
   175 -------------- ANIMATIONS ------------------
   178 -------------- ANIMATIONS ------------------
   176 
   179 
   177 function Skipanim(anim)
       
   178 	if goals[anim] ~= nil then
       
   179 		ShowMission(unpack(goals[anim]))
       
   180     end
       
   181 end
       
   182 
       
   183 function AnimationSetup()
   180 function AnimationSetup()
   184 	-- DIALOG 01 - Start, game instructions
   181 	-- DIALOG 01 - Start, game instructions
   185 	AddSkipFunction(dialog01, Skipanim, {dialog01})
       
   186 	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 3000}})
   182 	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 3000}})
   187 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("On the Desert Planet, Hog Solo found some time to play with his RC plane"), 3000}})
   183 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("On the Desert Planet, Hog Solo found some time to play with his RC plane"), 3000}})
   188 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Each time you destroy all the targets on your current level you'll get teleported to the next level"), 5000}})
   184 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Each time you destroy all the targets on your current level you'll get teleported to the next level"), 5000}})
   189 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("You'll have only one RC plane at the start of the mission"), 5000}})
   185 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("You'll have only one RC plane at the start of the mission"), 5000}})
   190 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("During the game you can get new RC planes by collecting the weapon crates"), 5000}})
   186 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("During the game you can get new RC planes by collecting the weapon crates"), 5000}})