Engine:
authorsmxx
Mon, 15 Feb 2010 23:22:26 +0000
changeset 2816 30fc14a79aa0
parent 2815 c1daf1213cbe
child 2817 4494dab9ef6a
Engine: * Forgot to commit hwengine.rc Training Missions: * Small tweaks to keep the time left once the goal is reached
hedgewars/hwengine.rc
share/hedgewars/Data/Missions/Bazooka Training.hwt
share/hedgewars/Data/Missions/Shotgun Training.hwt
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/hedgewars/hwengine.rc	Mon Feb 15 23:22:26 2010 +0000
@@ -0,0 +1,1 @@
+MAINICON ICON "hwengine.ico"
\ No newline at end of file
--- a/share/hedgewars/Data/Missions/Bazooka Training.hwt	Mon Feb 15 21:56:49 2010 +0000
+++ b/share/hedgewars/Data/Missions/Bazooka Training.hwt	Mon Feb 15 23:22:26 2010 +0000
@@ -22,6 +22,8 @@
 local game_lost = false
 -- This variable will point to the hog's gear
 local player = nil
+-- This variable will grab the time left at the end of the round
+local time_goal = 0
 
 -- This is a custom function to make it easier to
 -- spawn more targets with just one line of code
@@ -107,6 +109,8 @@
 		ShowMission("Bazooka Training", "Aiming Practice", "Oh no! Time's up! Just try again.", -amSkip, 0);
 		-- How about killing our poor hog due to his poor performance?
 		SetHealth(player, 0);
+		-- Just to be sure set the goal time to 1 ms
+		time_goal = 1
 	end
 	-- If the goal is reached or we've lost ...
 	if score == score_goal or game_lost then
@@ -118,6 +122,8 @@
 		else
 			-- ... or just lower the timer by 1.
 			end_timer = end_timer - 1
+			-- Reset the time left to stop the timer
+			TurnTimeLeft = time_goal
 		end
 	end
 end
@@ -152,6 +158,8 @@
 			ShowMission("Bazooka Training", "Aiming Practice", "Congratulations! You've eliminated all targets|within the allowed time frame.", 0, 0);
 			-- Also let the hogs shout "victory!"
 			PlaySound(sndVictory)
+			-- Save the time left so we may keep it.
+			time_goal = TurnTimeLeft
 			end
 		end
 	end
--- a/share/hedgewars/Data/Missions/Shotgun Training.hwt	Mon Feb 15 21:56:49 2010 +0000
+++ b/share/hedgewars/Data/Missions/Shotgun Training.hwt	Mon Feb 15 23:22:26 2010 +0000
@@ -22,6 +22,8 @@
 local game_lost = false
 -- This variable will point to the hog's gear
 local player = nil
+-- This variable will grab the time left at the end of the round
+local time_goal = 0
 
 -- This is a custom function to make it easier to
 -- spawn more targets with just one line of code
@@ -107,6 +109,8 @@
 		ShowMission("Shotgun Training", "Aiming Practice", "Oh no! Time's up! Just try again.", -amSkip, 0);
 		-- How about killing our poor hog due to his poor performance?
 		SetHealth(player, 0);
+		-- Just to be sure set the goal time to 1 ms
+		time_goal = 1
 	end
 	-- If the goal is reached or we've lost ...
 	if score == score_goal or game_lost then
@@ -118,6 +122,8 @@
 		else
 			-- ... or just lower the timer by 1.
 			end_timer = end_timer - 1
+			-- Reset the time left to stop the timer
+			TurnTimeLeft = time_goal
 		end
 	end
 end
@@ -152,6 +158,8 @@
 			ShowMission("Shotgun Training", "Aiming Practice", "Congratulations! You've eliminated all targets|within the allowed time frame.", 0, 0);
 			-- Also let the hogs shout "victory!"
 			PlaySound(sndVictory)
+			-- Save the time left so we may keep it.
+			time_goal = TurnTimeLeft
 			end
 		end
 	end