share/hedgewars/Data/Missions/Training/Basic_Training_-_Rope.lua
changeset 7838 5c2337f8dbb2
parent 7827 353d90ddc188
child 8043 da083f8d95e6
equal deleted inserted replaced
7837:3e031b3b33e6 7838:5c2337f8dbb2
   110 
   110 
   111 	AddTeam( loc( "Rope Team" ), 14483456, "Simple", "Island", "Default" ) -- Lets make the team
   111 	AddTeam( loc( "Rope Team" ), 14483456, "Simple", "Island", "Default" ) -- Lets make the team
   112 	Player = AddHog( loc( "Hunter" ), 0, 1, "StrawHat" ) -- Add a hog for it, and name it "Hunter"
   112 	Player = AddHog( loc( "Hunter" ), 0, 1, "StrawHat" ) -- Add a hog for it, and name it "Hunter"
   113 	SetGearPosition( Player, 420, 1750 ) -- Set player position
   113 	SetGearPosition( Player, 420, 1750 ) -- Set player position
   114 
   114 
   115 	SetEffect( Player, heResurrectable, true ) -- By Suggestion :)
   115 	SetEffect( Player, heResurrectable, 1 ) -- By Suggestion :)
   116 end
   116 end
   117 
   117 
   118 function onGameStart() -- Called when the game starts
   118 function onGameStart() -- Called when the game starts
   119 	AutoSpawn() -- Spawn our 1st target using the wrapper function
   119 	AutoSpawn() -- Spawn our 1st target using the wrapper function
   120 
   120 
   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
   134 		Info(loc("Aiming Practice"), loc("You did not make it in time, try again!"), -amSkip )
   134 		Info(loc("Aiming Practice"), loc("You did not make it in time, try again!"), -amSkip )
   135 		SetHealth( Player, 0 ) -- Kill the player so he can't keep moving!
   135 		SetHealth( Player, 0 ) -- Kill the player so he can't keep moving!
   136 
   136 
   137 		SetEffect( Player, heResurrectable, false )
   137 		SetEffect( Player, heResurrectable, 0 )
   138 
   138 
   139 	end
   139 	end
   140 
   140 
   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
   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 			ParseCommand("teamgone " .. 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, false )
   149 			--SetEffect( Player, heResurrectable, 0 )
   150 			TurnTimeLeft = 1
   150 			TurnTimeLeft = 1
   151 
   151 
   152 			WaitTime = -1
   152 			WaitTime = -1
   153 		else
   153 		else
   154 			WaitTime = WaitTime - 20
   154 			WaitTime = WaitTime - 20