autoselect weapon in time challenges spacecampaign
authorPeriklis Ntanasis <pntanasis@gmail.com>
Sun, 22 Sep 2013 18:34:53 +0300
branchspacecampaign
changeset 9645 da7b4d8c181e
parent 9644 4a19f25e86bf
child 9646 7588daa8d28f
autoselect weapon in time challenges
share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/desert02.lua
share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/ice02.lua
share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/moon02.lua
--- a/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/desert02.lua	Sun Sep 22 17:37:57 2013 +0300
+++ b/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/desert02.lua	Sun Sep 22 18:34:53 2013 +0300
@@ -99,6 +99,10 @@
 	AddAnim(dialog01)
 end
 
+function onNewTurn()
+	ParseCommand("setweap " .. string.char(amRope))
+end
+
 function onGameTick()
 	AnimUnWait()
 	if ShowAnimation() == false then
--- a/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/ice02.lua	Sun Sep 22 17:37:57 2013 +0300
+++ b/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/ice02.lua	Sun Sep 22 18:34:53 2013 +0300
@@ -114,6 +114,8 @@
 function onNewTurn()
 	if not hero.dead and CurrentHedgehog == ally.gear and challengeStarted then
 		heroLost()
+	elseif not hero.dead and CurrentHedgehog == hero.gear and challengeStarted then
+		ParseCommand("setweap " .. string.char(amJetpack))
 	end
 end
 
--- a/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/moon02.lua	Sun Sep 22 17:37:57 2013 +0300
+++ b/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/moon02.lua	Sun Sep 22 18:34:53 2013 +0300
@@ -99,6 +99,7 @@
 			if GetAmmoCount(hero.gear, amRope) == 0  then
 				lose()
 			end
+			ParseCommand("setweap " .. string.char(amRope))
 			TurnTimeLeft = runner.places[currentPosition].turnTime + previousTimeLeft
 			previousTimeLeft = 0
 		end