165 lines
6.0 KiB
Lua
165 lines
6.0 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 BaseAbility = ____dota_ts_adapter.BaseAbility
|
|
local BaseModifier = ____dota_ts_adapter.BaseModifier
|
|
local registerAbility = ____dota_ts_adapter.registerAbility
|
|
local registerModifier = ____dota_ts_adapter.registerModifier
|
|
____exports.ability_glyph_custom = __TS__Class()
|
|
local ability_glyph_custom = ____exports.ability_glyph_custom
|
|
ability_glyph_custom.name = "ability_glyph_custom"
|
|
ability_glyph_custom.____file_path = "scripts/vscripts/abilities/modifiers/ability_glyph_custom.lua"
|
|
__TS__ClassExtends(ability_glyph_custom, BaseAbility)
|
|
function ability_glyph_custom.prototype.GetIntrinsicModifierName(self)
|
|
return "modifier_glyph_custom_passive"
|
|
end
|
|
ability_glyph_custom = __TS__Decorate(
|
|
ability_glyph_custom,
|
|
ability_glyph_custom,
|
|
{registerAbility(nil)},
|
|
{kind = "class", name = "ability_glyph_custom"}
|
|
)
|
|
____exports.ability_glyph_custom = ability_glyph_custom
|
|
____exports.modifier_glyph_custom_passive = __TS__Class()
|
|
local modifier_glyph_custom_passive = ____exports.modifier_glyph_custom_passive
|
|
modifier_glyph_custom_passive.name = "modifier_glyph_custom_passive"
|
|
modifier_glyph_custom_passive.____file_path = "scripts/vscripts/abilities/modifiers/ability_glyph_custom.lua"
|
|
__TS__ClassExtends(modifier_glyph_custom_passive, BaseModifier)
|
|
function modifier_glyph_custom_passive.prototype.____constructor(self, ...)
|
|
BaseModifier.prototype.____constructor(self, ...)
|
|
self.isActive = true
|
|
end
|
|
function modifier_glyph_custom_passive.prototype.IsHidden(self)
|
|
return false
|
|
end
|
|
function modifier_glyph_custom_passive.prototype.DeclareFunctions(self)
|
|
return {MODIFIER_PROPERTY_MIN_HEALTH, MODIFIER_EVENT_ON_TAKEDAMAGE}
|
|
end
|
|
function modifier_glyph_custom_passive.prototype.GetMinHealth(self)
|
|
if self.isActive then
|
|
return 1
|
|
end
|
|
return 0
|
|
end
|
|
function modifier_glyph_custom_passive.prototype.OnTakeDamage(self, event)
|
|
local parent = self:GetParent()
|
|
if event.unit == parent then
|
|
if parent:GetHealthPercent() <= 10 and self.isActive then
|
|
FireGameEvent("dota_glyph_used", {teamnumber = DOTA_TEAM_GOODGUYS})
|
|
self.isActive = false
|
|
parent:AddNewModifier(
|
|
parent,
|
|
self:GetAbility(),
|
|
"modifier_glyph_custom",
|
|
{duration = 6}
|
|
)
|
|
Timers:CreateTimer(
|
|
306,
|
|
function()
|
|
self.isActive = true
|
|
end
|
|
)
|
|
parent:RemoveModifierByName("modifier_glyph_custom_passive")
|
|
end
|
|
end
|
|
end
|
|
modifier_glyph_custom_passive = __TS__Decorate(
|
|
modifier_glyph_custom_passive,
|
|
modifier_glyph_custom_passive,
|
|
{registerModifier(nil)},
|
|
{kind = "class", name = "modifier_glyph_custom_passive"}
|
|
)
|
|
____exports.modifier_glyph_custom_passive = modifier_glyph_custom_passive
|
|
____exports.modifier_glyph_custom = __TS__Class()
|
|
local modifier_glyph_custom = ____exports.modifier_glyph_custom
|
|
modifier_glyph_custom.name = "modifier_glyph_custom"
|
|
modifier_glyph_custom.____file_path = "scripts/vscripts/abilities/modifiers/ability_glyph_custom.lua"
|
|
__TS__ClassExtends(modifier_glyph_custom, BaseModifier)
|
|
function modifier_glyph_custom.prototype.IsHidden(self)
|
|
return false
|
|
end
|
|
function modifier_glyph_custom.prototype.IsPurgable(self)
|
|
return false
|
|
end
|
|
function modifier_glyph_custom.prototype.OnCreated(self, params)
|
|
local parent = self:GetParent()
|
|
local particle = ParticleManager:CreateParticle("particles/items_fx/glyph.vpcf", PATTACH_ABSORIGIN_FOLLOW, parent)
|
|
ParticleManager:SetParticleControl(
|
|
particle,
|
|
0,
|
|
parent:GetAbsOrigin()
|
|
)
|
|
ParticleManager:SetParticleControl(
|
|
particle,
|
|
1,
|
|
Vector(150, 1, 1)
|
|
)
|
|
self:AddParticle(
|
|
particle,
|
|
false,
|
|
false,
|
|
-1,
|
|
false,
|
|
false
|
|
)
|
|
end
|
|
function modifier_glyph_custom.prototype.OnDestroy(self)
|
|
if IsClient() then
|
|
return
|
|
end
|
|
local parent = self:GetParent()
|
|
local ability = self:GetAbility()
|
|
if ability then
|
|
parent:AddNewModifier(parent, ability, "modifier_glyph_custom_passive_cd", {duration = 300})
|
|
end
|
|
end
|
|
function modifier_glyph_custom.prototype.CheckState(self)
|
|
return {[MODIFIER_STATE_INVULNERABLE] = true}
|
|
end
|
|
modifier_glyph_custom = __TS__Decorate(
|
|
modifier_glyph_custom,
|
|
modifier_glyph_custom,
|
|
{registerModifier(nil)},
|
|
{kind = "class", name = "modifier_glyph_custom"}
|
|
)
|
|
____exports.modifier_glyph_custom = modifier_glyph_custom
|
|
____exports.modifier_glyph_custom_passive_cd = __TS__Class()
|
|
local modifier_glyph_custom_passive_cd = ____exports.modifier_glyph_custom_passive_cd
|
|
modifier_glyph_custom_passive_cd.name = "modifier_glyph_custom_passive_cd"
|
|
modifier_glyph_custom_passive_cd.____file_path = "scripts/vscripts/abilities/modifiers/ability_glyph_custom.lua"
|
|
__TS__ClassExtends(modifier_glyph_custom_passive_cd, BaseModifier)
|
|
function modifier_glyph_custom_passive_cd.prototype.IsHidden(self)
|
|
return false
|
|
end
|
|
function modifier_glyph_custom_passive_cd.prototype.IsDebuff(self)
|
|
return true
|
|
end
|
|
function modifier_glyph_custom_passive_cd.prototype.IsPurgable(self)
|
|
return true
|
|
end
|
|
function modifier_glyph_custom_passive_cd.prototype.OnDestroy(self)
|
|
if IsClient() then
|
|
return
|
|
end
|
|
local ability = self:GetAbility()
|
|
if ability then
|
|
self:GetParent():AddNewModifier(
|
|
self:GetParent(),
|
|
ability,
|
|
"modifier_glyph_custom_passive",
|
|
{}
|
|
)
|
|
end
|
|
end
|
|
modifier_glyph_custom_passive_cd = __TS__Decorate(
|
|
modifier_glyph_custom_passive_cd,
|
|
modifier_glyph_custom_passive_cd,
|
|
{registerModifier(nil)},
|
|
{kind = "class", name = "modifier_glyph_custom_passive_cd"}
|
|
)
|
|
____exports.modifier_glyph_custom_passive_cd = modifier_glyph_custom_passive_cd
|
|
return ____exports
|