Files
2026-05-29 15:11:31 +07:00

111 lines
4.1 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 BaseItem = ____dota_ts_adapter.BaseItem
local BaseModifier = ____dota_ts_adapter.BaseModifier
local registerAbility = ____dota_ts_adapter.registerAbility
local registerModifier = ____dota_ts_adapter.registerModifier
____exports.item_battle_fury_custom = __TS__Class()
local item_battle_fury_custom = ____exports.item_battle_fury_custom
item_battle_fury_custom.name = "item_battle_fury_custom"
item_battle_fury_custom.____file_path = "scripts/vscripts/items/default_items/item_battle_fury_custom.lua"
__TS__ClassExtends(item_battle_fury_custom, BaseItem)
function item_battle_fury_custom.prototype.GetIntrinsicModifierName(self)
return "modifier_battle_fury_custom"
end
function item_battle_fury_custom.prototype.GetAOERadius(self)
return self:GetSpecialValueFor("tree")
end
function item_battle_fury_custom.prototype.OnSpellStart(self)
if not IsServer() then
return
end
local caster = self:GetCaster()
local point = self:GetCursorPosition()
local trees = GridNav:GetAllTreesAroundPoint(
point,
self:GetSpecialValueFor("tree"),
true
)
if trees and #trees > 0 then
self:CutTree(caster, point)
end
end
function item_battle_fury_custom.prototype.CutTree(self, caster, position)
GridNav:DestroyTreesAroundPoint(
position,
self:GetSpecialValueFor("tree"),
true
)
end
item_battle_fury_custom = __TS__Decorate(
item_battle_fury_custom,
item_battle_fury_custom,
{registerAbility(nil)},
{kind = "class", name = "item_battle_fury_custom"}
)
____exports.item_battle_fury_custom = item_battle_fury_custom
____exports.modifier_battle_fury_custom = __TS__Class()
local modifier_battle_fury_custom = ____exports.modifier_battle_fury_custom
modifier_battle_fury_custom.name = "modifier_battle_fury_custom"
modifier_battle_fury_custom.____file_path = "scripts/vscripts/items/default_items/item_battle_fury_custom.lua"
__TS__ClassExtends(modifier_battle_fury_custom, BaseModifier)
function modifier_battle_fury_custom.prototype.IsHidden(self)
return true
end
function modifier_battle_fury_custom.prototype.IsDebuff(self)
return false
end
function modifier_battle_fury_custom.prototype.IsPurgable(self)
return false
end
function modifier_battle_fury_custom.prototype.GetAttributes(self)
return MODIFIER_ATTRIBUTE_MULTIPLE
end
function modifier_battle_fury_custom.prototype.DeclareFunctions(self)
return {MODIFIER_PROPERTY_PREATTACK_BONUS_DAMAGE, MODIFIER_EVENT_ON_ATTACK_LANDED}
end
function modifier_battle_fury_custom.prototype.OnAttackLanded(self, event)
if not IsServer() then
return
end
if self:GetParent():IsRangedAttacker() then
return
end
local parent = event.attacker
if parent ~= self:GetParent() then
return
end
local ability = self:GetAbility()
if not ability then
return
end
local target = event.target
local attackDamage = parent:GetAverageTrueAttackDamage(target)
local cleaveDamage = attackDamage * (self:GetAbility():GetSpecialValueFor("cleave_damage") / 100)
DoCleaveAttack(
parent,
target,
ability,
cleaveDamage,
self:GetAbility():GetSpecialValueFor("cleave_starting_width"),
self:GetAbility():GetSpecialValueFor("cleave_ending_width"),
self:GetAbility():GetSpecialValueFor("cleave_distance"),
"particles/items_fx/battlefury_cleave.vpcf"
)
end
function modifier_battle_fury_custom.prototype.GetModifierPreAttack_BonusDamage(self)
return self:GetAbility():GetSpecialValueFor("bonus_damage")
end
modifier_battle_fury_custom = __TS__Decorate(
modifier_battle_fury_custom,
modifier_battle_fury_custom,
{registerModifier(nil)},
{kind = "class", name = "modifier_battle_fury_custom"}
)
____exports.modifier_battle_fury_custom = modifier_battle_fury_custom
return ____exports