share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/desert01.lua
branchspacecampaign
changeset 9574 da3d39667881
parent 9490 b93448b75fa4
child 9578 16139270448f
equal deleted inserted replaced
9572:278cff2a965f 9574:da3d39667881
    15 HedgewarsScriptLoad("/Scripts/Animate.lua")
    15 HedgewarsScriptLoad("/Scripts/Animate.lua")
    16 
    16 
    17 ----------------- VARIABLES --------------------
    17 ----------------- VARIABLES --------------------
    18 -- globals
    18 -- globals
    19 local campaignName = loc("A Space Adventure")
    19 local campaignName = loc("A Space Adventure")
    20 local missionName = loc("Desert planet, lost in sand!")
    20 local missionName = loc("Searching in the dust")
    21 local heroIsInBattle = false
    21 local heroIsInBattle = false
    22 local ongoingBattle = 0
    22 local ongoingBattle = 0
    23 local cratesFound = 0
    23 local cratesFound = 0
    24 local checkPointReached = 1 -- 1 is normal spawn
    24 local checkPointReached = 1 -- 1 is normal spawn
    25 -- dialogs
    25 -- dialogs
    54 -- teams
    54 -- teams
    55 local teamA = {}
    55 local teamA = {}
    56 local teamB = {}
    56 local teamB = {}
    57 local teamC = {}
    57 local teamC = {}
    58 -- hedgehogs values
    58 -- hedgehogs values
    59 hero.name = "Hog Solo"
    59 hero.name = loc("Hog Solo")
    60 hero.x = 1740
    60 hero.x = 1740
    61 hero.y = 40
    61 hero.y = 40
    62 hero.dead = false
    62 hero.dead = false
    63 ally.name = "Chief Sandologist"
    63 ally.name = loc("Chief Sandologist")
    64 ally.x = 1660
    64 ally.x = 1660
    65 ally.y = 40
    65 ally.y = 40
    66 smuggler1.name = "Sanndy"
    66 smuggler1.name = loc("Sandy")
    67 smuggler1.x = 400
    67 smuggler1.x = 400
    68 smuggler1.y = 235
    68 smuggler1.y = 235
    69 smuggler2.name = "Spike"
    69 smuggler2.name = loc("Spike")
    70 smuggler2.x = 736
    70 smuggler2.x = 736
    71 smuggler2.y = 860
    71 smuggler2.y = 860
    72 smuggler3.name = "Sandstorm"
    72 smuggler3.name = loc("Sandstorm")
    73 smuggler3.x = 1940
    73 smuggler3.x = 1940
    74 smuggler3.y = 1625
    74 smuggler3.y = 1625
    75 teamA.name = loc("PAotH")
    75 teamA.name = loc("PAotH")
    76 teamA.color = tonumber("FF0000",16) -- red
    76 teamA.color = tonumber("FF0000",16) -- red
    77 teamB.name = loc("Smugglers")
    77 teamB.name = loc("Smugglers")
   391 end
   391 end
   392 
   392 
   393 function heroAtThirdBattle(gear)
   393 function heroAtThirdBattle(gear)
   394 	heroIsInBattle = true
   394 	heroIsInBattle = true
   395 	ongoingBattle = 3
   395 	ongoingBattle = 3
   396 	AnimSay(smuggler3.gear, loc("Who's there! I'll get you..."), SAY_SHOUT, 5000)	
   396 	AnimSay(smuggler3.gear, loc("Who's there?! I'll get you..."), SAY_SHOUT, 5000)	
   397 	AnimSwitchHog(smuggler3.gear)
   397 	AnimSwitchHog(smuggler3.gear)
   398 	TurnTimeLeft = 0
   398 	TurnTimeLeft = 0
   399 end
   399 end
   400 
   400 
   401 -- for some weird reson I couldn't call the same action for both events
   401 -- for some weird reson I couldn't call the same action for both events
   423 
   423 
   424 function AnimationSetup()
   424 function AnimationSetup()
   425 	-- DIALOG 01 - Start, getting info about the device
   425 	-- DIALOG 01 - Start, getting info about the device
   426 	AddSkipFunction(dialog01, Skipanim, {dialog01})
   426 	AddSkipFunction(dialog01, Skipanim, {dialog01})
   427 	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 3000}})
   427 	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 3000}})
   428 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("In the planet of sand, you have to double check your moves..."), 5000}})
   428 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("In the Planet of Sand, you have to double check your moves..."), 5000}})
   429 	table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("Finaly you are here..."), SAY_SAY, 2000}})
   429 	table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("Finaly you are here..."), SAY_SAY, 2000}})
   430 	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 2000}})
   430 	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 2000}})
   431 	table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("Thank you for meeting me in such a short notice!"), SAY_SAY, 3000}})
   431 	table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("Thank you for meeting me in such a short notice!"), SAY_SAY, 3000}})
   432 	table.insert(dialog01, {func = AnimWait, args = {ally.gear, 4000}})
   432 	table.insert(dialog01, {func = AnimWait, args = {ally.gear, 4000}})
   433 	table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("No problem, I would do anything for M!"), SAY_SAY, 4000}})
   433 	table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("No problem, I would do anything for H!"), SAY_SAY, 4000}})
   434 	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}})
   434 	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}})
   435 	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}})
   435 	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}})
   436 	table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("M confimed that there isn't such a PAotH activity logged"), SAY_SAY, 4000}})
   436 	table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("H confimed that there isn't such a PAotH activity logged"), SAY_SAY, 4000}})
   437 	table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("So, I believe that it's a good place to start"), SAY_SAY, 3000}})
   437 	table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("So, I believe that it's a good place to start"), SAY_SAY, 3000}})
   438 	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}})
   438 	table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("Beware though! Many smugglers come often to explore these tunnels and scavage whatever valuable items they can find"), SAY_SAY, 5000}})
   439 	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}})
   439 	table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("They won't hesitate to attack you in order to rob you!"), SAY_SAY, 4000}})
   440 	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 6000}})
   440 	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 6000}})
   441 	table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("OK, I'll be extra careful!"), SAY_SAY, 4000}})
   441 	table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("OK, I'll be extra careful!"), SAY_SAY, 4000}})
   442 	table.insert(dialog01, {func = AnimWait, args = {ally.gear, 2000}})
   442 	table.insert(dialog01, {func = AnimWait, args = {ally.gear, 2000}})
   443 	table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("There is the tunnel entrance"), SAY_SAY, 3000}})
   443 	table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("There is the tunnel entrance"), SAY_SAY, 3000}})
   444 	table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("Good luck!"), SAY_SAY, 3000}})
   444 	table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("Good luck!"), SAY_SAY, 3000}})
   495 		AnimSay(hero.gear, loc("Haven't found it yet..."), SAY_THINK, 5000)
   495 		AnimSay(hero.gear, loc("Haven't found it yet..."), SAY_THINK, 5000)
   496 		cratesFound = cratesFound + 1
   496 		cratesFound = cratesFound + 1
   497 	elseif cratesFound == 1 then
   497 	elseif cratesFound == 1 then
   498 		-- end game
   498 		-- end game
   499 		AnimSay(hero.gear, loc("Hoo Ray!!!"), SAY_SHOUT, 5000)
   499 		AnimSay(hero.gear, loc("Hoo Ray!!!"), SAY_SHOUT, 5000)
   500 		SendStat('siGameResult', loc("Congratulations, you got the part!")) --1
   500 		SendStat('siGameResult', loc("Congratulations, you won!")) --1
   501 		SendStat('siCustomAchievement', loc("To win the game you had to collect 2 crates with no specific order")) --11
   501 		SendStat('siCustomAchievement', loc("To win the game you had to collect the 2 crates with no specific order")) --11
   502 		SendStat('siPlayerKills','1',teamC.name)
   502 		SendStat('siPlayerKills','1',teamC.name)
   503 		SendStat('siPlayerKills','0',teamB.name)
   503 		SendStat('siPlayerKills','0',teamB.name)
   504 		EndGame()
   504 		EndGame()
   505 	end
   505 	end
   506 end
   506 end