Files
Dota-Zombie-Invasion/scripts/vscripts/abilities/heroes/mirana/mirana_damage_shared.lua
T
2026-05-29 15:11:31 +07:00

27 lines
916 B
Lua
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
--[[ Generated with https://github.com/TypeScriptToLua/TypeScriptToLua ]]
local ____exports = {}
--- Доп. урон кастомок Мираны: недостающая мана × (`missing_mana_damage_pct` / 100) из врождёнки.
function ____exports.getMiranaMissingManaBonusDamage(self, caster)
if not caster or caster:IsNull() or not caster:IsAlive() or not caster:IsHero() then
return 0
end
local innate = caster:FindAbilityByName("ability_mirana_innate_custom")
if not innate or innate:IsNull() then
return 0
end
local level = math.max(
1,
innate:GetLevel()
)
local pct = innate:GetLevelSpecialValueFor("missing_mana_damage_pct", level)
if pct <= 0 then
return 0
end
local missing = math.max(
0,
caster:GetMaxMana() - caster:GetMana()
)
return missing * (pct * 0.01)
end
return ____exports