From 846cd1efbb9e8c8de0f0c50ae90d271281c45719 Mon Sep 17 00:00:00 2001 From: JMM889901 <41163714+JMM889901@users.noreply.github.com> Date: Sun, 6 Mar 2022 22:52:19 +0000 Subject: Add function to update vortex shield ignored weapons (#250) --- .../mod/scripts/vscripts/weapons/_vortex.nut | 20 ++++++++++++++++---- 1 file 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 VortexIgnoreClassnames = { ["mp_titancore_flame_wave"] = true, ["mp_ability_grapple"] = true, ["mp_ability_shifter"] = true, } - +void function RegisterNewVortexIgnoreClassnames(table 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 +} -- cgit v1.2.3