share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/death01.lua
branchspacecampaign
changeset 9574 da3d39667881
parent 9568 58cdc9332a54
child 9578 16139270448f
equal deleted inserted replaced
9572:278cff2a965f 9574:da3d39667881
     8 HedgewarsScriptLoad("/Scripts/Locale.lua")
     8 HedgewarsScriptLoad("/Scripts/Locale.lua")
     9 HedgewarsScriptLoad("/Scripts/Animate.lua")
     9 HedgewarsScriptLoad("/Scripts/Animate.lua")
    10 
    10 
    11 ----------------- VARIABLES --------------------
    11 ----------------- VARIABLES --------------------
    12 -- globals
    12 -- globals
    13 local campaignName = loc("A Space Adventure")
    13 local missionName = loc("The last encounter")
    14 local missionName = loc("Death planet")
       
    15 -- dialogs
    14 -- dialogs
    16 local dialog01 = {}
    15 local dialog01 = {}
    17 -- missions objectives
    16 -- missions objectives
    18 local goals = {
    17 local goals = {
    19 	[dialog01] = {missionName, loc("The final part"), loc("Defeat Professor Hogevil!"), 1, 4500},
    18 	[dialog01] = {missionName, loc("The final part"), loc("Defeat Professor Hogevil!"), 1, 4500},
    50 paoth1.y = 1480
    49 paoth1.y = 1480
    51 paoth2.name = "Dr.Cornelius"
    50 paoth2.name = "Dr.Cornelius"
    52 paoth2.x = 3800
    51 paoth2.x = 3800
    53 paoth2.y = 1480
    52 paoth2.y = 1480
    54 professor.name = "Prof. Hogevil"
    53 professor.name = "Prof. Hogevil"
    55 --professor.x = 3630
       
    56 --professor.y = 1480
       
    57 professor.dead = false
    54 professor.dead = false
    58 thug1.x = 1265
    55 thug1.x = 1265
    59 thug1.y = 1400
    56 thug1.y = 1400
    60 thug1.health = 100
    57 thug1.health = 100
    61 thug2.x = 2035
    58 thug2.x = 2035
   120 	professor.bot = AddHog(professor.name, 1, 300, "tophats")
   117 	professor.bot = AddHog(professor.name, 1, 300, "tophats")
   121 	AnimSetGearPosition(professor.bot, paoth1.x - 100, paoth1.y)
   118 	AnimSetGearPosition(professor.bot, paoth1.x - 100, paoth1.y)
   122 	HogTurnLeft(professor.bot, true)
   119 	HogTurnLeft(professor.bot, true)
   123 	professor.gear = professor.bot
   120 	professor.gear = professor.bot
   124 	for i=1,table.getn(thugs) do
   121 	for i=1,table.getn(thugs) do
   125 		thugs[i].gear = AddHog("thug #"..i, 1, thugs[i].health, "war_desertgrenadier1")
   122 		thugs[i].gear = AddHog(loc("thug").." #"..i, 1, thugs[i].health, "war_desertgrenadier1")
   126 		AnimSetGearPosition(thugs[i].gear, thugs[i].x, thugs[i].y)
   123 		AnimSetGearPosition(thugs[i].gear, thugs[i].x, thugs[i].y)
   127 		HogTurnLeft(thugs[i].gear, not thugs[i].turnLeft)
   124 		HogTurnLeft(thugs[i].gear, not thugs[i].turnLeft)
   128 	end
   125 	end
   129 	
   126 	
   130 	AnimInit()
   127 	AnimInit()
   243 
   240 
   244 -------------- ACTIONS ------------------
   241 -------------- ACTIONS ------------------
   245 
   242 
   246 function heroDeath(gear)
   243 function heroDeath(gear)
   247 	SendStat('siGameResult', loc("Hog Solo lost, try again!")) --1
   244 	SendStat('siGameResult', loc("Hog Solo lost, try again!")) --1
   248 	SendStat('siCustomAchievement', loc("To win the game you have to eliminate your enemies")) --11
   245 	SendStat('siCustomAchievement', loc("To win the game you have to eliminate all your enemies")) --11
   249 	SendStat('siPlayerKills','1',teamC.name)
   246 	SendStat('siPlayerKills','1',teamC.name)
   250 	SendStat('siPlayerKills','0',teamA.name)
   247 	SendStat('siPlayerKills','0',teamA.name)
   251 	EndGame()
   248 	EndGame()
   252 end
   249 end
   253 
   250 
   254 function enemiesDeath(gear)
   251 function enemiesDeath(gear)
   255 	SendStat('siGameResult', loc("Congratulations, you won!")) --1
   252 	SendStat('siGameResult', loc("Congratulations, you won!")) --1
   256 	SendStat('siCustomAchievement', loc("You have successfuly eliminated Professor Hogevil")) --11
   253 	SendStat('siCustomAchievement', loc("You have successfuly eliminated Professor Hogevil")) --11
   257 	SendStat('siCustomAchievement', loc("You have rescued H and Dr. Cornelius")) --11
   254 	SendStat('siCustomAchievement', loc("You have rescued H and Dr.Cornelius")) --11
   258 	SendStat('siCustomAchievement', loc("You have acquired the device")) --11
   255 	SendStat('siCustomAchievement', loc("You have acquired the last part")) --11
   259 	SendStat('siPlayerKills','1',teamA.name)
   256 	SendStat('siPlayerKills','1',teamA.name)
   260 	SendStat('siPlayerKills','0',teamC.name)
   257 	SendStat('siPlayerKills','0',teamC.name)
   261 	EndGame()
   258 	EndGame()
   262 end
   259 end
   263 
   260 
   272 
   269 
   273 function AnimationSetup()
   270 function AnimationSetup()
   274 	-- DIALOG01, GAME START, INTRODUCTION
   271 	-- DIALOG01, GAME START, INTRODUCTION
   275 	AddSkipFunction(dialog01, Skipanim, {dialog01})
   272 	AddSkipFunction(dialog01, Skipanim, {dialog01})
   276 	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 3000}})
   273 	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 3000}})
   277 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Somewhere in the Death Planet, where no other hog lives..."), 5000}})
   274 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Somewhere in the uninhabitable Death Planet..."), 5000}})
   278 	table.insert(dialog01, {func = AnimSay, args = {professor.human, loc("Welcome HogSolo, surpised to see me?"), SAY_SAY, 4000}})
   275 	table.insert(dialog01, {func = AnimSay, args = {professor.human, loc("Welcome Hog Solo, surpised to see me?"), SAY_SAY, 4000}})
   279 	table.insert(dialog01, {func = AnimSay, args = {professor.human, loc("As you can see I have survived our last encounter and I had time to plot my master plan!"), SAY_SAY, 4000}})	
   276 	table.insert(dialog01, {func = AnimSay, args = {professor.human, loc("As you can see I have survived our last encounter and I had time to plot my master plan!"), SAY_SAY, 4000}})	
   280 	table.insert(dialog01, {func = AnimSay, args = {professor.human, loc("I've thought that the best way to get the device is to let you collect most of the parts for me!"), SAY_SAY, 4000}})	
   277 	table.insert(dialog01, {func = AnimSay, args = {professor.human, loc("I've thought that the best way to get the device is to let you collect most of the parts for me!"), SAY_SAY, 4000}})	
   281 	table.insert(dialog01, {func = AnimSay, args = {professor.human, loc("So, now I got the last part and I have your friends captured..."), SAY_SAY, 4000}})
   278 	table.insert(dialog01, {func = AnimSay, args = {professor.human, loc("So, now I got the last part and I have your friends captured..."), SAY_SAY, 4000}})
   282 	table.insert(dialog01, {func = AnimSay, args = {professor.human, loc("So, will you give me the other parts?"), SAY_SAY, 4000}})
   279 	table.insert(dialog01, {func = AnimSay, args = {professor.human, loc("Will you give me the other parts?"), SAY_SAY, 4000}})
   283 	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 3000}})
   280 	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 3000}})
   284 	table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("I will never hand you the parts!"), SAY_SAY, 4000}})	
   281 	table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("I will never hand you the parts!"), SAY_SAY, 4000}})	
   285 	table.insert(dialog01, {func = AnimWait, args = {professor.human, 3000}})
   282 	table.insert(dialog01, {func = AnimWait, args = {professor.human, 3000}})
   286 	table.insert(dialog01, {func = AnimSay, args = {professor.human, loc("Then prepare for battle!"), SAY_SAY, 4000}})	
   283 	table.insert(dialog01, {func = AnimSay, args = {professor.human, loc("Then prepare for battle!"), SAY_SAY, 4000}})	
   287 	table.insert(dialog01, {func = startBattle, args = {}})	
   284 	table.insert(dialog01, {func = startBattle, args = {}})