Skip to content

Commit 1b06dba

Browse files
committed
fix buying nostalgic deck and statue
1 parent 0476ca3 commit 1b06dba

File tree

3 files changed

+17
-9
lines changed

3 files changed

+17
-9
lines changed

items/inversions/reverse_tarots.lua

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -264,17 +264,17 @@ local statue = {
264264
pos = {x=3,y=1},
265265
use = function(self, card2)
266266
local cards = Entropy.GetHighlightedCards({G.hand}, card)
267-
Entropy.FlipThen(cards, function(card)
268-
card:set_ability(G.P_CENTERS.m_stone)
269-
card:set_edition()
270-
card.seal = nil
271-
end)
272267
G.E_MANAGER:add_event(Event({
273268
func = function()
274269
for i = 1, card2.ability.convert_per do
275270
local card3 = pseudorandom_element(G.deck.cards, pseudoseed("statue"))
276271
copy_card(#cards == 1 and cards[1] or pseudorandom_element(cards, pseudoseed("statue")), card3)
277272
end
273+
Entropy.FlipThen(cards, function(card)
274+
card:set_ability(G.P_CENTERS.m_stone)
275+
card:set_edition()
276+
card.seal = nil
277+
end)
278278
return true
279279
end
280280
}))

lib/hooks.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -576,15 +576,15 @@ G.FUNCS.buy_deckorsleeve = function(e)
576576
local count = G.consumeables.config.card_limit
577577
local cards = {}
578578
for i, v in pairs(G.jokers.cards) do
579-
v:remove_from_deck()
580-
G.jokers:remove_card(v)
581579
cards[#cards+1]=v
582580
end
583581
for i, v in pairs(G.consumeables.cards) do
584-
v:remove_from_deck()
585-
G.consumeables:remove_card(v)
586582
cards[#cards+1]=v
587583
end
584+
for i, v in pairs(cards) do
585+
v.area:remove_card(v)
586+
v:remove_from_deck()
587+
end
588588
G.consumeables:remove()
589589
count = count + G.jokers.config.card_limit
590590
G.jokers:remove()

lib/utils.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -713,4 +713,12 @@ end
713713
function Entropy.CanEeSpawn()
714714
if MP and MP.LOBBY then return false end
715715
return true
716+
end
717+
718+
function Entropy.stringsplit(s)
719+
local tbl = {}
720+
for i = 1, #s do
721+
tbl[#tbl+1]=s:sub(i,i)
722+
end
723+
return tbl
716724
end

0 commit comments

Comments
 (0)