Cooler akimbo, Custom_, & more
This commit is contained in:
parent
569d7e11b1
commit
fca318aa2e
|
@ -0,0 +1,34 @@
|
|||
AddCSLuaFile()
|
||||
|
||||
function EFFECT:Init( data )
|
||||
-- Because CEffectData is a shared object, we can't just store it and use its' properties later
|
||||
-- Instead, we store the properties themselves
|
||||
self.offset = data:GetOrigin() + Vector( 0, 0, 0.2 )
|
||||
self.angles = data:GetAngles()
|
||||
self.particles = 4
|
||||
end
|
||||
|
||||
function EFFECT:Think()
|
||||
return true
|
||||
end
|
||||
|
||||
function EFFECT:Render()
|
||||
local emitter = ParticleEmitter( self.offset, false )
|
||||
for i=0, self.particles do
|
||||
local particle = emitter:Add( "effects/softglow", self.offset )
|
||||
if particle then
|
||||
particle:SetAngles( self.angles )
|
||||
particle:SetVelocity( Vector( 0, 0, 15 ) )
|
||||
particle:SetColor( 255, 102, 0 )
|
||||
particle:SetLifeTime( 0 )
|
||||
particle:SetDieTime( 0.2 )
|
||||
particle:SetStartAlpha( 255 )
|
||||
particle:SetEndAlpha( 0 )
|
||||
particle:SetStartSize( 1.6 )
|
||||
particle:SetStartLength( 1 )
|
||||
particle:SetEndSize( 1.2 )
|
||||
particle:SetEndLength( 4 )
|
||||
end
|
||||
end
|
||||
emitter:Finish()
|
||||
end
|
|
@ -1,11 +1,23 @@
|
|||
|
||||
|
||||
function SWEP:PrimaryAttack()
|
||||
self:BFire( false )-- self:GetTempHandedness() )
|
||||
return true
|
||||
end
|
||||
|
||||
function SWEP:SecondaryAttack()
|
||||
self:BFire( true )-- self:GetTempHandedness() )
|
||||
return true
|
||||
end
|
||||
|
||||
function SWEP:BFire( hand )
|
||||
if self:BTable( hand ) then
|
||||
local p = self:GetOwner()
|
||||
local wep_table = self:BTable( hand )
|
||||
local wep_class = self:BClass( hand )
|
||||
|
||||
if wep_class.Fire then
|
||||
if wep_class.Fire( self, wep_table ) then return end
|
||||
if wep_class.Custom_Fire then
|
||||
if wep_class.Custom_Fire( self, wep_table, wep_class, hand ) then return end
|
||||
end
|
||||
if self:D_GetDelay( hand ) > CurTime() then
|
||||
return
|
||||
|
@ -28,6 +40,15 @@ function SWEP:BFire( hand )
|
|||
self:D_SetDelay( hand, CurTime() + wep_class.Delay )
|
||||
self:D_SetBurst( hand, self:D_GetBurst( hand ) + 1 )
|
||||
|
||||
|
||||
if CLIENT and IsFirstTimePredicted() then
|
||||
local vStart = self:GetAttachment( 1 ).Pos
|
||||
local vPoint = p:GetEyeTrace().HitPos
|
||||
local effectdata = EffectData()
|
||||
effectdata:SetStart( vStart )
|
||||
effectdata:SetOrigin( vPoint )
|
||||
util.Effect( "ToolTracer", effectdata )
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -89,12 +89,12 @@ function SWEP:BHolster( hand )
|
|||
if self:D_GetID( hand ) == "" then
|
||||
return -- What the hell are you holstering..?
|
||||
end
|
||||
local p = self:GetOwner()
|
||||
|
||||
local item = p:INV_Get()[ self:D_GetID( hand ) ]
|
||||
local p = self:GetOwner()
|
||||
local item = self:BTable( hand )
|
||||
if item then
|
||||
local class = WEAPONS[item.Class]
|
||||
if class.Holster then class.Holster( self, self:BTable( hand ) ) end
|
||||
if class.Custom_Holster then class.Custom_Holster( self, item, class, hand ) end
|
||||
end
|
||||
|
||||
self:D_SetID( hand, "" )
|
||||
|
|
|
@ -54,11 +54,6 @@ function SWEP:SetupDataTables()
|
|||
self:SetWep2_Firemode( 1 )
|
||||
end
|
||||
|
||||
function SWEP:PrimaryAttack()
|
||||
self:BFire( self:GetTempHandedness() )
|
||||
return true
|
||||
end
|
||||
|
||||
-- BENNY shit
|
||||
function SWEP:BTable( alt )
|
||||
return self:GetOwner():INV_Get()[ alt and self:GetWep2() or self:GetWep1() ]
|
||||
|
@ -96,10 +91,6 @@ function SWEP:B_FiremodeName( alt )
|
|||
end
|
||||
end
|
||||
|
||||
function SWEP:SecondaryAttack()
|
||||
return true
|
||||
end
|
||||
|
||||
function SWEP:Reload()
|
||||
local p = self:GetOwner()
|
||||
local inv = p:INV_Get()
|
||||
|
@ -108,8 +99,8 @@ function SWEP:Reload()
|
|||
local wep_table = self:BTable( hand )
|
||||
local wep_class = self:BClass( hand )
|
||||
if wep_table then
|
||||
if wep_class.Reload then
|
||||
if wep_class.Reload( self, wep_table ) then return end
|
||||
if wep_class.Custom_Reload then
|
||||
if wep_class.Custom_Reload( self, wep_table ) then return end
|
||||
end
|
||||
if self:D_GetDelay( hand ) > CurTime() then
|
||||
return false
|
||||
|
@ -167,16 +158,38 @@ end
|
|||
|
||||
CreateClientConVar( "benny_toggleaim", 0, true, true )
|
||||
|
||||
hook.Add( "PlayerButtonDown", "Benny_PlayerButtonDown_TempForAim", function( ply, button )
|
||||
local wep = ply:BennyCheck()
|
||||
|
||||
if button == KEY_F then
|
||||
if tobool(ply:GetInfoNum("benny_toggleaim", 0)) then
|
||||
wep:SetUserAim( !wep:GetUserAim() )
|
||||
else
|
||||
wep:SetUserAim( true )
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
hook.Add( "PlayerButtonUp", "Benny_PlayerButtonUp_TempForAim", function( ply, button )
|
||||
local wep = ply:BennyCheck()
|
||||
|
||||
if button == KEY_F then
|
||||
if !tobool(ply:GetInfoNum("benny_toggleaim", 0)) then
|
||||
wep:SetUserAim( false )
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
function SWEP:Think()
|
||||
local p = self:GetOwner()
|
||||
|
||||
if tobool(p:GetInfoNum("benny_toggleaim", 0)) then
|
||||
if p:KeyPressed( IN_ATTACK2 ) then
|
||||
self:SetUserAim( !self:GetUserAim() )
|
||||
end
|
||||
else
|
||||
self:SetUserAim( p:KeyDown( IN_ATTACK2 ) )
|
||||
end
|
||||
--if tobool(p:GetInfoNum("benny_toggleaim", 0)) then
|
||||
-- if p:KeyPressed( IN_ATTACK2 ) then
|
||||
-- self:SetUserAim( !self:GetUserAim() )
|
||||
-- end
|
||||
--else
|
||||
-- self:SetUserAim( p:KeyDown( IN_ATTACK2 ) )
|
||||
--end
|
||||
|
||||
if p:KeyPressed( IN_ZOOM ) and (SERVER or (CLIENT and IsFirstTimePredicted())) then
|
||||
self:SetTempHandedness( !self:GetTempHandedness() )
|
||||
|
@ -207,8 +220,8 @@ function SWEP:Think()
|
|||
end
|
||||
|
||||
if self:BClass( false ) then
|
||||
if self:BClass( false ).Think then
|
||||
self:BClass( false ).Think( self, self:BTable( false ) )
|
||||
if self:BClass( false ).Custom_Think then
|
||||
self:BClass( false ).Custom_Think( self, self:BTable( false ) )
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -292,9 +292,17 @@ hook.Add( "CalcView", "Benny_CalcView", function( ply, pos, ang, fov )
|
|||
end
|
||||
end
|
||||
|
||||
if ply:BennyCheck() then -- and ply:GetActiveWeapon():GetAim() > 0 then
|
||||
view.drawviewer = true
|
||||
view.origin, view.angles, view.fov = bennyfp( view.origin, view.angles, view.fov )
|
||||
local wep = ply:BennyCheck()
|
||||
if wep then -- and ply:GetActiveWeapon():GetAim() > 0 then
|
||||
local cv = wep:BClass( true ) and wep:BClass( true ).Custom_CalcView or wep:BClass( false ) and wep:BClass( false ).Custom_CalcView
|
||||
local halt = false
|
||||
if cv then
|
||||
halt = cv( wep, view, view.origin, view.angles, view.fov )
|
||||
end
|
||||
if !halt then
|
||||
view.drawviewer = true
|
||||
view.origin, view.angles, view.fov = bennyfp( view.origin, view.angles, view.fov )
|
||||
end
|
||||
end
|
||||
|
||||
local st = c_over:GetString()
|
||||
|
|
|
@ -232,12 +232,13 @@ if CLIENT then
|
|||
Collapse:SetLabel( i )
|
||||
local Lays = itemlist:Add( "DIconLayout" )
|
||||
Collapse:SetContents( Lays )
|
||||
Collapse:SetExpanded( false )
|
||||
Lays:Dock( FILL )
|
||||
Lays:SetSpaceX( ss(1) )
|
||||
Lays:SetSpaceY( ss(1) )
|
||||
for Mew, New in ipairs( v ) do
|
||||
local button = Lays:Add( "DButton" )
|
||||
button:SetSize( ss(96), ss(14) )
|
||||
button:SetSize( ss(95), ss(14) )
|
||||
--button:Dock( TOP )
|
||||
button:DockMargin( 0, 0, 0, ss(4) )
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ hook.Add( "PlayerNoClip", "Benny_PlayerNoClip", function( ply, desiredNoClipStat
|
|||
end)
|
||||
|
||||
hook.Add( "InputMouseApply", "Benny_InputMouseApply", function( cmd, x, y, ang )
|
||||
if LocalPlayer():BennyCheck() and !LocalPlayer():NoclippingAndNotVaulting() then
|
||||
if LocalPlayer():BennyCheck() and !LocalPlayer():NoclippingAndNotVaulting() and GetConVar("benny_cam_override"):GetBool() == "" then
|
||||
TPSOverride:Add( Angle( y*0.022, -x*0.022, 0 ) )
|
||||
return true
|
||||
end
|
||||
|
@ -76,7 +76,7 @@ hook.Add( "CreateMove", "Benny_CreateMove", function( cmd )
|
|||
|
||||
local p = LocalPlayer()
|
||||
local w = p:GetActiveWeapon()
|
||||
if p:BennyCheck() and !LocalPlayer():NoclippingAndNotVaulting() then -- FPS cam
|
||||
if p:BennyCheck() and !LocalPlayer():NoclippingAndNotVaulting() and GetConVar("benny_cam_override"):GetBool() == "" then -- FPS cam
|
||||
local aimed = w:GetUserAim()
|
||||
local opos, ang = p:CamSpot( TPSOverride )
|
||||
|
||||
|
|
|
@ -198,10 +198,8 @@ do -- Toolgun
|
|||
|
||||
Delay = (60/300),
|
||||
Firemodes = FIREMODE_SEMI,
|
||||
Ammo = 0,
|
||||
Damage = 0,
|
||||
|
||||
Fire = function( self, data )
|
||||
Custom_Fire = function( self, data )
|
||||
if self:GetDelay1() > CurTime() then
|
||||
return true
|
||||
end
|
||||
|
@ -226,7 +224,7 @@ do -- Toolgun
|
|||
return true
|
||||
end,
|
||||
|
||||
Reload = function( self, data )
|
||||
Custom_Reload = function( self, data )
|
||||
if CLIENT and self:GetOwner():KeyPressed( IN_RELOAD ) then
|
||||
CreateSelect()
|
||||
end
|
||||
|
@ -238,6 +236,53 @@ do -- Toolgun
|
|||
Features = "firearm",
|
||||
}
|
||||
|
||||
|
||||
WEAPONS["camera"] = {
|
||||
Name = "DIRECTOR'S 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_CalcView = function( self, data )
|
||||
if self:GetUserAim() and GetConVar("benny_cam_override"):GetString() == "" then
|
||||
data.drawviewer = false
|
||||
return true -- Return true to halt
|
||||
end
|
||||
|
||||
end,
|
||||
|
||||
Features = "firearm",
|
||||
}
|
||||
end
|
||||
|
||||
do -- Melee
|
||||
|
@ -1011,10 +1056,10 @@ do -- Grenades, nothing here is guaranteed.
|
|||
Description = "Pull the pin and throw it the hell away!",
|
||||
Type = "grenade",
|
||||
|
||||
Fire = GrenadeFire,
|
||||
Reload = GrenadeReload,
|
||||
Think = GrenadeThink,
|
||||
Holster = GrenadeHolster,
|
||||
Custom_Fire = GrenadeFire,
|
||||
Custom_Reload = GrenadeReload,
|
||||
Custom_Think = GrenadeThink,
|
||||
Custom_Holster = GrenadeHolster,
|
||||
GrenadeEnt = "benny_grenade_frag",
|
||||
GrenadeFuse = 4,
|
||||
GrenadeCharge = true,
|
||||
|
@ -1031,9 +1076,10 @@ do -- Grenades, nothing here is guaranteed.
|
|||
Description = "Long, audible fuse, but sticks to whatever it touches.",
|
||||
Type = "grenade",
|
||||
|
||||
Fire = GrenadeFire,
|
||||
Reload = GrenadeReload,
|
||||
Think = GrenadeThink,
|
||||
Custom_Fire = GrenadeFire,
|
||||
Custom_Reload = GrenadeReload,
|
||||
Custom_Think = GrenadeThink,
|
||||
Custom_Holster = GrenadeHolster,
|
||||
GrenadeEnt = "benny_grenade_semtex",
|
||||
GrenadeFuse = 4,
|
||||
GrenadeCharge = true,
|
||||
|
@ -1050,9 +1096,10 @@ do -- Grenades, nothing here is guaranteed.
|
|||
Description = "Alcoholic bottle of flame!",
|
||||
Type = "grenade",
|
||||
|
||||
Fire = GrenadeFire,
|
||||
Reload = GrenadeReload,
|
||||
Think = GrenadeThink,
|
||||
Custom_Fire = GrenadeFire,
|
||||
Custom_Reload = GrenadeReload,
|
||||
Custom_Think = GrenadeThink,
|
||||
Custom_Holster = GrenadeHolster,
|
||||
GrenadeEnt = "benny_grenade_molotov",
|
||||
GrenadeFuse = 4,
|
||||
GrenadeCharge = true,
|
||||
|
@ -1069,9 +1116,10 @@ do -- Grenades, nothing here is guaranteed.
|
|||
Description = "Lightweight knife to throw and pick back up.",
|
||||
Type = "grenade",
|
||||
|
||||
Fire = GrenadeFire,
|
||||
Reload = GrenadeReload,
|
||||
Think = GrenadeThink,
|
||||
Custom_Fire = GrenadeFire,
|
||||
Custom_Reload = GrenadeReload,
|
||||
Custom_Think = GrenadeThink,
|
||||
Custom_Holster = GrenadeHolster,
|
||||
GrenadeEnt = "benny_grenade_tknife",
|
||||
GrenadeFuse = 4,
|
||||
GrenadeCharge = true,
|
||||
|
@ -1088,9 +1136,10 @@ do -- Grenades, nothing here is guaranteed.
|
|||
Description = "Smoke bomb used to conceal a position, and makes enemies cough.",
|
||||
Type = "grenade",
|
||||
|
||||
Fire = GrenadeFire,
|
||||
Reload = GrenadeReload,
|
||||
Think = GrenadeThink,
|
||||
Custom_Fire = GrenadeFire,
|
||||
Custom_Reload = GrenadeReload,
|
||||
Custom_Think = GrenadeThink,
|
||||
Custom_Holster = GrenadeHolster,
|
||||
GrenadeEnt = "benny_grenade_smoke",
|
||||
GrenadeFuse = 4,
|
||||
GrenadeCharge = true,
|
||||
|
@ -1107,9 +1156,10 @@ do -- Grenades, nothing here is guaranteed.
|
|||
Description = "Stun grenade that gives off a bright flash and a loud 'bang'.",
|
||||
Type = "grenade",
|
||||
|
||||
Fire = GrenadeFire,
|
||||
Reload = GrenadeReload,
|
||||
Think = GrenadeThink,
|
||||
Custom_Fire = GrenadeFire,
|
||||
Custom_Reload = GrenadeReload,
|
||||
Custom_Think = GrenadeThink,
|
||||
Custom_Holster = GrenadeHolster,
|
||||
GrenadeEnt = "benny_grenade_flashbang",
|
||||
GrenadeFuse = 2,
|
||||
GrenadeCharge = false,
|
||||
|
@ -1126,9 +1176,10 @@ do -- Grenades, nothing here is guaranteed.
|
|||
Description = "Short burst of gas that slows and disorient targets.",
|
||||
Type = "grenade",
|
||||
|
||||
Fire = GrenadeFire,
|
||||
Reload = GrenadeReload,
|
||||
Think = GrenadeThink,
|
||||
Custom_Fire = GrenadeFire,
|
||||
Custom_Reload = GrenadeReload,
|
||||
Custom_Think = GrenadeThink,
|
||||
Custom_Holster = GrenadeHolster,
|
||||
GrenadeEnt = "benny_grenade_gas",
|
||||
GrenadeFuse = 4,
|
||||
GrenadeCharge = true,
|
||||
|
@ -1145,9 +1196,10 @@ do -- Grenades, nothing here is guaranteed.
|
|||
Description = "Mine that bounces into the air.",
|
||||
Type = "grenade",
|
||||
|
||||
Fire = GrenadeFire,
|
||||
Reload = GrenadeReload,
|
||||
Think = GrenadeThink,
|
||||
Custom_Fire = GrenadeFire,
|
||||
Custom_Reload = GrenadeReload,
|
||||
Custom_Think = GrenadeThink,
|
||||
Custom_Holster = GrenadeHolster,
|
||||
GrenadeEnt = "benny_grenade_prox",
|
||||
GrenadeFuse = 4,
|
||||
GrenadeCharge = true,
|
||||
|
@ -1164,9 +1216,10 @@ do -- Grenades, nothing here is guaranteed.
|
|||
Description = "Mine that shoots shrapnel in a cone.",
|
||||
Type = "grenade",
|
||||
|
||||
Fire = GrenadeFire,
|
||||
Reload = GrenadeReload,
|
||||
Think = GrenadeThink,
|
||||
Custom_Fire = GrenadeFire,
|
||||
Custom_Reload = GrenadeReload,
|
||||
Custom_Think = GrenadeThink,
|
||||
Custom_Holster = GrenadeHolster,
|
||||
GrenadeEnt = "benny_grenade_claymore",
|
||||
GrenadeFuse = 4,
|
||||
GrenadeCharge = true,
|
||||
|
@ -1183,9 +1236,10 @@ do -- Grenades, nothing here is guaranteed.
|
|||
Description = "Disrupts enemy radar based on proximity.",
|
||||
Type = "grenade",
|
||||
|
||||
Fire = GrenadeFire,
|
||||
Reload = GrenadeReload,
|
||||
Think = GrenadeThink,
|
||||
Custom_Fire = GrenadeFire,
|
||||
Custom_Reload = GrenadeReload,
|
||||
Custom_Think = GrenadeThink,
|
||||
Custom_Holster = GrenadeHolster,
|
||||
GrenadeEnt = "benny_grenade_scrambler",
|
||||
GrenadeFuse = 4,
|
||||
GrenadeCharge = true,
|
||||
|
@ -1202,9 +1256,10 @@ do -- Grenades, nothing here is guaranteed.
|
|||
Description = "Disrupts enemy equipment based on proximity.",
|
||||
Type = "grenade",
|
||||
|
||||
Fire = GrenadeFire,
|
||||
Reload = GrenadeReload,
|
||||
Think = GrenadeThink,
|
||||
Custom_Fire = GrenadeFire,
|
||||
Custom_Reload = GrenadeReload,
|
||||
Custom_Think = GrenadeThink,
|
||||
Custom_Holster = GrenadeHolster,
|
||||
GrenadeEnt = "benny_grenade_emp",
|
||||
GrenadeFuse = 4,
|
||||
GrenadeCharge = true,
|
||||
|
@ -1221,9 +1276,10 @@ do -- Grenades, nothing here is guaranteed.
|
|||
Description = "Charge that stuns and forces enemies to fire their weapons.",
|
||||
Type = "grenade",
|
||||
|
||||
Fire = GrenadeFire,
|
||||
Reload = GrenadeReload,
|
||||
Think = GrenadeThink,
|
||||
Custom_Fire = GrenadeFire,
|
||||
Custom_Reload = GrenadeReload,
|
||||
Custom_Think = GrenadeThink,
|
||||
Custom_Holster = GrenadeHolster,
|
||||
GrenadeEnt = "benny_grenade_shockcharge",
|
||||
GrenadeFuse = 4,
|
||||
GrenadeCharge = true,
|
||||
|
@ -1240,9 +1296,10 @@ do -- Grenades, nothing here is guaranteed.
|
|||
Description = "Burns through armor.",
|
||||
Type = "grenade",
|
||||
|
||||
Fire = GrenadeFire,
|
||||
Reload = GrenadeReload,
|
||||
Think = GrenadeThink,
|
||||
Custom_Fire = GrenadeFire,
|
||||
Custom_Reload = GrenadeReload,
|
||||
Custom_Think = GrenadeThink,
|
||||
Custom_Holster = GrenadeHolster,
|
||||
GrenadeEnt = "benny_grenade_thermobaric",
|
||||
GrenadeFuse = 4,
|
||||
GrenadeCharge = true,
|
||||
|
|
Loading…
Reference in New Issue