share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/desert03.lua
changeset 12582 e2b5c6e805e8
parent 12580 0c5ce463949b
child 12591 7510fe66bfbb
equal deleted inserted replaced
12581:1fb961480b3c 12582:e2b5c6e805e8
    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 	["init"] = {missionName, loc("Challenge objectives"), challengeObjectives, 1, 60000},
    21 	["init"] = {missionName, loc("Challenge objectives"), challengeObjectives, 1, 30000},
    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,
    60 
    60 
    61 function onGameInit()
    61 function onGameInit()
    62 	GameFlags = gfOneClanMode
    62 	GameFlags = gfOneClanMode
    63 	Seed = 1
    63 	Seed = 1
    64 	TurnTime = -1
    64 	TurnTime = -1
       
    65 	Ready = 30000
    65 	CaseFreq = 0
    66 	CaseFreq = 0
    66 	MinesNum = 0
    67 	MinesNum = 0
    67 	MinesTime = 1
    68 	MinesTime = 1
    68 	Explosives = 0
    69 	Explosives = 0
    69 	Map = "desert03_map"
    70 	Map = "desert03_map"
    77 	hero.gear = AddHog(hero.name, 0, 1, "war_desertgrenadier1")
    78 	hero.gear = AddHog(hero.name, 0, 1, "war_desertgrenadier1")
    78 	AnimSetGearPosition(hero.gear, hero.x, hero.y)
    79 	AnimSetGearPosition(hero.gear, hero.x, hero.y)
    79 
    80 
    80 	initCheckpoint("desert03")
    81 	initCheckpoint("desert03")
    81 
    82 
    82 	AnimInit(true)
    83 	AnimInit()
    83 	AnimationSetup()
       
    84 end
    84 end
    85 
    85 
    86 function onGameStart()
    86 function onGameStart()
    87 	AnimWait(hero.gear, 3000)
       
    88 	FollowGear(hero.gear)
    87 	FollowGear(hero.gear)
    89 	ShowMission(unpack(goals["init"]))
    88 	ShowMission(unpack(goals["init"]))
    90 
    89 
    91 	AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0)
    90 	AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0)
    92 	AddEvent(onLose, {hero.gear}, lose, {hero.gear}, 0)
    91 	AddEvent(onLose, {hero.gear}, lose, {hero.gear}, 0)
   171 
   170 
   172 function lose(gear)
   171 function lose(gear)
   173 	AddCaption(loc("Out of ammo!"), 0xFFFFFFFF, capgrpMessage2)
   172 	AddCaption(loc("Out of ammo!"), 0xFFFFFFFF, capgrpMessage2)
   174 	PlaySound(sndStupid, hero.gear)
   173 	PlaySound(sndStupid, hero.gear)
   175 	gameOver()
   174 	gameOver()
   176 end
       
   177 
       
   178 -------------- ANIMATIONS ------------------
       
   179 
       
   180 function AnimationSetup()
       
   181 	-- DIALOG 01 - Start, game instructions
       
   182 	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 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}})
       
   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}})
       
   185 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("You'll have only one RC plane at the start of the mission"), 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}})
       
   187 	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 500}})
       
   188 end
   175 end
   189 
   176 
   190 ----------------- Other Functions -----------------
   177 ----------------- Other Functions -----------------
   191 
   178 
   192 function checkTargetsDestroyed()
   179 function checkTargetsDestroyed()