share/hedgewars/Data/Scripts/Multiplayer/Space_Invasion.lua
changeset 10670 638af9cb922b
parent 10036 3be36d2fdca6
child 12059 0e6f044daeac
equal deleted inserted replaced
10669:4c78eafe76ac 10670:638af9cb922b
   288 local fierceComp = false
   288 local fierceComp = false
   289 local chainCounter = 0
   289 local chainCounter = 0
   290 local chainLength = 0
   290 local chainLength = 0
   291 local shotsFired = 0
   291 local shotsFired = 0
   292 local shotsHit = 0
   292 local shotsHit = 0
   293 local SurfTime = 0
       
   294 local sniperHits = 0
   293 local sniperHits = 0
   295 local pointBlankHits = 0
   294 local pointBlankHits = 0
   296 ---------------------
   295 ---------------------
   297 -- tumbler goods
   296 -- tumbler goods
   298 ---------------------
   297 ---------------------
  1103 	shotsHit = 0
  1102 	shotsHit = 0
  1104 	sniperHits = 0
  1103 	sniperHits = 0
  1105 	pointBlankHits = 0
  1104 	pointBlankHits = 0
  1106 	chainLength = 0
  1105 	chainLength = 0
  1107 	chainCounter = 0
  1106 	chainCounter = 0
  1108 	SurfTime = 12
       
  1109 
  1107 
  1110 	-------------------------
  1108 	-------------------------
  1111 	-- gaudy racer
  1109 	-- gaudy racer
  1112 	-------------------------
  1110 	-------------------------
  1113 	CheckForNewRound()
  1111 	CheckForNewRound()
  1158 		ProjectileTrack(gear)
  1156 		ProjectileTrack(gear)
  1159 	end
  1157 	end
  1160 
  1158 
  1161 end
  1159 end
  1162 
  1160 
       
  1161 function onGearWaterSkip(gear)
       
  1162 	if gear == CurrentHedgehog then
       
  1163 
       
  1164 		for i = 0,(TeamsCount-1) do
       
  1165 			if teamClan[i] == GetHogClan(CurrentHedgehog) and (teamSurfer[i] == false) then
       
  1166 				teamSurfer[i] = true
       
  1167 				AddCaption(loc("Surfer! +15 points!"),0xffba00ff,capgrpVolume)
       
  1168 				AwardPoints(15)
       
  1169 			end
       
  1170 		end
       
  1171 
       
  1172 	end
       
  1173 end
  1163 
  1174 
  1164 function onGameTick()
  1175 function onGameTick()
  1165 
  1176 
  1166 
  1177 
  1167 	--WriteLnToConsole("Start of GameTick")
  1178 	--WriteLnToConsole("Start of GameTick")
  1325 					g1, g2, g3, g4, g5, g6, g7, g8, g9, g10 = GetVisualGearValues(tempE)
  1336 					g1, g2, g3, g4, g5, g6, g7, g8, g9, g10 = GetVisualGearValues(tempE)
  1326 					SetVisualGearValues(tempE, g1, g2, g3, g4, g5, g6, g7, g8, g9, GetClanColor(GetHogClan(CurrentHedgehog)) )
  1337 					SetVisualGearValues(tempE, g1, g2, g3, g4, g5, g6, g7, g8, g9, GetClanColor(GetHogClan(CurrentHedgehog)) )
  1327 				end
  1338 				end
  1328 				--------------
  1339 				--------------
  1329 				--------------
  1340 				--------------
  1330 
       
  1331 				------------------------
       
  1332 				-- surfer achievement
       
  1333 				------------------------
       
  1334 
       
  1335 				if (WaterLine - GetY(CurrentHedgehog)) < 15 then
       
  1336 					SurfTime = SurfTime -1
       
  1337 				end
       
  1338 
       
  1339 				if SurfTime ~= 12 then
       
  1340 
       
  1341 					SurfTime = SurfTime - 1
       
  1342 					if SurfTime <= 0 then
       
  1343 						for i = 0,(TeamsCount-1) do
       
  1344 							if teamClan[i] == GetHogClan(CurrentHedgehog) and (teamSurfer[i] == false) then
       
  1345 								teamSurfer[i] = true
       
  1346 								SurfTime = 12
       
  1347 								AddCaption(loc("Surfer! +15 points!"),0xffba00ff,capgrpVolume)
       
  1348 								AwardPoints(15)
       
  1349 							end
       
  1350 						end
       
  1351 					end
       
  1352 				end
       
  1353 
       
  1354 
  1341 
  1355 				dx, dy = GetGearVelocity(CurrentHedgehog)
  1342 				dx, dy = GetGearVelocity(CurrentHedgehog)
  1356 
  1343 
  1357 				--WriteLnToConsole("I just got the velocity of currenthedgehog. It is dx: " .. dx .. "; dy: " .. dy)
  1344 				--WriteLnToConsole("I just got the velocity of currenthedgehog. It is dx: " .. dx .. "; dy: " .. dy)
  1358 				--WriteLnToConsole("The above event occured game Time: " .. GameTime .. "; luaTicks: " .. luaGameTicks)
  1345 				--WriteLnToConsole("The above event occured game Time: " .. GameTime .. "; luaTicks: " .. luaGameTicks)