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 = 28
|
|
____exports.card_28 = __TS__Class()
|
|
local card_28 = ____exports.card_28
|
|
card_28.name = "card_28"
|
|
card_28.____file_path = "scripts/vscripts/cards/examples/card_28.lua"
|
|
__TS__ClassExtends(card_28, CardBase)
|
|
function card_28.prototype.GetModifierName(self)
|
|
return "modifier_card_28"
|
|
end
|
|
card_28 = __TS__Decorate(card_28, card_28, {RegisterCard}, {kind = "class", name = "card_28"})
|
|
____exports.card_28 = card_28
|
|
____exports.modifier_card_28 = __TS__Class()
|
|
local modifier_card_28 = ____exports.modifier_card_28
|
|
modifier_card_28.name = "modifier_card_28"
|
|
modifier_card_28.____file_path = "scripts/vscripts/cards/examples/card_28.lua"
|
|
__TS__ClassExtends(modifier_card_28, CardBaseModifier)
|
|
function modifier_card_28.prototype.getValue(self, key, fallback)
|
|
return self:getCardValue(key, fallback, CARD_ID)
|
|
end
|
|
function modifier_card_28.prototype.DeclareFunctions(self)
|
|
return {MODIFIER_PROPERTY_PREATTACK_BONUS_DAMAGE, MODIFIER_PROPERTY_TOOLTIP}
|
|
end
|
|
function modifier_card_28.prototype.GetModifierPreAttack_BonusDamage(self)
|
|
local hero = self:GetParent()
|
|
if not hero or not IsValidEntity(hero) then
|
|
return 0
|
|
end
|
|
local healthToDamagePct = self:getScaledCardValue("health_to_damage_pct", 15)
|
|
if healthToDamagePct <= 0 then
|
|
return 0
|
|
end
|
|
return hero:GetHealth() * (healthToDamagePct / 100)
|
|
end
|
|
modifier_card_28 = __TS__Decorate(
|
|
modifier_card_28,
|
|
modifier_card_28,
|
|
{registerModifier(nil)},
|
|
{kind = "class", name = "modifier_card_28"}
|
|
)
|
|
____exports.modifier_card_28 = modifier_card_28
|
|
return ____exports
|