mirror of
https://github.com/ClockEFFX/ProjectileCore.git
synced 2025-03-04 03:13:02 -05:00
flechette support
This commit is contained in:
parent
848025b1de
commit
be917befdc
@ -13,4 +13,4 @@ E2Helper.Descriptions[ "shootRPG" ] = "Fires a RPG missile with specified positi
|
||||
E2Helper.Descriptions[ "shootSMGGrenade" ] = "Fires a SMG grenade with specified position, velocity, damage, and blast radius\nNOTE: Damage is subject to falloff\nReturns the grenade entity"
|
||||
|
||||
-- ep2
|
||||
E2Helper.Descriptions[ "shootFlechette" ] = "Fires a hunter flechette (WIP)"
|
||||
E2Helper.Descriptions[ "shootFlechette" ] = "Fires a flechette with specified position, and velocity\nReturns the flechette entity"
|
@ -153,10 +153,19 @@ PROJECTILECORE.SMGGRENADE_DELAY = PROJECTILECORE.CVARS.SMGGRENADE_DELAY:GetFloat
|
||||
|
||||
|
||||
|
||||
-- ep2 convars
|
||||
PROJECTILECORE.CVARS.FLECHETTE_ENABLED = CreateConVar( "projcore_flechette_enabled", "0", FCVAR_ARCHIVE, "Allow E2 to shoot hunter flechettes (EP2 required)", 0, 1 )
|
||||
-- flechette
|
||||
PROJECTILECORE.CVARS.FLECHETTE_ENABLED = CreateConVar( "projcore_flechette_enabled", "1", FCVAR_ARCHIVE, "Allow E2 to shoot hunter flechettes (EP2 required)", 0, 1 )
|
||||
PROJECTILECORE.FLECHETTE_ENABLED = PROJECTILECORE.CVARS.FLECHETTE_ENABLED:GetBool()
|
||||
|
||||
PROJECTILECORE.CVARS.FLECHETTE_MAXVEL = CreateConVar( "projcore_flechette_maxvel", "2000", FCVAR_ARCHIVE, "Maximum velocity E2 fired flechettes are allowed to have (set to -1 for no limit)" )
|
||||
PROJECTILECORE.FLECHETTE_MAXVEL = PROJECTILECORE.CVARS.FLECHETTE_MAXVEL:GetInt()
|
||||
|
||||
PROJECTILECORE.CVARS.FLECHETTE_DELAY = CreateConVar( "projcore_flechette_delay", "0.1", FCVAR_ARCHIVE, "Minimum time between flechette shots" )
|
||||
PROJECTILECORE.FLECHETTE_DELAY = PROJECTILECORE.CVARS.FLECHETTE_DELAY:GetFloat()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -901,9 +910,12 @@ function PROJECTILECORE.SHOOTFLECHETTE( ent, chip, pos, vel )
|
||||
flech:Activate()
|
||||
|
||||
local dir = Vector( vel[ 1 ], vel[ 2 ], vel[ 3 ] )
|
||||
flech:SetVelocity( dir )
|
||||
flech:SetAngles( dir:Angle() )
|
||||
|
||||
local maxvel = PROJECTILECORE.FLECHETTE_MAXVEL
|
||||
dir = maxvel > -1 and PROJECTILECORE.CLAMPVECTOR( dir, maxvel ) or dir
|
||||
|
||||
flech:SetVelocity( dir )
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user