71 lines
2.5 KiB
Lua
71 lines
2.5 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_value_resolver = require("cards.card_value_resolver")
|
|
local getCardValueByLevel = ____card_value_resolver.getCardValueByLevel
|
|
local CARD_ID = 6
|
|
____exports.card_6 = __TS__Class()
|
|
local card_6 = ____exports.card_6
|
|
card_6.name = "card_6"
|
|
card_6.____file_path = "scripts/vscripts/cards/examples/card_6.lua"
|
|
__TS__ClassExtends(card_6, CardBase)
|
|
function card_6.prototype.GetModifierName(self)
|
|
return "modifier_card_6"
|
|
end
|
|
card_6 = __TS__Decorate(card_6, card_6, {RegisterCard}, {kind = "class", name = "card_6"})
|
|
____exports.card_6 = card_6
|
|
____exports.modifier_card_6 = __TS__Class()
|
|
local modifier_card_6 = ____exports.modifier_card_6
|
|
modifier_card_6.name = "modifier_card_6"
|
|
modifier_card_6.____file_path = "scripts/vscripts/cards/examples/card_6.lua"
|
|
__TS__ClassExtends(modifier_card_6, CardBaseModifier)
|
|
function modifier_card_6.prototype.OnCustomCreated(self, params)
|
|
if not IsServer() then
|
|
return
|
|
end
|
|
local hero = self:GetParent()
|
|
if not hero or not IsValidEntity(hero) then
|
|
return
|
|
end
|
|
Timers:CreateTimer(
|
|
0,
|
|
function()
|
|
local player = hero:GetPlayerOwner()
|
|
if not player or not player.cardSystem then
|
|
return nil
|
|
end
|
|
player.cardSystem:TryGrantCard6Level2FreeRerolls()
|
|
local showCount = math.max(
|
|
1,
|
|
math.floor(getCardValueByLevel(
|
|
nil,
|
|
CARD_ID,
|
|
hero,
|
|
"card_show_count",
|
|
3
|
|
))
|
|
)
|
|
player.cardSystem:ShowCardSelection(showCount, "modifier_card_6_bonus_selection")
|
|
self:Destroy()
|
|
return nil
|
|
end
|
|
)
|
|
end
|
|
modifier_card_6 = __TS__Decorate(
|
|
modifier_card_6,
|
|
modifier_card_6,
|
|
{registerModifier(nil)},
|
|
{kind = "class", name = "modifier_card_6"}
|
|
)
|
|
____exports.modifier_card_6 = modifier_card_6
|
|
return ____exports
|