65 lines
2.2 KiB
Lua
65 lines
2.2 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 ____dota_ts_adapter = require("lib.dota_ts_adapter")
|
|
local BaseModifier = ____dota_ts_adapter.BaseModifier
|
|
local registerModifier = ____dota_ts_adapter.registerModifier
|
|
____exports.modifier_swamp_slow = __TS__Class()
|
|
local modifier_swamp_slow = ____exports.modifier_swamp_slow
|
|
modifier_swamp_slow.name = "modifier_swamp_slow"
|
|
modifier_swamp_slow.____file_path = "scripts/vscripts/abilities/modifiers/modifier_swamp_slow.lua"
|
|
__TS__ClassExtends(modifier_swamp_slow, BaseModifier)
|
|
function modifier_swamp_slow.prototype.OnCreated(self)
|
|
self:StartIntervalThink(0.33)
|
|
end
|
|
function modifier_swamp_slow.prototype.OnIntervalThink(self)
|
|
if IsClient() then
|
|
return
|
|
end
|
|
local movespeed = self:GetParent():GetMoveSpeedModifier(
|
|
self:GetParent():GetBaseMoveSpeed(),
|
|
false
|
|
)
|
|
local damagetable = {
|
|
victim = self:GetParent(),
|
|
attacker = self:GetParent(),
|
|
damage = self:GetStackCount() * 1,
|
|
damage_type = DAMAGE_TYPE_PURE
|
|
}
|
|
ApplyDamage({
|
|
victim = damagetable.victim,
|
|
attacker = damagetable.attacker,
|
|
damage = movespeed <= 100 and damagetable.damage + self:GetParent():GetMaxHealth() * 0.01 or damagetable.damage,
|
|
damage_type = damagetable.damage_type
|
|
})
|
|
self:IncrementStackCount()
|
|
end
|
|
function modifier_swamp_slow.prototype.IsHidden(self)
|
|
return false
|
|
end
|
|
function modifier_swamp_slow.prototype.IsDebuff(self)
|
|
return true
|
|
end
|
|
function modifier_swamp_slow.prototype.IsPurgable(self)
|
|
return true
|
|
end
|
|
function modifier_swamp_slow.prototype.DeclareFunctions(self)
|
|
return {MODIFIER_PROPERTY_MOVESPEED_BONUS_CONSTANT}
|
|
end
|
|
function modifier_swamp_slow.prototype.GetModifierMoveSpeedBonus_Constant(self)
|
|
return -30
|
|
end
|
|
function modifier_swamp_slow.prototype.GetTexture(self)
|
|
return "night_stalker_darkness"
|
|
end
|
|
modifier_swamp_slow = __TS__Decorate(
|
|
modifier_swamp_slow,
|
|
modifier_swamp_slow,
|
|
{registerModifier(nil)},
|
|
{kind = "class", name = "modifier_swamp_slow"}
|
|
)
|
|
____exports.modifier_swamp_slow = modifier_swamp_slow
|
|
return ____exports
|