summaryrefslogtreecommitdiff
path: root/gamemode/player_class
diff options
context:
space:
mode:
Diffstat (limited to 'gamemode/player_class')
-rw-r--r--gamemode/player_class/player_army.lua4
-rw-r--r--gamemode/player_class/player_base.lua24
-rw-r--r--gamemode/player_class/player_default.lua24
-rw-r--r--gamemode/player_class/player_zombie.lua34
4 files changed, 43 insertions, 43 deletions
diff --git a/gamemode/player_class/player_army.lua b/gamemode/player_class/player_army.lua
index 7e20c13..163ac5e 100644
--- a/gamemode/player_class/player_army.lua
+++ b/gamemode/player_class/player_army.lua
@@ -1,7 +1,7 @@
AddCSLuaFile()
-local PLAYER = {}
+local PLAYER = {}
function PLAYER:GetHandsModel()
@@ -13,4 +13,4 @@ function PLAYER:Spawn()
end
-player_manager.RegisterClass( "player_army", PLAYER, "player_baseclass" ) \ No newline at end of file
+player_manager.RegisterClass( "player_army", PLAYER, "player_baseclass" )
diff --git a/gamemode/player_class/player_base.lua b/gamemode/player_class/player_base.lua
index a470104..02733a8 100644
--- a/gamemode/player_class/player_base.lua
+++ b/gamemode/player_class/player_base.lua
@@ -3,7 +3,7 @@ AddCSLuaFile()
DEFINE_BASECLASS( "player_default" )
-local PLAYER = {}
+local PLAYER = {}
function PLAYER:GetHandsModel()
@@ -79,7 +79,7 @@ function PLAYER:HandlePlayerNoClipping( velocity )
if ( self.Player:InVehicle() ) then return end
- if ( self.Player:GetMoveType() != MOVETYPE_NOCLIP ) then
+ if ( self.Player:GetMoveType() != MOVETYPE_NOCLIP ) then
if ( self.Player.m_bWasNoclipping ) then
@@ -110,16 +110,16 @@ function PLAYER:HandlePlayerVaulting( velocity )
if ( velocity:Length() < 1000 ) then return end
if ( self.Player:IsOnGround() ) then return end
- self.Player.CalcIdeal = ACT_MP_SWIM
+ self.Player.CalcIdeal = ACT_MP_SWIM
return true
end
function PLAYER:HandlePlayerSwimming( velocity )
- if ( self.Player:WaterLevel() < 2 ) then
+ if ( self.Player:WaterLevel() < 2 ) then
self.Player.m_bInSwim = false
- return false
+ return false
end
if ( velocity:Length2D() > 10 ) then
@@ -129,12 +129,12 @@ function PLAYER:HandlePlayerSwimming( velocity )
end
self.Player.m_bInSwim = true
-
+
return true
end
-function PLAYER:HandlePlayerLanding( velocity, WasOnGround )
+function PLAYER:HandlePlayerLanding( velocity, WasOnGround )
if ( self.Player:GetMoveType() == MOVETYPE_NOCLIP ) then return end
@@ -147,10 +147,10 @@ end
function PLAYER:HandlePlayerDriving()
return false
-
+
end
-function PLAYER:UpdateAnimation( velocity, maxseqgroundspeed )
+function PLAYER:UpdateAnimation( velocity, maxseqgroundspeed )
local len = velocity:Length()
local movement = 1.0
@@ -164,7 +164,7 @@ function PLAYER:UpdateAnimation( velocity, maxseqgroundspeed )
-- if we're under water we want to constantly be swimming..
if ( self.Player:WaterLevel() >= 2 ) then
rate = math.max( rate, 0.5 )
- elseif ( !self.Player:IsOnGround() && len >= 1000 ) then
+ elseif ( !self.Player:IsOnGround() && len >= 1000 ) then
rate = 0.1;
end
@@ -177,7 +177,7 @@ function PLAYER:UpdateAnimation( velocity, maxseqgroundspeed )
end
-function PLAYER:GrabEarAnimation()
+function PLAYER:GrabEarAnimation()
self.Player.ChatGestureWeight = self.Player.ChatGestureWeight or 0
@@ -335,4 +335,4 @@ function PLAYER:DoAnimationEvent( event, data )
return nil
end
-player_manager.RegisterClass( "player_base", PLAYER, "player_default" ) \ No newline at end of file
+player_manager.RegisterClass( "player_base", PLAYER, "player_default" )
diff --git a/gamemode/player_class/player_default.lua b/gamemode/player_class/player_default.lua
index 1a5f9b3..cf3cb3d 100644
--- a/gamemode/player_class/player_default.lua
+++ b/gamemode/player_class/player_default.lua
@@ -3,7 +3,7 @@ AddCSLuaFile()
DEFINE_BASECLASS( "player_default" )
-local PLAYER = {}
+local PLAYER = {}
function PLAYER:HandlePlayerJumping( velocity )
@@ -73,7 +73,7 @@ function PLAYER:HandlePlayerNoClipping( velocity )
if ( self.Player:InVehicle() ) then return end
- if ( self.Player:GetMoveType() != MOVETYPE_NOCLIP ) then
+ if ( self.Player:GetMoveType() != MOVETYPE_NOCLIP ) then
if ( self.Player.m_bWasNoclipping ) then
@@ -104,16 +104,16 @@ function PLAYER:HandlePlayerVaulting( velocity )
if ( velocity:Length() < 1000 ) then return end
if ( self.Player:IsOnGround() ) then return end
- self.Player.CalcIdeal = ACT_MP_SWIM
+ self.Player.CalcIdeal = ACT_MP_SWIM
return true
end
function PLAYER:HandlePlayerSwimming( velocity )
- if ( self.Player:WaterLevel() < 2 ) then
+ if ( self.Player:WaterLevel() < 2 ) then
self.Player.m_bInSwim = false
- return false
+ return false
end
if ( velocity:Length2D() > 10 ) then
@@ -123,12 +123,12 @@ function PLAYER:HandlePlayerSwimming( velocity )
end
self.Player.m_bInSwim = true
-
+
return true
end
-function PLAYER:HandlePlayerLanding( velocity, WasOnGround )
+function PLAYER:HandlePlayerLanding( velocity, WasOnGround )
if ( self.Player:GetMoveType() == MOVETYPE_NOCLIP ) then return end
@@ -141,10 +141,10 @@ end
function PLAYER:HandlePlayerDriving()
return false
-
+
end
-function PLAYER:UpdateAnimation( velocity, maxseqgroundspeed )
+function PLAYER:UpdateAnimation( velocity, maxseqgroundspeed )
local len = velocity:Length()
local movement = 1.0
@@ -158,7 +158,7 @@ function PLAYER:UpdateAnimation( velocity, maxseqgroundspeed )
-- if we're under water we want to constantly be swimming..
if ( self.Player:WaterLevel() >= 2 ) then
rate = math.max( rate, 0.5 )
- elseif ( !self.Player:IsOnGround() && len >= 1000 ) then
+ elseif ( !self.Player:IsOnGround() && len >= 1000 ) then
rate = 0.1;
end
@@ -175,7 +175,7 @@ end
-- If you don't want the player to grab his ear in your gamemode then
-- just override this.
--
-function PLAYER:GrabEarAnimation()
+function PLAYER:GrabEarAnimation()
self.Player.ChatGestureWeight = self.Player.ChatGestureWeight or 0
@@ -337,4 +337,4 @@ function PLAYER:DoAnimationEvent( event, data )
return nil
end
-player_manager.RegisterClass( "player_baseclass", PLAYER, "player_default" ) \ No newline at end of file
+player_manager.RegisterClass( "player_baseclass", PLAYER, "player_default" )
diff --git a/gamemode/player_class/player_zombie.lua b/gamemode/player_class/player_zombie.lua
index f8333b1..4167953 100644
--- a/gamemode/player_class/player_zombie.lua
+++ b/gamemode/player_class/player_zombie.lua
@@ -1,29 +1,29 @@
AddCSLuaFile()
-local PLAYER = {}
+local PLAYER = {}
-function PLAYER:UpdateAnimation( velocity, maxseqgroundspeed )
+function PLAYER:UpdateAnimation( velocity, maxseqgroundspeed )
local len = velocity:Length()
local movement = 1.0
if len > 0.2 then
-
- movement = len / maxseqgroundspeed
-
+
+ movement = len / maxseqgroundspeed
+
end
rate = math.min( movement, 2 )
if self.Player:WaterLevel() >= 2 then
-
+
rate = math.max( rate, 0.5 )
-
- elseif !self.Player:IsOnGround() and len >= 1000 then
-
+
+ elseif !self.Player:IsOnGround() and len >= 1000 then
+
rate = 0.1
-
+
end
local weapon = self.Player:GetActiveWeapon()
@@ -31,10 +31,10 @@ function PLAYER:UpdateAnimation( velocity, maxseqgroundspeed )
self.Player:SetPlaybackRate( rate )
if CLIENT then
-
+
self:GrabEarAnimation()
self:MouthMoveAnimation()
-
+
end
end
@@ -45,11 +45,11 @@ function PLAYER:CalcMainActivity( velocity )
self.Player.CalcSeqOverride = self.Player:LookupSequence( "zombie_idle" )
local len2d = velocity:Length2D()
-
+
if len2d > 1 then
-
+
self.Player.CalcSeqOverride = self.Player:LookupSequence( "zombie_run" )
-
+
end
return self.Player.CalcIdeal, self.Player.CalcSeqOverride
@@ -73,7 +73,7 @@ function PLAYER:DoAnimationEvent( event, data )
self.Player.m_bJumping = true
self.Player.m_bFirstJumpFrame = true
self.Player.m_flJumpStartTime = CurTime()
-
+
self.Player:AnimRestartMainSequence()
return ACT_INVALID
@@ -90,4 +90,4 @@ function PLAYER:DoAnimationEvent( event, data )
end
-player_manager.RegisterClass( "player_zombie", PLAYER, "player_base" ) \ No newline at end of file
+player_manager.RegisterClass( "player_zombie", PLAYER, "player_base" )