Begin rebuild
This commit is contained in:
parent
eaa404bef1
commit
35ba698d27
|
@ -1,59 +0,0 @@
|
||||||
AddCSLuaFile()
|
|
||||||
|
|
||||||
ENT.Type = "anim"
|
|
||||||
ENT.Base = "base_anim"
|
|
||||||
ENT.RenderGroup = RENDERGROUP_BOTH
|
|
||||||
|
|
||||||
function ENT:Initialize()
|
|
||||||
self.DieTime = CurTime() + 3
|
|
||||||
end
|
|
||||||
|
|
||||||
function ENT:InitSpecial( model )
|
|
||||||
self:SetModel( model )
|
|
||||||
|
|
||||||
-- Physics stuff
|
|
||||||
self:SetMoveType( MOVETYPE_VPHYSICS )
|
|
||||||
self:SetSolid( SOLID_VPHYSICS )
|
|
||||||
|
|
||||||
-- Init physics only on server, so it doesn't mess up physgun beam
|
|
||||||
if ( SERVER ) then self:PhysicsInit( SOLID_VPHYSICS ) end
|
|
||||||
|
|
||||||
self:SetCollisionGroup( COLLISION_GROUP_PROJECTILE )
|
|
||||||
|
|
||||||
-- Make prop to fall on spawn
|
|
||||||
self:PhysWake()
|
|
||||||
|
|
||||||
if SERVER then
|
|
||||||
local p = self:GetPhysicsObject()
|
|
||||||
p:SetMass( 0 )
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function ENT:Think()
|
|
||||||
if SERVER and self.DieTime <= CurTime() then
|
|
||||||
self:Remove()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function ENT:PhysicsCollide( data, phys )
|
|
||||||
if ( data.Speed > 200 ) and data.DeltaTime > 0.2 then
|
|
||||||
local ent = data.HitEntity
|
|
||||||
print(ent:Health())
|
|
||||||
if ent:IsValid() and ent:Health() > 0 then
|
|
||||||
ent:EmitSound( ")benny/violence/bodysplat_mix2.ogg", 70, 100, 1 )
|
|
||||||
|
|
||||||
local dmg = DamageInfo()
|
|
||||||
dmg:SetDamageType( DMG_CLUB )
|
|
||||||
dmg:SetDamage( 25 )
|
|
||||||
dmg:SetAttacker( self:GetOwner() )
|
|
||||||
dmg:SetInflictor( self )
|
|
||||||
print( data.HitSpeed, data.HitSpeed:Length() )
|
|
||||||
dmg:SetDamageForce( data.HitSpeed*-10 )
|
|
||||||
dmg:SetDamagePosition( data.HitPos )
|
|
||||||
|
|
||||||
ent:TakeDamageInfo( dmg )
|
|
||||||
else
|
|
||||||
self:EmitSound( "physics/metal/weapon_impact_hard1.wav" )
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,3 +0,0 @@
|
||||||
|
|
||||||
ENT.Base = "b-item"
|
|
||||||
|
|
|
@ -1,95 +0,0 @@
|
||||||
function SWEP:DrawWorldModel()
|
|
||||||
local p = self:GetOwner()
|
|
||||||
do
|
|
||||||
local wm = self.CWM
|
|
||||||
local class = self:bWepClass( false )
|
|
||||||
if class then
|
|
||||||
if !IsValid(wm) then
|
|
||||||
wm = ClientsideModel( class.WModel )
|
|
||||||
self.CWM = wm
|
|
||||||
end
|
|
||||||
wm:SetModel( class.WModel )
|
|
||||||
wm:SetNoDraw( true )
|
|
||||||
if class.MAdj then
|
|
||||||
if wm:IsEffectActive( EF_BONEMERGE ) then
|
|
||||||
wm:RemoveEffects( EF_BONEMERGE )
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Specify a good position
|
|
||||||
local offsetVec = class.MAdj
|
|
||||||
local offsetAng = class.MAdjA or angle_zero
|
|
||||||
|
|
||||||
local boneid = p:LookupBone("ValveBiped.Bip01_R_Hand") -- Right Hand
|
|
||||||
if !boneid then return end
|
|
||||||
|
|
||||||
local matrix = p:GetBoneMatrix(boneid)
|
|
||||||
if !matrix then return end
|
|
||||||
|
|
||||||
local newPos, newAng = LocalToWorld(offsetVec, offsetAng, matrix:GetTranslation(), matrix:GetAngles())
|
|
||||||
|
|
||||||
wm:SetPos(newPos)
|
|
||||||
wm:SetAngles(newAng)
|
|
||||||
|
|
||||||
wm:SetupBones()
|
|
||||||
else
|
|
||||||
if !wm:IsEffectActive( EF_BONEMERGE ) then
|
|
||||||
wm:AddEffects( EF_BONEMERGE )
|
|
||||||
end
|
|
||||||
wm:SetPos(self:GetPos())
|
|
||||||
wm:SetAngles(self:GetAngles())
|
|
||||||
end
|
|
||||||
wm:SetParent( p )
|
|
||||||
if true or self:GetUserAim() then wm:DrawModel() end
|
|
||||||
else
|
|
||||||
if IsValid(wm) then wm:Remove() end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
do
|
|
||||||
local wm = self.CWM_Left
|
|
||||||
local class = self:bWepClass( true )
|
|
||||||
if class then
|
|
||||||
if !IsValid(wm) then
|
|
||||||
wm = ClientsideModel( class.WModel )
|
|
||||||
self.CWM_Left = wm
|
|
||||||
end
|
|
||||||
wm:SetModel( class.WModel )
|
|
||||||
wm:SetNoDraw( true )
|
|
||||||
|
|
||||||
if IsValid(p) then
|
|
||||||
-- Specify a good position
|
|
||||||
wm:SetPos( vector_origin )
|
|
||||||
wm:SetAngles( angle_zero )
|
|
||||||
wm:SetupBones()
|
|
||||||
|
|
||||||
local pv = wm:GetBoneMatrix( wm:LookupBone( "ValveBiped.Bip01_R_Hand" ) ):GetTranslation()
|
|
||||||
local pa = wm:GetBoneMatrix( wm:LookupBone( "ValveBiped.Bip01_R_Hand" ) ):GetAngles()
|
|
||||||
pv.x = -pv.x
|
|
||||||
pv.y = pv.y
|
|
||||||
pv.z = -pv.z
|
|
||||||
pa.p = -pa.p
|
|
||||||
pa.r = pa.r + 180
|
|
||||||
|
|
||||||
local boneid = p:LookupBone("ValveBiped.Bip01_L_Hand") -- Right Hand
|
|
||||||
if !boneid then return end
|
|
||||||
|
|
||||||
local matrix = p:GetBoneMatrix(boneid)
|
|
||||||
if !matrix then return end
|
|
||||||
|
|
||||||
local newPos, newAng = LocalToWorld(pv, pa, matrix:GetTranslation(), matrix:GetAngles())
|
|
||||||
|
|
||||||
wm:SetPos(newPos)
|
|
||||||
wm:SetAngles(newAng)
|
|
||||||
|
|
||||||
wm:SetupBones()
|
|
||||||
else
|
|
||||||
wm:SetPos(self:GetPos())
|
|
||||||
wm:SetAngles(self:GetAngles())
|
|
||||||
wm:SetupBones()
|
|
||||||
end
|
|
||||||
|
|
||||||
if true or self:GetUserAim() then wm:DrawModel() end
|
|
||||||
else
|
|
||||||
if IsValid(wm) then wm:Remove() end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,34 +0,0 @@
|
||||||
|
|
||||||
function SWEP:Drop( hand )
|
|
||||||
if self:bWepClass( hand ) then
|
|
||||||
local p = self:GetOwner()
|
|
||||||
self:EmitSound( "weapons/slam/throw.wav", 70, 100, 1, CHAN_STATIC )
|
|
||||||
|
|
||||||
if SERVER then
|
|
||||||
local throw = ents.Create( "b-item" )
|
|
||||||
throw:SetPos( p:EyePos() + p:EyeAngles():Forward()*16 )
|
|
||||||
throw:SetAngles( p:EyeAngles() )
|
|
||||||
throw:SetOwner( p )
|
|
||||||
throw:InitSpecial(self:bWepClass( hand ).WModel)
|
|
||||||
throw:SetPhysicsAttacker( p )
|
|
||||||
throw:Spawn()
|
|
||||||
local throwp = throw:GetPhysicsObject()
|
|
||||||
assert( throwp:IsValid(), "Benny Drop: Physics object invalid" )
|
|
||||||
throwp:SetVelocityInstantaneous( (p:EyeAngles()+Angle(-7,0,0)):Forward()*1000 )
|
|
||||||
if self:bWepClass( hand ).ClassName == "m16a2" then
|
|
||||||
throwp:SetAngleVelocityInstantaneous( Vector( 360*-0.2, 360*1, 360*0 ) )
|
|
||||||
else
|
|
||||||
throwp:SetAngleVelocityInstantaneous( Vector( 360*-0.25, 360*10, 360*0.25 ) )
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if SERVER or CLIENT and IsFirstTimePredicted() then
|
|
||||||
--InvDiscard( p, self:bGetInvID( hand ) )
|
|
||||||
end
|
|
||||||
self:SetJustThrew( CurTime() + 0.25 )
|
|
||||||
self:SetJustThrewHand( hand )
|
|
||||||
self:bWepTable( hand ).Thrown = true
|
|
||||||
p:AddVCDSequenceToGestureSlot( GESTURE_SLOT_JUMP, p:SelectWeightedSequence( ACT_HL2MP_GESTURE_RANGE_ATTACK_MELEE ), 0, true )
|
|
||||||
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,84 +0,0 @@
|
||||||
|
|
||||||
|
|
||||||
function SWEP:PrimaryAttack()
|
|
||||||
if self:bWepTable( self:hFlipHand( false ) ) and self:bWepTable( self:hFlipHand( false ) ).Thrown then return true end
|
|
||||||
self:BFireLogic( self:hFlipHand( false ) )
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
|
|
||||||
function SWEP:SecondaryAttack()
|
|
||||||
if self:bWepTable( self:hFlipHand( true ) ) and self:bWepTable( self:hFlipHand( true ) ).Thrown then return true end
|
|
||||||
self:BFireLogic( self:hFlipHand( true ) )
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
|
|
||||||
function SWEP:BFireLogic( hand )
|
|
||||||
if self:bWepClass( hand ) then
|
|
||||||
self:BFire( hand )
|
|
||||||
elseif self:bWepClass( !hand ) then
|
|
||||||
self:BFireAlt( !hand )
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function SWEP:BFire( hand )
|
|
||||||
if self:bWepClass( hand ) and self:bWepClass( hand ).Func_Attack then
|
|
||||||
if self:bWepClass( hand ).Func_Attack( self, hand ) then return end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function SWEP:BFireAlt( hand )
|
|
||||||
if self:bWepClass( hand ) and self:bWepClass( hand ).Func_AttackAlt then
|
|
||||||
if self:bWepClass( hand ).Func_AttackAlt( self, hand ) then return end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local bc = { effects = true, damage = true }
|
|
||||||
function SWEP:CallFire( hand )
|
|
||||||
local p = self:GetOwner()
|
|
||||||
local class = self:bWepClass( hand )
|
|
||||||
local spread = self:BSpread( hand )
|
|
||||||
for i=1, self:GetStat( hand, "Pellets" ) do
|
|
||||||
local dir = self:GetOwner():EyeAngles()
|
|
||||||
|
|
||||||
local radius = util.SharedRandom("benny_distance_"..tostring(hand), 0, 1, i )
|
|
||||||
local circ = util.SharedRandom("benny_radius_"..tostring(hand), 0, math.rad(360), i )
|
|
||||||
|
|
||||||
dir:RotateAroundAxis( dir:Right(), spread * radius * math.sin( circ ) )
|
|
||||||
dir:RotateAroundAxis( dir:Up(), spread * radius * math.cos( circ ) )
|
|
||||||
dir:RotateAroundAxis( dir:Forward(), 0 )
|
|
||||||
local tr = util.TraceLine( {
|
|
||||||
start = p:EyePos(),
|
|
||||||
endpos = p:EyePos() + dir:Forward() * 8192,
|
|
||||||
filter = p
|
|
||||||
} )
|
|
||||||
|
|
||||||
self:FireBullets( {
|
|
||||||
Attacker = p,
|
|
||||||
Damage = class.Damage,
|
|
||||||
Force = ( class.Damage / 10 ) * self:GetStat( hand, "Pellets" ),
|
|
||||||
Src = p:EyePos(),
|
|
||||||
Dir = dir:Forward(),
|
|
||||||
Tracer = 0,
|
|
||||||
IgnoreEntity = p,
|
|
||||||
Callback = function( atk, tr, dmginfo )
|
|
||||||
if CLIENT and IsFirstTimePredicted() then
|
|
||||||
self:FireCL( hand, tr )
|
|
||||||
end
|
|
||||||
return bc
|
|
||||||
end,
|
|
||||||
} )
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function SWEP:FireCL( hand, tr )
|
|
||||||
-- PROTO: This is shit! Replace it with a function that gets the right model.
|
|
||||||
local vStart = (hand and self.CWM_Left or self.CWM):GetAttachment( 1 ).Pos
|
|
||||||
local vPoint = tr.HitPos
|
|
||||||
local effectdata = EffectData()
|
|
||||||
effectdata:SetStart( vStart )
|
|
||||||
effectdata:SetOrigin( vPoint )
|
|
||||||
effectdata:SetEntity( self )
|
|
||||||
effectdata:SetScale( 1025*12 )
|
|
||||||
effectdata:SetFlags( 1 )
|
|
||||||
util.Effect( "Tracer", effectdata )
|
|
||||||
end
|
|
|
@ -1,155 +0,0 @@
|
||||||
|
|
||||||
|
|
||||||
-- Holdtype thingys
|
|
||||||
do
|
|
||||||
local ActIndex = {
|
|
||||||
[ "pistol" ] = ACT_HL2MP_IDLE_PISTOL,
|
|
||||||
[ "smg" ] = ACT_HL2MP_IDLE_SMG1,
|
|
||||||
[ "grenade" ] = ACT_HL2MP_IDLE_GRENADE,
|
|
||||||
[ "ar2" ] = ACT_HL2MP_IDLE_AR2,
|
|
||||||
[ "shotgun" ] = ACT_HL2MP_IDLE_SHOTGUN,
|
|
||||||
[ "rpg" ] = ACT_HL2MP_IDLE_RPG,
|
|
||||||
[ "physgun" ] = ACT_HL2MP_IDLE_PHYSGUN,
|
|
||||||
[ "crossbow" ] = ACT_HL2MP_IDLE_CROSSBOW,
|
|
||||||
[ "melee" ] = ACT_HL2MP_IDLE_MELEE,
|
|
||||||
[ "slam" ] = ACT_HL2MP_IDLE_SLAM,
|
|
||||||
[ "normal" ] = ACT_HL2MP_IDLE,
|
|
||||||
[ "fist" ] = ACT_HL2MP_IDLE_FIST,
|
|
||||||
[ "melee2" ] = ACT_HL2MP_IDLE_MELEE2,
|
|
||||||
[ "passive" ] = ACT_HL2MP_IDLE_PASSIVE,
|
|
||||||
[ "knife" ] = ACT_HL2MP_IDLE_KNIFE,
|
|
||||||
[ "duel" ] = ACT_HL2MP_IDLE_DUEL,
|
|
||||||
[ "camera" ] = ACT_HL2MP_IDLE_CAMERA,
|
|
||||||
[ "magic" ] = ACT_HL2MP_IDLE_MAGIC,
|
|
||||||
[ "revolver" ] = ACT_HL2MP_IDLE_REVOLVER,
|
|
||||||
|
|
||||||
[ "suitcase" ] = ACT_HL2MP_IDLE,
|
|
||||||
[ "melee_angry" ] = ACT_HL2MP_IDLE_MELEE_ANGRY,
|
|
||||||
[ "angry" ] = ACT_HL2MP_IDLE_ANGRY,
|
|
||||||
[ "scared" ] = ACT_HL2MP_IDLE_SCARED,
|
|
||||||
[ "zombie" ] = ACT_HL2MP_IDLE_ZOMBIE,
|
|
||||||
[ "cower" ] = ACT_HL2MP_IDLE_COWER,
|
|
||||||
}
|
|
||||||
|
|
||||||
--[[---------------------------------------------------------
|
|
||||||
Name: SetWeaponHoldType
|
|
||||||
Desc: Sets up the translation table, to translate from normal
|
|
||||||
standing idle pose, to holding weapon pose.
|
|
||||||
-----------------------------------------------------------]]
|
|
||||||
function SWEP:SetWeaponHoldType( t )
|
|
||||||
|
|
||||||
t = string.lower( t )
|
|
||||||
local index = ActIndex[ t ]
|
|
||||||
|
|
||||||
if ( index == nil ) then
|
|
||||||
Msg( "SWEP:SetWeaponHoldType - ActIndex[ \"" .. t .. "\" ] isn't set! (defaulting to normal)\n" )
|
|
||||||
t = "normal"
|
|
||||||
index = ActIndex[ t ]
|
|
||||||
end
|
|
||||||
|
|
||||||
self.ActivityTranslate = {}
|
|
||||||
self.ActivityTranslate[ ACT_MP_STAND_IDLE ] = index
|
|
||||||
self.ActivityTranslate[ ACT_MP_WALK ] = index + 1
|
|
||||||
self.ActivityTranslate[ ACT_MP_RUN ] = index + 2
|
|
||||||
self.ActivityTranslate[ ACT_MP_CROUCH_IDLE ] = index + 3
|
|
||||||
self.ActivityTranslate[ ACT_MP_CROUCHWALK ] = index + 4
|
|
||||||
self.ActivityTranslate[ ACT_MP_ATTACK_STAND_PRIMARYFIRE ] = index + 5
|
|
||||||
self.ActivityTranslate[ ACT_MP_ATTACK_CROUCH_PRIMARYFIRE ] = index + 5
|
|
||||||
self.ActivityTranslate[ ACT_MP_RELOAD_STAND ] = index + 6
|
|
||||||
self.ActivityTranslate[ ACT_MP_RELOAD_CROUCH ] = index + 6
|
|
||||||
self.ActivityTranslate[ ACT_MP_JUMP ] = index + 7
|
|
||||||
self.ActivityTranslate[ ACT_RANGE_ATTACK1 ] = index + 8
|
|
||||||
self.ActivityTranslate[ ACT_MP_SWIM ] = index + 9
|
|
||||||
|
|
||||||
-- "normal" jump animation doesn't exist
|
|
||||||
if ( t == "normal" ) then
|
|
||||||
self.ActivityTranslate[ ACT_MP_JUMP ] = ACT_HL2MP_JUMP_SLAM
|
|
||||||
end
|
|
||||||
|
|
||||||
if ( t == "suitcase" ) then
|
|
||||||
self.ActivityTranslate[ ACT_MP_STAND_IDLE ] = ACT_HL2MP_IDLE_SUITCASE
|
|
||||||
self.ActivityTranslate[ ACT_MP_WALK ] = ACT_HL2MP_WALK_SUITCASE
|
|
||||||
self.ActivityTranslate[ ACT_MP_JUMP ] = ACT_HL2MP_JUMP_SLAM
|
|
||||||
end
|
|
||||||
|
|
||||||
if ( t == "passive" ) then
|
|
||||||
self.ActivityTranslate[ ACT_MP_CROUCH_IDLE ] = ACT_HL2MP_IDLE_CROUCH_SLAM
|
|
||||||
self.ActivityTranslate[ ACT_MP_CROUCHWALK ] = ACT_HL2MP_WALK_CROUCH_SLAM
|
|
||||||
end
|
|
||||||
|
|
||||||
if ( t == "rpg" ) then
|
|
||||||
self.ActivityTranslate[ ACT_MP_CROUCH_IDLE ] = ACT_HL2MP_IDLE_CROUCH_AR2
|
|
||||||
self.ActivityTranslate[ ACT_MP_CROUCHWALK ] = ACT_HL2MP_WALK_CROUCH_AR2
|
|
||||||
end
|
|
||||||
|
|
||||||
--self:SetupWeaponHoldTypeForAI( t )
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Default hold pos is the pistol
|
|
||||||
SWEP:SetWeaponHoldType( "pistol" )
|
|
||||||
|
|
||||||
--[[---------------------------------------------------------
|
|
||||||
Name: weapon:TranslateActivity()
|
|
||||||
Desc: Translate a player's Activity into a weapon's activity
|
|
||||||
So for example, ACT_HL2MP_RUN becomes ACT_HL2MP_RUN_PISTOL
|
|
||||||
Depending on how you want the player to be holding the weapon
|
|
||||||
-----------------------------------------------------------]]
|
|
||||||
function SWEP:TranslateActivity( act )
|
|
||||||
|
|
||||||
if ( self.Owner:IsNPC() ) then
|
|
||||||
if ( self.ActivityTranslateAI[ act ] ) then
|
|
||||||
return self.ActivityTranslateAI[ act ]
|
|
||||||
end
|
|
||||||
return -1
|
|
||||||
end
|
|
||||||
|
|
||||||
if ( self.ActivityTranslate[ act ] != nil ) then
|
|
||||||
return self.ActivityTranslate[ act ]
|
|
||||||
end
|
|
||||||
|
|
||||||
return -1
|
|
||||||
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
SWEP.GestureFire = { ACT_HL2MP_GESTURE_RANGE_ATTACK_SHOTGUN, 0.85 }
|
|
||||||
SWEP.GestureReload = { ACT_FLINCH_STOMACH, 0.3 }
|
|
||||||
SWEP.GestureDraw = { ACT_GMOD_GESTURE_MELEE_SHOVE_1HAND, 0.75 }
|
|
||||||
SWEP.GestureHolster = { ACT_GMOD_GESTURE_MELEE_SHOVE_1HAND, 0.65 }
|
|
||||||
function SWEP:TPFire( hand )
|
|
||||||
if CLIENT and !IsFirstTimePredicted() then return end
|
|
||||||
local target = self:bWepClass( hand ) and self:bWepClass( hand ).GestureFire
|
|
||||||
if !target then
|
|
||||||
target = self.GestureFire
|
|
||||||
end
|
|
||||||
self:GetOwner():AddVCDSequenceToGestureSlot( GESTURE_SLOT_GRENADE, self:GetOwner():SelectWeightedSequence(target[1]), target[2], true )
|
|
||||||
end
|
|
||||||
function SWEP:TPCustom( tg1, tg2 )
|
|
||||||
if CLIENT and !IsFirstTimePredicted() then return end
|
|
||||||
self:GetOwner():AddVCDSequenceToGestureSlot( GESTURE_SLOT_GRENADE, self:GetOwner():SelectWeightedSequence(tg1), tg2, true )
|
|
||||||
end
|
|
||||||
function SWEP:TPReload( hand )
|
|
||||||
if CLIENT and !IsFirstTimePredicted() then return end
|
|
||||||
local target = self:bWepClass( hand ) and self:bWepClass( hand ).GestureReload
|
|
||||||
if !target then
|
|
||||||
target = self.GestureReload
|
|
||||||
end
|
|
||||||
self:GetOwner():AddVCDSequenceToGestureSlot( GESTURE_SLOT_GRENADE, self:GetOwner():SelectWeightedSequence(target[1]), target[2], true )
|
|
||||||
end
|
|
||||||
function SWEP:TPDraw( hand )
|
|
||||||
if CLIENT and !IsFirstTimePredicted() then return end
|
|
||||||
local target = self:bWepClass( hand ) and self:bWepClass( hand ).GestureDraw
|
|
||||||
if !target then
|
|
||||||
target = self.GestureDraw
|
|
||||||
end
|
|
||||||
self:GetOwner():AddVCDSequenceToGestureSlot( GESTURE_SLOT_GRENADE, self:GetOwner():SelectWeightedSequence(target[1]), target[2], true )
|
|
||||||
end
|
|
||||||
function SWEP:TPHolster( hand )
|
|
||||||
if CLIENT and !IsFirstTimePredicted() then return end
|
|
||||||
local target = self:bWepClass( hand ) and self:bWepClass( hand ).GestureHolster
|
|
||||||
if !target then
|
|
||||||
target = self.GestureHolster
|
|
||||||
end
|
|
||||||
self:GetOwner():AddVCDSequenceToGestureSlot( GESTURE_SLOT_GRENADE, self:GetOwner():SelectWeightedSequence(target[1]), target[2], true )
|
|
||||||
end
|
|
|
@ -1,97 +0,0 @@
|
||||||
|
|
||||||
function SWEP:GetStat( hand, stat )
|
|
||||||
local Hand = ((hand==true and "Left Hand") or (hand==false and "Right Hand"))
|
|
||||||
assert( self:bWepClass( hand ), "No weapon in " .. Hand .. " (Trying to get stat " .. stat .. ")" )
|
|
||||||
local thereturn = (self:bWepClass( hand ) and self:bWepClass( hand )[stat])
|
|
||||||
assert( thereturn, "No stat for " .. stat .. " ( " .. Hand .. " )" )
|
|
||||||
return thereturn
|
|
||||||
end
|
|
||||||
|
|
||||||
function BENNY_GetStat( class, stat )
|
|
||||||
assert( class, "No class" )
|
|
||||||
local thereturn = class[stat]
|
|
||||||
assert( thereturn, "No stat for " .. stat )
|
|
||||||
return thereturn
|
|
||||||
end
|
|
||||||
|
|
||||||
function SWEP:hFlipHand( hand )
|
|
||||||
hand = hand or false
|
|
||||||
local p = self:GetOwner()
|
|
||||||
local lt = self:bWepClass( true )
|
|
||||||
local flip = false
|
|
||||||
if lt then
|
|
||||||
if lt.Features == "firearm" then
|
|
||||||
flip = p:GetInfoNum( "benny_wep_ao_firearms", 1 )==1
|
|
||||||
elseif lt.Features == "grenade" then
|
|
||||||
flip = p:GetInfoNum( "benny_wep_ao_grenades", 0 )==1
|
|
||||||
else
|
|
||||||
flip = p:GetInfoNum( "benny_wep_ao_junk", 0 )==1
|
|
||||||
end
|
|
||||||
else
|
|
||||||
--return false
|
|
||||||
end
|
|
||||||
return ((flip and !hand) or (!flip and hand))
|
|
||||||
end
|
|
||||||
|
|
||||||
function SWEP:C_AttackDown( hand )
|
|
||||||
if self:hFlipHand() then hand = !hand end
|
|
||||||
return (hand == true) and self:GetOwner():KeyDown( IN_ATTACK2 ) or (hand == false) and self:GetOwner():KeyDown( IN_ATTACK )
|
|
||||||
end
|
|
||||||
|
|
||||||
function SWEP:BDeploy( hand, id )
|
|
||||||
assert( isbool(hand), "You forgot the hand." )
|
|
||||||
assert( isstring(id), "You forgot the ID." )
|
|
||||||
if self:bGetInvID( hand ) == id then
|
|
||||||
-- This breaks prediction somewhat!!
|
|
||||||
-- return -- PROTO: If you're in the middle of holstering, cancel it
|
|
||||||
elseif self:bGetInvID( hand ) != "" then
|
|
||||||
return--self:BHolster( hand )
|
|
||||||
end
|
|
||||||
local p = self:GetOwner()
|
|
||||||
local inv = p:INV_Get()
|
|
||||||
|
|
||||||
local item = inv[id]
|
|
||||||
local class = WeaponGet(item.Class)
|
|
||||||
|
|
||||||
assert( item, "That item doesn't exist. " .. tostring(item) )
|
|
||||||
|
|
||||||
self:bSetInvID( hand, id )
|
|
||||||
self:bSetMagInvID( hand, "" )
|
|
||||||
self:bSetIntClip( hand, 0 )
|
|
||||||
self:bSetSpread( hand, 0 )
|
|
||||||
self:bSetIntDelay( hand, CurTime() + 0.35 )
|
|
||||||
B_Sound( self, "Common.Deploy" )
|
|
||||||
if item.Loaded and item.Loaded != "" then
|
|
||||||
local mid = item.Loaded
|
|
||||||
local midi = inv[ mid ]
|
|
||||||
if !midi then
|
|
||||||
item.Loaded = ""
|
|
||||||
error( "Deploy: Magazine doesn't exist in the inventory!! " .. tostring(mid) .. " item.Loaded removed." )
|
|
||||||
end
|
|
||||||
self:bSetMagInvID( hand, mid )
|
|
||||||
self:bSetIntClip( hand, midi.Ammo )
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function SWEP:BHolster( hand )
|
|
||||||
if self:bGetInvID( hand ) == "" then
|
|
||||||
return -- What the hell are you holstering..?
|
|
||||||
end
|
|
||||||
|
|
||||||
local p = self:GetOwner()
|
|
||||||
--B_Sound( self, "Common.Holster" )
|
|
||||||
local item = self:bWepTable( hand )
|
|
||||||
if item then
|
|
||||||
local class = WeaponGet(item.Class)
|
|
||||||
if class.Custom_Holster then class.Custom_Holster( self, item, class, hand ) end
|
|
||||||
end
|
|
||||||
|
|
||||||
self:bSetInvID( hand, "" )
|
|
||||||
self:bSetMagInvID( hand, "" )
|
|
||||||
self:bSetIntClip( hand, 0 )
|
|
||||||
end
|
|
||||||
|
|
||||||
function SWEP:BSpread( hand )
|
|
||||||
return self:bWepClass( hand ).Spread + self:bGetSpread( hand )
|
|
||||||
end
|
|
||||||
|
|
|
@ -1,135 +0,0 @@
|
||||||
|
|
||||||
-- Reload logic
|
|
||||||
|
|
||||||
function SWEP:Reload( hand )
|
|
||||||
if hand == nil then return end -- Needs to be called from the custom ones
|
|
||||||
local p = self:GetOwner()
|
|
||||||
local inv = p:INV_Get()
|
|
||||||
local wep_table = self:bWepTable( hand )
|
|
||||||
local wep_class = self:bWepClass( hand )
|
|
||||||
if wep_table then
|
|
||||||
if self:bWepClass( hand ) and self:bWepClass( hand ).Func_Reload then
|
|
||||||
if self:bWepClass( hand ).Func_Reload( self, hand ) then return end
|
|
||||||
end
|
|
||||||
if wep_class.Custom_Reload then
|
|
||||||
if wep_class.Custom_Reload( self, wep_table ) then return end
|
|
||||||
end
|
|
||||||
if self:bGetIntDelay( hand ) > CurTime() then
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
local rt = self:bGetReloadTime( hand )
|
|
||||||
if rt > 0 then
|
|
||||||
local rtt = self:bGetReloadType( hand )
|
|
||||||
-- TODO: Unshitify this.
|
|
||||||
if rtt == 1 then
|
|
||||||
if (rt+self:GetStat( hand, "Reload_MagIn_Bonus1" )) <= RealTime() and RealTime() <= (rt+self:GetStat( hand, "Reload_MagIn_Bonus2" )) then
|
|
||||||
self:bSetReloadTime( hand, 0 )
|
|
||||||
return true
|
|
||||||
else
|
|
||||||
B_Sound( self, "Common.ReloadFail" )
|
|
||||||
self:bSetReloadTime( hand, RealTime() )
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
else
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local curmag = self:bGetMagInvID( hand )
|
|
||||||
if curmag != "" then
|
|
||||||
self:bSetReloadTime( hand, RealTime() )
|
|
||||||
self:bSetReloadType( hand, 2 )
|
|
||||||
B_Sound( self, wep_class.Sound_MagOut )
|
|
||||||
self:Reload_MagOut( hand, self:bGetMagInvID( hand ), inv )
|
|
||||||
elseif self:GetBestLoadableMagazine( hand, wep_table.Class, inv, wep_table ) then
|
|
||||||
self:bSetReloadTime( hand, RealTime() )
|
|
||||||
self:bSetReloadType( hand, 1 )
|
|
||||||
B_Sound( self, wep_class.Sound_MagIn )
|
|
||||||
else
|
|
||||||
B_Sound( self, "Common.NoAmmo" )
|
|
||||||
end
|
|
||||||
self:TPReload( hand )
|
|
||||||
end
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
|
|
||||||
function SWEP:Reload_MagOut( hand, curmag, optinv, optwep_table, optwep_class )
|
|
||||||
local p = self:GetOwner()
|
|
||||||
local inv = optinv or p:INV_Get()
|
|
||||||
local wep_table = optwep_table or self:bWepTable( hand )
|
|
||||||
local wep_class = optwep_class or self:bWepClass( hand )
|
|
||||||
|
|
||||||
if !inv[curmag] then
|
|
||||||
-- PROTO: This happens sometimes. I'm commenting it so it doesn't look like anything broke, because it didn't.
|
|
||||||
-- ErrorNoHalt( "Mag isn't a valid item" )
|
|
||||||
self:bSetMagInvID( hand, "" )
|
|
||||||
wep_table.Loaded = ""
|
|
||||||
elseif inv[curmag].Ammo == 0 then
|
|
||||||
if SERVER or (CLIENT and IsFirstTimePredicted()) then
|
|
||||||
p:INV_Discard( curmag )
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
self:bSetMagInvID( hand, "" )
|
|
||||||
self:bSetIntClip( hand, 0 )
|
|
||||||
--B_Sound( self, wep_class.Sound_MagOut )
|
|
||||||
wep_table.Loaded = ""
|
|
||||||
end
|
|
||||||
|
|
||||||
function SWEP:GetLoadableMagazines( hand, class, optinv, optwep_table )
|
|
||||||
local p = self:GetOwner()
|
|
||||||
local inv = optinv or p:INV_Get()
|
|
||||||
local wep_table = optwep_table or self:bWepTable( hand )
|
|
||||||
local maglist = p:INV_FindMag( wep_table.Class )
|
|
||||||
|
|
||||||
local usedlist = {}
|
|
||||||
for _id, mrow in pairs( inv ) do
|
|
||||||
if mrow.Loaded and mrow.Loaded != "" then
|
|
||||||
usedlist[mrow.Loaded] = true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
return maglist
|
|
||||||
end
|
|
||||||
|
|
||||||
function SWEP:GetBestLoadableMagazine( hand, class, optinv, optwep_table )
|
|
||||||
local p = self:GetOwner()
|
|
||||||
local inv = optinv or p:INV_Get()
|
|
||||||
local wep_table = optwep_table or self:bWepTable( hand )
|
|
||||||
local maglist = p:INV_FindMag( wep_table.Class )
|
|
||||||
local mag = false
|
|
||||||
|
|
||||||
local usedlist = {}
|
|
||||||
for _id, mrow in pairs( inv ) do
|
|
||||||
if mrow.Loaded and mrow.Loaded != "" then
|
|
||||||
usedlist[mrow.Loaded] = true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
for num, mid in ipairs( maglist ) do
|
|
||||||
if usedlist[mid] then
|
|
||||||
else
|
|
||||||
mag = mid
|
|
||||||
break
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
return mag
|
|
||||||
end
|
|
||||||
|
|
||||||
function SWEP:Reload_MagIn( hand, curmag, optinv, optwep_table, optwep_class )
|
|
||||||
local p = self:GetOwner()
|
|
||||||
local inv = optinv or p:INV_Get()
|
|
||||||
local wep_table = optwep_table or self:bWepTable( hand )
|
|
||||||
local wep_class = optwep_class or self:bWepClass( hand )
|
|
||||||
local mag = self:GetBestLoadableMagazine( hand, wep_table.Class )
|
|
||||||
|
|
||||||
if mag then
|
|
||||||
self:bSetMagInvID( hand, mag )
|
|
||||||
self:bSetIntClip( hand, inv[mag].Ammo )
|
|
||||||
wep_table.Loaded = mag
|
|
||||||
B_Sound( self, wep_class.Sound_Cock )
|
|
||||||
else
|
|
||||||
B_Sound( self, "Common.NoAmmo" )
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,156 +0,0 @@
|
||||||
|
|
||||||
-- Stat2
|
|
||||||
|
|
||||||
function SWEP:bWepTable( alt )
|
|
||||||
return self:GetOwner():INV_Get()[ ((alt==true) and self:GetWep2()) or ((alt==false) and self:GetWep1()) ]
|
|
||||||
end
|
|
||||||
|
|
||||||
function SWEP:bWepClass( alt )
|
|
||||||
local ta = self:bWepTable( alt )
|
|
||||||
if ta then
|
|
||||||
return WeaponGet( ta.Class )
|
|
||||||
else
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function SWEP:bMagTable( alt )
|
|
||||||
return self:GetOwner():INV_Get()[ ((alt==true) and self:GetWep2_Clip()) or ((alt==false) and self:GetWep1_Clip()) ]
|
|
||||||
end
|
|
||||||
|
|
||||||
function SWEP:bMagClass( alt )
|
|
||||||
local ta = self:bMagTable( alt )
|
|
||||||
if ta then
|
|
||||||
return WeaponGet( ta.Class )
|
|
||||||
else
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Weapon ID
|
|
||||||
function SWEP:bGetInvID( hand )
|
|
||||||
assert( hand!=nil, "Missing hand argument" )
|
|
||||||
return (hand == true) and self:GetWep2() or (hand == false) and self:GetWep1()
|
|
||||||
end
|
|
||||||
|
|
||||||
function SWEP:bSetInvID( hand, value )
|
|
||||||
assert( hand!=nil, "Missing hand argument" )
|
|
||||||
return (hand == true) and self:SetWep2( value ) or (hand == false) and self:SetWep1( value )
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Wep. Clip ID
|
|
||||||
function SWEP:bGetMagInvID( hand )
|
|
||||||
assert( hand!=nil, "Missing hand argument" )
|
|
||||||
return (hand == true) and self:GetWep2_Clip() or (hand == false) and self:GetWep1_Clip()
|
|
||||||
end
|
|
||||||
|
|
||||||
function SWEP:bSetMagInvID( hand, value )
|
|
||||||
assert( hand!=nil, "Missing hand argument" )
|
|
||||||
return (hand == true) and self:SetWep2_Clip( value ) or (hand == false) and self:SetWep1_Clip( value )
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Weapon Firemode
|
|
||||||
function SWEP:bGetFiremode( hand )
|
|
||||||
assert( hand!=nil, "Missing hand argument" )
|
|
||||||
return (hand == true) and self:GetWep2_Firemode() or (hand == false) and self:GetWep1_Firemode()
|
|
||||||
end
|
|
||||||
|
|
||||||
function SWEP:bSetFiremode( hand, value )
|
|
||||||
assert( hand!=nil, "Missing hand argument" )
|
|
||||||
return (hand == true) and self:SetWep2_Firemode( value ) or (hand == false) and self:SetWep1_Firemode( value )
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Weapon Burst
|
|
||||||
function SWEP:bGetBurst( hand )
|
|
||||||
assert( hand!=nil, "Missing hand argument" )
|
|
||||||
return (hand == true) and self:GetWep2_Burst() or (hand == false) and self:GetWep1_Burst()
|
|
||||||
end
|
|
||||||
|
|
||||||
function SWEP:bSetBurst( hand, value )
|
|
||||||
assert( hand!=nil, "Missing hand argument" )
|
|
||||||
return (hand == true) and self:SetWep2_Burst( value ) or (hand == false) and self:SetWep1_Burst( value )
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Weapon Spread
|
|
||||||
function SWEP:bGetSpread( hand )
|
|
||||||
assert( hand!=nil, "Missing hand argument" )
|
|
||||||
return (hand == true) and self:GetWep2_Spread() or (hand == false) and self:GetWep1_Spread()
|
|
||||||
end
|
|
||||||
|
|
||||||
function SWEP:bSetSpread( hand, value )
|
|
||||||
assert( hand!=nil, "Missing hand argument" )
|
|
||||||
return (hand == true) and self:SetWep2_Spread( value ) or (hand == false) and self:SetWep1_Spread( value )
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Weapon Spread
|
|
||||||
function SWEP:bGetShotTime( hand )
|
|
||||||
assert( hand!=nil, "Missing hand argument" )
|
|
||||||
return (hand == true) and self:GetWep2_ShotTime() or (hand == false) and self:GetWep1_ShotTime()
|
|
||||||
end
|
|
||||||
|
|
||||||
function SWEP:bSetShotTime( hand, value )
|
|
||||||
assert( hand!=nil, "Missing hand argument" )
|
|
||||||
return (hand == true) and self:SetWep2_ShotTime( value ) or (hand == false) and self:SetWep1_ShotTime( value )
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Weapon Holstering Time
|
|
||||||
function SWEP:bGetHolsterTime( hand )
|
|
||||||
assert( hand!=nil, "Missing hand argument" )
|
|
||||||
return (hand == true) and self:GetWep2_Holstering() or (hand == false) and self:GetWep1_Holstering()
|
|
||||||
end
|
|
||||||
|
|
||||||
function SWEP:bSetHolsterTime( hand, value )
|
|
||||||
assert( hand!=nil, "Missing hand argument" )
|
|
||||||
return (hand == true) and self:SetWep2_Holstering( value ) or (hand == false) and self:SetWep1_Holstering( value )
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Weapon Reloading Time
|
|
||||||
function SWEP:bGetReloadTime( hand )
|
|
||||||
assert( hand!=nil, "Missing hand argument" )
|
|
||||||
return (hand == true) and self:GetWep2_Reloading() or (hand == false) and self:GetWep1_Reloading()
|
|
||||||
end
|
|
||||||
|
|
||||||
function SWEP:bSetReloadTime( hand, value )
|
|
||||||
assert( hand!=nil, "Missing hand argument" )
|
|
||||||
return (hand == true) and self:SetWep2_Reloading( value ) or (hand == false) and self:SetWep1_Reloading( value )
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Weapon Reload Type
|
|
||||||
function SWEP:bGetReloadType( hand )
|
|
||||||
assert( hand!=nil, "Missing hand argument" )
|
|
||||||
return (hand == true) and self:GetWep2_ReloadType() or (hand == false) and self:GetWep1_ReloadType()
|
|
||||||
end
|
|
||||||
|
|
||||||
function SWEP:bSetReloadType( hand, value )
|
|
||||||
assert( hand!=nil, "Missing hand argument" )
|
|
||||||
return (hand == true) and self:SetWep2_ReloadType( value ) or (hand == false) and self:SetWep1_ReloadType( value )
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Weapon Player Requesting ID
|
|
||||||
function SWEP:bGetReqInvID( hand )
|
|
||||||
local p = self:GetOwner()
|
|
||||||
return (hand == true) and p:GetReqID2() or (hand == false) and p:GetReqID1()
|
|
||||||
end
|
|
||||||
|
|
||||||
function SWEP:bSetReqInvID( hand, value )
|
|
||||||
local p = self:GetOwner()
|
|
||||||
return (hand == true) and p:SetReqID2( value ) or (hand == false) and p:SetReqID1( value )
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Internal SWEP Delay
|
|
||||||
function SWEP:bGetIntDelay( hand )
|
|
||||||
return (hand == true) and self:GetDelay2() or (hand == false) and self:GetDelay1()
|
|
||||||
end
|
|
||||||
|
|
||||||
function SWEP:bSetIntDelay( hand, value )
|
|
||||||
return (hand == true) and self:SetDelay2( value ) or (hand == false) and self:SetDelay1( value )
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Internal SWEP Clip
|
|
||||||
function SWEP:bGetIntClip( hand )
|
|
||||||
return (hand == true) and self:Clip2() or (hand == false) and self:Clip1()
|
|
||||||
end
|
|
||||||
|
|
||||||
function SWEP:bSetIntClip( hand, value )
|
|
||||||
return (hand == true) and self:SetClip2( value ) or (hand == false) and self:SetClip1( value )
|
|
||||||
end
|
|
|
@ -1,34 +0,0 @@
|
||||||
|
|
||||||
if SERVER then
|
|
||||||
util.AddNetworkString( "Benny_StatRegen" )
|
|
||||||
function SWEP:BSend( ... )
|
|
||||||
net.Start( "Benny_StatRegen" )
|
|
||||||
net.WriteUInt( #{ ... }, 4 )
|
|
||||||
for i, v in ipairs( { ... } ) do
|
|
||||||
net.WriteString( v[1] )
|
|
||||||
net.WriteBool( v[2] )
|
|
||||||
if v[2] then
|
|
||||||
net.WriteString( v[3] )
|
|
||||||
else
|
|
||||||
net.WriteDouble( v[3] )
|
|
||||||
end
|
|
||||||
end
|
|
||||||
net.Send( self:GetOwner() )
|
|
||||||
end
|
|
||||||
else
|
|
||||||
net.Receive( "Benny_StatRegen", function( len, ply )
|
|
||||||
local count = net.ReadUInt( 4 )
|
|
||||||
|
|
||||||
for i=1, count do
|
|
||||||
local stat = net.ReadString()
|
|
||||||
local str = net.ReadBool()
|
|
||||||
local data
|
|
||||||
if str then
|
|
||||||
data = net.ReadString()
|
|
||||||
else
|
|
||||||
data = net.ReadDouble()
|
|
||||||
end
|
|
||||||
LocalPlayer():GetActiveWeapon():bWepTable()[stat] = data
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
end
|
|
|
@ -1,311 +0,0 @@
|
||||||
|
|
||||||
-- The benny weapon handles the weapon pickups you find throughout the game.
|
|
||||||
|
|
||||||
SWEP.Base = "weapon_base"
|
|
||||||
|
|
||||||
SWEP.PrintName = "Benny Weapon Handler"
|
|
||||||
|
|
||||||
SWEP.ViewModel = "models/weapons/c_pistol.mdl"
|
|
||||||
SWEP.ViewModelFOV = 10
|
|
||||||
SWEP.WorldModel = "models/weapons/w_pistol.mdl"
|
|
||||||
|
|
||||||
SWEP.Primary.ClipSize = 0
|
|
||||||
SWEP.Primary.DefaultClip = 0
|
|
||||||
SWEP.Primary.Automatic = true
|
|
||||||
SWEP.Primary.Ammo = "none"
|
|
||||||
|
|
||||||
SWEP.Secondary.ClipSize = 0
|
|
||||||
SWEP.Secondary.DefaultClip = 0
|
|
||||||
SWEP.Secondary.Automatic = true
|
|
||||||
SWEP.Secondary.Ammo = "none"
|
|
||||||
|
|
||||||
AddCSLuaFile( "sh_statregen.lua" )
|
|
||||||
include ( "sh_statregen.lua" )
|
|
||||||
AddCSLuaFile( "sh_firing.lua" )
|
|
||||||
include ( "sh_firing.lua" )
|
|
||||||
AddCSLuaFile( "sh_inv.lua" )
|
|
||||||
include ( "sh_inv.lua" )
|
|
||||||
AddCSLuaFile( "sh_stat2.lua" )
|
|
||||||
include ( "sh_stat2.lua" )
|
|
||||||
AddCSLuaFile( "sh_holdtypes.lua" )
|
|
||||||
include ( "sh_holdtypes.lua" )
|
|
||||||
AddCSLuaFile( "sh_reload.lua" )
|
|
||||||
include ( "sh_reload.lua" )
|
|
||||||
AddCSLuaFile( "sh_drop.lua" )
|
|
||||||
include ( "sh_drop.lua" )
|
|
||||||
|
|
||||||
AddCSLuaFile( "cl_wm.lua" )
|
|
||||||
if CLIENT then
|
|
||||||
include ( "cl_wm.lua" )
|
|
||||||
end
|
|
||||||
|
|
||||||
function SWEP:SetupDataTables()
|
|
||||||
self:NetworkVar( "Float", 0, "Aim" )
|
|
||||||
self:NetworkVar( "Float", 1, "Delay1" )
|
|
||||||
self:NetworkVar( "Float", 2, "Delay2" )
|
|
||||||
self:NetworkVar( "Float", 3, "GrenadeDownStart" )
|
|
||||||
self:NetworkVar( "Float", 4, "Wep1_Spread" )
|
|
||||||
self:NetworkVar( "Float", 5, "Wep2_Spread" )
|
|
||||||
self:NetworkVar( "Float", 6, "Wep1_ShotTime" )
|
|
||||||
self:NetworkVar( "Float", 7, "Wep2_ShotTime" )
|
|
||||||
self:NetworkVar( "Float", 8, "Wep1_Holstering" )
|
|
||||||
self:NetworkVar( "Float", 9, "Wep2_Holstering" )
|
|
||||||
self:NetworkVar( "Float", 10, "Wep1_Reloading" )
|
|
||||||
self:NetworkVar( "Float", 11, "Wep2_Reloading" )
|
|
||||||
self:NetworkVar( "Float", 12, "JustThrew" )
|
|
||||||
self:NetworkVar( "String", 0, "Wep1" )
|
|
||||||
self:NetworkVar( "String", 1, "Wep2" )
|
|
||||||
self:NetworkVar( "String", 2, "Wep1_Clip" )
|
|
||||||
self:NetworkVar( "String", 3, "Wep2_Clip" )
|
|
||||||
self:NetworkVar( "Int", 0, "Wep1_Burst" )
|
|
||||||
self:NetworkVar( "Int", 1, "Wep2_Burst" )
|
|
||||||
self:NetworkVar( "Int", 2, "Wep1_Firemode" )
|
|
||||||
self:NetworkVar( "Int", 3, "Wep2_Firemode" )
|
|
||||||
self:NetworkVar( "Int", 4, "Wep1_ReloadType" )
|
|
||||||
self:NetworkVar( "Int", 5, "Wep2_ReloadType" )
|
|
||||||
self:NetworkVar( "Bool", 0, "UserAim" )
|
|
||||||
self:NetworkVar( "Bool", 1, "GrenadeDown" )
|
|
||||||
self:NetworkVar( "Bool", 2, "JustThrewHand" )
|
|
||||||
|
|
||||||
self:SetWep1_Firemode( 1 )
|
|
||||||
self:SetWep2_Firemode( 1 )
|
|
||||||
|
|
||||||
self:SetWep1_Holstering( -1 )
|
|
||||||
self:SetWep2_Holstering( -1 )
|
|
||||||
|
|
||||||
self:SetWep1_Reloading( -1 )
|
|
||||||
self:SetWep2_Reloading( -1 )
|
|
||||||
end
|
|
||||||
|
|
||||||
function SWEP:B_Ammo( hand, value )
|
|
||||||
local p = self:GetOwner()
|
|
||||||
local inv = p:INV_Get()
|
|
||||||
self:bSetIntClip( hand, value )
|
|
||||||
assert( self:bGetMagInvID( hand ) != "", "There is no magazine loaded!" )
|
|
||||||
inv[ self:bGetMagInvID( hand ) ].Ammo = value
|
|
||||||
end
|
|
||||||
|
|
||||||
function SWEP:B_Firemode( alt )
|
|
||||||
return self:bWepClass( alt ).Firemodes[ self:bGetFiremode( alt ) ]
|
|
||||||
end
|
|
||||||
|
|
||||||
function SWEP:B_FiremodeName( alt )
|
|
||||||
local mode = self:B_Firemode( alt ).Mode
|
|
||||||
if mode == 1 then
|
|
||||||
return "SEMI"
|
|
||||||
elseif mode == math.huge then
|
|
||||||
return "AUTO"
|
|
||||||
else
|
|
||||||
return mode .. "RND"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
hook.Add( "PlayerButtonDown", "Benny_PlayerButtonDown_TempForAim", function( ply, button )
|
|
||||||
local wep = ply:BennyCheck()
|
|
||||||
if wep then
|
|
||||||
if button == KEY_F then
|
|
||||||
if tobool(ply:GetInfoNum("benny_wep_toggleaim", 1)) then
|
|
||||||
wep:SetUserAim( !wep:GetUserAim() )
|
|
||||||
else
|
|
||||||
wep:SetUserAim( true )
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if button == ply:GetInfoNum("benny_bind_reload", KEY_R) then
|
|
||||||
wep:Reload( wep:hFlipHand( false ) )
|
|
||||||
end
|
|
||||||
|
|
||||||
if button == ply:GetInfoNum("benny_bind_reloada", KEY_T) then
|
|
||||||
wep:Reload( wep:hFlipHand( true ) )
|
|
||||||
end
|
|
||||||
|
|
||||||
if button == ply:GetInfoNum("benny_bind_drop", KEY_G) then
|
|
||||||
wep:Drop( wep:hFlipHand( false ) )
|
|
||||||
end
|
|
||||||
|
|
||||||
if button == ply:GetInfoNum("benny_bind_dropa", KEY_H) then
|
|
||||||
wep:Drop( wep:hFlipHand( true ) )
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
||||||
hook.Add( "PlayerButtonUp", "Benny_PlayerButtonUp_TempForAim", function( ply, button )
|
|
||||||
local wep = ply:BennyCheck()
|
|
||||||
if wep then
|
|
||||||
if button == KEY_F then
|
|
||||||
if !tobool(ply:GetInfoNum("benny_wep_toggleaim", 0)) then
|
|
||||||
wep:SetUserAim( false )
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
|
|
||||||
function SWEP:BStartHolster( hand )
|
|
||||||
if self:bGetHolsterTime( hand ) == -1 then
|
|
||||||
B_Sound( self, "Common.Holster" )
|
|
||||||
-- print( "Holstering the " .. (hand and "LEFT" or "RIGHT") )
|
|
||||||
self:bSetHolsterTime( hand, 0 )
|
|
||||||
self:bSetReloadTime( hand, -1 )
|
|
||||||
self:bSetReloadType( hand, 0 )
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function SWEP:BThinkHolster( hand )
|
|
||||||
if self:bGetHolsterTime( hand ) >= 0 then
|
|
||||||
self:bSetHolsterTime( hand, math.Approach( self:bGetHolsterTime( hand ), 1, FrameTime() / 0.35 ) )
|
|
||||||
end
|
|
||||||
if self:bGetHolsterTime( hand ) == 1 then
|
|
||||||
self:bSetHolsterTime( hand, -1 )
|
|
||||||
self:bSetReloadTime( hand, -1 )
|
|
||||||
self:bSetReloadType( hand, 0 )
|
|
||||||
self:BHolster( hand )
|
|
||||||
local p = self:GetOwner()
|
|
||||||
local req = self:bGetReqInvID( hand )
|
|
||||||
local inv = p:INV_Get()
|
|
||||||
if req != "" and inv[req] then
|
|
||||||
self:BDeploy( hand, req )
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function SWEP:Think()
|
|
||||||
local p = self:GetOwner()
|
|
||||||
local inv = p:INV_Get()
|
|
||||||
|
|
||||||
local wep1 = self:bWepTable( false )
|
|
||||||
local wep1c = self:bWepClass( false )
|
|
||||||
local wep2 = self:bWepTable( true )
|
|
||||||
local wep2c = self:bWepClass( true )
|
|
||||||
|
|
||||||
if self:bGetReqInvID( false ) != "" and self:bGetReqInvID( true ) != "" and self:bGetReqInvID( false ) == self:bGetReqInvID( true ) then
|
|
||||||
self:bSetReqInvID( false, "" )
|
|
||||||
self:bSetReqInvID( true, "" )
|
|
||||||
if CLIENT then chat.AddText( "Same weapons on ReqID, both holstered" ) end
|
|
||||||
end
|
|
||||||
for i=1, 2 do
|
|
||||||
local hand = i==2
|
|
||||||
if self:bGetReqInvID( hand ) != "" and !inv[self:bGetReqInvID( hand )] then
|
|
||||||
self:bSetReqInvID( hand, "" )
|
|
||||||
end
|
|
||||||
local req = self:bGetReqInvID( hand )
|
|
||||||
local req_o = self:bGetReqInvID( !hand )
|
|
||||||
local curr = self:bGetInvID( hand )
|
|
||||||
local curr_o = self:bGetInvID( !hand )
|
|
||||||
if req != curr then
|
|
||||||
-- Don't allow holstering from this weapon if...
|
|
||||||
-- Just know, this feels bad.
|
|
||||||
if self:bGetReloadTime( hand ) > 0 then
|
|
||||||
-- hold
|
|
||||||
elseif self:GetJustThrew() > CurTime() then
|
|
||||||
-- hold
|
|
||||||
elseif self:bWepClass( hand ) and self:bGetShotTime( hand ) + self:GetStat( hand, "ShootHolsterTime" ) > CurTime() then
|
|
||||||
-- hold
|
|
||||||
else
|
|
||||||
if curr != "" then
|
|
||||||
-- require holster first
|
|
||||||
self:BStartHolster( hand )
|
|
||||||
else
|
|
||||||
local otherhasthis = curr_o == req
|
|
||||||
if req != "" then
|
|
||||||
if otherhasthis then
|
|
||||||
self:BStartHolster( !hand )
|
|
||||||
else
|
|
||||||
self:BDeploy( hand, req )
|
|
||||||
end
|
|
||||||
else
|
|
||||||
self:BStartHolster( hand )
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
self:BThinkHolster( hand )
|
|
||||||
|
|
||||||
if self:GetJustThrew() != 0 and self:GetJustThrew() <= CurTime() then
|
|
||||||
if SERVER then
|
|
||||||
InvDiscard( p, self:bGetInvID( self:GetJustThrewHand() ) )
|
|
||||||
end
|
|
||||||
self:SetJustThrew( 0 )
|
|
||||||
end
|
|
||||||
|
|
||||||
do -- Reload logic
|
|
||||||
if self:bGetReloadTime( hand ) != -1 then
|
|
||||||
local rlt = self:bGetReloadType( hand )
|
|
||||||
-- TODO: Unshitify this.
|
|
||||||
if RealTime() >= self:bGetReloadTime( hand ) + (rlt == 1 and self:GetStat( hand, "Reload_MagIn" ) or rlt == 2 and self:GetStat( hand, "Reload_MagOut" )) then
|
|
||||||
if rlt == 1 then
|
|
||||||
if SERVER or (CLIENT and IsFirstTimePredicted() ) then
|
|
||||||
self:Reload_MagIn( hand, self:bGetMagInvID( hand ), inv )
|
|
||||||
end
|
|
||||||
elseif rlt == 2 then
|
|
||||||
end
|
|
||||||
self:bSetReloadTime( hand, -1 )
|
|
||||||
self:bSetReloadType( hand, 0 )
|
|
||||||
-- Do reload stuff.
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
self:SetAim( math.Approach( self:GetAim(), self:GetUserAim() and 1 or 0, FrameTime()/0.2 ) )
|
|
||||||
|
|
||||||
for i=1, 2 do
|
|
||||||
local hand = i==2
|
|
||||||
if !self:C_AttackDown( hand ) then
|
|
||||||
self:bSetBurst( hand, 0 )
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
for i=1, 2 do
|
|
||||||
local hand = i==2
|
|
||||||
local wep, wepc = self:bWepTable( hand ), self:bWepClass( hand )
|
|
||||||
if wepc and wepc.Features == "firearm" and self:bGetIntDelay( hand ) < CurTime()-0.01 then
|
|
||||||
local mweh = math.Remap( CurTime(), self:bGetShotTime( hand ), self:bGetShotTime( hand ) + self:GetStat( hand, "SpreadDecay_RampTime" ), 0, 1 )
|
|
||||||
mweh = math.Clamp( mweh, 0, 1 )
|
|
||||||
local decayfinal = Lerp( math.ease.InExpo( mweh ), self:GetStat( hand, "SpreadDecay_Start" ), self:GetStat( hand, "SpreadDecay_End" ) )
|
|
||||||
self:bSetSpread( hand, math.Approach( self:bGetSpread( hand ), 0, decayfinal * FrameTime() ) )
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local ht = "normal"
|
|
||||||
if self:bWepClass( false ) and self:bGetHolsterTime( false ) < 0 then
|
|
||||||
ht = "passive"
|
|
||||||
if self:GetUserAim() then
|
|
||||||
if self:GetJustThrew() != 0 then
|
|
||||||
ht = "melee"
|
|
||||||
elseif self:bWepClass( true ) then
|
|
||||||
ht = "duel"
|
|
||||||
else
|
|
||||||
ht = self:GetStat( false, "HoldType" )
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if ht == "normal" and self:GetHoldType() != "normal" then
|
|
||||||
self:TPHolster( false )
|
|
||||||
elseif ht != "normal" and self:GetHoldType() == "normal" then
|
|
||||||
self:TPDraw( false )
|
|
||||||
end
|
|
||||||
|
|
||||||
for i=1, 2 do
|
|
||||||
local hand = i==2
|
|
||||||
if self:bWepClass( hand ) then
|
|
||||||
if self:bWepClass( hand ).Custom_Think then
|
|
||||||
self:bWepClass( hand ).Custom_Think( self, self:bWepTable( hand ), self:bWepClass( hand ), hand )
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
self:SetWeaponHoldType(ht)
|
|
||||||
self:SetHoldType(ht)
|
|
||||||
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
|
|
||||||
function SWEP:Deploy()
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
|
|
||||||
function SWEP:Holster()
|
|
||||||
return true
|
|
||||||
end
|
|
|
@ -0,0 +1,200 @@
|
||||||
|
|
||||||
|
AddCSLuaFile()
|
||||||
|
|
||||||
|
SWEP.Base = "weapon_base"
|
||||||
|
SWEP.AEItemHandler = true
|
||||||
|
|
||||||
|
SWEP.ViewModel = "models/weapons/c_arms.mdl"
|
||||||
|
SWEP.ViewModelFOV = 74
|
||||||
|
SWEP.ViewModelFlip = false
|
||||||
|
SWEP.UseHands = true
|
||||||
|
SWEP.WorldModel = "models/weapons/w_pistol.mdl"
|
||||||
|
SWEP.DrawWorldModel = true
|
||||||
|
|
||||||
|
|
||||||
|
SWEP.Primary.ClipSize = -1
|
||||||
|
SWEP.Primary.DefaultClip = 0
|
||||||
|
SWEP.Primary.Ammo = "none"
|
||||||
|
SWEP.Primary.Automatic = true
|
||||||
|
|
||||||
|
SWEP.Secondary.ClipSize = -1
|
||||||
|
SWEP.Secondary.DefaultClip = 0
|
||||||
|
SWEP.Secondary.Ammo = "none"
|
||||||
|
SWEP.Secondary.Automatic = true
|
||||||
|
|
||||||
|
function SWEP:SetupDataTables()
|
||||||
|
self:NetworkVar( "Entity", 0, "ActiveR" )
|
||||||
|
self:NetworkVar( "Entity", 1, "ActiveL" )
|
||||||
|
end
|
||||||
|
|
||||||
|
function SWEP:ItemR( run )
|
||||||
|
local active = self:GetActiveR()
|
||||||
|
if run and active:IsValid() then
|
||||||
|
return active.Class[run]( active.Class, active, self )
|
||||||
|
else
|
||||||
|
return active:IsValid() and active or false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function SWEP:ItemL( run )
|
||||||
|
local active = self:GetActiveL()
|
||||||
|
if run and active:IsValid() then
|
||||||
|
active.Class[run]( active.Class, active, self )
|
||||||
|
else
|
||||||
|
return active:IsValid() and active or false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function SWEP:Initialize()
|
||||||
|
end
|
||||||
|
|
||||||
|
local size = 8/2
|
||||||
|
local tracedef = {
|
||||||
|
mins = Vector( -size, -size, -size ),
|
||||||
|
maxs = Vector( size, size, size ),
|
||||||
|
}
|
||||||
|
function SWEP:ItemCheckTrace()
|
||||||
|
local p = self:GetOwner()
|
||||||
|
p:LagCompensation( true )
|
||||||
|
tracedef.filter = p
|
||||||
|
tracedef.start = p:EyePos()
|
||||||
|
tracedef.endpos = p:EyePos() + (p:GetAimVector() * 72)
|
||||||
|
local trace = util.TraceHull(tracedef)
|
||||||
|
p:LagCompensation( false )
|
||||||
|
return trace
|
||||||
|
end
|
||||||
|
|
||||||
|
function SWEP:SetActive( ent )
|
||||||
|
local p = self:GetOwner()
|
||||||
|
if ent:GetOwner() != p then return false end
|
||||||
|
if self:GetActiveR():IsValid() then self:Deactive() end
|
||||||
|
self:SetActiveR( ent )
|
||||||
|
self:ItemR( "Deploy" )
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
function SWEP:Deactive()
|
||||||
|
local p = self:GetOwner()
|
||||||
|
self:SetActiveR( NULL )
|
||||||
|
end
|
||||||
|
|
||||||
|
function SWEP:PrimaryAttack()
|
||||||
|
local p = self:GetOwner()
|
||||||
|
if self:ItemR() then
|
||||||
|
self:ItemR("Attack")
|
||||||
|
else
|
||||||
|
local trace = self:ItemCheckTrace()
|
||||||
|
self:EquipItem( trace.Entity )
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function SWEP:Reload()
|
||||||
|
if self:ItemR() then
|
||||||
|
self:ItemR("Reload")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function SWEP:SecondaryAttack()
|
||||||
|
local p = self:GetOwner()
|
||||||
|
if p:KeyPressed(IN_ATTACK2) then
|
||||||
|
self:DropItem()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if SERVER then
|
||||||
|
util.AddNetworkString("AEINV_PredictItem")
|
||||||
|
else
|
||||||
|
net.Receive("AEINV_PredictItem", function()
|
||||||
|
local ent = net.ReadEntity()
|
||||||
|
if ent:IsValid() then
|
||||||
|
ent:SetPredictable( net.ReadBool() )
|
||||||
|
else
|
||||||
|
print("Tried to make an ent predictable")
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
function SWEP:EquipItem( ent )
|
||||||
|
local p = self:GetOwner()
|
||||||
|
if CLIENT then print("FUCK OFF") debug.Trace() return end
|
||||||
|
if IsValid(ent) and ent.AEItem then
|
||||||
|
if ent:GetOwner() != NULL then
|
||||||
|
print( ent, "belongs to", ent:GetOwner(), "!! Not equipping." )
|
||||||
|
return
|
||||||
|
end
|
||||||
|
if p:GetInventory()[ent] then
|
||||||
|
print( ent, "is in", p, "'s inventory!" )
|
||||||
|
return
|
||||||
|
end
|
||||||
|
print("Pick up", ent)
|
||||||
|
|
||||||
|
ent:AddEFlags( EFL_KEEP_ON_RECREATE_ENTITIES )
|
||||||
|
ent:RemoveEffects( EF_ITEM_BLINK )
|
||||||
|
ent:SetParent( p )
|
||||||
|
ent:SetOwner( p )
|
||||||
|
ent:SetPos( vector_origin )
|
||||||
|
ent:SetAngles( Angle( 0, p:EyeAngles().y, 0 ) )
|
||||||
|
ent:SetAcquisition( CurTime() )
|
||||||
|
|
||||||
|
ent:EmitSound( "ae/items/pickup.ogg", 70, 100, 1, CHAN_STATIC )
|
||||||
|
|
||||||
|
--self:SetActive( ent )
|
||||||
|
local inv = p:GetInventory()
|
||||||
|
inv[ent] = true
|
||||||
|
inv:Sync()
|
||||||
|
|
||||||
|
net.Start("AEINV_PredictItem")
|
||||||
|
net.WriteEntity( ent )
|
||||||
|
net.WriteBool( true )
|
||||||
|
net.Send( p )
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function SWEP:DropItem()
|
||||||
|
local p = self:GetOwner()
|
||||||
|
local ent = self:GetActiveR()
|
||||||
|
if CLIENT then print("FUCK OFF") debug.Trace() return end
|
||||||
|
if ent:IsValid() then
|
||||||
|
ent:SetParent( NULL )
|
||||||
|
ent:SetOwner( NULL )
|
||||||
|
|
||||||
|
local ep = ent:GetPhysicsObject()
|
||||||
|
ent:RemoveEFlags( EFL_KEEP_ON_RECREATE_ENTITIES )
|
||||||
|
ent:AddEffects( EF_ITEM_BLINK )
|
||||||
|
ent:SetPos( p:EyePos() + p:GetAimVector() * 0 )
|
||||||
|
ent:SetAngles( p:EyeAngles() + Angle( 0, 180, 0 ) )
|
||||||
|
|
||||||
|
self:Deactive()
|
||||||
|
|
||||||
|
local inv = p:GetInventory()
|
||||||
|
inv[ent] = nil
|
||||||
|
inv:Sync()
|
||||||
|
|
||||||
|
local ep = ent:GetPhysicsObject()
|
||||||
|
ep:SetVelocity( p:GetAimVector() * 700 )
|
||||||
|
ep:SetAngleVelocity( Vector( 0, -360*4, 0 ) )
|
||||||
|
ep:Wake()
|
||||||
|
net.Start("AEINV_PredictItem")
|
||||||
|
net.WriteEntity( ent )
|
||||||
|
net.WriteBool( false )
|
||||||
|
net.Send( p )
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function SWEP:Think()
|
||||||
|
local p = self:GetOwner()
|
||||||
|
|
||||||
|
if p:IsValid() then
|
||||||
|
if self:ItemR() then
|
||||||
|
self:ItemR("Think")
|
||||||
|
end
|
||||||
|
else
|
||||||
|
print( self, "Thinking without an owner." )
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function SWEP:Deploy()
|
||||||
|
end
|
||||||
|
|
||||||
|
function SWEP:Holster()
|
||||||
|
end
|
|
@ -0,0 +1,117 @@
|
||||||
|
|
||||||
|
ITEMS = {}
|
||||||
|
|
||||||
|
local itemmeta = {}
|
||||||
|
|
||||||
|
function itemmeta:__tostring()
|
||||||
|
return "ItemDef [" .. self.ClassName .. "]"
|
||||||
|
end
|
||||||
|
|
||||||
|
local ITEMHELPER = {
|
||||||
|
Get = function( self, key )
|
||||||
|
return self.key
|
||||||
|
end,
|
||||||
|
GetRaw = function( self, key )
|
||||||
|
return rawget( self, key )
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|
||||||
|
function itemmeta.__index( self, key )
|
||||||
|
if ITEMHELPER[key] then return ITEMHELPER[key] end
|
||||||
|
if rawget(self, "BaseClass") then
|
||||||
|
return rawget(self, "BaseClass")[key]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function AddItem( itemname, item )
|
||||||
|
if item then
|
||||||
|
ITEMS[itemname] = item
|
||||||
|
item.ClassName = itemname
|
||||||
|
item.BaseClass = ITEMS[item.Base]
|
||||||
|
setmetatable( item, itemmeta )
|
||||||
|
else
|
||||||
|
return ITEMS[itemname]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
AddItem( "base", {
|
||||||
|
PrintName = "Base Item",
|
||||||
|
|
||||||
|
Vars = {
|
||||||
|
["Float"] = {
|
||||||
|
"Acquisition",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
["Initialize"] = function( class, ent, handler )
|
||||||
|
print( class, "Initialized base initialization" )
|
||||||
|
end,
|
||||||
|
|
||||||
|
["Deploy"] = function( class, ent, handler )
|
||||||
|
end,
|
||||||
|
|
||||||
|
["Holster"] = function( class, ent, handler )
|
||||||
|
end,
|
||||||
|
|
||||||
|
["Attack"] = function( class, ent, handler )
|
||||||
|
end,
|
||||||
|
|
||||||
|
["Think"] = function( class, ent, handler )
|
||||||
|
end,
|
||||||
|
|
||||||
|
["Reload"] = function( class, ent, handler )
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
AddItem( "base_firearm", {
|
||||||
|
PrintName = "Base Firearm",
|
||||||
|
Base = "base",
|
||||||
|
|
||||||
|
Vars = {
|
||||||
|
["Int"] = {
|
||||||
|
"Clip",
|
||||||
|
"BurstCount",
|
||||||
|
},
|
||||||
|
["Float"] = {
|
||||||
|
"Delay",
|
||||||
|
"DelayBurst",
|
||||||
|
"RefillTime",
|
||||||
|
"Accuracy_Reset",
|
||||||
|
"Accuracy_Amount",
|
||||||
|
"DelayReload",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
Delay = 0.1,
|
||||||
|
Pellets = 1,
|
||||||
|
ClipSize = 15,
|
||||||
|
BurstCount = math.huge,
|
||||||
|
BurstRunaway = false,
|
||||||
|
BurstAuto = false,
|
||||||
|
BurstDelay = 0,
|
||||||
|
|
||||||
|
["Initialize"] = function( class, ent, handler )
|
||||||
|
ITEMS["base"].Initialize( class, ent, handler )
|
||||||
|
|
||||||
|
ent:SetClip( class.ClipSize )
|
||||||
|
|
||||||
|
print( class, "Initialized a firearm" )
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
AddItem( "mk23", {
|
||||||
|
PrintName = "MK.23",
|
||||||
|
Base = "base_firearm",
|
||||||
|
|
||||||
|
Model = "models/weapons/w_pist_usp.mdl",
|
||||||
|
|
||||||
|
ClipSize = 12,
|
||||||
|
Delay = (60/300),
|
||||||
|
FireSound = "weapons/usp/usp_unsil-1.wav",
|
||||||
|
|
||||||
|
Accuracy = 5/60,
|
||||||
|
BurstCount = 1,
|
||||||
|
Accuracy_Add = 0.5,
|
||||||
|
Accuracy_Reset = 0.4,
|
||||||
|
Accuracy_Decay = 5,
|
||||||
|
})
|
|
@ -1,53 +0,0 @@
|
||||||
|
|
||||||
--[[
|
|
||||||
Your Name Is Benny
|
|
||||||
Item definition
|
|
||||||
]]
|
|
||||||
|
|
||||||
-- Not 100% sure how metastuff works yet.
|
|
||||||
|
|
||||||
-- Global weapons table
|
|
||||||
WEAPONS = {}
|
|
||||||
|
|
||||||
function WeaponGet(class)
|
|
||||||
return ItemDef(class)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- ItemDef metatable
|
|
||||||
ItemDef = {}
|
|
||||||
|
|
||||||
ItemDefHelpers = {
|
|
||||||
Get = function( self, key )
|
|
||||||
return self.key
|
|
||||||
end,
|
|
||||||
GetRaw = function( self, key )
|
|
||||||
return rawget( self, key )
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
|
|
||||||
function ItemDef.__index( self, key )
|
|
||||||
if ItemDefHelpers[key] then return ItemDefHelpers[key] end
|
|
||||||
if rawget(self, "BaseClass") then
|
|
||||||
return rawget(self, "BaseClass")[key]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function ItemDef:new( classname, classtable )
|
|
||||||
if classtable then
|
|
||||||
local newdef = classtable
|
|
||||||
newdef.ClassName = classname
|
|
||||||
newdef.BaseClass = WEAPONS[newdef.Base]
|
|
||||||
|
|
||||||
setmetatable( newdef, ItemDef )
|
|
||||||
WEAPONS[classname] = newdef
|
|
||||||
return newdef
|
|
||||||
else
|
|
||||||
return WEAPONS[classname]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
function ItemDef:__tostring()
|
|
||||||
return "ItemDef [" .. self.ClassName .. "]"
|
|
||||||
end
|
|
||||||
|
|
||||||
setmetatable( ItemDef, { __call = ItemDef.new } )
|
|
|
@ -1,5 +0,0 @@
|
||||||
|
|
||||||
--[[
|
|
||||||
Your Name Is Benny
|
|
||||||
Item existance
|
|
||||||
]]
|
|
|
@ -1,735 +0,0 @@
|
||||||
|
|
||||||
do -- Toolgun
|
|
||||||
|
|
||||||
|
|
||||||
WEAPONS["camera"] = {
|
|
||||||
Name = "CAMERA",
|
|
||||||
Description = "Developer development device",
|
|
||||||
Type = "special",
|
|
||||||
|
|
||||||
WModel = "models/maxofs2d/camera.mdl",
|
|
||||||
HoldType = "camera",
|
|
||||||
GestureDraw = { ACT_HL2MP_GESTURE_RELOAD_REVOLVER, 0.8 },
|
|
||||||
|
|
||||||
Delay = (60/300),
|
|
||||||
Firemodes = FIREMODE_SEMI,
|
|
||||||
|
|
||||||
Custom_Fire = function( self, data )
|
|
||||||
if self:GetDelay1() > CurTime() then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
self:SetDelay1( CurTime() + 0.2 )
|
|
||||||
|
|
||||||
local p = self:GetOwner()
|
|
||||||
|
|
||||||
if CLIENT and IsFirstTimePredicted() then
|
|
||||||
local zp, za, zf = p:EyePos(), p:EyeAngles(), 90
|
|
||||||
RunConsoleCommand( "benny_cam_override", zp.x .. " " .. zp.y .. " " .. zp.z .. " " .. za.p .. " " .. za.y .. " " .. za.r .. " " .. zf )
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Return true to skip weapon logic
|
|
||||||
return true
|
|
||||||
end,
|
|
||||||
|
|
||||||
Custom_Reload = function( self, data )
|
|
||||||
RunConsoleCommand( "benny_cam_override", "" )
|
|
||||||
|
|
||||||
-- Return true to skip weapon logic
|
|
||||||
return true
|
|
||||||
end,
|
|
||||||
|
|
||||||
Custom_DisableSpecialMovement = function( self, data )
|
|
||||||
-- Return true to skip weapon logic
|
|
||||||
if self:GetUserAim() then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
|
|
||||||
Custom_CalcView = function( self, data )
|
|
||||||
if self:GetUserAim() and GetConVar("benny_cam_override"):GetString() == "" then
|
|
||||||
data.drawviewer = false
|
|
||||||
data.origin = self:GetOwner():EyePos()
|
|
||||||
data.angles = self:GetOwner():EyeAngles()
|
|
||||||
return true -- Return true to halt
|
|
||||||
end
|
|
||||||
|
|
||||||
end,
|
|
||||||
|
|
||||||
Features = "firearm",
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
do -- Handguns
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
do -- SMGs & PDWs
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
do -- Shotguns
|
|
||||||
|
|
||||||
WEAPONS["spas12"] = {
|
|
||||||
Name = "SPAS-12",
|
|
||||||
Description = "Heavy metal pump-action shotgun.",
|
|
||||||
Type = "shotgun",
|
|
||||||
|
|
||||||
WModel = "models/weapons/w_shotgun.mdl",
|
|
||||||
HoldType = "rpg",
|
|
||||||
GestureFire = { ACT_HL2MP_GESTURE_RANGE_ATTACK_CROSSBOW, 0.5 },
|
|
||||||
|
|
||||||
Sound_Fire = "SPAS12.Fire",
|
|
||||||
Sound_DryFire = "Common.Dryfire.Rifle",
|
|
||||||
Sound_MagOut = "SPAS12.MagOut",
|
|
||||||
Sound_MagIn = "SPAS12.MagIn",
|
|
||||||
|
|
||||||
Delay = (60/120),
|
|
||||||
Firemodes = FIREMODE_SEMI,
|
|
||||||
Ammo = 8,
|
|
||||||
Damage = 10,
|
|
||||||
Pellets = 8,
|
|
||||||
Spread = 150/60,
|
|
||||||
SpreadAdd = 150/60,
|
|
||||||
SpreadAddMax = 20,
|
|
||||||
|
|
||||||
SpreadDecay_Start = 2,
|
|
||||||
SpreadDecay_End = 30,
|
|
||||||
SpreadDecay_RampTime = 0.7,
|
|
||||||
|
|
||||||
Speed_Move = 0.93,
|
|
||||||
Speed_Aiming = 0.95,
|
|
||||||
Speed_Reloading = 0.85,
|
|
||||||
Speed_Firing = 0.75,
|
|
||||||
|
|
||||||
Features = "firearm",
|
|
||||||
}
|
|
||||||
|
|
||||||
WEAPONS["doublebarrel"] = {
|
|
||||||
Name = "D/B",
|
|
||||||
Description = "Pocket-sized double-barrelled rocket of fun!",
|
|
||||||
Type = "shotgun",
|
|
||||||
|
|
||||||
WModel = "models/weapons/w_shot_shorty.mdl",
|
|
||||||
HoldType = "rpg",
|
|
||||||
GestureFire = { ACT_HL2MP_GESTURE_RANGE_ATTACK_CROSSBOW, 0.5 },
|
|
||||||
|
|
||||||
Sound_Fire = "SPAS12.Fire",
|
|
||||||
Sound_DryFire = "Common.Dryfire.Rifle",
|
|
||||||
Sound_MagOut = "SPAS12.MagOut",
|
|
||||||
Sound_MagIn = "SPAS12.MagIn",
|
|
||||||
|
|
||||||
Delay = (60/120),
|
|
||||||
Firemodes = FIREMODE_SEMI,
|
|
||||||
Ammo = 2,
|
|
||||||
Damage = 10,
|
|
||||||
Pellets = 8,
|
|
||||||
Spread = 300/60,
|
|
||||||
SpreadAdd = 150/60,
|
|
||||||
SpreadAddMax = 20,
|
|
||||||
|
|
||||||
SpreadDecay_Start = 10,
|
|
||||||
SpreadDecay_End = 30,
|
|
||||||
SpreadDecay_RampTime = 0.5,
|
|
||||||
|
|
||||||
Speed_Move = 0.95,
|
|
||||||
Speed_Aiming = 0.95,
|
|
||||||
Speed_Reloading = 0.9,
|
|
||||||
Speed_Firing = 0.9,
|
|
||||||
|
|
||||||
Features = "firearm",
|
|
||||||
}
|
|
||||||
|
|
||||||
WEAPONS["overunder"] = {
|
|
||||||
Name = "O/U",
|
|
||||||
Description = "Full-length double-barrelled bar fight finisher.",
|
|
||||||
Type = "shotgun",
|
|
||||||
|
|
||||||
WModel = "models/weapons/w_shot_kozlice.mdl",
|
|
||||||
HoldType = "rpg",
|
|
||||||
GestureFire = { ACT_HL2MP_GESTURE_RANGE_ATTACK_CROSSBOW, 0.5 },
|
|
||||||
|
|
||||||
Sound_Fire = "SPAS12.Fire",
|
|
||||||
Sound_DryFire = "Common.Dryfire.Rifle",
|
|
||||||
Sound_MagOut = "SPAS12.MagOut",
|
|
||||||
Sound_MagIn = "SPAS12.MagIn",
|
|
||||||
|
|
||||||
Delay = (60/120),
|
|
||||||
Firemodes = FIREMODE_SEMI,
|
|
||||||
Ammo = 2,
|
|
||||||
Damage = 10,
|
|
||||||
Pellets = 8,
|
|
||||||
Spread = 130/60,
|
|
||||||
SpreadAdd = 130/60,
|
|
||||||
SpreadAddMax = 20,
|
|
||||||
|
|
||||||
SpreadDecay_Start = 10,
|
|
||||||
SpreadDecay_End = 30,
|
|
||||||
SpreadDecay_RampTime = 0.5,
|
|
||||||
|
|
||||||
Speed_Move = 0.93,
|
|
||||||
Speed_Aiming = 0.95,
|
|
||||||
Speed_Reloading = 0.85,
|
|
||||||
Speed_Firing = 0.85,
|
|
||||||
|
|
||||||
Features = "firearm",
|
|
||||||
}
|
|
||||||
|
|
||||||
WEAPONS["aa12"] = {
|
|
||||||
Name = "AA-12",
|
|
||||||
Description = "Magazine fed powerhouse.",
|
|
||||||
Type = "shotgun",
|
|
||||||
|
|
||||||
WModel = "models/weapons/w_shot_br99.mdl",
|
|
||||||
HoldType = "rpg",
|
|
||||||
GestureFire = { ACT_HL2MP_GESTURE_RANGE_ATTACK_CROSSBOW, 0.5 },
|
|
||||||
|
|
||||||
Sound_Fire = "AA12.Fire",
|
|
||||||
Sound_DryFire = "Common.Dryfire.Rifle",
|
|
||||||
Sound_MagOut = "AA12.MagOut",
|
|
||||||
Sound_MagIn = "AA12.MagIn",
|
|
||||||
|
|
||||||
Delay = (60/180),
|
|
||||||
Firemodes = FIREMODE_AUTO,
|
|
||||||
Ammo = 8,
|
|
||||||
Damage = 8,
|
|
||||||
Pellets = 8,
|
|
||||||
Spread = 250/60,
|
|
||||||
SpreadAdd = 150/60,
|
|
||||||
SpreadAddMax = 20,
|
|
||||||
|
|
||||||
SpreadDecay_Start = 700/60,
|
|
||||||
SpreadDecay_End = 30,
|
|
||||||
SpreadDecay_RampTime = 1,
|
|
||||||
|
|
||||||
Reload_MagOut = 0.5,
|
|
||||||
Reload_MagIn = 1.5,
|
|
||||||
Reload_MagIn_Bonus1 = 1.2,
|
|
||||||
Reload_MagIn_Bonus2 = 1.2+0.1,
|
|
||||||
|
|
||||||
Speed_Move = 0.92,
|
|
||||||
Speed_Aiming = 0.92,
|
|
||||||
Speed_Reloading = 0.5,
|
|
||||||
Speed_Firing = 0.334,
|
|
||||||
Speed_FiringTime = 0.5,
|
|
||||||
|
|
||||||
Features = "firearm",
|
|
||||||
}
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
do -- Rifles
|
|
||||||
|
|
||||||
WEAPONS["fnc"] = {
|
|
||||||
Name = "FNC PARA",
|
|
||||||
Description = "Run of the mill automatic assault rifle.",
|
|
||||||
Type = "rifle",
|
|
||||||
|
|
||||||
Icon = Material( "benny/weapons/fnc.png", "smooth" ),
|
|
||||||
WModel = "models/weapons/w_rif_ar556.mdl",
|
|
||||||
HoldType = "rpg",
|
|
||||||
GestureFire = { ACT_HL2MP_GESTURE_RANGE_ATTACK_PISTOL, 0.3 },
|
|
||||||
|
|
||||||
Sound_Fire = "FNC.Fire",
|
|
||||||
Sound_DryFire = "Common.Dryfire.Rifle",
|
|
||||||
Sound_MagOut = "FNC.MagOut",
|
|
||||||
Sound_MagIn = "FNC.MagIn",
|
|
||||||
Sound_Cock = "FNC.Cock",
|
|
||||||
|
|
||||||
Delay = (60/700),
|
|
||||||
Firemodes = FIREMODE_AUTOSEMI,
|
|
||||||
Ammo = 30,
|
|
||||||
Damage = 30,
|
|
||||||
Spread = 30/60,
|
|
||||||
SpreadAdd = 22/60,
|
|
||||||
SpreadAddMax = 10,
|
|
||||||
|
|
||||||
SpreadDecay_Start = 0,
|
|
||||||
SpreadDecay_End = 12,
|
|
||||||
SpreadDecay_RampTime = 0.2,
|
|
||||||
|
|
||||||
Reload_MagOut = 0.3,
|
|
||||||
Reload_MagIn = 1.3,
|
|
||||||
Reload_MagIn_Bonus1 = 0.8,
|
|
||||||
Reload_MagIn_Bonus2 = 0.8+0.1,
|
|
||||||
|
|
||||||
Speed_Move = 0.95,
|
|
||||||
Speed_Aiming = 0.95,
|
|
||||||
Speed_Reloading = 0.95,
|
|
||||||
Speed_Firing = 0.95,
|
|
||||||
|
|
||||||
Features = "firearm",
|
|
||||||
}
|
|
||||||
|
|
||||||
WEAPONS["qbz"] = {
|
|
||||||
Name = "QBZ-95",
|
|
||||||
Description = "Bullpup assault rifle. Low profile, great in close quarters.",
|
|
||||||
Type = "rifle",
|
|
||||||
|
|
||||||
Icon = Material( "benny/weapons/fnc.png", "smooth" ),
|
|
||||||
WModel = "models/weapons/w_rif_bakm.mdl",
|
|
||||||
HoldType = "rpg",
|
|
||||||
GestureFire = { ACT_HL2MP_GESTURE_RANGE_ATTACK_PISTOL, 0.3 },
|
|
||||||
|
|
||||||
Sound_Fire = "QBBLSW.Fire",
|
|
||||||
Sound_DryFire = "Common.Dryfire.Rifle",
|
|
||||||
Sound_MagOut = "FNC.MagOut",
|
|
||||||
Sound_MagIn = "FNC.MagIn",
|
|
||||||
Sound_Cock = "FNC.Cock",
|
|
||||||
|
|
||||||
Delay = (60/800),
|
|
||||||
Firemodes = FIREMODE_AUTOSEMI,
|
|
||||||
Ammo = 30,
|
|
||||||
Damage = 28,
|
|
||||||
Spread = 45/60,
|
|
||||||
SpreadAdd = 35/60,
|
|
||||||
SpreadAddMax = 10,
|
|
||||||
|
|
||||||
SpreadDecay_Start = 12,
|
|
||||||
SpreadDecay_End = 36,
|
|
||||||
SpreadDecay_RampTime = 0.6,
|
|
||||||
|
|
||||||
Reload_MagOut = 0.4,
|
|
||||||
Reload_MagIn = 1.5,
|
|
||||||
Reload_MagIn_Bonus1 = 0.8,
|
|
||||||
Reload_MagIn_Bonus2 = 0.8+0.1,
|
|
||||||
|
|
||||||
Speed_Move = 0.975,
|
|
||||||
Speed_Aiming = 0.975,
|
|
||||||
Speed_Reloading = 0.975,
|
|
||||||
Speed_Firing = 0.975,
|
|
||||||
|
|
||||||
Features = "firearm",
|
|
||||||
}
|
|
||||||
|
|
||||||
WEAPONS["m16a2"] = {
|
|
||||||
Name = "M16A2",
|
|
||||||
Description = "Burst-fire assault rifle. Precise and effective at range.",
|
|
||||||
Type = "rifle",
|
|
||||||
|
|
||||||
Icon = Material( "benny/weapons/m16a2.png", "smooth" ),
|
|
||||||
WModel = "models/weapons/w_rif_m16a2.mdl",
|
|
||||||
HoldType = "rpg",
|
|
||||||
GestureFire = { ACT_HL2MP_GESTURE_RANGE_ATTACK_PISTOL, 0.3 },
|
|
||||||
|
|
||||||
Sound_Fire = "M16A2.Fire",
|
|
||||||
Sound_DryFire = "Common.Dryfire.Rifle",
|
|
||||||
Sound_MagOut = "M16A2.MagOut",
|
|
||||||
Sound_MagIn = "M16A2.MagIn",
|
|
||||||
Sound_Cock = "M16A2.Cock",
|
|
||||||
|
|
||||||
Delay = (60/700),
|
|
||||||
Firemodes = {
|
|
||||||
{ Mode = 3 },
|
|
||||||
{ Mode = 1 },
|
|
||||||
},
|
|
||||||
Ammo = 30,
|
|
||||||
Damage = 32,
|
|
||||||
Spread = 22/60,
|
|
||||||
SpreadAdd = 11/60,
|
|
||||||
SpreadAddMax = 10,
|
|
||||||
|
|
||||||
SpreadDecay_Start = 0,
|
|
||||||
SpreadDecay_End = 12,
|
|
||||||
SpreadDecay_RampTime = 0.3,
|
|
||||||
|
|
||||||
Reload_MagOut = 0.3,
|
|
||||||
Reload_MagIn = 1.3,
|
|
||||||
Reload_MagIn_Bonus1 = 0.6,
|
|
||||||
Reload_MagIn_Bonus2 = 0.6+0.1,
|
|
||||||
|
|
||||||
Speed_Move = 0.95,
|
|
||||||
Speed_Aiming = 0.9,
|
|
||||||
Speed_Reloading = 0.95,
|
|
||||||
Speed_Firing = 0.9,
|
|
||||||
|
|
||||||
Features = "firearm",
|
|
||||||
}
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
do -- Sniper rifles
|
|
||||||
|
|
||||||
WEAPONS["barrett"] = {
|
|
||||||
Name = "BARRETT .50c",
|
|
||||||
Description = "Semi-automatic .50 slinger. Turns people into slushie!",
|
|
||||||
Type = "sniper",
|
|
||||||
|
|
||||||
Icon = Material( "benny/weapons/m16a2.png", "smooth" ),
|
|
||||||
WModel = "models/weapons/w_snip_awp.mdl",
|
|
||||||
HoldType = "rpg",
|
|
||||||
GestureFire = { ACT_HL2MP_GESTURE_RANGE_ATTACK_CROSSBOW, 0.1 },
|
|
||||||
|
|
||||||
Sound_Fire = "Barrett.Fire",
|
|
||||||
Sound_DryFire = "Common.Dryfire.Rifle",
|
|
||||||
Sound_MagOut = "Barrett.MagOut",
|
|
||||||
Sound_MagIn = "Barrett.MagIn",
|
|
||||||
Sound_Cock = "Barrett.Cock",
|
|
||||||
|
|
||||||
ShootHolsterTime = 1,
|
|
||||||
|
|
||||||
Delay = (60/140),
|
|
||||||
Firemodes = FIREMODE_SEMI,
|
|
||||||
Ammo = 5,
|
|
||||||
Damage = 99,
|
|
||||||
Spread = 5/60,
|
|
||||||
SpreadAdd = 9,
|
|
||||||
SpreadAddMax = 18,
|
|
||||||
|
|
||||||
SpreadDecay_Start = 4,
|
|
||||||
SpreadDecay_End = 22,
|
|
||||||
SpreadDecay_RampTime = 1,
|
|
||||||
|
|
||||||
Reload_MagOut = 0.5,
|
|
||||||
Reload_MagIn = 1.5,
|
|
||||||
Reload_MagIn_Bonus1 = 1.0,
|
|
||||||
Reload_MagIn_Bonus2 = 1.0+0.1,
|
|
||||||
|
|
||||||
Speed_Move = 0.75,
|
|
||||||
Speed_Aiming = 0.75,
|
|
||||||
Speed_Reloading = 0.5,
|
|
||||||
Speed_Firing = 0.334,
|
|
||||||
Speed_FiringTime = 1,
|
|
||||||
|
|
||||||
Features = "firearm",
|
|
||||||
}
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
do -- Machine guns
|
|
||||||
|
|
||||||
WEAPONS["stoner63"] = {
|
|
||||||
Name = "STONER 63",
|
|
||||||
Description = "Box-fed light machine gun that maintains mid-range authority.",
|
|
||||||
Type = "machinegun",
|
|
||||||
|
|
||||||
WModel = "models/weapons/w_mach_hk21e.mdl",
|
|
||||||
HoldType = "rpg",
|
|
||||||
GestureFire = { ACT_HL2MP_GESTURE_RANGE_ATTACK_REVOLVER, 0.3 },
|
|
||||||
|
|
||||||
Sound_Fire = "Stoner63.Fire",
|
|
||||||
Sound_DryFire = "Common.Dryfire.Rifle",
|
|
||||||
Sound_MagOut = "M16A2.MagOut",
|
|
||||||
Sound_MagIn = "M16A2.MagIn",
|
|
||||||
|
|
||||||
Delay = (60/650),
|
|
||||||
Firemodes = FIREMODE_AUTOSEMI,
|
|
||||||
Ammo = 75,
|
|
||||||
Damage = 32,
|
|
||||||
Spread = 26/60,
|
|
||||||
SpreadAdd = 22/60,
|
|
||||||
SpreadAddMax = 10,
|
|
||||||
|
|
||||||
SpreadDecay_Start = 4,
|
|
||||||
SpreadDecay_End = 36,
|
|
||||||
SpreadDecay_RampTime = 0.6,
|
|
||||||
|
|
||||||
Speed_Move = 0.8,
|
|
||||||
Speed_Aiming = 0.75,
|
|
||||||
Speed_Reloading = 0.5,
|
|
||||||
Speed_Firing = 0.334,
|
|
||||||
|
|
||||||
Features = "firearm",
|
|
||||||
}
|
|
||||||
|
|
||||||
WEAPONS["qbblsw"] = {
|
|
||||||
Name = "QBB-LSW-42",
|
|
||||||
Description = "Bullpup mag-fed light machine gun that excels in close quarters.",
|
|
||||||
Type = "machinegun",
|
|
||||||
|
|
||||||
WModel = "models/weapons/w_mach_mg36.mdl",
|
|
||||||
HoldType = "rpg",
|
|
||||||
GestureFire = { ACT_HL2MP_GESTURE_RANGE_ATTACK_REVOLVER, 0.3 },
|
|
||||||
|
|
||||||
Sound_Fire = "QBBLSW.Fire",
|
|
||||||
Sound_DryFire = "Common.Dryfire.Rifle",
|
|
||||||
Sound_MagOut = "M16A2.MagOut",
|
|
||||||
Sound_MagIn = "M16A2.MagIn",
|
|
||||||
|
|
||||||
Delay = (60/850),
|
|
||||||
Firemodes = FIREMODE_AUTOSEMI,
|
|
||||||
Ammo = 60,
|
|
||||||
Damage = 29,
|
|
||||||
Spread = 36/60,
|
|
||||||
SpreadAdd = 33/60,
|
|
||||||
SpreadAddMax = 15,
|
|
||||||
|
|
||||||
SpreadDecay_Start = 6,
|
|
||||||
SpreadDecay_End = 36,
|
|
||||||
SpreadDecay_RampTime = 0.4,
|
|
||||||
|
|
||||||
Speed_Move = 0.8,
|
|
||||||
Speed_Aiming = 0.8,
|
|
||||||
Speed_Reloading = 0.75,
|
|
||||||
Speed_Firing = 0.334,
|
|
||||||
|
|
||||||
Features = "firearm",
|
|
||||||
}
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
do -- Grenades, nothing here is guaranteed.
|
|
||||||
|
|
||||||
local function GrenadeFire( self, data, class, hand )
|
|
||||||
local p = self:GetOwner()
|
|
||||||
if self:GetGrenadeDown() then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
if self:bGetHolsterTime( hand ) > 0 then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
|
|
||||||
self:SetGrenadeDown( true )
|
|
||||||
self:SetGrenadeDownStart( CurTime() )
|
|
||||||
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
|
|
||||||
local function GrenadeReload( self, data )
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
|
|
||||||
local function GrenadeCreate( self, data )
|
|
||||||
-- PROTO: See to getting this done better. Maybe it's spawned while priming the nade for low CL-SV/phys delay?
|
|
||||||
local p = self:GetOwner()
|
|
||||||
local class = WeaponGet(data.Class)
|
|
||||||
local GENT = ents.Create( class.GrenadeEnt )
|
|
||||||
GENT:SetOwner( p )
|
|
||||||
local ang = p:EyeAngles()
|
|
||||||
ang.p = ang.p - 5
|
|
||||||
GENT:SetPos( p:EyePos() + (ang:Forward()*16) )
|
|
||||||
GENT:SetAngles( ang + Angle( 0, 0, -90 ) )
|
|
||||||
GENT.Fuse = self:GetGrenadeDownStart() + class.GrenadeFuse
|
|
||||||
GENT:Spawn()
|
|
||||||
|
|
||||||
local velocity = ang:Forward() * 1500
|
|
||||||
velocity:Mul( Lerp( math.TimeFraction( 90, 0, ang.p ), 0, 1 ) )
|
|
||||||
-- velocity:Add( p:EyeAngles():Up() * 500 * Lerp( math.TimeFraction( 0, -90, p:EyeAngles().p ), 0, 1 ) )
|
|
||||||
|
|
||||||
GENT:GetPhysicsObject():SetVelocity( velocity )
|
|
||||||
end
|
|
||||||
|
|
||||||
local function GrenadeThrow( self, data )
|
|
||||||
local p = self:GetOwner()
|
|
||||||
local class = WeaponGet(data.Class)
|
|
||||||
self:SetGrenadeDown( false )
|
|
||||||
-- TEMP: Do this right!
|
|
||||||
if !class.GrenadeCharge then self:SetGrenadeDownStart( CurTime() ) end
|
|
||||||
--
|
|
||||||
local hand = (self:bWepTable( true ) and self:bWepTable( true ).Class == data.Class) or false
|
|
||||||
self:TPFire( hand )
|
|
||||||
if SERVER then GrenadeCreate( self, data ) end
|
|
||||||
local id = self:bGetInvID( hand )
|
|
||||||
self:BHolster( hand )
|
|
||||||
|
|
||||||
if SERVER or (CLIENT and IsFirstTimePredicted()) then
|
|
||||||
p:INV_Discard( id )
|
|
||||||
end
|
|
||||||
|
|
||||||
-- local subsequent = p:INV_Find( data.Class )[1]
|
|
||||||
-- if subsequent then
|
|
||||||
-- self:BDeploy( hand, subsequent )
|
|
||||||
-- end
|
|
||||||
end
|
|
||||||
|
|
||||||
local function GrenadeThink( self, data, class, hand )
|
|
||||||
local p = self:GetOwner()
|
|
||||||
local class = WeaponGet(data.Class)
|
|
||||||
if self:GetGrenadeDown() then
|
|
||||||
if true or ( CurTime() >= (self:GetGrenadeDownStart() + class.GrenadeFuse) ) then
|
|
||||||
GrenadeThrow( self, data )
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
|
|
||||||
local function GrenadeHolster( self, data )
|
|
||||||
if self:GetGrenadeDown() then
|
|
||||||
GrenadeThrow( self, data )
|
|
||||||
end
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
|
|
||||||
WEAPONS["g_frag"] = {
|
|
||||||
Name = "FRAG GRENADE",
|
|
||||||
Description = "Pull the pin and throw it the hell away!",
|
|
||||||
Type = "grenade",
|
|
||||||
|
|
||||||
Custom_Fire = GrenadeFire,
|
|
||||||
Custom_Reload = GrenadeReload,
|
|
||||||
Custom_Think = GrenadeThink,
|
|
||||||
Custom_Holster = GrenadeHolster,
|
|
||||||
GrenadeEnt = "b-gr_frag",
|
|
||||||
GrenadeFuse = 4,
|
|
||||||
GrenadeCharge = true,
|
|
||||||
|
|
||||||
WModel = "models/weapons/w_eq_fraggrenade.mdl",
|
|
||||||
HoldType = "grenade",
|
|
||||||
GestureFire = { ACT_HL2MP_GESTURE_RANGE_ATTACK_GRENADE, 0 },
|
|
||||||
|
|
||||||
Features = "grenade",
|
|
||||||
}
|
|
||||||
|
|
||||||
WEAPONS["g_semtex"] = {
|
|
||||||
Name = "SEMTEX GRENADE",
|
|
||||||
Description = "Long, audible fuse, but sticks to whatever it touches.",
|
|
||||||
Type = "grenade",
|
|
||||||
|
|
||||||
Custom_Fire = GrenadeFire,
|
|
||||||
Custom_Reload = GrenadeReload,
|
|
||||||
Custom_Think = GrenadeThink,
|
|
||||||
Custom_Holster = GrenadeHolster,
|
|
||||||
GrenadeEnt = "b-gr_semtex",
|
|
||||||
GrenadeFuse = 4,
|
|
||||||
GrenadeCharge = true,
|
|
||||||
|
|
||||||
WModel = "models/weapons/w_eq_flashbang.mdl",
|
|
||||||
HoldType = "grenade",
|
|
||||||
GestureFire = { ACT_HL2MP_GESTURE_RANGE_ATTACK_GRENADE, 0 },
|
|
||||||
|
|
||||||
Features = "grenade",
|
|
||||||
}
|
|
||||||
|
|
||||||
WEAPONS["g_molotov"] = {
|
|
||||||
Name = "MOLOTOV COCKTAIL",
|
|
||||||
Description = "Alcoholic bottle of flame!",
|
|
||||||
Type = "grenade",
|
|
||||||
|
|
||||||
Custom_Fire = GrenadeFire,
|
|
||||||
Custom_Reload = GrenadeReload,
|
|
||||||
Custom_Think = GrenadeThink,
|
|
||||||
Custom_Holster = GrenadeHolster,
|
|
||||||
GrenadeEnt = "b-gr_molotov",
|
|
||||||
GrenadeFuse = 4,
|
|
||||||
GrenadeCharge = true,
|
|
||||||
|
|
||||||
WModel = "models/weapons/w_eq_flashbang.mdl",
|
|
||||||
HoldType = "grenade",
|
|
||||||
GestureFire = { ACT_HL2MP_GESTURE_RANGE_ATTACK_GRENADE, 0 },
|
|
||||||
|
|
||||||
Features = "grenade",
|
|
||||||
}
|
|
||||||
|
|
||||||
WEAPONS["g_tknife"] = {
|
|
||||||
Name = "THROWING KNIFE",
|
|
||||||
Description = "Lightweight knife to throw and pick back up.",
|
|
||||||
Type = "grenade",
|
|
||||||
|
|
||||||
Custom_Fire = GrenadeFire,
|
|
||||||
Custom_Reload = GrenadeReload,
|
|
||||||
Custom_Think = GrenadeThink,
|
|
||||||
Custom_Holster = GrenadeHolster,
|
|
||||||
GrenadeEnt = "b-gr_tknife",
|
|
||||||
GrenadeFuse = 4,
|
|
||||||
GrenadeCharge = true,
|
|
||||||
|
|
||||||
WModel = "models/weapons/w_eq_flashbang.mdl",
|
|
||||||
HoldType = "grenade",
|
|
||||||
GestureFire = { ACT_HL2MP_GESTURE_RANGE_ATTACK_GRENADE, 0 },
|
|
||||||
|
|
||||||
Features = "grenade",
|
|
||||||
}
|
|
||||||
|
|
||||||
WEAPONS["g_smoke"] = {
|
|
||||||
Name = "SMOKE GRENADE",
|
|
||||||
Description = "Smoke bomb used to conceal a position, and makes enemies cough.",
|
|
||||||
Type = "grenade",
|
|
||||||
|
|
||||||
Custom_Fire = GrenadeFire,
|
|
||||||
Custom_Reload = GrenadeReload,
|
|
||||||
Custom_Think = GrenadeThink,
|
|
||||||
Custom_Holster = GrenadeHolster,
|
|
||||||
GrenadeEnt = "b-gr_smoke",
|
|
||||||
GrenadeFuse = 4,
|
|
||||||
GrenadeCharge = true,
|
|
||||||
|
|
||||||
WModel = "models/weapons/w_eq_flashbang.mdl",
|
|
||||||
HoldType = "grenade",
|
|
||||||
GestureFire = { ACT_HL2MP_GESTURE_RANGE_ATTACK_GRENADE, 0 },
|
|
||||||
|
|
||||||
Features = "grenade",
|
|
||||||
}
|
|
||||||
|
|
||||||
WEAPONS["g_flashbang"] = {
|
|
||||||
Name = "FLASHBANG",
|
|
||||||
Description = "Stun grenade that gives off a bright flash and a loud 'bang'.",
|
|
||||||
Type = "grenade",
|
|
||||||
|
|
||||||
Custom_Fire = GrenadeFire,
|
|
||||||
Custom_Reload = GrenadeReload,
|
|
||||||
Custom_Think = GrenadeThink,
|
|
||||||
Custom_Holster = GrenadeHolster,
|
|
||||||
GrenadeEnt = "b-gr_flashbang",
|
|
||||||
GrenadeFuse = 2,
|
|
||||||
GrenadeCharge = false,
|
|
||||||
|
|
||||||
WModel = "models/weapons/w_eq_flashbang.mdl",
|
|
||||||
HoldType = "grenade",
|
|
||||||
GestureFire = { ACT_HL2MP_GESTURE_RANGE_ATTACK_GRENADE, 0 },
|
|
||||||
|
|
||||||
Features = "grenade",
|
|
||||||
}
|
|
||||||
|
|
||||||
WEAPONS["g_prox"] = {
|
|
||||||
Name = "PROXIMITY MINE",
|
|
||||||
Description = "Mine that bounces into the air.",
|
|
||||||
Type = "grenade",
|
|
||||||
|
|
||||||
Custom_Fire = GrenadeFire,
|
|
||||||
Custom_Reload = GrenadeReload,
|
|
||||||
Custom_Think = GrenadeThink,
|
|
||||||
Custom_Holster = GrenadeHolster,
|
|
||||||
GrenadeEnt = "b-gr_prox",
|
|
||||||
GrenadeFuse = 4,
|
|
||||||
GrenadeCharge = true,
|
|
||||||
|
|
||||||
WModel = "models/weapons/w_eq_flashbang.mdl",
|
|
||||||
HoldType = "grenade",
|
|
||||||
GestureFire = { ACT_HL2MP_GESTURE_RANGE_ATTACK_GRENADE, 0 },
|
|
||||||
|
|
||||||
Features = "grenade",
|
|
||||||
}
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
do -- Equipment, nothing here is guaranteed.
|
|
||||||
|
|
||||||
WEAPONS["e_medkit"] = {
|
|
||||||
Name = "MEDKIT",
|
|
||||||
Description = "Station that regenerates a portion of health.",
|
|
||||||
Type = "equipment",
|
|
||||||
|
|
||||||
WModel = "models/weapons/w_eq_flashbang.mdl",
|
|
||||||
|
|
||||||
Features = "grenade",
|
|
||||||
}
|
|
||||||
|
|
||||||
WEAPONS["e_ammo"] = {
|
|
||||||
Name = "AMMO CRATE",
|
|
||||||
Description = "Station that replenishes ammo.",
|
|
||||||
Type = "equipment",
|
|
||||||
|
|
||||||
WModel = "models/weapons/w_eq_flashbang.mdl",
|
|
||||||
|
|
||||||
Features = "grenade",
|
|
||||||
}
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Ammo generator
|
|
||||||
|
|
||||||
for class, data in SortedPairs( WEAPONS ) do
|
|
||||||
if data.Features == "firearm" then
|
|
||||||
WEAPONS["mag_" .. class] = {
|
|
||||||
Name = "MAG: " .. WEAPONS[class].Name,
|
|
||||||
Description = "Magazine for the " .. WEAPONS[class].Name .. ".",
|
|
||||||
Type = "magazine",
|
|
||||||
|
|
||||||
WModel = "models/weapons/w_pist_glock18.mdl",
|
|
||||||
HoldType = "slam",
|
|
||||||
|
|
||||||
Ammo = WEAPONS[class].Ammo,
|
|
||||||
|
|
||||||
Features = "magazine",
|
|
||||||
}
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,326 +0,0 @@
|
||||||
|
|
||||||
--[[
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
WEAPONS["m92"] = {
|
|
||||||
Name = "M92FS",
|
|
||||||
Description = "Accurate pistol, but low caliber won't do much against armor.",
|
|
||||||
Type = "pistol",
|
|
||||||
|
|
||||||
Icon = Material( "benny/weapons/mk23.png", "smooth" ),
|
|
||||||
WModel = "models/weapons/w_pist_elite_single.mdl",
|
|
||||||
HoldType = "revolver",
|
|
||||||
GestureFire = { ACT_HL2MP_GESTURE_RANGE_ATTACK_PISTOL, 0.2 },
|
|
||||||
GestureDraw = { ACT_HL2MP_GESTURE_RELOAD_REVOLVER, 0.8 },
|
|
||||||
|
|
||||||
Sound_Fire = "M92.Fire",
|
|
||||||
Sound_DryFire = "Common.Dryfire.Pistol",
|
|
||||||
Sound_Reload = "USP.Reload",
|
|
||||||
Sound_MagOut = "USP.MagOut",
|
|
||||||
Sound_MagIn = "USP.MagIn",
|
|
||||||
|
|
||||||
Delay = (60/400),
|
|
||||||
Firemodes = FIREMODE_SEMI,
|
|
||||||
Ammo = 15,
|
|
||||||
Damage = 30,
|
|
||||||
|
|
||||||
Features = "firearm",
|
|
||||||
}
|
|
||||||
|
|
||||||
WEAPONS["p226"] = {
|
|
||||||
Name = "P226",
|
|
||||||
Description = "Special forces pistol in fast .357 ammo.",
|
|
||||||
Type = "pistol",
|
|
||||||
|
|
||||||
Icon = Material( "benny/weapons/mk23.png", "smooth" ),
|
|
||||||
WModel = "models/weapons/w_pist_p228.mdl",
|
|
||||||
HoldType = "revolver",
|
|
||||||
GestureFire = { ACT_HL2MP_GESTURE_RANGE_ATTACK_PISTOL, 0.2 },
|
|
||||||
GestureDraw = { ACT_HL2MP_GESTURE_RELOAD_REVOLVER, 0.8 },
|
|
||||||
|
|
||||||
Sound_Fire = "P226.Fire",
|
|
||||||
Sound_DryFire = "Common.Dryfire.Pistol",
|
|
||||||
Sound_Reload = "USP.Reload",
|
|
||||||
Sound_MagOut = "P226.MagOut",
|
|
||||||
Sound_MagIn = "P226.MagIn",
|
|
||||||
|
|
||||||
Delay = (60/350),
|
|
||||||
Firemodes = FIREMODE_SEMI,
|
|
||||||
Ammo = 13,
|
|
||||||
Damage = 30,
|
|
||||||
|
|
||||||
Features = "firearm",
|
|
||||||
}
|
|
||||||
|
|
||||||
WEAPONS["cqb70"] = {
|
|
||||||
Name = "CS-70",
|
|
||||||
Description = "meow",
|
|
||||||
Type = "shotgun",
|
|
||||||
|
|
||||||
WModel = "models/weapons/w_shot_cs3.mdl",
|
|
||||||
HoldType = "rpg",
|
|
||||||
GestureFire = { ACT_HL2MP_GESTURE_RANGE_ATTACK_CROSSBOW, 0.5 },
|
|
||||||
|
|
||||||
Sound_Fire = "AA12.Fire",
|
|
||||||
Sound_DryFire = "Common.Dryfire.Rifle",
|
|
||||||
Sound_MagOut = "AA12.MagOut",
|
|
||||||
Sound_MagIn = "AA12.MagIn",
|
|
||||||
|
|
||||||
Delay = (60/120),
|
|
||||||
Firemodes = FIREMODE_SEMI,
|
|
||||||
Ammo = 4,
|
|
||||||
Damage = 10,
|
|
||||||
Pellets = 8,
|
|
||||||
Spread = 150/60,
|
|
||||||
|
|
||||||
Features = "firearm",
|
|
||||||
}
|
|
||||||
|
|
||||||
WEAPONS["m12ak"] = {
|
|
||||||
Name = "M12AK",
|
|
||||||
Description = "meow",
|
|
||||||
Type = "shotgun",
|
|
||||||
|
|
||||||
WModel = "models/weapons/w_shot_saiga.mdl",
|
|
||||||
HoldType = "rpg",
|
|
||||||
GestureFire = { ACT_HL2MP_GESTURE_RANGE_ATTACK_CROSSBOW, 0.5 },
|
|
||||||
|
|
||||||
Sound_Fire = "AA12.Fire",
|
|
||||||
Sound_DryFire = "Common.Dryfire.Rifle",
|
|
||||||
Sound_MagOut = "AA12.MagOut",
|
|
||||||
Sound_MagIn = "AA12.MagIn",
|
|
||||||
|
|
||||||
Delay = (60/160),
|
|
||||||
Firemodes = FIREMODE_SEMI,
|
|
||||||
Ammo = 5,
|
|
||||||
Damage = 10,
|
|
||||||
Pellets = 8,
|
|
||||||
Spread = 150/60,
|
|
||||||
|
|
||||||
Features = "firearm",
|
|
||||||
}
|
|
||||||
|
|
||||||
WEAPONS["g_gas"] = {
|
|
||||||
Name = "GAS GRENADE",
|
|
||||||
Description = "Short burst of gas that slows and disorient targets.",
|
|
||||||
Type = "grenade",
|
|
||||||
|
|
||||||
Custom_Fire = GrenadeFire,
|
|
||||||
Custom_Reload = GrenadeReload,
|
|
||||||
Custom_Think = GrenadeThink,
|
|
||||||
Custom_Holster = GrenadeHolster,
|
|
||||||
GrenadeEnt = "b-gr_gas",
|
|
||||||
GrenadeFuse = 4,
|
|
||||||
GrenadeCharge = true,
|
|
||||||
|
|
||||||
WModel = "models/weapons/w_eq_flashbang.mdl",
|
|
||||||
HoldType = "grenade",
|
|
||||||
GestureFire = { ACT_HL2MP_GESTURE_RANGE_ATTACK_GRENADE, 0 },
|
|
||||||
|
|
||||||
Features = "grenade",
|
|
||||||
}
|
|
||||||
|
|
||||||
WEAPONS["g_claymore"] = {
|
|
||||||
Name = "CLAYMORE",
|
|
||||||
Description = "Mine that shoots shrapnel in a cone.",
|
|
||||||
Type = "grenade",
|
|
||||||
|
|
||||||
Custom_Fire = GrenadeFire,
|
|
||||||
Custom_Reload = GrenadeReload,
|
|
||||||
Custom_Think = GrenadeThink,
|
|
||||||
Custom_Holster = GrenadeHolster,
|
|
||||||
GrenadeEnt = "b-gr_claymore",
|
|
||||||
GrenadeFuse = 4,
|
|
||||||
GrenadeCharge = true,
|
|
||||||
|
|
||||||
WModel = "models/weapons/w_eq_flashbang.mdl",
|
|
||||||
HoldType = "grenade",
|
|
||||||
GestureFire = { ACT_HL2MP_GESTURE_RANGE_ATTACK_GRENADE, 0 },
|
|
||||||
|
|
||||||
Features = "grenade",
|
|
||||||
}
|
|
||||||
|
|
||||||
WEAPONS["g_scrambler"] = {
|
|
||||||
Name = "SCRAMBLER",
|
|
||||||
Description = "Disrupts enemy radar based on proximity.",
|
|
||||||
Type = "grenade",
|
|
||||||
|
|
||||||
Custom_Fire = GrenadeFire,
|
|
||||||
Custom_Reload = GrenadeReload,
|
|
||||||
Custom_Think = GrenadeThink,
|
|
||||||
Custom_Holster = GrenadeHolster,
|
|
||||||
GrenadeEnt = "b-gr_scrambler",
|
|
||||||
GrenadeFuse = 4,
|
|
||||||
GrenadeCharge = true,
|
|
||||||
|
|
||||||
WModel = "models/weapons/w_eq_flashbang.mdl",
|
|
||||||
HoldType = "grenade",
|
|
||||||
GestureFire = { ACT_HL2MP_GESTURE_RANGE_ATTACK_GRENADE, 0 },
|
|
||||||
|
|
||||||
Features = "grenade",
|
|
||||||
}
|
|
||||||
|
|
||||||
WEAPONS["g_emp"] = {
|
|
||||||
Name = "EMP NADE",
|
|
||||||
Description = "Disrupts enemy equipment based on proximity.",
|
|
||||||
Type = "grenade",
|
|
||||||
|
|
||||||
Custom_Fire = GrenadeFire,
|
|
||||||
Custom_Reload = GrenadeReload,
|
|
||||||
Custom_Think = GrenadeThink,
|
|
||||||
Custom_Holster = GrenadeHolster,
|
|
||||||
GrenadeEnt = "b-gr_emp",
|
|
||||||
GrenadeFuse = 4,
|
|
||||||
GrenadeCharge = true,
|
|
||||||
|
|
||||||
WModel = "models/weapons/w_eq_flashbang.mdl",
|
|
||||||
HoldType = "grenade",
|
|
||||||
GestureFire = { ACT_HL2MP_GESTURE_RANGE_ATTACK_GRENADE, 0 },
|
|
||||||
|
|
||||||
Features = "grenade",
|
|
||||||
}
|
|
||||||
|
|
||||||
WEAPONS["g_shockcharge"] = {
|
|
||||||
Name = "SHOCK CHARGE",
|
|
||||||
Description = "Charge that stuns and forces enemies to fire their weapons.",
|
|
||||||
Type = "grenade",
|
|
||||||
|
|
||||||
Custom_Fire = GrenadeFire,
|
|
||||||
Custom_Reload = GrenadeReload,
|
|
||||||
Custom_Think = GrenadeThink,
|
|
||||||
Custom_Holster = GrenadeHolster,
|
|
||||||
GrenadeEnt = "b-gr_shockcharge",
|
|
||||||
GrenadeFuse = 4,
|
|
||||||
GrenadeCharge = true,
|
|
||||||
|
|
||||||
WModel = "models/weapons/w_eq_flashbang.mdl",
|
|
||||||
HoldType = "grenade",
|
|
||||||
GestureFire = { ACT_HL2MP_GESTURE_RANGE_ATTACK_GRENADE, 0 },
|
|
||||||
|
|
||||||
Features = "grenade",
|
|
||||||
}
|
|
||||||
|
|
||||||
WEAPONS["g_thermobaric"] = {
|
|
||||||
Name = "THERMOBARIC GRENADE",
|
|
||||||
Description = "Burns through armor.",
|
|
||||||
Type = "grenade",
|
|
||||||
|
|
||||||
Custom_Fire = GrenadeFire,
|
|
||||||
Custom_Reload = GrenadeReload,
|
|
||||||
Custom_Think = GrenadeThink,
|
|
||||||
Custom_Holster = GrenadeHolster,
|
|
||||||
GrenadeEnt = "b-gr_thermobaric",
|
|
||||||
GrenadeFuse = 4,
|
|
||||||
GrenadeCharge = true,
|
|
||||||
|
|
||||||
WModel = "models/weapons/w_eq_flashbang.mdl",
|
|
||||||
HoldType = "grenade",
|
|
||||||
GestureFire = { ACT_HL2MP_GESTURE_RANGE_ATTACK_GRENADE, 0 },
|
|
||||||
|
|
||||||
Features = "grenade",
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
WEAPONS["e_tacinsertion"] = {
|
|
||||||
Name = "TACTICAL INSERTION",
|
|
||||||
Description = "Flare that changes your deployment location.",
|
|
||||||
Type = "equipment",
|
|
||||||
|
|
||||||
WModel = "models/weapons/w_eq_flashbang.mdl",
|
|
||||||
|
|
||||||
Features = "grenade",
|
|
||||||
}
|
|
||||||
|
|
||||||
WEAPONS["e_cover"] = {
|
|
||||||
Name = "DEPLOYABLE COVER",
|
|
||||||
Description = ".",
|
|
||||||
Type = "equipment",
|
|
||||||
|
|
||||||
WModel = "models/weapons/w_eq_flashbang.mdl",
|
|
||||||
|
|
||||||
Features = "grenade",
|
|
||||||
}
|
|
||||||
|
|
||||||
WEAPONS["e_ddos"] = {
|
|
||||||
Name = "DDOS",
|
|
||||||
Description = ".",
|
|
||||||
Type = "equipment",
|
|
||||||
|
|
||||||
WModel = "models/weapons/w_eq_flashbang.mdl",
|
|
||||||
|
|
||||||
Features = "grenade",
|
|
||||||
}
|
|
||||||
|
|
||||||
WEAPONS["e_trophysystem"] = {
|
|
||||||
Name = "TROPHY SYSTEM",
|
|
||||||
Description = "Disrupts enemy equipment.",
|
|
||||||
Type = "equipment",
|
|
||||||
|
|
||||||
WModel = "models/weapons/w_eq_flashbang.mdl",
|
|
||||||
|
|
||||||
Features = "grenade",
|
|
||||||
}
|
|
||||||
|
|
||||||
WEAPONS["e_portableradar"] = {
|
|
||||||
Name = "PORTABLE RADAR",
|
|
||||||
Description = "Detects nearby enemies based on proximity.",
|
|
||||||
Type = "equipment",
|
|
||||||
|
|
||||||
WModel = "models/weapons/w_eq_flashbang.mdl",
|
|
||||||
|
|
||||||
Features = "grenade",
|
|
||||||
}
|
|
||||||
|
|
||||||
WEAPONS["e_cameraspike"] = {
|
|
||||||
Name = "CAMERA SPIKE",
|
|
||||||
Description = "Mountable camera that gives you a live video feed.",
|
|
||||||
Type = "equipment",
|
|
||||||
|
|
||||||
WModel = "models/weapons/w_eq_flashbang.mdl",
|
|
||||||
|
|
||||||
Features = "grenade",
|
|
||||||
}
|
|
||||||
|
|
||||||
WEAPONS["e_recondrone"] = {
|
|
||||||
Name = "RECON DRONE",
|
|
||||||
Description = "Pilotable hovering recon drone that automatically marks enemies.",
|
|
||||||
Type = "equipment",
|
|
||||||
|
|
||||||
WModel = "models/weapons/w_eq_flashbang.mdl",
|
|
||||||
|
|
||||||
Features = "grenade",
|
|
||||||
}
|
|
||||||
|
|
||||||
WEAPONS["e_gasdrone"] = {
|
|
||||||
Name = "GAS DRONE",
|
|
||||||
Description = "Drone that dispenses toxic gas onto an area.",
|
|
||||||
Type = "equipment",
|
|
||||||
|
|
||||||
WModel = "models/weapons/w_eq_flashbang.mdl",
|
|
||||||
|
|
||||||
Features = "grenade",
|
|
||||||
}
|
|
||||||
|
|
||||||
WEAPONS["e_suppressionmine"] = {
|
|
||||||
Name = "SUPPRESSION MINE",
|
|
||||||
Description = "Mine that detonates to dispense hard-to-see sleeping gas.",
|
|
||||||
Type = "equipment",
|
|
||||||
|
|
||||||
WModel = "models/weapons/w_eq_flashbang.mdl",
|
|
||||||
|
|
||||||
Features = "grenade",
|
|
||||||
}
|
|
||||||
|
|
||||||
WEAPONS["e_antiarmor"] = {
|
|
||||||
Name = "ANTI-ARMOR ROUNDS",
|
|
||||||
Description = "Ammo crate that dispenses armor to disable vehicles.",
|
|
||||||
Type = "equipment",
|
|
||||||
|
|
||||||
WModel = "models/weapons/w_eq_flashbang.mdl",
|
|
||||||
|
|
||||||
Features = "grenade",
|
|
||||||
}
|
|
||||||
|
|
||||||
]]
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue