diff --git a/manifest.json b/manifest.json index 72ecc19..fb9db2f 100644 --- a/manifest.json +++ b/manifest.json @@ -17,5 +17,5 @@ "conflicts": [ "Jen" ], - "version": "1.6.9" + "version": "1.6.10" } \ No newline at end of file diff --git a/src/slugcat.lua b/src/slugcat.lua index 17ae33e..9539baa 100644 --- a/src/slugcat.lua +++ b/src/slugcat.lua @@ -387,14 +387,35 @@ SMODS.Joker { cost = Cryptid and 12 or 20, rarity = Cryptid and epic or 4, Bakery_can_use = function(_, card) - return not card.debuff and Jane.can_use() and G.pack_cards and G.pack_cards.cards and next(G.pack_cards.cards) + if card.debuff or not + Jane.can_use() or not + ((G.pack_cards or {}).cards or {})[1] then + return false + end + + local ret = false + + for _, v in pairs(G.pack_cards.cards) do + if v.jane_spearmaster then + return false + elseif ((v.ability or {}).consumeable or {}).hand_type then + ret = true + end + end + + return ret end, Bakery_use_button_text = function() return "USE ALL" end, - Bakery_use_joker = function() + Bakery_use_joker = function(self, card) + if not self:Bakery_can_use(card) then + return + end + local c = G.pack_cards.cards for i = #c, 1, -1 do - if (((c[i] or {}).ability or {}).consumeable or {}).hand_type then + if ((c[i].ability or {}).consumeable or {}).hand_type then + c[i].jane_spearmaster = true c[i]:use_consumeable() SMODS.calculate_context {using_consumeable = true, consumeable = c[i], area = c[i].from_area} c[i]:start_dissolve() @@ -693,8 +714,8 @@ SMODS.Joker { Bakery_can_use = function(_, card) return not card.debuff and Jane.can_use() end, - Bakery_use_joker = function(_, card) - if card.debuff then + Bakery_use_joker = function(self, card) + if not self:Bakery_can_use(card) then return end