<commit_before>AddCSLuaFile()
DEFINE_BASECLASS( "base_wire_entity" )
ENT.PrintName       = "Wire Hoverball"
ENT.RenderGroup		= RENDERGROUP_BOTH
ENT.WireDebugName	= "Hoverball"


-- Shared

function ENT:GetTargetZ()
	return self:GetNetworkedInt( 0 )
end
function ENT:SetTargetZ( z )
	return self:SetNetworkedInt( 0, z )
end

function ENT:GetSpeed()
	if (!game.SinglePlayer()) then
		return math.Clamp( self:GetNetworkedFloat( 1 ), 0.0, 10.0 )
	end

	return self:GetNetworkedFloat( 1 )
end
function ENT:SetSpeed( s )
	self:SetNetworkedFloat( 1, s )
end

function ENT:GetHoverMode()
	return self:GetNetworkedBool( 2 )
end
function ENT:SetHoverMode( h )
	return self:SetNetworkedBool( 2, h )
end

if CLIENT then 
	CreateConVar( "cl_drawhoverballs", "1" )
	local glowmat = Material( "sprites/light_glow02_add" )

	function ENT:Initialize()
		self.ShouldDraw = 1
	end

	function ENT:Draw()
		if self.ShouldDraw == 0 then return end
		self.BaseClass.Draw( self )
	end

	function ENT:DrawTranslucent()
		if self.ShouldDraw == 0 then return end

		if self:GetHoverMode() then
			local vOffset = self:GetPos()
			local vPlayerEyes = LocalPlayer():EyePos()
			local vDiff = (vOffset - vPlayerEyes):GetNormalized()

			render.SetMaterial( self.Glow )
			local color = Color( 40, 50, 200, 255 ) //70,180,255,255
			render.DrawSprite( vOffset - vDiff * 2, 22, 22, color )

			local Distance = math.abs( (self:GetTargetZ() - self:GetPos().z) * math.sin( CurTime() * 20 )  ) * 0.05
			color.r = color.r * math.Clamp( Distance, 0, 1 )
			color.b = color.b * math.Clamp( Distance, 0, 1 )
			color.g = color.g * math.Clamp( Distance, 0, 1 )

			render.DrawSprite( vOffset + vDiff * 4, 48, 48, color )
			render.DrawSprite( vOffset + vDiff * 4, 52, 52, color )
		else
			local vOffset = self:GetPos()
			local vPlayerEyes = LocalPlayer():EyePos()
			local vDiff = (vOffset - vPlayerEyes):GetNormalized()

			render.SetMaterial( self.Glow )
			local color = Color( 255, 50, 60, 255 ) //70,180,255,255
			render.DrawSprite( vOffset - vDiff * 2, 22, 22, color )

			local Pulse = math.sin( CurTime() * 20 ) * 0.05
			color.r = color.r * math.Clamp( Pulse, 0, 1 )
			color.b = color.b * math.Clamp( Pulse, 0, 1 )
			color.g = color.g * math.Clamp( Pulse, 0, 1 )

			render.DrawSprite( vOffset + vDiff * 4, 48, 48, color )
			render.DrawSprite( vOffset + vDiff * 4, 52, 52, color )
		end
	end

	function ENT:Think()
		self.BaseClass.Think(self)

		self.ShouldDraw = GetConVarNumber( "cl_drawhoverballs" )
	end
	
	return  -- No more client<commit_msg>Hoverball: Fixed typo causing clientside console spam<commit_after>AddCSLuaFile()
DEFINE_BASECLASS( "base_wire_entity" )
ENT.PrintName       = "Wire Hoverball"
ENT.RenderGroup		= RENDERGROUP_BOTH
ENT.WireDebugName	= "Hoverball"


-- Shared

function ENT:GetTargetZ()
	return self:GetNetworkedInt( 0 )
end
function ENT:SetTargetZ( z )
	return self:SetNetworkedInt( 0, z )
end

function ENT:GetSpeed()
	if (!game.SinglePlayer()) then
		return math.Clamp( self:GetNetworkedFloat( 1 ), 0.0, 10.0 )
	end

	return self:GetNetworkedFloat( 1 )
end
function ENT:SetSpeed( s )
	self:SetNetworkedFloat( 1, s )
end

function ENT:GetHoverMode()
	return self:GetNetworkedBool( 2 )
end
function ENT:SetHoverMode( h )
	return self:SetNetworkedBool( 2, h )
end

if CLIENT then 
	CreateConVar( "cl_drawhoverballs", "1" )
	local glowmat = Material( "sprites/light_glow02_add" )

	function ENT:Initialize()
		self.ShouldDraw = 1
	end

	function ENT:Draw()
		if self.ShouldDraw == 0 then return end
		self.BaseClass.Draw( self )
	end

	function ENT:DrawTranslucent()
		if self.ShouldDraw == 0 then return end

		if self:GetHoverMode() then
			local vOffset = self:GetPos()
			local vPlayerEyes = LocalPlayer():EyePos()
			local vDiff = (vOffset - vPlayerEyes):GetNormalized()

			render.SetMaterial( glowmat )
			local color = Color( 40, 50, 200, 255 ) //70,180,255,255
			render.DrawSprite( vOffset - vDiff * 2, 22, 22, color )

			local Distance = math.abs( (self:GetTargetZ() - self:GetPos().z) * math.sin( CurTime() * 20 )  ) * 0.05
			color.r = color.r * math.Clamp( Distance, 0, 1 )
			color.b = color.b * math.Clamp( Distance, 0, 1 )
			color.g = color.g * math.Clamp( Distance, 0, 1 )

			render.DrawSprite( vOffset + vDiff * 4, 48, 48, color )
			render.DrawSprite( vOffset + vDiff * 4, 52, 52, color )
		else
			local vOffset = self:GetPos()
			local vPlayerEyes = LocalPlayer():EyePos()
			local vDiff = (vOffset - vPlayerEyes):GetNormalized()

			render.SetMaterial( glowmat )
			local color = Color( 255, 50, 60, 255 ) //70,180,255,255
			render.DrawSprite( vOffset - vDiff * 2, 22, 22, color )

			local Pulse = math.sin( CurTime() * 20 ) * 0.05
			color.r = color.r * math.Clamp( Pulse, 0, 1 )
			color.b = color.b * math.Clamp( Pulse, 0, 1 )
			color.g = color.g * math.Clamp( Pulse, 0, 1 )

			render.DrawSprite( vOffset + vDiff * 4, 48, 48, color )
			render.DrawSprite( vOffset + vDiff * 4, 52, 52, color )
		end
	end

	function ENT:Think()
		self.BaseClass.Think(self)

		self.ShouldDraw = GetConVarNumber( "cl_drawhoverballs" )
	end
	
	return  -- No more client
{'fraction_non_alphanumeric': 0.12799842705465986, 'fraction_numerical': 0.04404246952418404, 'mean_word_length': 3.714550509731233, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5814305', 'n_tokens_mistral': 2250, 'n_tokens_neox': 1875, 'n_words': 497}