Skip to content

Commit fc268f1

Browse files
committed
buttercup related fixes
1 parent 384cb60 commit fc268f1

File tree

2 files changed

+44
-1
lines changed

2 files changed

+44
-1
lines changed

items/spooky.lua

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2045,6 +2045,24 @@ local buttercup = {
20452045
end
20462046
end
20472047
end,
2048+
init = function()
2049+
local start_dissolveref = Card.start_dissolve
2050+
function Card:start_dissolve(...)
2051+
start_dissolveref(self, card)
2052+
if self.config.center.key == "j_cry_buttercup" then
2053+
G.E_MANAGER:add_event(Event({
2054+
func = function()
2055+
for i, v in pairs((self.cry_storage or {}).cards or {}) do
2056+
v.states.visible = false
2057+
v:start_dissolve()
2058+
end
2059+
if self.cry_storage then self.cry_storage:remove() end
2060+
return true
2061+
end
2062+
}))
2063+
end
2064+
end
2065+
end
20482066
}
20492067

20502068
items = {

lib/overrides.lua

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1621,14 +1621,39 @@ function create_card_for_shop(area)
16211621
-- then put its data in `loaded_card_data` and its index in the table in `loaded_card_pos`
16221622
if G.GAME.next_shop_cards and #G.GAME.next_shop_cards > 0 then
16231623
for i, card in ipairs(G.GAME.next_shop_cards) do
1624-
sendInfoMessage(card.cry_from_shop, "next_shop_cards")
16251624
if not card.cry_from_shop then
16261625
card.cry_from_shop = "shop_jokers"
16271626
end -- failsafe :3
16281627
if areas_to_check[card.cry_from_shop] == area and loaded_card_pos == -1 then
16291628
loaded_card_data = card
16301629
loaded_card_pos = i
16311630
break
1631+
elseif areas_to_check[card.cry_from_shop] ~= G.shop_jokers then
1632+
local other_card = Card(
1633+
area.x,
1634+
area.y,
1635+
G.CARD_W,
1636+
G.CARD_H,
1637+
nil,
1638+
G.P_CENTERS.j_jolly,
1639+
{ bypass_discovery_center = true, bypass_discovery_ui = true }
1640+
)
1641+
other_card:load(card, nil)
1642+
other_card.VT.h = other_card.T.h
1643+
table.remove(G.GAME.next_shop_cards, i)
1644+
create_shop_card_ui(other_card, G.P_CENTERS[card.save_fields.center],set, areas_to_check[card.cry_from_shop])
1645+
areas_to_check[card.cry_from_shop]:emplace(other_card)
1646+
other_card.states.visible = false
1647+
G.E_MANAGER:add_event(Event({
1648+
delay = 0.4,
1649+
trigger = "after",
1650+
func = function()
1651+
other_card:start_materialize()
1652+
other_card:set_cost()
1653+
return true
1654+
end,
1655+
}))
1656+
other_card:set_cost()
16321657
end
16331658
end
16341659
end

0 commit comments

Comments
 (0)