share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/moon02.lua
changeset 11692 68eddcdc9f26
parent 11492 806da449d355
child 11891 d79621bcb709
equal deleted inserted replaced
11646:42d7f5dbd8dc 11692:68eddcdc9f26
    18 -- dialogs
    18 -- dialogs
    19 local dialog01 = {}
    19 local dialog01 = {}
    20 local dialog02 = {}
    20 local dialog02 = {}
    21 -- mission objectives
    21 -- mission objectives
    22 local goals = {
    22 local goals = {
    23 	[dialog01] = {missionName, loc("Challenge Objectives"), challengeObjectives, 1, 4500},
    23 	[dialog01] = {missionName, loc("Challenge objectives"), challengeObjectives, 1, 4500},
    24 }
    24 }
    25 -- hogs
    25 -- hogs
    26 local hero = {
    26 local hero = {
    27 	name = loc("Hog Solo"),
    27 	name = loc("Hog Solo"),
    28 	x = 1300,
    28 	x = 1300,
    77 end
    77 end
    78 
    78 
    79 function onGameStart()
    79 function onGameStart()
    80 	AnimWait(hero.gear, 3000)
    80 	AnimWait(hero.gear, 3000)
    81 	FollowGear(hero.gear)
    81 	FollowGear(hero.gear)
    82 	ShowMission(missionName, loc("Challenge Objectives"), challengeObjectives, -amSkip, 0)
    82 	ShowMission(missionName, loc("Challenge objectives"), challengeObjectives, -amSkip, 0)
    83 
    83 
    84 	AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0)
    84 	AddEvent(onHeroDeath, {hero.gear}, heroDeath, {hero.gear}, 0)
    85 
    85 
    86 	AddAmmo(hero.gear, amRope, 1)
    86 	AddAmmo(hero.gear, amRope, 1)
    87 
    87 
   156 
   156 
   157 function AnimationSetup()
   157 function AnimationSetup()
   158 	-- DIALOG 01 - Start, game instructions
   158 	-- DIALOG 01 - Start, game instructions
   159 	AddSkipFunction(dialog01, Skipanim, {dialog01})
   159 	AddSkipFunction(dialog01, Skipanim, {dialog01})
   160 	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 3200}})
   160 	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 3200}})
   161 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("On the other side of the moon..."), 5000}})
   161 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("On the other side of the moon ..."), 5000}})
   162 	table.insert(dialog01, {func = AnimSay, args = {runner.gear, loc("So you are interested in Professor Hogevil"), SAY_SAY, 3000}})
   162 	table.insert(dialog01, {func = AnimSay, args = {runner.gear, loc("So you are interested in Professor Hogevil, huh?"), SAY_SAY, 3000}})
   163 	table.insert(dialog01, {func = AnimSay, args = {runner.gear, loc("We'll play a game first"), SAY_SAY, 3000}})
   163 	table.insert(dialog01, {func = AnimSay, args = {runner.gear, loc("We'll play a game first."), SAY_SAY, 3000}})
   164 	table.insert(dialog01, {func = AnimSay, args = {runner.gear, loc("I'll let you know whatever I know about him if you manage to catch me 3 times"), SAY_SAY, 4000}})
   164 	table.insert(dialog01, {func = AnimSay, args = {runner.gear, loc("I'll let you know whatever I know about him if you manage to catch me 3 times."), SAY_SAY, 4000}})
   165 	table.insert(dialog01, {func = AnimSay, args = {runner.gear, loc("Let's go!"), SAY_SAY, 2000}})
   165 	table.insert(dialog01, {func = AnimSay, args = {runner.gear, loc("Let's go!"), SAY_SAY, 2000}})
   166 	table.insert(dialog01, {func = moveRunner, args = {}})
   166 	table.insert(dialog01, {func = moveRunner, args = {}})
   167 	-- DIALOG 02 - Hog Solo story
   167 	-- DIALOG 02 - Hog Solo story
   168 	AddSkipFunction(dialog02, Skipanim, {dialog02})
   168 	AddSkipFunction(dialog02, Skipanim, {dialog02})
   169 	table.insert(dialog02, {func = AnimWait, args = {hero.gear, 3200}})
   169 	table.insert(dialog02, {func = AnimWait, args = {hero.gear, 3200}})
   170 	table.insert(dialog02, {func = AnimCaption, args = {hero.gear, loc("The truth about Professor Hogevil"), 5000}})
   170 	table.insert(dialog02, {func = AnimCaption, args = {hero.gear, loc("The truth about Professor Hogevil"), 5000}})
   171 	table.insert(dialog02, {func = AnimSay, args = {runner.gear, loc("Amazing! I was never beaten in a race before!"), SAY_SAY, 4000}})
   171 	table.insert(dialog02, {func = AnimSay, args = {runner.gear, loc("Amazing! I was never beaten in a race before!"), SAY_SAY, 4000}})
   172 	table.insert(dialog02, {func = AnimSay, args = {runner.gear, loc("So, let me tell you what I know about Professor Hogevil..."), SAY_SAY, 4000}})
   172 	table.insert(dialog02, {func = AnimSay, args = {runner.gear, loc("So, let me tell you what I know about Professor Hogevil."), SAY_SAY, 4000}})
   173 	table.insert(dialog02, {func = AnimSay, args = {runner.gear, loc("Professor Hogevil, then known as James Hogus, worked for PAotH back in my time"), SAY_SAY, 4000}})
   173 	table.insert(dialog02, {func = AnimSay, args = {runner.gear, loc("Professor Hogevil, then known as James Hogus, worked for PAotH back in my time."), SAY_SAY, 4000}})
   174 	table.insert(dialog02, {func = AnimSay, args = {runner.gear, loc("He was the lab assistant of Dr. Goodhogan, the inventor of the anti-gravity device"), SAY_SAY, 5000}})
   174 	table.insert(dialog02, {func = AnimSay, args = {runner.gear, loc("He was the lab assistant of Dr. Goodhogan, the inventor of the anti-gravity device."), SAY_SAY, 5000}})
   175 	table.insert(dialog02, {func = AnimSay, args = {runner.gear, loc("During the final testing of the device an accident happened"), SAY_SAY, 5000}})
   175 	table.insert(dialog02, {func = AnimSay, args = {runner.gear, loc("During the final testing of the device an accident happened."), SAY_SAY, 5000}})
   176 	table.insert(dialog02, {func = AnimSay, args = {runner.gear, loc("In this accident Professor Hogevil lost all his spines on his head!"), SAY_SAY, 5000}})
   176 	table.insert(dialog02, {func = AnimSay, args = {runner.gear, loc("In this accident, Professor Hogevil lost all his spines on his head!"), SAY_SAY, 5000}})
   177 	table.insert(dialog02, {func = AnimSay, args = {runner.gear, loc("That's why he always wears a hat since then"), SAY_SAY, 4000}})
   177 	table.insert(dialog02, {func = AnimSay, args = {runner.gear, loc("That's why he always wears a hat since then."), SAY_SAY, 4000}})
   178 	table.insert(dialog02, {func = AnimSay, args = {runner.gear, loc("After that incident he went underground and started working on his plan to steal the device"), SAY_SAY, 5000}})
   178 	table.insert(dialog02, {func = AnimSay, args = {runner.gear, loc("After that incident he went underground and started working on his plan to steal the device."), SAY_SAY, 5000}})
   179 	table.insert(dialog02, {func = AnimSay, args = {runner.gear, loc("He is a very tough and very determined hedgehog. I would be extremely careful if I were you"), SAY_SAY, 5000}})
   179 	table.insert(dialog02, {func = AnimSay, args = {runner.gear, loc("He is a very tough and very determined hedgehog. I would be extremely careful if I were you."), SAY_SAY, 5000}})
   180 	table.insert(dialog02, {func = AnimSay, args = {runner.gear, loc("I should go now, goodbye!"), SAY_SAY, 3000}})
   180 	table.insert(dialog02, {func = AnimSay, args = {runner.gear, loc("I should go now, goodbye!"), SAY_SAY, 3000}})
   181 	table.insert(dialog02, {func = win, args = {}})
   181 	table.insert(dialog02, {func = win, args = {}})
   182 end
   182 end
   183 
   183 
   184 ------------- other functions ---------------
   184 ------------- other functions ---------------
   206 		end
   206 		end
   207 		AddAmmo(hero.gear, amRope, 1)
   207 		AddAmmo(hero.gear, amRope, 1)
   208 		if currentPosition ~= 1 then
   208 		if currentPosition ~= 1 then
   209 			PlaySound(sndVictory)
   209 			PlaySound(sndVictory)
   210 			if currentPosition > 1 and currentPosition < 4 then
   210 			if currentPosition > 1 and currentPosition < 4 then
   211 				AnimCaption(hero.gear, loc("Go get him again"), 3000)
   211 				AnimCaption(hero.gear, loc("Go, get him again!"), 3000)
   212 				AnimSay(runner.gear, loc("You got me"), SAY_SAY, 3000)
   212 				AnimSay(runner.gear, loc("You got me!"), SAY_SAY, 3000)
   213 			end
   213 			end
   214 			previousTimeLeft = TurnTimeLeft
   214 			previousTimeLeft = TurnTimeLeft
   215 		end
   215 		end
   216 		currentPosition = currentPosition + 1
   216 		currentPosition = currentPosition + 1
   217 		AddVisualGear(GetX(runner.gear), GetY(runner.gear), vgtExplosion, 0, false) 
   217 		AddVisualGear(GetX(runner.gear), GetY(runner.gear), vgtExplosion, 0, false) 
   219 		TurnTimeLeft = 0
   219 		TurnTimeLeft = 0
   220 	end
   220 	end
   221 end
   221 end
   222 
   222 
   223 function lose()
   223 function lose()
   224 	SendStat(siGameResult, loc("Too slow! Try again..."))
   224 	SendStat(siGameResult, loc("Too slow! Try again ..."))
   225 	SendStat(siCustomAchievement, loc("You have to catch the other hog 3 times"))
   225 	SendStat(siCustomAchievement, loc("You have to catch the other hog 3 times."))
   226 	SendStat(siCustomAchievement, loc("The time that you have left when you reach the blue hedgehog will be added to the next turn"))
   226 	SendStat(siCustomAchievement, loc("The time that you have left when you reach the blue hedgehog will be added to the next turn."))
   227 	SendStat(siCustomAchievement, loc("Each turn you'll have only one rope to use"))
   227 	SendStat(siCustomAchievement, loc("Each turn you'll have only one rope to use."))
   228 	SendStat(siCustomAchievement, loc("You'll lose if you die or if your time is up"))
   228 	SendStat(siCustomAchievement, loc("You'll lose if you die or if your time is up."))
   229 	SendStat(siPlayerKills,'0',teamA.name)
   229 	SendStat(siPlayerKills,'0',teamA.name)
   230 	EndGame()
   230 	EndGame()
   231 end
   231 end
   232 
   232 
   233 function win()
   233 function win()
   234 	SendStat(siGameResult, loc("Congratulations, you are the fastest!"))
   234 	SendStat(siGameResult, loc("Congratulations, you are the fastest!"))
   235 	SendStat(siCustomAchievement, loc("You have managed to catch the blue hedgehog in time"))
   235 	SendStat(siCustomAchievement, loc("You have managed to catch the blue hedgehog in time."))
   236 	SendStat(siPlayerKills,'1',teamA.name)
   236 	SendStat(siPlayerKills,'1',teamA.name)
   237 	EndGame()
   237 	EndGame()
   238 end
   238 end