2024-03-07 21:19:30 -05:00
|
|
|
|
|
|
|
---------------------
|
|
|
|
-- Your Name is Benny
|
|
|
|
---------------------
|
|
|
|
|
2024-09-15 15:41:34 -04:00
|
|
|
function GM:PlayerInitialSpawn( ply, transiton )
|
2024-09-15 18:18:31 -04:00
|
|
|
if BennyGame:GetType() == BG_GTYPE_MP then
|
|
|
|
ply:SetTeam( BennyGame:BestAutoJoinTeam() )
|
|
|
|
else
|
|
|
|
ply:SetTeam( 7 )
|
|
|
|
end
|
2024-09-15 15:41:34 -04:00
|
|
|
end
|
|
|
|
|
2024-03-07 21:19:30 -05:00
|
|
|
function GM:PlayerSpawn( ply )
|
|
|
|
player_manager.SetPlayerClass( ply, "player_benny" )
|
2024-09-21 14:07:03 -04:00
|
|
|
ply:SetViewOffset( Vector( 0, 0, 52 ) )
|
|
|
|
ply:SetViewOffsetDucked( Vector( 0, 0, 52 ) )
|
2024-03-07 21:19:30 -05:00
|
|
|
ply:Give( "itemhandler" )
|
|
|
|
|
2024-09-20 16:20:22 -04:00
|
|
|
ply:Give( "goat_1" )
|
|
|
|
ply:Give( "goat_2" )
|
|
|
|
ply:Give( "goat_3" )
|
|
|
|
ply:Give( "goat_4" )
|
|
|
|
ply:Give( "goat_5" )
|
|
|
|
ply:Give( "goat_6" )
|
|
|
|
ply:Give( "goat_7" )
|
|
|
|
ply:Give( "goat_8" )
|
|
|
|
ply:Give( "goat_9" )
|
|
|
|
ply:Give( "goat_0" )
|
|
|
|
|
|
|
|
ply:SetActiveWeapon( ply:GetWeapon( "itemhandler" ) )
|
|
|
|
|
2024-03-07 21:19:30 -05:00
|
|
|
ply:SetStamina( 1 )
|
|
|
|
|
|
|
|
ply:SetCrouchedWalkSpeed( 0.3 )
|
|
|
|
ply:SetDuckSpeed( 0.1 )
|
|
|
|
ply:SetUnDuckSpeed( 0.1 )
|
|
|
|
ply:SetSlowWalkSpeed( 100 )
|
|
|
|
ply:SetWalkSpeed( 200 )
|
|
|
|
ply:SetRunSpeed( 200 )
|
|
|
|
ply:SetStepSize( 18 )
|
|
|
|
ply:SetCanZoom( false )
|
|
|
|
|
2024-04-06 09:30:09 -04:00
|
|
|
ply:SetHealth_Blood( 1000 )
|
|
|
|
ply:SetHealth_Stamina( 1000 )
|
|
|
|
|
2024-03-07 21:19:30 -05:00
|
|
|
ply:MakeCharacter()
|
|
|
|
end
|
|
|
|
|
2024-09-15 15:41:34 -04:00
|
|
|
function GM:PlayerPostThink( ply )
|
|
|
|
if ply:GetTouchedObjective():IsValid() then
|
|
|
|
if ply:GetTouchedObjectiveTime()+0.1 <= CurTime() then
|
|
|
|
ply:SetTouchedObjective( NULL )
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2024-03-07 22:34:29 -05:00
|
|
|
function GM:PlayerNoClip()
|
|
|
|
return true
|
|
|
|
end
|
2024-03-07 21:19:30 -05:00
|
|
|
|
|
|
|
local PT = FindMetaTable( "Player" )
|
|
|
|
|
2024-09-15 15:41:34 -04:00
|
|
|
concommand.Add("b-cheat_setxp", function( ply, cmd, args )
|
|
|
|
if !ply or !ply:IsValid() then return end
|
|
|
|
|
|
|
|
ply:SetLevel_XP( args[1] )
|
|
|
|
end)
|
|
|
|
|
|
|
|
concommand.Add("b-cheat_rewardxp", function( ply, cmd, args )
|
|
|
|
if !ply or !ply:IsValid() then return end
|
|
|
|
|
|
|
|
ply:RewardXP( args[1] )
|
|
|
|
end)
|
|
|
|
|
|
|
|
function PT:RewardXP( amt )
|
|
|
|
if CLIENT then return end
|
|
|
|
|
|
|
|
--self.amountcollected = (self.amountcollected or 0) + amt
|
|
|
|
self:SetLevel_XP( self:GetLevel_XP() + amt )
|
|
|
|
--self:ChatPrint( "Rewarded " .. amt .. " XP" )
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
function PT:RewardScore()
|
|
|
|
if CLIENT then return end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
2024-03-07 21:19:30 -05:00
|
|
|
local bgl = {
|
|
|
|
["benny"] = {
|
|
|
|
[0] = Vector( 0.275, 0.7, 0.7 ),
|
|
|
|
[1] = 17,
|
|
|
|
[2] = 7,
|
|
|
|
[3] = 2,
|
|
|
|
[4] = 11,
|
|
|
|
[5] = 3,
|
|
|
|
[6] = 0,
|
|
|
|
[7] = 0,
|
|
|
|
[8] = 3,
|
|
|
|
[9] = 0,
|
|
|
|
[10] = 0,
|
|
|
|
[11] = 0,
|
|
|
|
[12] = 3,
|
|
|
|
[13] = 0,
|
|
|
|
},
|
|
|
|
["nikki"] = {
|
|
|
|
[0] = Vector( 0.9, 0.3, 0.9 ),
|
|
|
|
[1] = 17,
|
|
|
|
[2] = 7,
|
|
|
|
[3] = 2,
|
|
|
|
[4] = 11,
|
|
|
|
[5] = 3,
|
|
|
|
[6] = 0,
|
|
|
|
[7] = 0,
|
|
|
|
[8] = 2,
|
|
|
|
[9] = 1,
|
|
|
|
[10] = 5,
|
|
|
|
[11] = 0,
|
|
|
|
[12] = 3,
|
|
|
|
[13] = 0,
|
|
|
|
},
|
|
|
|
["igor"] = {
|
|
|
|
[0] = Vector( 0.776, 0.929, 0.89 ),
|
|
|
|
[1] = 4,
|
|
|
|
[2] = 6,
|
|
|
|
[3] = 2,
|
|
|
|
[4] = 3,
|
|
|
|
[5] = 1,
|
|
|
|
[6] = 0,
|
|
|
|
[7] = 2,
|
|
|
|
[8] = 3,
|
|
|
|
[9] = 3,
|
|
|
|
[10] = 6,
|
|
|
|
[11] = 2,
|
|
|
|
[12] = 1,
|
|
|
|
[13] = 0,
|
|
|
|
},
|
|
|
|
["yanghao"] = {
|
|
|
|
[0] = Vector( 0.627, 0.21, 0.186 ),
|
|
|
|
[1] = 13,
|
|
|
|
[2] = 2,
|
|
|
|
[3] = 0,
|
|
|
|
[4] = 3,
|
|
|
|
[5] = 0,
|
|
|
|
[6] = 1,
|
|
|
|
[7] = 3,
|
|
|
|
[8] = 0,
|
|
|
|
[9] = 3,
|
|
|
|
[10] = 4,
|
|
|
|
[11] = 0,
|
|
|
|
[12] = 0,
|
|
|
|
[13] = 0,
|
|
|
|
},
|
|
|
|
["mp_cia"] = {
|
|
|
|
[0] = Vector( 1, 1, 1 )
|
|
|
|
},
|
|
|
|
["mp_plasof"] = {
|
|
|
|
[0] = Vector( 1, 1, 1 )
|
|
|
|
},
|
|
|
|
["mp_militia"] = {
|
|
|
|
[0] = Vector( 1, 1, 1 )
|
|
|
|
},
|
|
|
|
["mp_natguard"] = {
|
|
|
|
[0] = Vector( 1, 1, 1 )
|
|
|
|
},
|
|
|
|
["mp_viper"] = {
|
|
|
|
[0] = Vector( 1, 1, 1 )
|
|
|
|
},
|
|
|
|
["mp_halo"] = {
|
|
|
|
[0] = Vector( 1, 1, 1 )
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
function PT:MakeCharacter()
|
|
|
|
local char = "benny"
|
2024-04-06 09:30:09 -04:00
|
|
|
--self:SetModel( "models/player/infoplayerrealism.mdl" )
|
|
|
|
self:SetModel( "models/benny/player/benny_placeholder3.mdl" )
|
|
|
|
--self:SetPlayerColor( bgl[char][0] )
|
|
|
|
--self:SetBodygroup( 0, 0 )
|
|
|
|
--self:SetSkin( 3 )
|
|
|
|
--for i, v in ipairs( bgl[char] ) do
|
|
|
|
-- self:SetBodygroup( i, v )
|
|
|
|
--end
|
2024-03-07 21:19:30 -05:00
|
|
|
end
|
|
|
|
|
2024-03-12 18:43:31 -04:00
|
|
|
function PT:HandlerCheck()
|
2024-03-07 21:19:30 -05:00
|
|
|
local wep = self:GetActiveWeapon()
|
|
|
|
return ( wep:IsValid() and wep:GetClass() == "itemhandler" and wep.GetActiveR ) and wep or false
|
|
|
|
end
|
2024-03-23 21:18:11 -04:00
|
|
|
|
2024-10-08 17:58:47 -04:00
|
|
|
BGESTURE_ITEM1_RIGHT = GESTURE_SLOT_ATTACK_AND_RELOAD -- 0
|
|
|
|
BGESTURE_ITEM1_LEFT = GESTURE_SLOT_GRENADE -- 1
|
|
|
|
BGESTURE_ITEM2_RIGHT = GESTURE_SLOT_JUMP -- 2
|
|
|
|
BGESTURE_ITEM2_LEFT = GESTURE_SLOT_SWIM -- 3
|
|
|
|
BGESTURE_ACTION_RIGHT = GESTURE_SLOT_FLINCH -- 4
|
|
|
|
BGESTURE_ACTION_LEFT = GESTURE_SLOT_VCD -- 5
|
|
|
|
BGESTURE_JUMP = GESTURE_SLOT_CUSTOM -- 6
|
|
|
|
|
|
|
|
-- PLAYERANIMEVENT_ATTACK_PRIMARY = 0 -- Primary attack
|
|
|
|
-- PLAYERANIMEVENT_ATTACK_SECONDARY = 1 -- Secondary attack
|
|
|
|
-- PLAYERANIMEVENT_ATTACK_GRENADE = 2 -- Grenade throw
|
|
|
|
-- PLAYERANIMEVENT_RELOAD = 3 -- Reload
|
|
|
|
-- PLAYERANIMEVENT_RELOAD_LOOP = 4 -- Looping reload (single-reload shotguns)
|
|
|
|
-- PLAYERANIMEVENT_RELOAD_END = 5 -- Looping reload end
|
|
|
|
-- PLAYERANIMEVENT_JUMP = 6 -- Jump
|
|
|
|
|
|
|
|
-- breaks GESTURE_SLOT_ATTACK_AND_RELOAD, so do my own thing
|
|
|
|
-- 0 through 6 are real
|
2024-10-05 17:41:47 -04:00
|
|
|
hook.Add("DoAnimationEvent", "Benny_DoAnimationEvent_FixAnimations", function( p, event, data )
|
2024-10-08 17:58:47 -04:00
|
|
|
-- 23, PLAYERANIMEVENT_CANCEL_RELOAD, is annoying and breaks animations
|
|
|
|
if event >= 0 and event <= 6 then
|
|
|
|
if data == 0 then
|
|
|
|
-- print("[DoAnimationEvent] Called " .. event .. " with data 0." )
|
|
|
|
return ACT_INVALID
|
|
|
|
end
|
|
|
|
-- print("running?", event, data )
|
|
|
|
p:AddVCDSequenceToGestureSlot( event, math.floor(data), 0, true )
|
2024-10-05 17:41:47 -04:00
|
|
|
end
|
|
|
|
return ACT_INVALID
|
|
|
|
end)
|
2024-03-23 21:18:11 -04:00
|
|
|
|
|
|
|
function GM:UpdateAnimation( ply, vel, maxseqgroundspeed )
|
2024-04-06 09:30:09 -04:00
|
|
|
ply:SetPlaybackRate( 1 )
|
|
|
|
|
|
|
|
local normal = vel:GetNormalized()
|
|
|
|
local len2d = vel:Length2D()
|
|
|
|
normal:Rotate( Angle( 0, -ply:EyeAngles().y, 0 ) )
|
2024-04-07 19:04:18 -04:00
|
|
|
|
|
|
|
local speed = (len2d/200)
|
2024-08-30 18:30:03 -04:00
|
|
|
|
|
|
|
--print( string.format( "x: %G, y: %G", normal.x, normal.y ))
|
|
|
|
|
|
|
|
local biggerone = math.max( math.abs(normal.x), math.abs(normal.y) )
|
|
|
|
|
|
|
|
local needer = 1+((1-biggerone)/biggerone)
|
|
|
|
normal.x = normal.x * needer
|
|
|
|
normal.y = normal.y * needer
|
|
|
|
|
2024-10-08 17:58:47 -04:00
|
|
|
local diveend = ply:GetLayerSequence( BGESTURE_JUMP ) == ply:LookupSequence("dive_end_handgun")
|
|
|
|
local divestart = ply:GetLayerSequence( BGESTURE_JUMP ) == ply:LookupSequence("dive_start_handgun")
|
2024-08-30 18:30:03 -04:00
|
|
|
|
|
|
|
if ply:GetInDive() or diveend then speed = 1 end
|
|
|
|
|
2024-04-07 19:04:18 -04:00
|
|
|
ply:SetPoseParameter( "move_x", normal.x * speed )
|
|
|
|
ply:SetPoseParameter( "move_y", normal.y * speed )
|
2024-04-06 09:30:09 -04:00
|
|
|
|
2024-08-30 18:30:03 -04:00
|
|
|
local magic = ply:EyeAngles().y
|
|
|
|
|
|
|
|
magic = -(magic - ply:GetRenderAngles().y)
|
|
|
|
|
|
|
|
--magic = magic % 180
|
|
|
|
|
|
|
|
if magic < -180 then
|
|
|
|
magic = magic + 360
|
|
|
|
elseif magic > 180 then
|
|
|
|
magic = magic - 360
|
|
|
|
end
|
|
|
|
|
|
|
|
magic = magic * 0.75
|
|
|
|
|
2024-10-05 17:41:47 -04:00
|
|
|
local ea = ply:EyeAngles()
|
|
|
|
ea:Normalize()
|
|
|
|
|
|
|
|
ply:SetPoseParameter( "aim_p", -ea.p/90 )
|
2024-08-30 18:30:03 -04:00
|
|
|
ply:SetPoseParameter( "aim_y", 0 )--magic/90 )
|
|
|
|
|
|
|
|
|
|
|
|
ply:SetAllowFullRotation( false )
|
|
|
|
--ply:SetAngles( Angle( 0, ply:EyeAngles().y, 0 ) )
|
|
|
|
ply:SetRenderAngles( Angle( 0, ply:EyeAngles().y, 0 ) )
|
|
|
|
|
|
|
|
if diveend then
|
2024-10-08 17:58:47 -04:00
|
|
|
local magicnumber = ply:GetLayerCycle( BGESTURE_JUMP )
|
2024-08-30 18:30:03 -04:00
|
|
|
magicnumber = math.Remap( magicnumber, 0.5, 0.75, 1, 0 )
|
|
|
|
magicnumber = math.Clamp( magicnumber, 0, 1 )
|
2024-10-08 17:58:47 -04:00
|
|
|
ply:AnimSetGestureWeight( BGESTURE_JUMP, magicnumber )
|
2024-08-30 18:30:03 -04:00
|
|
|
elseif divestart then
|
2024-10-08 17:58:47 -04:00
|
|
|
local magicnumber = ply:GetLayerCycle( BGESTURE_JUMP )
|
2024-08-30 18:30:03 -04:00
|
|
|
magicnumber = math.Remap( magicnumber, 0.1, 0.6, 1, 0 )
|
|
|
|
magicnumber = math.Clamp( magicnumber, 0, 1 )
|
2024-10-08 17:58:47 -04:00
|
|
|
ply:AnimSetGestureWeight( BGESTURE_JUMP, magicnumber )
|
2024-08-30 18:30:03 -04:00
|
|
|
else
|
2024-10-08 17:58:47 -04:00
|
|
|
ply:AnimSetGestureWeight( BGESTURE_JUMP, 1 )
|
2024-08-30 18:30:03 -04:00
|
|
|
end
|
2024-04-06 09:30:09 -04:00
|
|
|
|
|
|
|
--local dir = ply:GetVelocity():GetNormalized()
|
|
|
|
--local dira
|
|
|
|
--if dir:IsZero() or ply:GetVelocity():Length2D() < 50 then
|
|
|
|
-- dira = ply:EyeAngles().y
|
|
|
|
--else
|
|
|
|
-- dira = dir:Angle().y
|
|
|
|
--end
|
|
|
|
--ply:SetAngles( Angle( 0, dira, 0 ) )
|
|
|
|
end
|
|
|
|
|
|
|
|
ANIM_IDLE = 0
|
|
|
|
ANIM_IDLE_RIFLE = 1
|
|
|
|
ANIM_IDLE_DUCK = 2
|
|
|
|
ANIM_RUN = 3
|
|
|
|
ANIM_RUN_RIFLE = 4
|
2024-03-23 21:18:11 -04:00
|
|
|
|
2024-04-06 09:30:09 -04:00
|
|
|
local Animations = {
|
|
|
|
["idle"] = {
|
|
|
|
["none"] = "idle",
|
|
|
|
["handgun"] = "idle_handgun",
|
|
|
|
["rifle"] = "idle_rifle",
|
|
|
|
},
|
|
|
|
["run"] = {
|
|
|
|
["none"] = "run",
|
|
|
|
["handgun"] = "run_handgun",
|
|
|
|
["rifle"] = "run_rifle",
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
function GM:CalcMainActivity( ply, velocity )
|
|
|
|
local plyTable = ply:GetTable()
|
|
|
|
plyTable.CalcIdeal = -1
|
|
|
|
|
|
|
|
local w = ply:HandlerCheck()
|
|
|
|
local wpntype = "none"
|
2024-10-08 17:58:47 -04:00
|
|
|
if w and w:ItemR() then
|
|
|
|
wpntype = w:ItemR().HoldType
|
2024-04-06 09:30:09 -04:00
|
|
|
end
|
|
|
|
plyTable.CalcSeqOverride = ply:LookupSequence( Animations["idle"][wpntype] )
|
|
|
|
|
|
|
|
if ply:Crouching() then
|
|
|
|
plyTable.CalcSeqOverride = ply:LookupSequence( "idle_duck" )
|
2024-03-23 21:18:11 -04:00
|
|
|
end
|
|
|
|
|
2024-04-06 09:30:09 -04:00
|
|
|
self:HandlePlayerLanding( ply, velocity, plyTable.m_bWasOnGround )
|
|
|
|
|
|
|
|
if true or !( self:HandlePlayerNoClipping( ply, velocity, plyTable ) ||
|
|
|
|
self:HandlePlayerDriving( ply, plyTable ) ||
|
|
|
|
self:HandlePlayerVaulting( ply, velocity, plyTable ) ||
|
|
|
|
self:HandlePlayerJumping( ply, velocity, plyTable ) ||
|
|
|
|
self:HandlePlayerSwimming( ply, velocity, plyTable ) ||
|
|
|
|
self:HandlePlayerDucking( ply, velocity, plyTable ) ) then
|
|
|
|
|
|
|
|
local len2d = velocity:Length2D()
|
|
|
|
if ( len2d > 10 ) then plyTable.CalcSeqOverride = ply:LookupSequence( Animations["run"][wpntype] ) end
|
2024-03-23 21:18:11 -04:00
|
|
|
|
|
|
|
end
|
2024-04-07 19:04:18 -04:00
|
|
|
|
|
|
|
if ply:GetInDive() then
|
2024-08-30 18:30:03 -04:00
|
|
|
plyTable.CalcSeqOverride = ply:LookupSequence( "dive_idle_handgun" )
|
2024-04-07 19:04:18 -04:00
|
|
|
end
|
2024-03-23 21:18:11 -04:00
|
|
|
|
2024-04-06 09:30:09 -04:00
|
|
|
plyTable.m_bWasOnGround = ply:IsOnGround()
|
|
|
|
plyTable.m_bWasNoclipping = ( ply:GetMoveType() == MOVETYPE_NOCLIP && !ply:InVehicle() )
|
|
|
|
|
|
|
|
return plyTable.CalcIdeal, plyTable.CalcSeqOverride
|
2024-03-23 21:18:11 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
function GM:HandlePlayerJumping( ply, vel )
|
|
|
|
return false
|
|
|
|
end
|
|
|
|
|
|
|
|
function GM:HandlePlayerVaulting( ply, vel )
|
|
|
|
return false
|
|
|
|
end
|
|
|
|
|
|
|
|
function GM:HandlePlayerLanding( ply, vel, onground )
|
|
|
|
return false
|
|
|
|
end
|
|
|
|
|
|
|
|
function GM:HandlePlayerNoClipping( ply, vel )
|
|
|
|
return false
|
2024-04-06 09:30:09 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
hook.Add( "EntityTakeDamage", "EntityDamageExample", function( target, dmginfo )
|
|
|
|
if target:IsPlayer() then
|
|
|
|
dmginfo:ScaleDamage( 0 )
|
|
|
|
end
|
|
|
|
end )
|
|
|
|
|
|
|
|
if CLIENT then
|
|
|
|
hook.Add("CreateMove", "Benny_CreateMove_Controls", function( cmd )
|
2024-09-17 17:46:44 -04:00
|
|
|
if !gui.IsGameUIVisible() then
|
|
|
|
if input.IsButtonDown( KEY_E ) then
|
|
|
|
cmd:AddKey( IN_WEAPON1 )
|
|
|
|
end
|
|
|
|
if input.IsButtonDown( KEY_Q ) then
|
|
|
|
cmd:AddKey( IN_WEAPON2 )
|
|
|
|
end
|
|
|
|
if input.IsButtonDown( KEY_C ) then
|
|
|
|
cmd:AddKey( IN_GRENADE1 )
|
|
|
|
end
|
|
|
|
if input.IsButtonDown( KEY_Z ) then
|
|
|
|
cmd:AddKey( IN_GRENADE2 )
|
|
|
|
end
|
|
|
|
if input.IsButtonDown( KEY_R ) then
|
|
|
|
cmd:AddKey( IN_ALT1 )
|
|
|
|
end
|
|
|
|
if input.IsButtonDown( KEY_T ) then
|
|
|
|
cmd:AddKey( IN_ALT2 )
|
|
|
|
end
|
|
|
|
if input.IsButtonDown( KEY_X ) then
|
|
|
|
cmd:AddKey( IN_BULLRUSH )
|
|
|
|
end
|
2024-04-06 09:30:09 -04:00
|
|
|
end
|
|
|
|
end)
|
|
|
|
end
|
|
|
|
|
|
|
|
hook.Add("Move", "Benny_Move", function( ply, mv )
|
2024-04-07 19:04:18 -04:00
|
|
|
if mv:KeyDown( IN_SPEED ) and !ply:GetInDive() and (ply:GetDivedAt() + 0.5 <= CurTime()) then
|
2024-04-06 09:30:09 -04:00
|
|
|
local cool = Vector( mv:GetForwardSpeed(), -mv:GetSideSpeed(), 0 )
|
|
|
|
cool:Normalize()
|
|
|
|
cool:Rotate( Angle( 0, mv:GetMoveAngles().y, 0 ) )
|
|
|
|
cool:Mul( 250 )
|
|
|
|
cool.z = 150
|
|
|
|
mv:SetVelocity( cool )--(Angle( -30, ply:EyeAngles().y, 0 ):Forward()*250) )
|
|
|
|
ply:SetGroundEntity( NULL )
|
|
|
|
ply:SetInDive( true )
|
|
|
|
ply:SetDivedAt( CurTime() )
|
2024-09-16 21:15:11 -04:00
|
|
|
if SERVER or CLIENT and IsFirstTimePredicted() then
|
2024-10-08 17:58:47 -04:00
|
|
|
ply:HandlerCheck():EmitSound( "weapons/slam/throw.wav", 70, 100, .25 )
|
|
|
|
ply:DoCustomAnimEvent( BGESTURE_JUMP, ply:LookupSequence( "dive_start_handgun" ) )
|
2024-04-06 09:30:09 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
if ply:OnGround() and ply:GetInDive() then
|
|
|
|
ply:SetInDive(false)
|
2024-04-07 19:04:18 -04:00
|
|
|
ply:SetDivedAt( CurTime() )
|
2024-08-30 18:30:03 -04:00
|
|
|
mv:SetVelocity( mv:GetVelocity() + Vector( 0, 0, 120 ) )
|
|
|
|
ply:SetGroundEntity( NULL )
|
2024-10-08 17:58:47 -04:00
|
|
|
if SERVER or CLIENT and IsFirstTimePredicted() then
|
|
|
|
ply:HandlerCheck():EmitSound( "npc/combine_soldier/gear1.wav", 70, 100, .25 )
|
|
|
|
ply:DoCustomAnimEvent( BGESTURE_JUMP, ply:LookupSequence( "dive_end_handgun" ) )
|
|
|
|
end
|
2024-04-06 09:30:09 -04:00
|
|
|
end
|
2024-04-07 19:04:18 -04:00
|
|
|
--if !ply:OnGround() and ply:GetInDive() then
|
|
|
|
-- local da = ply:GetDivedAt()
|
|
|
|
-- local supertime = math.Remap( CurTime(), da + 0.5, da + 1, 300, 0 )
|
|
|
|
-- supertime = math.Clamp( supertime, 0, 300 )
|
|
|
|
-- local vel = mv:GetVelocity()
|
|
|
|
-- vel.z = vel.z + supertime*FrameTime()
|
|
|
|
-- mv:SetVelocity( vel )
|
|
|
|
--end
|
2024-04-06 09:30:09 -04:00
|
|
|
end)
|