share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/desert01.lua
branchspacecampaign
changeset 9422 85b17f344c97
parent 9420 27aff3a11822
child 9424 9a150b7862e9
equal deleted inserted replaced
9420:27aff3a11822 9422:85b17f344c97
     6 -- lost part.
     6 -- lost part.
     7 
     7 
     8 -- TODO
     8 -- TODO
     9 -- maybe use same name in missionName and frontend mission name..
     9 -- maybe use same name in missionName and frontend mission name..
    10 -- in this map I have to track the weapons the player has in checkpoints
    10 -- in this map I have to track the weapons the player has in checkpoints
       
    11 -- GENRAL NOTE: change hats :D
    11 
    12 
    12 HedgewarsScriptLoad("/Scripts/Locale.lua")
    13 HedgewarsScriptLoad("/Scripts/Locale.lua")
    13 HedgewarsScriptLoad("/Scripts/Animate.lua")
    14 HedgewarsScriptLoad("/Scripts/Animate.lua")
    14 
    15 
    15 ----------------- VARIABLES --------------------
    16 ----------------- VARIABLES --------------------
    16 -- globals
    17 -- globals
    17 local campaignName = loc("A Space Adventure")
    18 local campaignName = loc("A Space Adventure")
    18 local missionName = loc("Desert planet, lost in sand!")
    19 local missionName = loc("Desert planet, lost in sand!")
    19 local checkPointReached = 1 -- 1 is normal spawn
    20 local checkPointReached = 1 -- 1 is normal spawn
       
    21 -- dialogs
       
    22 local dialog01 = {}
       
    23 -- mission objectives
       
    24 local goals = {
       
    25 	[dialog01] = {missionName, loc("Getting ready"), loc("The part is hidden in one of the crates! Go and get it!"), 1, 4500},
       
    26 }
    20 -- crates
    27 -- crates
    21 local btorch1Y = 60
    28 local btorch1Y = 60
    22 local btorch1X = 2700
    29 local btorch1X = 2700
    23 local btorch2Y = 1800
    30 local btorch2Y = 1800
    24 local btorch2X = 1010
    31 local btorch2X = 1010
    96 	smuggler2.gear = AddHog(smuggler2.name, 1, 120, "tophats")
   103 	smuggler2.gear = AddHog(smuggler2.name, 1, 120, "tophats")
    97 	AnimSetGearPosition(smuggler2.gear, smuggler2.x, smuggler2.y)	
   104 	AnimSetGearPosition(smuggler2.gear, smuggler2.x, smuggler2.y)	
    98 	smuggler3.gear = AddHog(smuggler3.name, 1, 120, "tophats")
   105 	smuggler3.gear = AddHog(smuggler3.name, 1, 120, "tophats")
    99 	AnimSetGearPosition(smuggler3.gear, smuggler3.x, smuggler3.y)	
   106 	AnimSetGearPosition(smuggler3.gear, smuggler3.x, smuggler3.y)	
   100 	
   107 	
   101 	--AnimInit()
   108 	AnimInit()
   102 	--AnimationSetup()	
   109 	AnimationSetup()	
   103 end
   110 end
   104 
   111 
   105 function onGameStart()
   112 function onGameStart()
   106 	--AnimWait(hero.gear, 3000)
   113 	AnimWait(hero.gear, 3000)
   107 	FollowGear(hero.gear)
   114 	FollowGear(hero.gear)
   108 	
   115 	
   109 	AddAmmo(hero.gear, amRope, 10)
   116 	AddAmmo(hero.gear, amRope, 10)
   110 	
   117 	
   111 	-- spawn crates	
   118 	-- spawn crates	
   141 	while x < 3300 do
   148 	while x < 3300 do
   142 		AddGear(x, 1450, gtMine, 0, 0, 0, 0)
   149 		AddGear(x, 1450, gtMine, 0, 0, 0, 0)
   143 		x = x + math.random(8,20)
   150 		x = x + math.random(8,20)
   144 	end
   151 	end
   145 	
   152 	
       
   153 	AddAnim(dialog01)
       
   154 end
       
   155 
       
   156 function onGameTick()
       
   157 	AnimUnWait()
       
   158 	if ShowAnimation() == false then
       
   159 		return
       
   160 	end
       
   161 	ExecuteAfterAnimations()
       
   162 	CheckEvents()
   146 end
   163 end
   147 
   164 
   148 function onAmmoStoreInit()
   165 function onAmmoStoreInit()
   149 	SetAmmo(amBlowTorch, 0, 0, 0, 1)
   166 	SetAmmo(amBlowTorch, 0, 0, 0, 1)
   150 	SetAmmo(amRope, 0, 0, 0, 1)
   167 	SetAmmo(amRope, 0, 0, 0, 1)
   156 	if gear == hero.gear then
   173 	if gear == hero.gear then
   157 		hero.dead = true
   174 		hero.dead = true
   158 	end
   175 	end
   159 end
   176 end
   160 
   177 
       
   178 function onPrecise()
       
   179 	if GameTime > 3000 then
       
   180 		SetAnimSkip(true)   
       
   181 	end
       
   182 end
       
   183 
       
   184 -------------- ANIMATIONS ------------------
       
   185 
       
   186 function Skipanim(anim)
       
   187 	if goals[anim] ~= nil then
       
   188 		ShowMission(unpack(goals[anim]))
       
   189     end
       
   190 end
       
   191 
       
   192 function AnimationSetup()
       
   193 	-- DIALOG 01 - Start, getting info about the device
       
   194 	AddSkipFunction(dialog01, Skipanim, {dialog01})
       
   195 	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 3000}})
       
   196 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("In the planet of sand, you have to double check your moves..."), 5000}})
       
   197 	table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("Finaly you are here..."), SAY_SAY, 2000}})
       
   198 	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 2000}})
       
   199 	table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("Thank you for meeting me in such a short notice!"), SAY_SAY, 3000}})
       
   200 	table.insert(dialog01, {func = AnimWait, args = {ally.gear, 4000}})
       
   201 	table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("No problem, I would do anything for M!"), SAY_SAY, 4000}})
       
   202 	table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("Now listen carefully! Below us there are tunnels that have been created naturally over the years"), SAY_SAY, 4000}})
       
   203 	table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("I have heared the local tribes saying that many years ago some PAotH scientists were dumping their waste here"), SAY_SAY, 5000}})
       
   204 	table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("M confimed that there isn't such a PAotH activity logged"), SAY_SAY, 4000}})
       
   205 	table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("So, I believe that it's a good place to start"), SAY_SAY, 3000}})
       
   206 	table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("Beware though! Many smugglers come often to explore these tunnels and scavage whatever valuable item they can find"), SAY_SAY, 5000}})
       
   207 	table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("They won't hesitate to attack you in order to take your valuables!"), SAY_SAY, 4000}})
       
   208 	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 6000}})
       
   209 	table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("OK, I'll be extra careful!"), SAY_SAY, 4000}})
       
   210 	table.insert(dialog01, {func = AnimWait, args = {ally.gear, 2000}})
       
   211 	table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("There is the tunnel entrance"), SAY_SAY, 3000}})
       
   212 	table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("Good luck!"), SAY_SAY, 3000}})
       
   213 	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 500}})
       
   214 	table.insert(dialog01, {func = AnimSwitchHog, args = {hero.gear}})
       
   215 end