stats and minor corrections, difficulty adjustment spacecampaign
authorPeriklis Ntanasis <pntanasis@gmail.com>
Tue, 06 Aug 2013 23:34:24 +0300
branchspacecampaign
changeset 9474 c255f6c46e33
parent 9471 867f020b0621
child 9476 3ca7160dc6d2
stats and minor corrections, difficulty adjustment
share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/desert01.lua
share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/desert02.lua
--- a/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/desert01.lua	Mon Aug 05 20:02:16 2013 +0300
+++ b/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/desert01.lua	Tue Aug 06 23:34:24 2013 +0300
@@ -241,7 +241,6 @@
 	elseif CurrentHedgehog == ally.gear then
 		TurnTimeLeft = 0
 	end
-	WriteLnToConsole("CURRENT HEDGEHOG IS "..CurrentHedgehog)
 end
 
 function onGameTick()
@@ -442,11 +441,16 @@
 	table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("There is the tunnel entrance"), SAY_SAY, 3000}})
 	table.insert(dialog01, {func = AnimSay, args = {ally.gear, loc("Good luck!"), SAY_SAY, 3000}})
 	table.insert(dialog01, {func = AnimWait, args = {hero.gear, 500}})
-	table.insert(dialog01, {func = AnimSwitchHog, args = {hero.gear}})	
+	table.insert(dialog01, {func = startMission, args = {hero.gear}})	
 end
 
 --------------- OTHER FUNCTIONS ------------------
 
+function startMission()
+	AnimSwitchHog(bandit1.gear)
+	TurnTimeLeft = 0
+end
+
 function secondBattle()
 	-- second battle
 	heroIsInBattle = true
--- a/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/desert02.lua	Mon Aug 05 20:02:16 2013 +0300
+++ b/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/desert02.lua	Tue Aug 06 23:34:24 2013 +0300
@@ -10,6 +10,8 @@
 -- globals
 local campaignName = loc("A Space Adventure")
 local missionName = loc("Desert planet, Journey down below!")
+local turnCounter = 0
+local startChallenge = false
 -- dialogs
 local dialog01 = {}
 -- mission objectives
@@ -53,7 +55,7 @@
 function onGameInit()
 	GameFlags = gfOneClanMode
 	Seed = 1
-	TurnTime = 6000
+	TurnTime = 8000
 	Delay = 2
 	CaseFreq = 0
 	MinesNum = 500
@@ -89,8 +91,8 @@
 end
 
 function onNewTurn()
-	if not hero.dead and CurrentHedgehog == ally.gear and challengeStarted then
-		heroLost()
+	if not hero.dead and startChallenge then
+		turnCounter = turnCounter + 1
 	end
 end
 
@@ -125,7 +127,7 @@
 end
 
 function onHeroSafe(gear)
-	if not hero.dead and GetY(hero.gear) < 200 and StoppedGear(hero.gear) then
+	if not hero.dead and GetY(hero.gear) < 170 and StoppedGear(hero.gear) then
 		return true
 	end
 	return false
@@ -134,12 +136,19 @@
 -------------- OUTCOMES ------------------
 
 function heroDeath(gear)
-	-- hero lost stuff
+	SendStat('siGameResult', loc("Hog Solo lost, try again!")) --1
+	SendStat('siCustomAchievement', loc("To win the game you have to go to the surface")) --11
+	SendStat('siCustomAchievement', loc("Most mines are not active")) --11
+	SendStat('siCustomAchievement', loc("From the second turn and beyond the water rises")) --11
+	SendStat('siPlayerKills','0',teamA.name)
 	EndGame()
 end
 
 function heroSafe(gear)
-	-- hero win stuff
+	SendStat('siGameResult', loc("Congratulations, you escaped!")) --1
+	SendStat('siCustomAchievement', loc("You have escaped successfully")) --11
+	SendStat('siCustomAchievement', loc("Your escape took you "..turnCounter.." turns")) --11
+	SendStat('siPlayerKills','1',teamA.name)
 	EndGame()
 end
 
@@ -148,8 +157,8 @@
 function Skipanim(anim)
 	if goals[anim] ~= nil then
 		ShowMission(unpack(goals[anim]))
-    end    
-	TurnTimeLeft = 0
+    end
+	challengeStart()
 end
 
 function AnimationSetup()
@@ -166,5 +175,6 @@
 ------------------ Other Functions -------------------
 
 function challengeStart()
+	startChallenge = true
 	TurnTimeLeft = 0
 end