cosmos, after death01 dialogs spacecampaign
authorPeriklis Ntanasis <pntanasis@gmail.com>
Wed, 18 Sep 2013 02:08:45 +0300
branchspacecampaign
changeset 9636 e1921235fc78
parent 9635 ea454f8a1593
child 9637 b23f9b7d49fa
cosmos, after death01 dialogs
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	Wed Sep 18 01:25:59 2013 +0300
+++ b/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/cosmos.lua	Wed Sep 18 02:08:45 2013 +0300
@@ -33,6 +33,7 @@
 local dialog05 = {}
 local dialog06 = {}
 local dialog07 = {}
+local dialog08 = {}
 -- mission objectives
 local goals = {
 	[dialog01] = {missionName, loc("Getting ready"), loc("Go and collect the crate").."|"..loc("Try not to get spotted by the guards!"), 1, 4500},
@@ -197,6 +198,10 @@
 		AddEvent(onDeathPlanetLanding, {hero.gear}, deathPlanetLanding, {hero.gear}, 0)
 	end
 	
+	if status.death01 and not status.final then
+		AddAnim(dialog08)
+	end
+	
 	SendHealthStatsOff()
 end
 
@@ -505,6 +510,16 @@
 	AddSkipFunction(dialog07, Skipanim, {dialog07})
 	table.insert(dialog07, {func = AnimCaption, args = {hero.gear, loc("This planet seems dangerous!"),  5000}})
 	table.insert(dialog07, {func = AnimSay, args = {hero.gear, loc("I am not ready for this planet yet. I should visit it when I have found all the other parts"), SAY_THINK, 4000}})
+	-- DIALOG 08 - Hero wins death01
+	AddSkipFunction(dialog08, Skipanim, {dialog08})
+	table.insert(dialog08, {func = AnimCaption, args = {hero.gear, loc("Under the meteorite shadow..."),  4000}})
+	table.insert(dialog08, {func = AnimSay, args = {doctor.gear, loc("You did great Hog Solo! However we aren't out of danger yet!"), SAY_SHOUT, 4500}})
+	table.insert(dialog08, {func = AnimSay, args = {doctor.gear, loc("The meteorite has come too close and the anti-gravity device isn't powerful enough to get it out of order"), SAY_SHOUT, 5000}})
+	table.insert(dialog08, {func = AnimSay, args = {doctor.gear, loc("We need it to get split into at least two parts"), SAY_SHOUT, 3000}})
+	table.insert(dialog08, {func = AnimSay, args = {doctor.gear, loc("PAotH has sent explosives but unfortunately the trigger mechanism seems to be faulty!"), SAY_SHOUT, 5000}})
+	table.insert(dialog08, {func = AnimSay, args = {doctor.gear, loc("We need you to go there and detonate them yourself! Good luck!"), SAY_SHOUT, 500}})
+	table.insert(dialog08, {func = AnimWait, args = {doctor.gear, 3000}})
+	table.insert(dialog08, {func = AnimSwitchHog, args = {hero.gear}})
 end
 
 ------------------- custom "animation" functions --------------------------
--- a/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/global_functions.lua	Wed Sep 18 01:25:59 2013 +0300
+++ b/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/global_functions.lua	Wed Sep 18 02:08:45 2013 +0300
@@ -1,7 +1,7 @@
 function saveCompletedStatus(planetNum)
-	--        1       2        3        4      5         6
-	-- order: moon01, fruit01, fruit02, ice01, desert01, death01
-	local status = "000000"
+	--        1       2        3        4      5         6        7
+	-- order: moon01, fruit01, fruit02, ice01, desert01, death01, final
+	local status = "0000000"
 	if tonumber(GetCampaignVar("MainMissionsStatus")) then
 		status = GetCampaignVar("MainMissionsStatus")
 	end
@@ -26,7 +26,8 @@
 		fruit02 = false,
 		ice01 = false,
 		desert01 = false,
-		death01 = false
+		death01 = false,
+		final = false
 	}
 	if allStatus ~= "" then
 		if allStatus:sub(1,1) == "1" then
@@ -47,6 +48,9 @@
 		if allStatus:sub(6,6) == "1" then
 			status.death01 = true
 		end
+		if allStatus:sub(7,7) == "1" then
+			status.final = true
+		end
 	end
 	return status
 end