93 lines
3.8 KiB
Lua
93 lines
3.8 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.back_stun = __TS__Class()
|
|
local back_stun = ____exports.back_stun
|
|
back_stun.name = "back_stun"
|
|
back_stun.____file_path = "scripts/vscripts/abilities/creep/demon_dragon_satyr/back_stun.lua"
|
|
__TS__ClassExtends(back_stun, BaseAbility)
|
|
function back_stun.prototype.Precache(self, context)
|
|
PrecacheResource("particle", "particles/econ/items/earthshaker/deep_magma/deep_magma_10th/deep_magma_10th_echoslam_start.vpcf", context)
|
|
PrecacheResource("particle", "particles/generic_gameplay/generic_stunned.vpcf", context)
|
|
end
|
|
function back_stun.prototype.GetCastRange(self)
|
|
return self:GetSpecialValueFor("cast_range")
|
|
end
|
|
function back_stun.prototype.OnSpellStart(self)
|
|
local caster = self:GetCaster()
|
|
local duration = self:GetSpecialValueFor("duration")
|
|
local radius = self:GetSpecialValueFor("cast_range")
|
|
if not caster then
|
|
return
|
|
end
|
|
local direction = caster:GetForwardVector()
|
|
local backPosition = caster:GetOrigin():__sub(direction:__mul(radius))
|
|
self.particle = ParticleManager:CreateParticle("particles/econ/items/earthshaker/deep_magma/deep_magma_10th/deep_magma_10th_echoslam_start.vpcf", PATTACH_WORLDORIGIN, nil)
|
|
ParticleManager:SetParticleControl(self.particle, 0, backPosition)
|
|
local units = FindUnitsInRadius(
|
|
caster:GetTeamNumber(),
|
|
backPosition,
|
|
nil,
|
|
radius,
|
|
DOTA_UNIT_TARGET_TEAM_ENEMY,
|
|
DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_BASIC,
|
|
DOTA_UNIT_TARGET_FLAG_NONE,
|
|
FIND_ANY_ORDER,
|
|
false
|
|
)
|
|
for ____, unit in ipairs(units) do
|
|
unit:AddNewModifier(caster, self, "modifier_back_stunned", {duration = duration})
|
|
local damage = self:GetSpecialValueFor("damage") + self:GetCaster():GetAverageTrueAttackDamage(unit) * 3
|
|
ApplyDamage({victim = unit, attacker = caster, damage = damage, damage_type = DAMAGE_TYPE_PURE})
|
|
EmitSoundOn("Hero_Centaur.HoofStomp", unit)
|
|
end
|
|
end
|
|
back_stun = __TS__Decorate(
|
|
back_stun,
|
|
back_stun,
|
|
{registerAbility(nil)},
|
|
{kind = "class", name = "back_stun"}
|
|
)
|
|
____exports.back_stun = back_stun
|
|
____exports.modifier_back_stunned = __TS__Class()
|
|
local modifier_back_stunned = ____exports.modifier_back_stunned
|
|
modifier_back_stunned.name = "modifier_back_stunned"
|
|
modifier_back_stunned.____file_path = "scripts/vscripts/abilities/creep/demon_dragon_satyr/back_stun.lua"
|
|
__TS__ClassExtends(modifier_back_stunned, BaseModifier)
|
|
function modifier_back_stunned.prototype.IsHidden(self)
|
|
return false
|
|
end
|
|
function modifier_back_stunned.prototype.IsDebuff(self)
|
|
return true
|
|
end
|
|
function modifier_back_stunned.prototype.IsStunDebuff(self)
|
|
return true
|
|
end
|
|
function modifier_back_stunned.prototype.IsPurgable(self)
|
|
return true
|
|
end
|
|
function modifier_back_stunned.prototype.GetEffectName(self)
|
|
return "particles/generic_gameplay/generic_stunned.vpcf"
|
|
end
|
|
function modifier_back_stunned.prototype.GetEffectAttachType(self)
|
|
return PATTACH_OVERHEAD_FOLLOW
|
|
end
|
|
function modifier_back_stunned.prototype.CheckState(self)
|
|
return {[MODIFIER_STATE_STUNNED] = true}
|
|
end
|
|
modifier_back_stunned = __TS__Decorate(
|
|
modifier_back_stunned,
|
|
modifier_back_stunned,
|
|
{registerModifier(nil)},
|
|
{kind = "class", name = "modifier_back_stunned"}
|
|
)
|
|
____exports.modifier_back_stunned = modifier_back_stunned
|
|
return ____exports
|