share/hedgewars/Data/Scripts/Multiplayer/Space_Invasion.lua
changeset 10670 638af9cb922b
parent 10036 3be36d2fdca6
child 12054 0e6f044daeac
--- a/share/hedgewars/Data/Scripts/Multiplayer/Space_Invasion.lua	Sun Dec 14 03:32:11 2014 +0100
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Space_Invasion.lua	Sun Dec 14 12:26:16 2014 +0900
@@ -290,7 +290,6 @@
 local chainLength = 0
 local shotsFired = 0
 local shotsHit = 0
-local SurfTime = 0
 local sniperHits = 0
 local pointBlankHits = 0
 ---------------------
@@ -1105,7 +1104,6 @@
 	pointBlankHits = 0
 	chainLength = 0
 	chainCounter = 0
-	SurfTime = 12
 
 	-------------------------
 	-- gaudy racer
@@ -1160,6 +1158,19 @@
 
 end
 
+function onGearWaterSkip(gear)
+	if gear == CurrentHedgehog then
+
+		for i = 0,(TeamsCount-1) do
+			if teamClan[i] == GetHogClan(CurrentHedgehog) and (teamSurfer[i] == false) then
+				teamSurfer[i] = true
+				AddCaption(loc("Surfer! +15 points!"),0xffba00ff,capgrpVolume)
+				AwardPoints(15)
+			end
+		end
+
+	end
+end
 
 function onGameTick()
 
@@ -1328,30 +1339,6 @@
 				--------------
 				--------------
 
-				------------------------
-				-- surfer achievement
-				------------------------
-
-				if (WaterLine - GetY(CurrentHedgehog)) < 15 then
-					SurfTime = SurfTime -1
-				end
-
-				if SurfTime ~= 12 then
-
-					SurfTime = SurfTime - 1
-					if SurfTime <= 0 then
-						for i = 0,(TeamsCount-1) do
-							if teamClan[i] == GetHogClan(CurrentHedgehog) and (teamSurfer[i] == false) then
-								teamSurfer[i] = true
-								SurfTime = 12
-								AddCaption(loc("Surfer! +15 points!"),0xffba00ff,capgrpVolume)
-								AwardPoints(15)
-							end
-						end
-					end
-				end
-
-
 				dx, dy = GetGearVelocity(CurrentHedgehog)
 
 				--WriteLnToConsole("I just got the velocity of currenthedgehog. It is dx: " .. dx .. "; dy: " .. dy)