27 lines
916 B
Lua
27 lines
916 B
Lua
--[[ 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
|