diff options
author | JMM889901 <41163714+JMM889901@users.noreply.github.com> | 2022-03-06 22:52:19 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-06 19:52:19 -0300 |
commit | 846cd1efbb9e8c8de0f0c50ae90d271281c45719 (patch) | |
tree | b7d1120ff937173fae018074ee5f544db053e0b0 | |
parent | 544f34caca405614e1ede544c3b3466e9d5566bd (diff) | |
download | NorthstarMods-846cd1efbb9e8c8de0f0c50ae90d271281c45719.tar.gz NorthstarMods-846cd1efbb9e8c8de0f0c50ae90d271281c45719.zip |
Add function to update vortex shield ignored weapons (#250)
-rw-r--r-- | Northstar.CustomServers/mod/scripts/vscripts/weapons/_vortex.nut | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/weapons/_vortex.nut b/Northstar.CustomServers/mod/scripts/vscripts/weapons/_vortex.nut index f1e46a53..b64a2759 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/weapons/_vortex.nut +++ b/Northstar.CustomServers/mod/scripts/vscripts/weapons/_vortex.nut @@ -5,6 +5,8 @@ global function Vortex_Init global function CreateVortexSphere global function DestroyVortexSphereFromVortexWeapon global function EnableVortexSphere +global function RegisterNewVortexIgnoreClassname +global function RegisterNewVortexIgnoreClassnames #if SERVER global function ValidateVortexImpact global function TryVortexAbsorb @@ -78,12 +80,22 @@ global const VORTEX_REFIRE_ROCKET = "rocket" global const VORTEX_REFIRE_GRENADE = "grenade" global const VORTEX_REFIRE_GRENADE_LONG_FUSE = "grenade_long_fuse" -const VortexIgnoreClassnames = { +table<string, bool> VortexIgnoreClassnames = { ["mp_titancore_flame_wave"] = true, ["mp_ability_grapple"] = true, ["mp_ability_shifter"] = true, } - +void function RegisterNewVortexIgnoreClassnames(table<string, bool> classTable) +{ + foreach(string classname, bool shouldignore in classTable) + { + RegisterNewVortexIgnoreClassname(classname, shouldignore) + } +} +void function RegisterNewVortexIgnoreClassname(string classname, bool shouldignore) +{ + VortexIgnoreClassnames[classname] <- shouldignore +} table vortexImpactWeaponInfo const DEG_COS_60 = cos( 60 * DEG_TO_RAD ) @@ -477,7 +489,7 @@ function Vortex_HandleElectricDamage( entity ent, entity attacker, damage, entit // this function handles all incoming vortex impact events bool function TryVortexAbsorb( entity vortexSphere, entity attacker, vector origin, int damageSourceID, entity weapon, string weaponName, string impactType, entity projectile = null, damageType = null, reflect = false ) { - if ( weaponName in VortexIgnoreClassnames ) + if ( weaponName in VortexIgnoreClassnames && VortexIgnoreClassnames[weaponName] ) return false entity vortexWeapon = vortexSphere.GetOwnerWeapon() @@ -1980,4 +1992,4 @@ int function VortexReflectAttack( entity vortexWeapon, attackParams, vector refl */ return totalfired -}
\ No newline at end of file +} |