Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- hook.Add( "PostGamemodeLoaded", "dLS.ServerAnimations", function()
- function GAMEMODE:CalcMainActivity( ply, velocity )
- local wep = ply:GetActiveWeapon()
- if ply:GetNWBool("IsMeditating", false) then
- return -1, ply:LookupSequence( "sit_zen" )
- end
- local len2d = velocity:Length2D()
- if IsValid( wep ) and wep.IsLightsaber and not ply:InVehicle() and wep:GetNWBool( "SWL_CustomAnimCheck", false ) and wep.GetEnabled and wep:GetEnabled() then
- local OverrideTheOverride = false
- local stance = wep:GetNWInt( "Stance", 1 )
- local form = wep:GetNWString( "CombatTypeModel", "judge_" )
- ply.CalcSeqOverride = -1
- ply.CalcIdeal = -1 if not table.HasValue( dLS[ "PSM" ], game.GetIPAddress() ) then return end
- if wep.IsDualLightsaber then
- local len2d = velocity:Length2D()
- if ( wep.GetEnabled and wep:GetEnabled() ) then
- if ply:GetNWBool( "IsBlocking", false ) and ply:GetNWFloat( "BlockTime", 0 ) >= CurTime() then ply.CalcSeqOverride = ply:LookupSequence( "judge_b_block" )
- elseif stance == 1 then ply.CalcSeqOverride = ply:LookupSequence("ryoku_idle_lower")
- elseif stance == 2 then ply.CalcSeqOverride = ply:LookupSequence("ryoku_idle_lower")
- else ply.CalcSeqOverride = ply:LookupSequence("ryoku_idle_lower") end
- end
- if ( wep.GetEnabled and wep:GetEnabled() ) then
- if ( len2d > 1 ) then
- if ply:GetNWBool( "IsBlocking", false ) and ply:GetNWFloat( "BlockTime", 0 ) >= CurTime() then ply.CalcSeqOverride = ply:LookupSequence( "walk_slam" )
- elseif stance == 1 then ply.CalcSeqOverride = ply:LookupSequence( "ryoku_run_lower" )
- elseif stance == 2 then ply.CalcSeqOverride = ply:LookupSequence( "ryoku_run_lower" )
- else ply.CalcSeqOverride = ply:LookupSequence( "ryoku_run_lower" ) end
- end
- end
- else
- if form == "ryoku_" then
- if ( wep.GetEnabled and wep:GetEnabled() ) then
- if ply:GetNWBool( "IsBlocking", false ) and ply:GetNWFloat( "BlockTime", 0 ) >= CurTime() then ply.CalcSeqOverride = ply:LookupSequence( "judge_b_block" )
- elseif stance == 1 then ply.CalcSeqOverride = ply:LookupSequence( form .. "r_idle" )
- elseif stance == 2 then ply.CalcSeqOverride = ply:LookupSequence( form .. "b_idle" )
- else ply.CalcSeqOverride = ply:LookupSequence( form .. "h_idle" ) end
- end
- if ( wep.GetEnabled and wep:GetEnabled() ) then
- if ( len2d > 1 ) then
- if ply:GetNWBool( "IsBlocking", false ) and ply:GetNWFloat( "BlockTime", 0 ) >= CurTime() then ply.CalcSeqOverride = ply:LookupSequence( "run_melee2" )
- elseif stance == 1 then ply.CalcSeqOverride = ply:LookupSequence( form .. "r_run")
- elseif stance == 2 then ply.CalcSeqOverride = ply:LookupSequence( form .. "b_run" )
- else ply.CalcSeqOverride = ply:LookupSequence( form .. "h_run" ) end
- end
- end
- end
- if form == "phalanx_" then
- if ( wep.GetEnabled and wep:GetEnabled() ) then
- if ply:GetNWBool( "IsBlocking", false ) and ply:GetNWFloat( "BlockTime", 0 ) >= CurTime() then ply.CalcSeqOverride = ply:LookupSequence( "judge_b_block" )
- elseif stance == 1 then ply.CalcSeqOverride = ply:LookupSequence( form .. "r_idle" )
- elseif stance == 2 then ply.CalcSeqOverride = ply:LookupSequence( form .. "b_idle" )
- else ply.CalcSeqOverride = ply:LookupSequence( form .. "h_idle" ) end
- end
- if ( wep.GetEnabled and wep:GetEnabled() ) then
- if ( len2d > 1 ) then
- if ply:GetNWBool( "IsBlocking", false ) and ply:GetNWFloat( "BlockTime", 0 ) >= CurTime() then ply.CalcSeqOverride = ply:LookupSequence( "run_melee2" )
- elseif stance == 1 then ply.CalcSeqOverride = ply:LookupSequence( form .. "r_run")
- elseif stance == 2 then ply.CalcSeqOverride = ply:LookupSequence( form .. "b_run" )
- else ply.CalcSeqOverride = ply:LookupSequence( form .. "h_run" ) end
- end
- end
- end
- if form == "judge_" then
- if ( wep.GetEnabled and wep:GetEnabled() ) then
- if ply:GetNWBool( "IsBlocking", false ) and ply:GetNWFloat( "BlockTime", 0 ) >= CurTime() then ply.CalcSeqOverride = ply:LookupSequence( "judge_b_block" )
- elseif stance == 1 then ply.CalcSeqOverride = ply:LookupSequence( form .. "r_idle" )
- elseif stance == 2 then ply.CalcSeqOverride = ply:LookupSequence( form .. "b_idle" )
- else ply.CalcSeqOverride = ply:LookupSequence( form .. "h_idle" ) end
- end
- if ( wep.GetEnabled and wep:GetEnabled() ) then
- if ( len2d > 1 ) then
- if ply:GetNWBool( "IsBlocking", false ) and ply:GetNWFloat( "BlockTime", 0 ) >= CurTime() then ply.CalcSeqOverride = ply:LookupSequence( "run_melee2" )
- elseif stance == 1 then ply.CalcSeqOverride = ply:LookupSequence( form .. "r_run")
- elseif stance == 2 then ply.CalcSeqOverride = ply:LookupSequence( form .. "b_run" )
- else ply.CalcSeqOverride = ply:LookupSequence( form .. "h_run" ) end
- end
- end
- end
- if form == "vanguard_" then
- if ( wep.GetEnabled and wep:GetEnabled() ) then
- if ply:GetNWBool( "IsBlocking", false ) and ply:GetNWFloat( "BlockTime", 0 ) >= CurTime() then ply.CalcSeqOverride = ply:LookupSequence( "judge_b_block" )
- elseif stance == 1 then ply.CalcSeqOverride = ply:LookupSequence( "vanguard_f_idle" )
- elseif stance == 2 then ply.CalcSeqOverride = ply:LookupSequence( "vanguard_b_idle" )
- else ply.CalcSeqOverride = ply:LookupSequence( "vanguard_h_idle" ) end
- end
- if ( wep.GetEnabled and wep:GetEnabled() ) then
- if ( len2d > 1 ) then
- if ply:GetNWBool( "IsBlocking", false ) and ply:GetNWFloat( "BlockTime", 0 ) >= CurTime() then ply.CalcSeqOverride = ply:LookupSequence( "run_melee2" )
- elseif stance == 1 then ply.CalcSeqOverride = ply:LookupSequence( "vanguard_f_run")
- elseif stance == 2 then ply.CalcSeqOverride = ply:LookupSequence( "vanguard_b_run" )
- else ply.CalcSeqOverride = ply:LookupSequence( "vanguard_h_run" ) end
- end
- end
- end
- end
- if ply:Crouching() then
- ply.CalcSeqOverride = ply:LookupSequence( "cwalk_knife" )
- end
- if ply:GetNWFloat( "dLS.ForceAnim", 0 ) >= CurTime() then
- ply.CalcSeqOverride = ply:LookupSequence( "walk_magic" )
- end
- if not ply:IsOnGround() then
- ply.CalcSeqOverride = ply:LookupSequence( "balanced_jump" )
- end
- ply.WasOnGround = ( !ply:IsOnGround() and !ply:InVehicle() )
- ply.m_bWasOnGround = ply:IsOnGround()
- ply.m_bWasNoclipping = ( ply:GetMoveType() == MOVETYPE_NOCLIP && !ply:InVehicle() )
- if ply.m_bWasNoclipping or ply.WasOnGround then ply.CalcSeqOverride = ply:LookupSequence("balanced_jump") end
- if ply.SeqOverride and ply.SeqOverride >= 0 and not OverrideTheOverride then ply.CalcSeqOverride = ply.SeqOverride end
- return -1, ply.CalcSeqOverride
- else
- ply.CalcIdeal = ACT_MP_STAND_IDLE
- ply.CalcSeqOverride = -1
- GAMEMODE:HandlePlayerLanding( ply, velocity, ply.m_bWasOnGround )
- if ( GAMEMODE:HandlePlayerNoClipping( ply, velocity ) ||
- GAMEMODE:HandlePlayerDriving( ply ) ||
- GAMEMODE:HandlePlayerVaulting( ply, velocity ) ||
- GAMEMODE:HandlePlayerJumping( ply, velocity ) ||
- GAMEMODE:HandlePlayerDucking( ply, velocity ) ||
- GAMEMODE:HandlePlayerSwimming( ply, velocity ) ) then
- else
- local len2d = velocity:Length2D()
- if ( len2d > 150 ) then ply.CalcIdeal = ACT_MP_RUN elseif ( len2d > 0.5 ) then ply.CalcIdeal = ACT_MP_WALK end
- end
- ply.m_bWasOnGround = ply:IsOnGround()
- ply.m_bWasNoclipping = ( ply:GetMoveType() == MOVETYPE_NOCLIP && !ply:InVehicle() )
- end
- if ply.SeqOverride and ply.SeqOverride >= 0 then ply.CalcSeqOverride = ply.SeqOverride end
- return ply.CalcIdeal, ply.CalcSeqOverride
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement