share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/moon01.lua
changeset 14488 7bb7e5e54f70
parent 14401 6c21bd8547dd
child 14612 bd15c8551318
equal deleted inserted replaced
14487:d72fb761aa59 14488:7bb7e5e54f70
   109 	Explosives = 0
   109 	Explosives = 0
   110 	HealthDecrease = 0
   110 	HealthDecrease = 0
   111 	WaterRise = 0
   111 	WaterRise = 0
   112 	Map = "moon01_map"
   112 	Map = "moon01_map"
   113 	Theme = "Cheese" -- Because ofc moon is made of cheese :)
   113 	Theme = "Cheese" -- Because ofc moon is made of cheese :)
   114 	-- Hog Solo
   114 	-- Hero
   115 	AddTeam(teamD.name, teamD.color, "Simple", "Island", "Default", "hedgewars")
   115 	teamD.name = AddMissionTeam(teamD.color)
   116 	if tonumber(GetCampaignVar("HeroHealth")) then
   116 	if tonumber(GetCampaignVar("HeroHealth")) then
   117 		hero.gear = AddHog(hero.name, 0, tonumber(GetCampaignVar("HeroHealth")), "war_desertgrenadier1")
   117 		hero.gear = AddMissionHog(tonumber(GetCampaignVar("HeroHealth")))
   118 	else
   118 	else
   119 		hero.gear = AddHog(hero.name, 0, 100, "war_desertgrenadier1")
   119 		hero.gear = AddMissionHog(100)
   120 	end
   120 	end
       
   121 	hero.name = GetHogName(hero.gear)
   121 	AnimSetGearPosition(hero.gear, hero.x, hero.y)
   122 	AnimSetGearPosition(hero.gear, hero.x, hero.y)
   122 	-- PAotH
   123 	-- PAotH
   123 	AddTeam(teamA.name, teamA.color, "Earth", "Island", "Default", "cm_galaxy")
   124 	teamA.name = AddTeam(teamA.name, teamA.color, "Earth", "Island", "Default", "cm_galaxy")
   124 	paoth1.gear = AddHog(paoth1.name, 0, 100, "scif_2001O")
   125 	paoth1.gear = AddHog(paoth1.name, 0, 100, "scif_2001O")
   125 	AnimSetGearPosition(paoth1.gear, paoth1.x, paoth1.y)
   126 	AnimSetGearPosition(paoth1.gear, paoth1.x, paoth1.y)
   126 	HogTurnLeft(paoth1.gear, true)
   127 	HogTurnLeft(paoth1.gear, true)
   127 	paoth2.gear = AddHog(paoth2.name, 0, 100, "scif_2001Y")
   128 	paoth2.gear = AddHog(paoth2.name, 0, 100, "scif_2001Y")
   128 	AnimSetGearPosition(paoth2.gear, paoth2.x, paoth2.y)
   129 	AnimSetGearPosition(paoth2.gear, paoth2.x, paoth2.y)
   132 	HogTurnLeft(paoth3.gear, true)
   133 	HogTurnLeft(paoth3.gear, true)
   133 	paoth4.gear = AddHog(paoth4.name, 0, 100, "scif_2001Y")
   134 	paoth4.gear = AddHog(paoth4.name, 0, 100, "scif_2001Y")
   134 	AnimSetGearPosition(paoth4.gear, paoth4.x, paoth4.y)
   135 	AnimSetGearPosition(paoth4.gear, paoth4.x, paoth4.y)
   135 	HogTurnLeft(paoth4.gear, true)
   136 	HogTurnLeft(paoth4.gear, true)
   136 	-- Professor
   137 	-- Professor
   137 	AddTeam(teamC.name, teamC.color, "star", "Island", "Default", "cm_sine")
   138 	teamC.name = AddTeam(teamC.name, teamC.color, "star", "Island", "Default", "cm_sine")
   138 	professor.gear = AddHog(professor.name, 0, professor.health, "tophats")
   139 	professor.gear = AddHog(professor.name, 0, professor.health, "tophats")
   139 	AnimSetGearPosition(professor.gear, professor.x, professor.y)
   140 	AnimSetGearPosition(professor.gear, professor.x, professor.y)
   140 	HogTurnLeft(professor.gear, true)
   141 	HogTurnLeft(professor.gear, true)
   141 	-- Minions
   142 	-- Minions
   142 	AddTeam(teamB.name, teamB.color, "eyecross", "Island", "Default", "cm_sine")
   143 	teamB.name = AddTeam(teamB.name, teamB.color, "eyecross", "Island", "Default", "cm_sine")
   143 	minion1.gear = AddHog(minion1.name, 1, 50, "Gasmask")
   144 	minion1.gear = AddHog(minion1.name, 1, 50, "Gasmask")
   144 	AnimSetGearPosition(minion1.gear, minion1.x, minion1.y)
   145 	AnimSetGearPosition(minion1.gear, minion1.x, minion1.y)
   145 	HogTurnLeft(minion1.gear, true)
   146 	HogTurnLeft(minion1.gear, true)
   146 	minion2.gear = AddHog(minion2.name, 1, 50, "Gasmask")
   147 	minion2.gear = AddHog(minion2.name, 1, 50, "Gasmask")
   147 	AnimSetGearPosition(minion2.gear, minion2.x, minion2.y)
   148 	AnimSetGearPosition(minion2.gear, minion2.x, minion2.y)
   170 function onGameStart()
   171 function onGameStart()
   171 	-- wait for the first turn to start
   172 	-- wait for the first turn to start
   172 	AnimWait(hero.gear, 3000)
   173 	AnimWait(hero.gear, 3000)
   173 	FollowGear(hero.gear)
   174 	FollowGear(hero.gear)
   174 
   175 
   175 	ShowMission(campaignName, missionName, loc("Hog Solo has to refuel his saucer.")..
   176 	ShowMission(campaignName, missionName, string.format(loc("%s has to refuel the saucer."), hero.name)..
   176 	"|"..loc("Rescue the imprisoned PAotH team and get the fuel!"), -amSkip, 0)
   177 	"|"..loc("Rescue the imprisoned PAotH team and get the fuel!"), -amSkip, 0)
   177 
   178 
   178 	AddAmmo(minion1.gear, amDEagle, 10)
   179 	AddAmmo(minion1.gear, amDEagle, 10)
   179 	AddAmmo(minion2.gear, amDEagle, 10)
   180 	AddAmmo(minion2.gear, amDEagle, 10)
   180 	AddAmmo(minion3.gear, amDEagle, 10)
   181 	AddAmmo(minion3.gear, amDEagle, 10)
   359 	-- but it is still theoretically possible to win by going for the weapons
   360 	-- but it is still theoretically possible to win by going for the weapons
   360 	-- very fast.
   361 	-- very fast.
   361 end
   362 end
   362 
   363 
   363 function heroDeath(gear)
   364 function heroDeath(gear)
   364 	SendStat(siGameResult, loc("Hog Solo lost, try again!"))
   365 	SendStat(siGameResult, string.format(loc("%s lost, try again!"), hero.name))
   365 	SendStat(siCustomAchievement, loc("You have to get the weapons and rescue the PAotH researchers."))
   366 	SendStat(siCustomAchievement, loc("You have to get the weapons and rescue the PAotH researchers."))
   366 	sendSimpleTeamRankings({teamC.name, teamB.name, teamD.name, teamA.name})
   367 	sendSimpleTeamRankings({teamC.name, teamB.name, teamD.name, teamA.name})
   367 	EndGame()
   368 	EndGame()
   368 end
   369 end
   369 
   370 
   385 end
   386 end
   386 
   387 
   387 function victory()
   388 function victory()
   388 	AnimCaption(hero.gear, loc("Congrats! You won!"), 6000)
   389 	AnimCaption(hero.gear, loc("Congrats! You won!"), 6000)
   389 	saveCompletedStatus(1)
   390 	saveCompletedStatus(1)
   390 	SendStat(siGameResult, loc("Hog Solo wins, congratulations!"))
   391 	SendStat(siGameResult, string.format(loc("%s wins, congratulations!"), hero.name))
   391 	sendSimpleTeamRankings({teamD.name, teamA.name, teamC.name, teamB.name})
   392 	sendSimpleTeamRankings({teamD.name, teamA.name, teamC.name, teamB.name})
   392 	SaveCampaignVar("CosmosCheckPoint", "5") -- hero got fuels
   393 	SaveCampaignVar("CosmosCheckPoint", "5") -- hero got fuels
   393 	resetCheckpoint() -- reset this mission
   394 	resetCheckpoint() -- reset this mission
   394 	gameOver = true
   395 	gameOver = true
   395 	EndGame()
   396 	EndGame()
   471 function AnimationSetup()
   472 function AnimationSetup()
   472 	-- DIALOG 01 - Start, welcome to moon
   473 	-- DIALOG 01 - Start, welcome to moon
   473 	AddSkipFunction(dialog01, Skipanim, {dialog01})
   474 	AddSkipFunction(dialog01, Skipanim, {dialog01})
   474 	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 3000}})
   475 	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 3000}})
   475 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Near a PAotH base on the moon ..."),  4000}})
   476 	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Near a PAotH base on the moon ..."),  4000}})
   476 	table.insert(dialog01, {func = AnimSay, args = {paoth1.gear, loc("Hey, Hog Solo! Finally you have come!"), SAY_SAY, 2000}})
   477 	table.insert(dialog01, {func = AnimSay, args = {paoth1.gear, string.format(loc("Hey, %s! Finally you have come!"), hero.name), SAY_SAY, 2000}})
   477 	table.insert(dialog01, {func = AnimSay, args = {paoth1.gear, loc("It seems that Professor Hogevil has prepared for your arrival!"), SAY_SAY, 4000}})
   478 	table.insert(dialog01, {func = AnimSay, args = {paoth1.gear, loc("It seems that Professor Hogevil has prepared for your arrival!"), SAY_SAY, 4000}})
   478 	table.insert(dialog01, {func = AnimSay, args = {paoth1.gear, loc("He has captured the rest of the PAotH team and awaits to capture you!"), SAY_SAY, 5000}})
   479 	table.insert(dialog01, {func = AnimSay, args = {paoth1.gear, loc("He has captured the rest of the PAotH team and awaits to capture you!"), SAY_SAY, 5000}})
   479 	table.insert(dialog01, {func = AnimSay, args = {paoth1.gear, loc("We have to hurry! Are you armed?"), SAY_SAY, 4300}})
   480 	table.insert(dialog01, {func = AnimSay, args = {paoth1.gear, loc("We have to hurry! Are you armed?"), SAY_SAY, 4300}})
   480 	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 450}})
   481 	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 450}})
   481 	table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("No, I am afraid I had to travel light."), SAY_SAY, 2500}})
   482 	table.insert(dialog01, {func = AnimSay, args = {hero.gear, loc("No, I am afraid I had to travel light."), SAY_SAY, 2500}})