share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/global_functions.lua
changeset 11952 63988f36debf
parent 9810 54c0fdec4600
child 11964 f3c1679694d3
equal deleted inserted replaced
11951:b05db9ca6e1c 11952:63988f36debf
     2 	--        1       2        3        4      5         6        7
     2 	--        1       2        3        4      5         6        7
     3 	-- order: moon01, fruit01, fruit02, ice01, desert01, death01, final
     3 	-- order: moon01, fruit01, fruit02, ice01, desert01, death01, final
     4 	local status = "0000000"
     4 	local status = "0000000"
     5 	if tonumber(GetCampaignVar("MainMissionsStatus")) then
     5 	if tonumber(GetCampaignVar("MainMissionsStatus")) then
     6 		status = GetCampaignVar("MainMissionsStatus")
     6 		status = GetCampaignVar("MainMissionsStatus")
       
     7 	end
       
     8 
       
     9 	local planetToLevelMapping = {
       
    10 		[1] = 2,
       
    11 		[2] = 3,
       
    12 		[3] = 8,
       
    13 		[4] = 5,
       
    14 		[5] = 4,
       
    15 		[6] = 9,
       
    16 		[7] = 14
       
    17 	}
       
    18 
       
    19 	local level = planetToLevelMapping[planetNum]
       
    20 	if level ~= nil then
       
    21 		SaveCampaignVar("Mission"..level.."Won", "true")
     7 	end
    22 	end
     8 
    23 
     9 	if planetNum == 1 then
    24 	if planetNum == 1 then
    10 		status = "1"..status:sub(2)
    25 		status = "1"..status:sub(2)
    11 	elseif planetNum == status:len() then
    26 	elseif planetNum == status:len() then