share/hedgewars/Data/Missions/Training/Basic_Training_-_Rope.lua
changeset 10290 42efccba0711
parent 8043 da083f8d95e6
child 12049 030464f34d47
equal deleted inserted replaced
10289:c3a77ff02a23 10290:42efccba0711
   123 	Info(loc("Aiming Practice"), loc("Get to the target using your rope! |Controls: Left & Right to swing the rope - Up & Down to Contract and Expand!"), -amRope ) -- Short intro to tell the player what to do
   123 	Info(loc("Aiming Practice"), loc("Get to the target using your rope! |Controls: Left & Right to swing the rope - Up & Down to Contract and Expand!"), -amRope ) -- Short intro to tell the player what to do
   124 	Timer( 10000, loc("Tip: The rope physics are different than in the real world, |use it to your advantage!") ) -- After 15 sec, give them more help
   124 	Timer( 10000, loc("Tip: The rope physics are different than in the real world, |use it to your advantage!") ) -- After 15 sec, give them more help
   125 end
   125 end
   126 
   126 
   127 function onNewTurn()
   127 function onNewTurn()
   128 	ParseCommand( "setweap " .. string.char( amRope ) ) -- Set the default weapon to Rope
   128 	SetWeapon(amRope) -- Set the default weapon to Rope
   129 end
   129 end
   130 
   130 
   131 function onGameTick20()
   131 function onGameTick20()
   132 	if TurnTimeLeft < 40 and TurnTimeLeft > 0 then -- Round starts at 0, so we check if the round is finished by using 1
   132 	if TurnTimeLeft < 40 and TurnTimeLeft > 0 then -- Round starts at 0, so we check if the round is finished by using 1
   133 		GameLost = true -- You lost the game
   133 		GameLost = true -- You lost the game
   141 	-- If the player gets to the last target, they win OR
   141 	-- If the player gets to the last target, they win OR
   142 	-- If round is finished and your not at the target you lose
   142 	-- If round is finished and your not at the target you lose
   143 	-- in either case, end the game
   143 	-- in either case, end the game
   144 	if (Objective == true) or (GameLost == true) then
   144 	if (Objective == true) or (GameLost == true) then
   145 		if (WaitTime == 0) then
   145 		if (WaitTime == 0) then
   146 			ParseCommand("teamgone " .. loc( "Rope Team" ))
   146 			DismissTeam(loc( "Rope Team" ))
   147 
   147 
   148 			--SetHealth( Player, 0 ) -- Kill the player so he can't keep moving!
   148 			--SetHealth( Player, 0 ) -- Kill the player so he can't keep moving!
   149 			--SetEffect( Player, heResurrectable, 0 )
   149 			--SetEffect( Player, heResurrectable, 0 )
   150 			TurnTimeLeft = 1
   150 			TurnTimeLeft = 1
   151 
   151