share/hedgewars/Data/Scripts/Multiplayer/TechRacer.lua
changeset 13024 a568bc16a99a
parent 12966 b543d767fed3
child 13027 625d5a45f267
equal deleted inserted replaced
13023:acba432d34b1 13024:a568bc16a99a
   210 -------
   210 -------
   211 -- racer vars
   211 -- racer vars
   212 --------
   212 --------
   213 
   213 
   214 local cGear = nil
   214 local cGear = nil
       
   215 local cameraGear = nil
   215 
   216 
   216 local bestClan = 10
   217 local bestClan = 10
   217 local bestTime = 1000000
   218 local bestTime = 1000000
   218 
   219 
   219 local gameBegun = false
   220 local gameBegun = false
  1143         end
  1144         end
  1144         SetGearPosition(cGear, -10000, 0)
  1145         SetGearPosition(cGear, -10000, 0)
  1145         end
  1146         end
  1146 
  1147 
  1147 
  1148 
  1148 		if activationStage < 10 then
  1149 	if activationStage < 10 then
  1149 				HandleFreshMapCreation()
  1150 		HandleFreshMapCreation()
  1150 		end
  1151 
       
  1152                 if not gameOver and gameBegun and not racerActive then
       
  1153 			if cameraGear then
       
  1154 				DeleteGear(cameraGear)
       
  1155 			end
       
  1156 			-- Move camera to first waypoint.
       
  1157 			-- We use a dummy gear to feed FollowGear. It does not affect the race.
       
  1158 			cameraGear = AddGear(wpX[0], wpY[0], gtGenericFaller, 0, 0, 0, 5000)
       
  1159 			SetState(cameraGear, bor(GetState(cameraGear), gstNoGravity+gstInvisiblee))
       
  1160 			FollowGear(cameraGear)
       
  1161                 end
       
  1162 
       
  1163 	end
  1151 
  1164 
  1152 
  1165 
  1153         -- start the player tumbling with a boom once their turn has actually begun
  1166         -- start the player tumbling with a boom once their turn has actually begun
  1154         if racerActive == false then
  1167         if racerActive == false then
  1155 
  1168 
  1336 end
  1349 end
  1337 
  1350 
  1338 function onGearDelete(gear)
  1351 function onGearDelete(gear)
  1339 
  1352 
  1340         if isATrackedGear(gear) then
  1353         if isATrackedGear(gear) then
  1341 			trackDeletion(gear)
  1354 		trackDeletion(gear)
  1342 		elseif GetGearType(gear) == gtAirAttack then
  1355 	elseif GetGearType(gear) == gtAirAttack then
  1343                 cGear = nil
  1356                 cGear = nil
  1344         elseif GetGearType(gear) == gtJetpack then
  1357         elseif GetGearType(gear) == gtJetpack then
  1345 			jet = nil
  1358 		jet = nil
  1346 		end
  1359 	elseif gear == cameraGear then
       
  1360 		cameraGear = nil
       
  1361 	end
  1347 
  1362 
  1348 end
  1363 end
  1349 
  1364 
  1350 function onAttack()
  1365 function onAttack()
  1351     at = GetCurAmmoType()
  1366     at = GetCurAmmoType()