share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/death01.lua
changeset 14488 7bb7e5e54f70
parent 14442 448213112508
child 14489 e5f1431aea1e
equal deleted inserted replaced
14487:d72fb761aa59 14488:7bb7e5e54f70
     1 ------------------- ABOUT ----------------------
     1 ------------------- ABOUT ----------------------
     2 --
     2 --
     3 -- This is the mission to acquire the last part.
     3 -- This is the mission to acquire the last part.
     4 -- This mission is the cameo of Professor Hogevil
     4 -- This mission is the cameo of Professor Hogevil
     5 -- who has took hostages H and Dr. Cornelius.
     5 -- who has took hostages H and Dr. Cornelius.
     6 -- Hog Solo has to defeat him and his thugs.
     6 -- The hero has to defeat him and his thugs.
     7 
     7 
     8 HedgewarsScriptLoad("/Scripts/Locale.lua")
     8 HedgewarsScriptLoad("/Scripts/Locale.lua")
     9 HedgewarsScriptLoad("/Scripts/Animate.lua")
     9 HedgewarsScriptLoad("/Scripts/Animate.lua")
    10 HedgewarsScriptLoad("/Missions/Campaign/A_Space_Adventure/global_functions.lua")
    10 HedgewarsScriptLoad("/Missions/Campaign/A_Space_Adventure/global_functions.lua")
    11 
    11 
   101 	HealthDecrease = 0
   101 	HealthDecrease = 0
   102 	WaterRise = 0
   102 	WaterRise = 0
   103 	Map = "death01_map"
   103 	Map = "death01_map"
   104 	Theme = "Hell"
   104 	Theme = "Hell"
   105 
   105 
   106 	-- Hog Solo
   106 	-- Hero
   107 	AddTeam(teamA.name, teamA.color, "Simple", "Island", "Default", "hedgewars")
   107 	teamA.name = AddMissionTeam(teamA.color)
   108 	hero.gear = AddHog(hero.name, 0, 100, "war_desertgrenadier1")
   108 	hero.gear = AddMissionHog(100)
       
   109 	hero.name = GetHogName(hero.gear)
   109 	AnimSetGearPosition(hero.gear, hero.x, hero.y)
   110 	AnimSetGearPosition(hero.gear, hero.x, hero.y)
   110 
   111 
   111 	-- PAotH
   112 	-- PAotH
   112 	AddTeam(teamB.name, teamB.color, "Earth", "Island", "Default", "cm_galaxy")
   113 	teamB.name = AddTeam(teamB.name, teamB.color, "Earth", "Island", "Default", "cm_galaxy")
   113 	paoth1.gear = AddHog(paoth1.name, 0, 100, "hair_yellow")
   114 	paoth1.gear = AddHog(paoth1.name, 0, 100, "hair_yellow")
   114 	AnimSetGearPosition(paoth1.gear, paoth1.x, paoth1.y)
   115 	AnimSetGearPosition(paoth1.gear, paoth1.x, paoth1.y)
   115 	HogTurnLeft(paoth1.gear, true)
   116 	HogTurnLeft(paoth1.gear, true)
   116 	SetGearAIHints(paoth1.gear, aihDoesntMatter)
   117 	SetGearAIHints(paoth1.gear, aihDoesntMatter)
   117 	paoth2.gear = AddHog(paoth2.name, 0, 100, "Glasses")
   118 	paoth2.gear = AddHog(paoth2.name, 0, 100, "Glasses")
   118 	AnimSetGearPosition(paoth2.gear, paoth2.x, paoth2.y)
   119 	AnimSetGearPosition(paoth2.gear, paoth2.x, paoth2.y)
   119 	HogTurnLeft(paoth2.gear, true)
   120 	HogTurnLeft(paoth2.gear, true)
   120 	SetGearAIHints(paoth2.gear, aihDoesntMatter)
   121 	SetGearAIHints(paoth2.gear, aihDoesntMatter)
   121 
   122 
   122 	-- Professor and Thugs
   123 	-- Professor and Thugs
   123 	AddTeam(teamC.name, teamC.color, "eyecross", "Island", "Default", "cm_sine")
   124 	teamC.name = AddTeam(teamC.name, teamC.color, "eyecross", "Island", "Default", "cm_sine")
   124 	professor.bot = AddHog(professor.name, 1, 300, "tophats")
   125 	professor.bot = AddHog(professor.name, 1, 300, "tophats")
   125 	AnimSetGearPosition(professor.bot, paoth1.x - 100, paoth1.y)
   126 	AnimSetGearPosition(professor.bot, paoth1.x - 100, paoth1.y)
   126 	HogTurnLeft(professor.bot, true)
   127 	HogTurnLeft(professor.bot, true)
   127 	professor.gear = professor.bot
   128 	professor.gear = professor.bot
   128 	for i=1,table.getn(thugs) do
   129 	for i=1,table.getn(thugs) do
   129 		thugs[i].gear = AddHog(string.format(loc("Thug #%d"), i), 1, thugs[i].health, "war_desertgrenadier1")
   130 		thugs[i].gear = AddHog(string.format(loc("Thug #%d"), i), 1, thugs[i].health, "war_desertgrenadier1")
   130 		AnimSetGearPosition(thugs[i].gear, thugs[i].x, thugs[i].y)
   131 		AnimSetGearPosition(thugs[i].gear, thugs[i].x, thugs[i].y)
   131 		HogTurnLeft(thugs[i].gear, not thugs[i].turnLeft)
   132 		HogTurnLeft(thugs[i].gear, not thugs[i].turnLeft)
   132 	end
   133 	end
   133 
   134 
   134 	AddTeam(teamC.name, teamC.color, "star", "Island", "Default", "cm_sine")
   135 	teamC.name = AddTeam(teamC.name, teamC.color, "star", "Island", "Default", "cm_sine")
   135 	professor.human = AddHog(professor.name, 0, 300, "tophats")
   136 	professor.human = AddHog(professor.name, 0, 300, "tophats")
   136 	AnimSetGearPosition(professor.human, hero.x + 70, hero.y)
   137 	AnimSetGearPosition(professor.human, hero.x + 70, hero.y)
   137 	HogTurnLeft(professor.human, true)
   138 	HogTurnLeft(professor.human, true)
   138 
   139 
   139 	initCheckpoint("death01")
   140 	initCheckpoint("death01")
   272 end
   273 end
   273 
   274 
   274 -------------- ACTIONS ------------------
   275 -------------- ACTIONS ------------------
   275 
   276 
   276 function heroDeath(gear)
   277 function heroDeath(gear)
   277 	SendStat(siGameResult, loc("Hog Solo lost, try again!"))
   278 	SendStat(siGameResult, string.format(loc("%s lost, try again!"), hero.name))
   278 	SendStat(siCustomAchievement, loc("To win the game you have to eliminate Professor Hogevil."))
   279 	SendStat(siCustomAchievement, loc("To win the game you have to eliminate Professor Hogevil."))
   279 	sendSimpleTeamRankings({teamC.name, teamA.name, teamB.name})
   280 	sendSimpleTeamRankings({teamC.name, teamA.name, teamB.name})
   280 	EndGame()
   281 	EndGame()
   281 end
   282 end
   282 
   283 
   301 	local profDiedOnMoon = GetCampaignVar("ProfDiedOnMoon") == "1"
   302 	local profDiedOnMoon = GetCampaignVar("ProfDiedOnMoon") == "1"
   302 	-- DIALOG01, GAME START, INTRODUCTION
   303 	-- DIALOG01, GAME START, INTRODUCTION
   303 	AddSkipFunction(dialog01, Skipanim, {dialog01})
   304 	AddSkipFunction(dialog01, Skipanim, {dialog01})
   304 	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 3000}})
   305 	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 3000}})
   305 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Somewhere on the uninhabitable Death Planet ..."), 5000}})
   306 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Somewhere on the uninhabitable Death Planet ..."), 5000}})
   306 	table.insert(dialog01, {func = AnimSay, args = {professor.human, loc("Welcome Hog Solo, surprised to see me?"), SAY_SAY, 4000}})
   307 	table.insert(dialog01, {func = AnimSay, args = {professor.human, string.format(loc("Welcome, %s, surprised to see me?"), hero.name), SAY_SAY, 4000}})
   307 	if profDiedOnMoon then
   308 	if profDiedOnMoon then
   308 		table.insert(dialog01, {func = AnimSay, args = {professor.human, loc("After you left the moon, my other loyal minions came and resurrected me so I could complete my master plan."), SAY_SAY, 6000}})
   309 		table.insert(dialog01, {func = AnimSay, args = {professor.human, loc("After you left the moon, my other loyal minions came and resurrected me so I could complete my master plan."), SAY_SAY, 6000}})
   309 	else
   310 	else
   310 		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}})
   311 		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}})
   311 	end
   312 	end