71 lines
2.6 KiB
Lua
71 lines
2.6 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 ____modifier_card_cursed = require("cards.modifier_card_cursed")
|
|
local addCursedStack = ____modifier_card_cursed.addCursedStack
|
|
local removeCursedStack = ____modifier_card_cursed.removeCursedStack
|
|
____exports.card_52 = __TS__Class()
|
|
local card_52 = ____exports.card_52
|
|
card_52.name = "card_52"
|
|
card_52.____file_path = "scripts/vscripts/cards/examples/card_52.lua"
|
|
__TS__ClassExtends(card_52, CardBase)
|
|
function card_52.prototype.GetModifierName(self)
|
|
return "modifier_card_52"
|
|
end
|
|
card_52 = __TS__Decorate(card_52, card_52, {RegisterCard}, {kind = "class", name = "card_52"})
|
|
____exports.card_52 = card_52
|
|
____exports.modifier_card_52 = __TS__Class()
|
|
local modifier_card_52 = ____exports.modifier_card_52
|
|
modifier_card_52.name = "modifier_card_52"
|
|
modifier_card_52.____file_path = "scripts/vscripts/cards/examples/card_52.lua"
|
|
__TS__ClassExtends(modifier_card_52, CardBaseModifier)
|
|
function modifier_card_52.prototype.____constructor(self, ...)
|
|
CardBaseModifier.prototype.____constructor(self, ...)
|
|
self.cursedApplied = false
|
|
end
|
|
function modifier_card_52.prototype.OnCustomCreated(self, params)
|
|
if not IsServer() then
|
|
return
|
|
end
|
|
local hero = self:GetParent()
|
|
if not hero or not IsValidEntity(hero) or not hero:IsRealHero() then
|
|
return
|
|
end
|
|
addCursedStack(nil, hero)
|
|
self.cursedApplied = true
|
|
end
|
|
function modifier_card_52.prototype.OnDestroy(self)
|
|
if not IsServer() then
|
|
return
|
|
end
|
|
if not self.cursedApplied then
|
|
return
|
|
end
|
|
local hero = self:GetParent()
|
|
if not hero or not IsValidEntity(hero) then
|
|
return
|
|
end
|
|
removeCursedStack(nil, hero)
|
|
self.cursedApplied = false
|
|
end
|
|
function modifier_card_52.prototype.GetAttributes(self)
|
|
return MODIFIER_ATTRIBUTE_MULTIPLE
|
|
end
|
|
modifier_card_52 = __TS__Decorate(
|
|
modifier_card_52,
|
|
modifier_card_52,
|
|
{registerModifier(nil)},
|
|
{kind = "class", name = "modifier_card_52"}
|
|
)
|
|
____exports.modifier_card_52 = modifier_card_52
|
|
return ____exports
|