add stats to cosmos spacecampaign
authorPeriklis Ntanasis <pntanasis@gmail.com>
Tue, 27 Aug 2013 02:00:13 +0300
branchspacecampaign
changeset 9584 a7bf5464dfb6
parent 9582 bf314b2258b3
child 9585 d079e1cc2806
add stats to cosmos
share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/cosmos.lua
--- a/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/cosmos.lua	Tue Aug 27 01:25:46 2013 +0300
+++ b/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/cosmos.lua	Tue Aug 27 02:00:13 2013 +0300
@@ -195,6 +195,8 @@
 	if GetCampaignVar("Planet") ~= "deathPlanet" then
 		AddEvent(onDeathPlanetLanding, {hero.gear}, deathPlanetLanding, {hero.gear}, 0)
 	end
+	
+	SendHealthStatsOff()
 end
 
 function onGameTick()
@@ -343,7 +345,7 @@
 	SaveCampaignVar("UnlockedMissions", "2")
 	SaveCampaignVar("Mission1", "2")
 	SaveCampaignVar("Mission2", "1")
-	EndGame()
+	sendStats(loc("the moon"))
 end
 
 function fruitPlanetLanding(gear)
@@ -355,7 +357,7 @@
 		SaveCampaignVar("UnlockedMissions", "2")
 		SaveCampaignVar("Mission1", "3")
 		SaveCampaignVar("Mission2", "1")
-		EndGame()
+		sendStats(loc("the Fruit Planet"))
 	end
 end
 
@@ -369,7 +371,7 @@
 		SaveCampaignVar("Mission1", "4")
 		SaveCampaignVar("Mission2", "7")
 		SaveCampaignVar("Mission3", "1")
-		EndGame()
+		sendStats(loc("the Desert Planet"))
 	end
 end
 
@@ -383,7 +385,7 @@
 		SaveCampaignVar("Mission1", "5")
 		SaveCampaignVar("Mission2", "6")
 		SaveCampaignVar("Mission3", "1")
-		EndGame()
+		sendStats(loc("the Ice Planet"))
 	end
 end
 
@@ -398,7 +400,7 @@
 		SaveCampaignVar("UnlockedMissions", "2")
 		SaveCampaignVar("Mission1", "9")
 		SaveCampaignVar("Mission2", "1")
-		EndGame()
+		sendStats(loc("the Planet of Death"))
 	end
 end
 
@@ -486,3 +488,11 @@
 	AnimSwitchHog(hero.gear)
 	TurnTimeLeft = 0
 end
+
+function sendStats(planet)
+	SendStat('siGameResult', loc("Hog Solo arrived to "..planet)) --1
+	SendStat('siCustomAchievement', loc("Return to the mission menu by pressing the \"Go back\" button")) --11
+	SendStat('siCustomAchievement', loc("Choose another planet by replaying the mission")) --11
+	SendStat('siPlayerKills','1',teamC.name)
+	EndGame()
+end