share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/fruit01.lua
branchspacecampaign
changeset 9578 16139270448f
parent 9574 da3d39667881
child 9582 bf314b2258b3
--- a/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/fruit01.lua	Mon Aug 26 02:08:11 2013 +0300
+++ b/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/fruit01.lua	Mon Aug 26 06:13:36 2013 +0300
@@ -21,6 +21,7 @@
 
 HedgewarsScriptLoad("/Scripts/Locale.lua")
 HedgewarsScriptLoad("/Scripts/Animate.lua")
+HedgewarsScriptLoad("/Missions/Campaign/A_Space_Adventure/global_functions.lua")
 
 ----------------- VARIABLES --------------------
 -- globals
@@ -326,6 +327,7 @@
 
 function battleWin(gear)
 	-- add stats
+	saveVariables()
 	SendStat('siGameResult', loc("Green Bananas won!")) --1
 	SendStat('siCustomAchievement', loc("You have eliminated all the visible enemy hogs!")) --11
 	SendStat('siPlayerKills','1',teamA.name)
@@ -336,6 +338,7 @@
 
 function escapeWin(gear)
 	-- add stats
+	saveVariables()
 	SendStat('siGameResult', loc("Hog Solo escaped successfully!")) --1
 	SendStat('siCustomAchievement', loc("You have reached the flying area successfully!")) --11
 	SendStat('siPlayerKills','1',teamA.name)
@@ -472,3 +475,11 @@
 		end
 	end
 end
+
+function saveVariables()
+	saveCompletedStatus(2)
+	SaveCampaignVar("UnlockedMissions", "3")
+	SaveCampaignVar("Mission1", "3")
+	SaveCampaignVar("Mission2", "8")
+	SaveCampaignVar("Mission3", "1")
+end