116 lines
4.7 KiB
Lua
116 lines
4.7 KiB
Lua
local ____lualib = require("lualib_bundle")
|
|
local __TS__Class = ____lualib.__TS__Class
|
|
local __TS__ClassExtends = ____lualib.__TS__ClassExtends
|
|
local __TS__Decorate = ____lualib.__TS__Decorate
|
|
local ____exports = {}
|
|
local ____difficulty_manager = require("difficulty_manager")
|
|
local Difficulty = ____difficulty_manager.Difficulty
|
|
local ____dota_ts_adapter = require("lib.dota_ts_adapter")
|
|
local BaseAbility = ____dota_ts_adapter.BaseAbility
|
|
local BaseModifier = ____dota_ts_adapter.BaseModifier
|
|
local registerAbility = ____dota_ts_adapter.registerAbility
|
|
local registerModifier = ____dota_ts_adapter.registerModifier
|
|
____exports.zombie_armor_decress = __TS__Class()
|
|
local zombie_armor_decress = ____exports.zombie_armor_decress
|
|
zombie_armor_decress.name = "zombie_armor_decress"
|
|
zombie_armor_decress.____file_path = "scripts/vscripts/abilities/creep/zombie_armor_decress.lua"
|
|
__TS__ClassExtends(zombie_armor_decress, BaseAbility)
|
|
function zombie_armor_decress.prototype.GetIntrinsicModifierName(self)
|
|
return "modifier_zombie_armor_decress"
|
|
end
|
|
zombie_armor_decress = __TS__Decorate(
|
|
zombie_armor_decress,
|
|
zombie_armor_decress,
|
|
{registerAbility(nil)},
|
|
{kind = "class", name = "zombie_armor_decress"}
|
|
)
|
|
____exports.zombie_armor_decress = zombie_armor_decress
|
|
____exports.modifier_zombie_armor_decress = __TS__Class()
|
|
local modifier_zombie_armor_decress = ____exports.modifier_zombie_armor_decress
|
|
modifier_zombie_armor_decress.name = "modifier_zombie_armor_decress"
|
|
modifier_zombie_armor_decress.____file_path = "scripts/vscripts/abilities/creep/zombie_armor_decress.lua"
|
|
__TS__ClassExtends(modifier_zombie_armor_decress, BaseModifier)
|
|
function modifier_zombie_armor_decress.prototype.IsHidden(self)
|
|
return true
|
|
end
|
|
function modifier_zombie_armor_decress.prototype.IsPurgable(self)
|
|
return false
|
|
end
|
|
function modifier_zombie_armor_decress.prototype.DeclareFunctions(self)
|
|
return {MODIFIER_EVENT_ON_ATTACK_LANDED}
|
|
end
|
|
function modifier_zombie_armor_decress.prototype.OnAttackLanded(self, event)
|
|
if not IsServer() then
|
|
return
|
|
end
|
|
if event.attacker ~= self:GetParent() then
|
|
return
|
|
end
|
|
if not event.target or not event.target:IsAlive() then
|
|
return
|
|
end
|
|
local ability = self:GetAbility()
|
|
if not ability then
|
|
return
|
|
end
|
|
local duration = ability:GetSpecialValueFor("corruption_duration")
|
|
event.target:AddNewModifier(
|
|
self:GetParent(),
|
|
ability,
|
|
____exports.modifier_zombie_armor_decress_debuff.name,
|
|
{duration = duration}
|
|
)
|
|
end
|
|
modifier_zombie_armor_decress = __TS__Decorate(
|
|
modifier_zombie_armor_decress,
|
|
modifier_zombie_armor_decress,
|
|
{registerModifier(nil)},
|
|
{kind = "class", name = "modifier_zombie_armor_decress"}
|
|
)
|
|
____exports.modifier_zombie_armor_decress = modifier_zombie_armor_decress
|
|
____exports.modifier_zombie_armor_decress_debuff = __TS__Class()
|
|
local modifier_zombie_armor_decress_debuff = ____exports.modifier_zombie_armor_decress_debuff
|
|
modifier_zombie_armor_decress_debuff.name = "modifier_zombie_armor_decress_debuff"
|
|
modifier_zombie_armor_decress_debuff.____file_path = "scripts/vscripts/abilities/creep/zombie_armor_decress.lua"
|
|
__TS__ClassExtends(modifier_zombie_armor_decress_debuff, BaseModifier)
|
|
function modifier_zombie_armor_decress_debuff.prototype.____constructor(self, ...)
|
|
BaseModifier.prototype.____constructor(self, ...)
|
|
self.armorDebuffBase = 0
|
|
end
|
|
function modifier_zombie_armor_decress_debuff.prototype.IsHidden(self)
|
|
return true
|
|
end
|
|
function modifier_zombie_armor_decress_debuff.prototype.GetAttributes(self)
|
|
return MODIFIER_ATTRIBUTE_MULTIPLE
|
|
end
|
|
function modifier_zombie_armor_decress_debuff.prototype.IsDebuff(self)
|
|
return true
|
|
end
|
|
function modifier_zombie_armor_decress_debuff.prototype.IsPurgable(self)
|
|
return true
|
|
end
|
|
function modifier_zombie_armor_decress_debuff.prototype.DeclareFunctions(self)
|
|
return {MODIFIER_PROPERTY_PHYSICAL_ARMOR_BONUS}
|
|
end
|
|
function modifier_zombie_armor_decress_debuff.prototype.OnCreated(self)
|
|
local ability = self:GetAbility()
|
|
if not ability then
|
|
return
|
|
end
|
|
self.armorDebuffBase = ability:GetSpecialValueFor("armor_debuff")
|
|
end
|
|
function modifier_zombie_armor_decress_debuff.prototype.OnRefresh(self)
|
|
self:OnCreated()
|
|
end
|
|
function modifier_zombie_armor_decress_debuff.prototype.GetModifierPhysicalArmorBonus(self)
|
|
return self.armorDebuffBase * Difficulty:getNpcStatScale()
|
|
end
|
|
modifier_zombie_armor_decress_debuff = __TS__Decorate(
|
|
modifier_zombie_armor_decress_debuff,
|
|
modifier_zombie_armor_decress_debuff,
|
|
{registerModifier(nil)},
|
|
{kind = "class", name = "modifier_zombie_armor_decress_debuff"}
|
|
)
|
|
____exports.modifier_zombie_armor_decress_debuff = modifier_zombie_armor_decress_debuff
|
|
return ____exports
|