TST
TST
DEFINE_BASECLASS( "player_default" )
if ( CLIENT ) then
end
local PLAYER = {}
--
-- Creates a Taunt Camera
--
PLAYER.TauntCam = TauntCamera()
--
-- See gamemodes/base/player_class/player_default.lua for all overridable variables
--
PLAYER.SlowWalkSpeed = 100
PLAYER.WalkSpeed = 200
PLAYER.RunSpeed = 400
--
-- Set up the network table accessors
--
function PLAYER:SetupDataTables()
BaseClass.SetupDataTables( self )
end
function PLAYER:Loadout()
self.Player:RemoveAllAmmo()
self.Player:Give( "weapon_crowbar" )
self.Player:Give( "weapon_pistol" )
self.Player:Give( "weapon_smg1" )
self.Player:Give( "weapon_frag" )
self.Player:Give( "weapon_physcannon" )
self.Player:Give( "weapon_crossbow" )
self.Player:Give( "weapon_shotgun" )
self.Player:Give( "weapon_357" )
self.Player:Give( "weapon_rpg" )
self.Player:Give( "weapon_ar2" )
end
self.Player:Give( "gmod_tool" )
self.Player:Give( "gmod_camera" )
self.Player:Give( "weapon_physgun" )
self.Player:SwitchToDefaultWeapon()
end
function PLAYER:SetModel()
BaseClass.SetModel( self )
end
--
-- Called when the player spawns
--
function PLAYER:Spawn()
BaseClass.Spawn( self )
end
--
-- Return true to draw local (thirdperson) camera - false to prevent - nothing to
use default behaviour
--
function PLAYER:ShouldDrawLocal()
if ( self.TauntCam:ShouldDrawLocalPlayer( self.Player,
self.Player:IsPlayingTaunt() ) ) then return true end
end
--
-- Allow player class to create move
--
function PLAYER:CreateMove( cmd )
end
--
-- Allow changing the player's view
--
function PLAYER:CalcView( view )
end
--
-- Reproduces the jump boost from HL2 singleplayer
--
local JUMPING
-- Only apply the jump boost in FinishMove if the player has jumped during
this frame
-- Using a global variable is safe here because nothing else happens between
SetupMove and FinishMove
if bit.band( move:GetButtons(), IN_JUMP ) ~= 0 and
bit.band( move:GetOldButtons(), IN_JUMP ) == 0 and self.Player:OnGround() then
JUMPING = true
end
end
JUMPING = nil
end