share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/global_functions.lua
changeset 11952 63988f36debf
parent 9810 54c0fdec4600
child 11964 f3c1679694d3
--- a/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/global_functions.lua	Wed May 04 02:10:59 2016 +0200
+++ b/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/global_functions.lua	Sun Nov 20 00:12:07 2016 +0100
@@ -6,6 +6,21 @@
 		status = GetCampaignVar("MainMissionsStatus")
 	end
 
+	local planetToLevelMapping = {
+		[1] = 2,
+		[2] = 3,
+		[3] = 8,
+		[4] = 5,
+		[5] = 4,
+		[6] = 9,
+		[7] = 14
+	}
+
+	local level = planetToLevelMapping[planetNum]
+	if level ~= nil then
+		SaveCampaignVar("Mission"..level.."Won", "true")
+	end
+
 	if planetNum == 1 then
 		status = "1"..status:sub(2)
 	elseif planetNum == status:len() then