Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function PLUGIN:EntityTakeDamage( target, dmginfo )
- -- orig helix plugin
- /* if ( target:IsPlayer() ) then
- if ( target:GetNetVar("resistance") == true ) then
- if (dmginfo:IsDamageType(DMG_BULLET)) then
- dmginfo:ScaleDamage(target:GetNWFloat("dmg_bullet"))
- elseif (dmginfo:IsDamageType(DMG_SLASH)) then
- dmginfo:ScaleDamage(target:GetNWFloat("dmg_slash"))
- elseif (dmginfo:IsDamageType(DMG_SHOCK)) then
- dmginfo:ScaleDamage(target:GetNWFloat("dmg_shock"))
- elseif (dmginfo:IsDamageType(DMG_BURN)) then
- dmginfo:ScaleDamage(target:GetNWFloat("dmg_burn"))
- elseif (dmginfo:IsDamageType(DMG_RADIATION)) then
- dmginfo:ScaleDamage(target:GetNWFloat("dmg_radiation"))
- elseif (dmginfo:IsDamageType(DMG_ACID)) then
- dmginfo:ScaleDamage(target:GetNWFloat("dmg_acid"))
- elseif (dmginfo:IsExplosionDamage()) then
- dmginfo:ScaleDamage(target:GetNWFloat("dmg_explosive"))
- end
- end
- end*/
- --original suit plugin from NS
- -- Bullet resistance
- if ( target:IsPlayer() and dmginfo:IsDamageType(DMG_BULLET)) then
- local damage = dmginfo:GetDamage()
- local perRes = target:GetNWFloat("ixperbulletres")
- local flatRes = target:GetNWInt("ixflatbulletres")
- local suitDuraDmg = damage / 100
- local suit = target:getEquippedBodyArmor()
- if suit != nil then
- suit:SetData("durability", math.Clamp(suit:getData("durability", 100) - suitDuraDmg, 0, 100))
- end
- damage = damage * (1-perRes)
- damage = damage - flatRes
- dmginfo:SetDamage(damage)
- end
- --Anomaly resistance
- local anomtypes = {}
- anomtypes[DMG_SHOCK] = true
- anomtypes[DMG_BURN] = true
- anomtypes[DMG_ACID] = true
- anomtypes[DMG_BLAST] = true
- anomtypes[DMG_SONIC] = true
- if ( entity:IsPlayer() and anomtypes[dmginfo:GetDamageType()]) then
- local damage = dmgInfo:GetDamage()
- local perRes = target:GetNWFloat("ixperanomres")
- local flatRes = target:GetNWInt("ixflatanomres")
- local suitDuraDmg = damage / 50
- local suit = entity:getEquippedBodyArmor()
- if suit != nil then
- suit:SetData("durability", math.Clamp(suit:getData("durability", 100) - suitDuraDmg, 0, 100))
- end
- damage = damage * (1-perRes)
- damage = damage - flatRes
- dmgInfo:SetDamage(damage)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement