share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/desert03.lua
branchspacecampaign
changeset 9608 e2d4c2198e55
parent 9606 1d088cc31ff8
child 9610 fabff82cf0b8
equal deleted inserted replaced
9607:893e5871b809 9608:e2d4c2198e55
    10 -- globals
    10 -- globals
    11 local missionName = loc("Precise flying")
    11 local missionName = loc("Precise flying")
    12 local challengeObjectives = loc("Use the rc plane and destroy the all the targets").."|"..
    12 local challengeObjectives = loc("Use the rc plane and destroy the all the targets").."|"..
    13 	loc("Each time you destroy your level targets you'll get teleported to the next level").."|"..
    13 	loc("Each time you destroy your level targets you'll get teleported to the next level").."|"..
    14 	loc("You'll have only one rc plane at the start of the mission").."|"..
    14 	loc("You'll have only one rc plane at the start of the mission").."|"..
    15 	loc("During the game you can get new plane by getting the weapon crates")
    15 	loc("During the game you can get new planes by getting the weapon crates")
    16 local currentTarget = 1
    16 local currentTarget = 1
       
    17 -- dialogs
       
    18 local dialog01 = {}
       
    19 -- mission objectives
       
    20 local goals = {
       
    21 	[dialog01] = {missionName, loc("Challenge Objectives"), challengeObjectives, 1, 4500},
       
    22 }
    17 -- hogs
    23 -- hogs
    18 local hero = {
    24 local hero = {
    19 	name = loc("Hog Solo"),
    25 	name = loc("Hog Solo"),
    20 	x = 100,
    26 	x = 100,
    21 	y = 170
    27 	y = 170
    67 	AnimSetGearPosition(hero.gear, hero.x, hero.y)
    73 	AnimSetGearPosition(hero.gear, hero.x, hero.y)
    68 	
    74 	
    69 	initCheckpoint("desert03")
    75 	initCheckpoint("desert03")
    70 	
    76 	
    71 	AnimInit()
    77 	AnimInit()
    72 	--AnimationSetup()
    78 	AnimationSetup()
    73 end
    79 end
    74 
    80 
    75 function onGameStart()
    81 function onGameStart()
    76 	AnimWait(hero.gear, 3000)
    82 	AnimWait(hero.gear, 3000)
    77 	FollowGear(hero.gear)
    83 	FollowGear(hero.gear)
    86 	
    92 	
    87 	-- hero ammo
    93 	-- hero ammo
    88 	AddAmmo(hero.gear, amRCPlane, 1)
    94 	AddAmmo(hero.gear, amRCPlane, 1)
    89 
    95 
    90 	SendHealthStatsOff()
    96 	SendHealthStatsOff()
       
    97 	AddAnim(dialog01)
    91 end
    98 end
    92 
    99 
    93 function onGameTick()
   100 function onGameTick()
    94 	AnimUnWait()
   101 	AnimUnWait()
    95 	if ShowAnimation() == false then
   102 	if ShowAnimation() == false then
   136 	gameOver()
   143 	gameOver()
   137 end
   144 end
   138 
   145 
   139 function lose(gear)
   146 function lose(gear)
   140 	gameOver()
   147 	gameOver()
       
   148 end
       
   149 
       
   150 -------------- ANIMATIONS ------------------
       
   151 
       
   152 function Skipanim(anim)
       
   153 	if goals[anim] ~= nil then
       
   154 		ShowMission(unpack(goals[anim]))
       
   155     end
       
   156 end
       
   157 
       
   158 function AnimationSetup()
       
   159 	-- DIALOG 01 - Start, game instructions
       
   160 	AddSkipFunction(dialog01, Skipanim, {dialog01})
       
   161 	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 3000}})
       
   162 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("In the Desert Planet, Hog Solo found some time to play with his RC plane..."), 3000}})
       
   163 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Each time you destroy your level targets you'll get teleported to the next level"), 5000}})
       
   164 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("You'll have only one rc plane at the start of the mission"), 5000}})
       
   165 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("During the game you can get new planes by getting the weapon crates"), 5000}})
       
   166 	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 500}})	
   141 end
   167 end
   142 
   168 
   143 ----------------- Other Functions -----------------
   169 ----------------- Other Functions -----------------
   144 
   170 
   145 function checkTargetsDestroied()
   171 function checkTargetsDestroied()