54 lines
2.1 KiB
Lua
54 lines
2.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 ____CardSystem = require("cards.CardSystem")
|
|
local CardBase = ____CardSystem.CardBase
|
|
local RegisterCard = ____CardSystem.RegisterCard
|
|
local ____CardBaseModifier = require("cards.CardBaseModifier")
|
|
local CardBaseModifier = ____CardBaseModifier.CardBaseModifier
|
|
local ____dota_ts_adapter = require("lib.dota_ts_adapter")
|
|
local registerModifier = ____dota_ts_adapter.registerModifier
|
|
local CARD_ID = 27
|
|
____exports.card_27 = __TS__Class()
|
|
local card_27 = ____exports.card_27
|
|
card_27.name = "card_27"
|
|
card_27.____file_path = "scripts/vscripts/cards/examples/card_27.lua"
|
|
__TS__ClassExtends(card_27, CardBase)
|
|
function card_27.prototype.GetModifierName(self)
|
|
return "modifier_card_27"
|
|
end
|
|
card_27 = __TS__Decorate(card_27, card_27, {RegisterCard}, {kind = "class", name = "card_27"})
|
|
____exports.card_27 = card_27
|
|
____exports.modifier_card_27 = __TS__Class()
|
|
local modifier_card_27 = ____exports.modifier_card_27
|
|
modifier_card_27.name = "modifier_card_27"
|
|
modifier_card_27.____file_path = "scripts/vscripts/cards/examples/card_27.lua"
|
|
__TS__ClassExtends(modifier_card_27, CardBaseModifier)
|
|
function modifier_card_27.prototype.getValue(self, key, fallback)
|
|
return self:getCardValue(key, fallback, CARD_ID)
|
|
end
|
|
function modifier_card_27.prototype.DeclareFunctions(self)
|
|
return {MODIFIER_PROPERTY_PREATTACK_BONUS_DAMAGE, MODIFIER_PROPERTY_TOOLTIP}
|
|
end
|
|
function modifier_card_27.prototype.GetModifierPreAttack_BonusDamage(self)
|
|
local hero = self:GetParent()
|
|
if not hero or not IsValidEntity(hero) then
|
|
return 0
|
|
end
|
|
local manaToDamagePct = self:getScaledCardValue("mana_to_damage_pct", 15)
|
|
if manaToDamagePct <= 0 then
|
|
return 0
|
|
end
|
|
return hero:GetMana() * (manaToDamagePct / 100)
|
|
end
|
|
modifier_card_27 = __TS__Decorate(
|
|
modifier_card_27,
|
|
modifier_card_27,
|
|
{registerModifier(nil)},
|
|
{kind = "class", name = "modifier_card_27"}
|
|
)
|
|
____exports.modifier_card_27 = modifier_card_27
|
|
return ____exports
|