53 lines
1.7 KiB
Lua
53 lines
1.7 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 ____card_value_resolver = require("cards.card_value_resolver")
|
|
local getCardValueByLevel = ____card_value_resolver.getCardValueByLevel
|
|
local CARD_ID = 60
|
|
____exports.card_60 = __TS__Class()
|
|
local card_60 = ____exports.card_60
|
|
card_60.name = "card_60"
|
|
card_60.____file_path = "scripts/vscripts/cards/examples/card_60.lua"
|
|
__TS__ClassExtends(card_60, CardBase)
|
|
function card_60.prototype.OnCreated(self)
|
|
if not IsServer() then
|
|
return
|
|
end
|
|
local hero = self:GetHero()
|
|
if not hero or not IsValidEntity(hero) or not hero:IsRealHero() then
|
|
return
|
|
end
|
|
local playerId = hero:GetPlayerOwnerID()
|
|
if playerId == nil or playerId == nil or playerId < 0 then
|
|
return
|
|
end
|
|
local goldReward = math.max(
|
|
0,
|
|
math.floor(getCardValueByLevel(
|
|
nil,
|
|
CARD_ID,
|
|
hero,
|
|
"gold_reward",
|
|
2000
|
|
))
|
|
)
|
|
if goldReward <= 0 then
|
|
return
|
|
end
|
|
PlayerResource:ModifyGold(playerId, goldReward, true, DOTA_ModifyGold_Unspecified)
|
|
end
|
|
function card_60.prototype.GetModifierName(self)
|
|
return nil
|
|
end
|
|
function card_60.prototype.IsHidden(self)
|
|
return true
|
|
end
|
|
card_60 = __TS__Decorate(card_60, card_60, {RegisterCard}, {kind = "class", name = "card_60"})
|
|
____exports.card_60 = card_60
|
|
return ____exports
|