#want this to give copy of last used
1 messages · Page 1 of 1 (latest)
hover over the yellow squiggles and fix the issues it has first
that'll probably get you some answers to what the problems are
the thing is, this code gives random tarot _planet
want to modify it to make it give last used one
oh, I understand now
i thought about coping **the fool **cade and applying it here
local fool_c = G.GAME.last_tarot_planet and G.P_CENTERS[G.GAME.last_tarot_planet] or nil
local last_tarot_planet = fool_c and localize { type = 'name_text', key = fool_c.key, set = fool_c.set } or
localize('k_none')
local colour = (not fool_c or fool_c.name == 'The Fool') and G.C.RED or G.C.GREEN
if not (not fool_c or fool_c.name == 'The Fool') then
info_queue[#info_queue + 1] = fool_c
end```
use = function(self, card, area, copier)
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0.4,
func = function()
if G.consumeables.config.card_limit > #G.consumeables.cards then
play_sound('timpani')
SMODS.add_card({ key = G.GAME.last_tarot_planet })
card:juice_up(0.3, 0.5)
end
return true
end
}))
delay(0.6)
end,
can_use = function(self, card)
return G.consumeables.config.card_limit > #G.consumeables.cards and G.GAME.last_tarot_planet ~= nil
end```
but not sure
I think literally all you need is SMODS.add_card({ key = G.GAME.last_tarot_planet })
will try that
that worked