Draw 2 flowers for fully completed (w/ side missions) planets in space campaign
authorWuzzy <almikes@aol.com>
Sun, 20 Nov 2016 03:43:27 +0100
changeset 11964 f3c1679694d3
parent 11963 0c1420aaa59e
child 11965 72be38f6d0c0
Draw 2 flowers for fully completed (w/ side missions) planets in space campaign
share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/cosmos.lua
share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/global_functions.lua
--- a/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/cosmos.lua	Sun Nov 20 01:50:24 2016 +0100
+++ b/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/cosmos.lua	Sun Nov 20 03:43:27 2016 +0100
@@ -479,27 +479,37 @@
 	--WriteLnToConsole("status: "..status.fruit01.." - "..status.fruit02)
 	if status.moon01 then
 		vgear = AddVisualGear(1116, 848, vgtBeeTrace, 0, false)
-
+		if status.moon02 then
+			vgear = AddVisualGear(1116, 828, vgtBeeTrace, 0, false)
+		end
 	end
 	if status.ice01 then
 		vgear = AddVisualGear(1512, 120, vgtBeeTrace, 0, false)
-
+		if status.ice02 then
+			vgear = AddVisualGear(1512, 100, vgtBeeTrace, 0, false)
+		end
 	end
 	if status.desert01 then
 		vgear = AddVisualGear(4015, 316, vgtBeeTrace, 0, false)
-
+		if status.desert02 and status.desert03 then
+			vgear = AddVisualGear(4015, 296, vgtBeeTrace, 0, false)
+		end
 	end
 	if status.fruit01 and status.fruit02 then
 		vgear = AddVisualGear(2390, 384, vgtBeeTrace, 0, false)
-
+		if status.fruit03 then
+			vgear = AddVisualGear(2390, 364, vgtBeeTrace, 0, false)
+		end
 	end
 	if status.death01 then
 		vgear = AddVisualGear(444, 400, vgtBeeTrace, 0, false)
-
+		if status.death02 then
+			vgear = AddVisualGear(444, 380, vgtBeeTrace, 0, false)
+		end
 	end
 	if status.final then
 		vgear = AddVisualGear(3070, 810, vgtBeeTrace, 0, false)
-
+		vgear = AddVisualGear(3070, 790, vgtBeeTrace, 0, false)
 	end
 end
 
@@ -595,6 +605,7 @@
 	SendStat(siCustomAchievement, loc("Return to the mission menu by pressing the \"Go back\" button."))
 	SendStat(siCustomAchievement, loc("You can choose another planet by replaying this mission."))
 	SendStat(siCustomAchievement, loc("Planets with completed main missions will be marked with a flower."))
+	SendStat(siCustomAchievement, loc("Planets with all missions completed will be marked with two flowers."))
 	SendStat(siPlayerKills,'1',teamC.name)
 	EndGame()
 end
--- a/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/global_functions.lua	Sun Nov 20 01:50:24 2016 +0100
+++ b/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/global_functions.lua	Sun Nov 20 03:43:27 2016 +0100
@@ -38,11 +38,17 @@
 	end
 	local status = {
 		moon01 = false,
+		moon02 = false,
 		fruit01 = false,
 		fruit02 = false,
+		fruit03 = false,
 		ice01 = false,
+		ice02 = false,
 		desert01 = false,
+		desert02 = false,
+		desert03 = false,
 		death01 = false,
+		death02 = false,
 		final = false
 	}
 	if allStatus ~= "" then
@@ -68,6 +74,25 @@
 			status.final = true
 		end
 	end
+	-- Bonus missions
+	if GetCampaignVar("Mission13Won") == "true" then
+		status.moon02 = true
+	end
+	if GetCampaignVar("Mission6Won") == "true" then
+		status.ice02 = true
+	end
+	if GetCampaignVar("Mission7Won") == "true" then
+		status.desert02 = true
+	end
+	if GetCampaignVar("Mission10Won") == "true" then
+		status.fruit03 = true
+	end
+	if GetCampaignVar("Mission11Won") == "true" then
+		status.death02 = true
+	end
+	if GetCampaignVar("Mission12Won") == "true" then
+		status.desert03 = true
+	end
 	return status
 end