share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/desert02.lua
changeset 9758 3b8058b251b8
parent 9645 da7b4d8c181e
child 10289 c3a77ff02a23
equal deleted inserted replaced
9757:9be28be004d4 9758:3b8058b251b8
    13 local startChallenge = false
    13 local startChallenge = false
    14 -- dialogs
    14 -- dialogs
    15 local dialog01 = {}
    15 local dialog01 = {}
    16 -- mission objectives
    16 -- mission objectives
    17 local goals = {
    17 local goals = {
    18 	[dialog01] = {missionName, loc("Getting ready"), loc("Use the rope and get asap to the surface!"), 1, 4500},
    18 	[dialog01] = {missionName, loc("Getting ready"), loc("Use the rope to quickly get to the surface!"), 1, 4500},
    19 }
    19 }
    20 -- health crates
    20 -- health crates
    21 healthX = 565
    21 healthX = 565
    22 health1Y = 1400
    22 health1Y = 1400
    23 health2Y = 850
    23 health2Y = 850
    32 hero.dead = false
    32 hero.dead = false
    33 teamA.name = loc("Hog Solo")
    33 teamA.name = loc("Hog Solo")
    34 teamA.color = tonumber("38D61C",16) -- green
    34 teamA.color = tonumber("38D61C",16) -- green
    35 -- way points
    35 -- way points
    36 local current waypoint = 1
    36 local current waypoint = 1
    37 local waypoints = { 
    37 local waypoints = {
    38 	[1] = {x=1450, y=140},
    38 	[1] = {x=1450, y=140},
    39 	[2] = {x=990, y=580},
    39 	[2] = {x=990, y=580},
    40 	[3] = {x=1650, y=950},
    40 	[3] = {x=1650, y=950},
    41 	[4] = {x=620, y=630},
    41 	[4] = {x=620, y=630},
    42 	[5] = {x=1470, y=540},
    42 	[5] = {x=1470, y=540},
    68 	SuddenDeathTurns = 1
    68 	SuddenDeathTurns = 1
    69 	WaterRise = 150
    69 	WaterRise = 150
    70 	HealthDecrease = 0
    70 	HealthDecrease = 0
    71 	Map = "desert02_map"
    71 	Map = "desert02_map"
    72 	Theme = "Desert"
    72 	Theme = "Desert"
    73 	
    73 
    74 	-- Hog Solo
    74 	-- Hog Solo
    75 	AddTeam(teamA.name, teamA.color, "Bone", "Island", "HillBilly", "cm_birdy")
    75 	AddTeam(teamA.name, teamA.color, "Bone", "Island", "HillBilly", "cm_birdy")
    76 	hero.gear = AddHog(hero.name, 0, 100, "war_desertgrenadier1")
    76 	hero.gear = AddHog(hero.name, 0, 100, "war_desertgrenadier1")
    77 	AnimSetGearPosition(hero.gear, hero.x, hero.y)
    77 	AnimSetGearPosition(hero.gear, hero.x, hero.y)
    78 	HogTurnLeft(hero.gear, true)
    78 	HogTurnLeft(hero.gear, true)
    79 	
    79 
    80 	initCheckpoint("desert02")
    80 	initCheckpoint("desert02")
    81 	
    81 
    82 	AnimInit()
    82 	AnimInit()
    83 	AnimationSetup()
    83 	AnimationSetup()
    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 	
    89 
    90 	AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0)
    90 	AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0)
    91 	AddEvent(onHeroSafe, {hero.gear}, heroSafe, {hero.gear}, 0)
    91 	AddEvent(onHeroSafe, {hero.gear}, heroSafe, {hero.gear}, 0)
    92 	
    92 
    93 	SpawnHealthCrate(healthX, health1Y)
    93 	SpawnHealthCrate(healthX, health1Y)
    94 	SpawnHealthCrate(healthX, health2Y)
    94 	SpawnHealthCrate(healthX, health2Y)
    95 	
    95 
    96 	AddAmmo(hero.gear, amRope, 99)
    96 	AddAmmo(hero.gear, amRope, 99)
    97 	
    97 
    98 	SendHealthStatsOff()
    98 	SendHealthStatsOff()
    99 	AddAnim(dialog01)
    99 	AddAnim(dialog01)
   100 end
   100 end
   101 
   101 
   102 function onNewTurn()
   102 function onNewTurn()
   118 	end
   118 	end
   119 end
   119 end
   120 
   120 
   121 function onPrecise()
   121 function onPrecise()
   122 	if GameTime > 3000 then
   122 	if GameTime > 3000 then
   123 		SetAnimSkip(true)   
   123 		SetAnimSkip(true)
   124 	end
   124 	end
   125 end
   125 end
   126 
   126 
   127 -------------- EVENTS ------------------
   127 -------------- EVENTS ------------------
   128 
   128 
   172 	-- DIALOG 01 - Start
   172 	-- DIALOG 01 - Start
   173 	AddSkipFunction(dialog01, Skipanim, {dialog01})
   173 	AddSkipFunction(dialog01, Skipanim, {dialog01})
   174 	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 3000}})
   174 	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 3000}})
   175 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Many meters below the surface..."), 5000}})
   175 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Many meters below the surface..."), 5000}})
   176 	table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("The tunnel is about to get flooded..."), SAY_THINK, 4000}})
   176 	table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("The tunnel is about to get flooded..."), SAY_THINK, 4000}})
   177 	table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("I have to reach the surface asap..."), SAY_THINK, 4000}})
   177 	table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("I have to reach the surface as quickly as I can..."), SAY_THINK, 4000}})
   178 	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 500}})
   178 	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 500}})
   179 	table.insert(dialog01, {func = challengeStart, args = {hero.gear}})
   179 	table.insert(dialog01, {func = challengeStart, args = {hero.gear}})
   180 end
   180 end
   181 
   181 
   182 ------------------ Other Functions -------------------
   182 ------------------ Other Functions -------------------