
[manifest]
version = "1.0.0"
dump_lua = true
priority = 0





#Debuff functionality
[[patches]]
[patches.pattern]
target = "card.lua"
pattern = '''
if self.ability.perishable and self.ability.perish_tally <= 0 then 
    if not self.debuff then
        self.debuff = true
        if self.area == G.jokers then self:remove_from_deck(true) end
    end
    return
end
'''
position = "after"
payload = '''
if next(find_joker("Commander Vantas")) and self.ability.name == "Wild Card" then should_debuff = false end
'''
match_indent = true

#Negative bonus chips UI
[[patches]]
[patches.pattern]
target = "card.lua"
pattern = '''
                    bonus_chips = (self.ability.bonus + (self.ability.perma_bonus or 0)) > 0 and (self.ability.bonus + (self.ability.perma_bonus or 0)) or nil,
'''
position = "at"
payload = '''
                    bonus_chips = (self.ability.bonus + (self.ability.perma_bonus or 0)) ~= 0 and (self.ability.bonus + (self.ability.perma_bonus or 0)) or nil,
'''
match_indent = true


# Pack Size Bonus
[[patches]]
[patches.pattern]
target = "card.lua"
pattern = "local _size = self.ability.extra"
position = "at"
match_indent = true
payload = '''
local _size = self.ability.extra + G.GAME.BALATROSTUCK.pack_size_bonus
'''

[[patches]]
[patches.pattern]
target = "card.lua"
pattern = "G.GAME.pack_choices = self.config.center.config.choose or 1"
position = "before"
match_indent = true
payload = '''
G.GAME.pack_size = math.min(G.GAME.pack_size + G.GAME.BALATROSTUCK.pack_size_bonus,5)
'''

[[patches]]
[patches.pattern]
target = "card.lua"
pattern = 'function Card:set_debuff(should_debuff)'
position = "after"
payload = '''
if next(find_joker("Commander Vantas")) and self.playing_card then
    local hasWild = false
    for k, v in pairs(G.playing_cards) do
        if v.config.center == G.P_CENTERS.m_wild then 
            hasWild = true
            break
        end
    end
    if hasWild then should_debuff = false end
end
'''
match_indent = true
times = 1

[[patches]]
[patches.pattern]
target = "card.lua"
pattern = 'function Card:is_suit(suit, bypass_debuff, flush_calc)'
position = "after"
payload = '''
if next(find_joker("Innapropriate Bucket")) then
    if (self.base.suit == G.GAME.BALATROSTUCK.bucket_suits[1] and suit == G.GAME.BALATROSTUCK.bucket_suits[2]) or (suit == G.GAME.BALATROSTUCK.bucket_suits[1] and self.base.suit == G.GAME.BALATROSTUCK.bucket_suits[2]) then
        return true
    end
end
'''
match_indent = true
times = 1

[[patches]]
[patches.pattern]
target = "game.lua"
pattern = 'joker_max = 2,'
position = "after"
payload = '''
booster_max = 2,
'''
match_indent = true
times = 1

[[patches]]
[patches.pattern]
target = "functions/UI_definitions.lua"
pattern = '''{card_limit = 2, type = 'shop', highlight_limit = 1, card_w = 1.27*G.CARD_W})'''
position = "at"
payload = '''
{card_limit = G.GAME.shop.booster_max, type = 'shop', highlight_limit = 1, card_w = 1.27*G.CARD_W})
'''
match_indent = true
times = 1

[[patches]]
[patches.pattern]
target = "game.lua"
pattern = '''for i = 1, 2 do'''
position = "at"
payload = '''
for i = 1, G.GAME.shop.booster_max - #G.shop_booster.cards do
'''
match_indent = true
times = 1



