SMODS.ConsumableType{
key = 'LTMConsumableType', -- consumable type key
collection_rows = {4,5}, -- amount of cards in one page
primary_colour = G.C.PURPLE, -- first color
secondary_colour = G.C.DARK_EDITION, -- second color
loc_txt = {
collection = 'LTM Cards', -- name displayed in collection
name = 'LTM Cards', -- name displayed in badge
undiscovered = {
name = 'Hidden LTM', -- undiscovered name
text = {'you dont know the', 'playlist id'} -- undiscovered text
}
},
shop_rate = 1, -- rate in shop out of 100
}
SMODS.UndiscoveredSprite{
key = 'LTMConsumableType', -- must be the same key as the consumabletype
atlas = 'Jokers',
pos = {x = 0, y = 0}
}
SMODS.Consumable{
key = 'LTM', -- key
set = 'LTMConsumableType', -- the set of the card: corresponds to a consumable type
atlas = 'Jokers', -- atlas
pos = {x = 1, y = 0}, -- position in atlas
loc_txt = {
name = 'Erics Sword', -- name of card
text = { -- text of card
'This thing seems VERY unstable',
'Apply a random enhancement to up to #1# selected cards',
}
},
config = {
extra = {
cards = 5, -- configurable value
}
},
loc_vars = function(self, info_queue, center)
if center and center.ability and center.ability.extra then
return {vars = {center.ability.extra.cards}}
end
return {vars = {}}
end,
can_use = function(self, card)
if G and G.hand and G.hand.highlighted and card.ability and card.ability.extra and card.ability.extra.cards then
if #G.hand.highlighted > 0 and #G.hand.highlighted <= card.ability.extra.cards then
return true
end
end
return false
end,
use = function(self, card, area, copier)
-- List of possible enhancements
local enhancements = {
G.P_CENTERS.m_bonus, G.P_CENTERS.m_mult, G.P_CENTERS.m_wild, G.P_CENTERS.m_lucky,
G.P_CENTERS.m_glass, G.P_CENTERS.m_steel, G.P_CENTERS.m_stone, G.P_CENTERS.m_gold
}
if G and G.hand and G.hand.highlighted then
for k, v in ipairs(G.hand.highlighted) do
-- Randomly select an enhancement for each card
local random_enhancement = enhancements[math.random(1, #enhancements)]
-- Apply the randomly selected enhancement to the current card
v:set_ability(random_enhancement, nil, true)
-- Trigger the event to juice up the card
G.E_MANAGER:add_event(Event({
func = function()
v:juice_up() -- Calling juice_up on the card
return true
end
}))
end
end
end,
}