share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/ice02.lua
branchspacecampaign
changeset 9455 4bf3fac0e49d
child 9457 934f4d8370f1
equal deleted inserted replaced
9453:c9c25089ab22 9455:4bf3fac0e49d
       
     1 ------------------- ABOUT ----------------------
       
     2 --
       
     3 -- Hero has to pass as fast as possible inside the
       
     4 -- rings as in the runner mode
       
     5 
       
     6 HedgewarsScriptLoad("/Scripts/Locale.lua")
       
     7 HedgewarsScriptLoad("/Scripts/Animate.lua")
       
     8 
       
     9 ----------------- VARIABLES --------------------
       
    10 -- globals
       
    11 local campaignName = loc("A Space Adventure")
       
    12 local missionName = loc("Ice planet, a frozen adventure!")
       
    13 local heroAtAntiFlyArea = false
       
    14 local heroVisitedAntiFlyArea = false
       
    15 local heroAtFinalStep = false
       
    16 local iceGunTaken = false
       
    17 local checkPointReached = 1 -- 1 is normal spawn
       
    18 -- dialogs
       
    19 local dialog01 = {}
       
    20 local dialog02 = {}
       
    21 -- mission objectives
       
    22 local goals = {
       
    23 	[dialog01] = {missionName, loc("Getting ready"), loc("Collect the icegun and get the device part from Thanta"), 1, 4500},
       
    24 }
       
    25 -- crates
       
    26 local icegunY = 1950
       
    27 local icegunX = 260
       
    28 -- hogs
       
    29 local hero = {}
       
    30 local ally = {}
       
    31 -- teams
       
    32 local teamA = {}
       
    33 local teamB = {}
       
    34 local teamC = {}
       
    35 -- hedgehogs values
       
    36 hero.name = "Hog Solo"
       
    37 hero.x = 450
       
    38 hero.y = 200
       
    39 hero.dead = false
       
    40 ally.name = "Paul McHoggy"
       
    41 ally.x = 512
       
    42 ally.y = 200
       
    43 teamA.name = loc("Hog Solo")
       
    44 teamA.color = tonumber("38D61C",16) -- green
       
    45 teamB.name = loc("Allies")
       
    46 teamB.color = tonumber("FF0000",16) -- red
       
    47 
       
    48 -------------- LuaAPI EVENT HANDLERS ------------------
       
    49 
       
    50 function onGameInit()
       
    51 	Seed = 1
       
    52 	TurnTime = 25000
       
    53 	CaseFreq = 0
       
    54 	MinesNum = 0
       
    55 	MinesTime = 1
       
    56 	Explosives = 0
       
    57 	Delay = 3
       
    58 	Map = "ice02_map"
       
    59 	Theme = "Snow"
       
    60 	
       
    61 	-- Hog Solo
       
    62 	AddTeam(teamA.name, teamA.color, "Bone", "Island", "HillBilly", "cm_birdy")
       
    63 	hero.gear = AddHog(hero.name, 0, 100, "war_desertgrenadier1")
       
    64 	AnimSetGearPosition(hero.gear, hero.x, hero.y)
       
    65 	HogTurnLeft(hero.gear, true)
       
    66 	-- Ally
       
    67 	AddTeam(teamB.name, teamB.color, "Bone", "Island", "HillBilly", "cm_birdy")
       
    68 	ally.gear = AddHog(ally.name, 0, 100, "tophats")
       
    69 	AnimSetGearPosition(ally.gear, ally.x, ally.y)
       
    70 	
       
    71 	AnimInit()
       
    72 	--AnimationSetup()	
       
    73 end
       
    74 
       
    75 function onGameStart()
       
    76 	AnimWait(hero.gear, 3000)
       
    77 	FollowGear(hero.gear)
       
    78 	
       
    79 	AddAmmo(hero.gear, amJetpack, 99)
       
    80 	
       
    81 	SendHealthStatsOff()
       
    82 end