added captions with rules and objectives spacecampaign
authorPeriklis Ntanasis <pntanasis@gmail.com>
Fri, 06 Sep 2013 06:29:42 +0300
branchspacecampaign
changeset 9608 e2d4c2198e55
parent 9607 893e5871b809
child 9609 70ef35c925d8
added captions with rules and objectives
share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/desert03.lua
--- a/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/desert03.lua	Fri Sep 06 06:03:26 2013 +0300
+++ b/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/desert03.lua	Fri Sep 06 06:29:42 2013 +0300
@@ -12,8 +12,14 @@
 local challengeObjectives = loc("Use the rc plane and destroy the all the targets").."|"..
 	loc("Each time you destroy your level targets you'll get teleported to the next level").."|"..
 	loc("You'll have only one rc plane at the start of the mission").."|"..
-	loc("During the game you can get new plane by getting the weapon crates")
+	loc("During the game you can get new planes by getting the weapon crates")
 local currentTarget = 1
+-- dialogs
+local dialog01 = {}
+-- mission objectives
+local goals = {
+	[dialog01] = {missionName, loc("Challenge Objectives"), challengeObjectives, 1, 4500},
+}
 -- hogs
 local hero = {
 	name = loc("Hog Solo"),
@@ -69,7 +75,7 @@
 	initCheckpoint("desert03")
 	
 	AnimInit()
-	--AnimationSetup()
+	AnimationSetup()
 end
 
 function onGameStart()
@@ -88,6 +94,7 @@
 	AddAmmo(hero.gear, amRCPlane, 1)
 
 	SendHealthStatsOff()
+	AddAnim(dialog01)
 end
 
 function onGameTick()
@@ -140,6 +147,25 @@
 	gameOver()
 end
 
+-------------- ANIMATIONS ------------------
+
+function Skipanim(anim)
+	if goals[anim] ~= nil then
+		ShowMission(unpack(goals[anim]))
+    end
+end
+
+function AnimationSetup()
+	-- DIALOG 01 - Start, game instructions
+	AddSkipFunction(dialog01, Skipanim, {dialog01})
+	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 3000}})
+	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("In the Desert Planet, Hog Solo found some time to play with his RC plane..."), 3000}})
+	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("Each time you destroy your level targets you'll get teleported to the next level"), 5000}})
+	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("You'll have only one rc plane at the start of the mission"), 5000}})
+	table.insert(dialog01, {func = AnimCaption, args = {hero.gear, loc("During the game you can get new planes by getting the weapon crates"), 5000}})
+	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 500}})	
+end
+
 ----------------- Other Functions -----------------
 
 function checkTargetsDestroied()