balatro-mods/Cryptid/lovely.toml
2025-01-19 15:01:49 +08:00

740 lines
26 KiB
TOML

[manifest]
version = "1.0.0"
dump_lua = true
priority = 0
# Make the splash screen more jolly
# Requires "Custom Main Menu" config to be enabled
[[patches]]
[patches.pattern]
target = "game.lua"
pattern = "SC = Card(G.ROOM.T.w/2 - SC_scale*G.CARD_W/2, 10. + G.ROOM.T.h/2 - SC_scale*G.CARD_H/2, SC_scale*G.CARD_W, SC_scale*G.CARD_H, G.P_CARDS.empty, G.P_CENTERS['j_joker'])"
position = "after"
payload = '''
if Cryptid.enabled["Menu"] then
if Cryptid.enabled["M Jokers"] then
local mcard = {}
for k, _ in pairs(Cryptid.M_jokers) do
if G.P_CENTERS[k] then
mcard[#mcard + 1] = k
end
end
local option = math.random(#mcard)
local chosenoption = mcard[option]
if chosenoption == "j_cry_biggestm" or chosenoption == "j_cry_reverse" then --These don't render properly; replace these with loopy instead
SC = Card(G.ROOM.T.w/2 - SC_scale*G.CARD_W/2, 10. + G.ROOM.T.h/2 - SC_scale*G.CARD_H/2, SC_scale*G.CARD_W, SC_scale*G.CARD_H, G.P_CARDS.empty, G.P_CENTERS['j_cry_loopy'])
else
SC = Card(G.ROOM.T.w/2 - SC_scale*G.CARD_W/2, 10. + G.ROOM.T.h/2 - SC_scale*G.CARD_H/2, SC_scale*G.CARD_W, SC_scale*G.CARD_H, G.P_CARDS.empty, G.P_CENTERS[chosenoption])
end
else
SC = Card(G.ROOM.T.w/2 - SC_scale*G.CARD_W/2, 10. + G.ROOM.T.h/2 - SC_scale*G.CARD_H/2, SC_scale*G.CARD_W, SC_scale*G.CARD_H, G.P_CARDS.empty, G.P_CENTERS['j_jolly'])
end
end
'''
match_indent = true
# Make cards in splash screen CCD cards
# Requires "Custom Main Menu" config to be enabled
[[patches]]
[patches.pattern]
target = "game.lua"
pattern = "if math.random() > 0.8 then card.sprite_facing = 'back'; card.facing = 'back' end"
position = "before"
payload = '''
if Cryptid.enabled["Menu"] then card:set_ability(get_random_consumable('cry_splash',{"no_grc"},nil,nil,true), true, nil) end
'''
match_indent = true
# Show Glitched Edition to confirm Cryptid is Active
[[patches]]
[patches.pattern]
target = "game.lua"
pattern = "replace_card.states.visible = false"
position = "before"
payload = "replace_card:set_edition(G.P_CENTERS.e_cry_glitched and 'e_cry_glitched' or 'e_negative',true,true)"
match_indent = true
# Patch related crash
[[patches]]
[patches.pattern]
target = "card.lua"
pattern = "if not initial then G.GAME.blind:debuff_card(self) end"
position = "at"
payload = "if not initial and G.GAME and G.GAME.blind then G.GAME.blind:debuff_card(self) end"
match_indent = true
# Draw midground layer
[[patches]]
[patches.pattern]
target = "card.lua"
pattern = "if self.config.center.soul_pos and (self.config.center.discovered or self.bypass_discovery_center) then"
position = "after"
payload = '''
if self.config.center.soul_pos and self.config.center.soul_pos.extra and (self.config.center.discovered or self.bypass_discovery_center) then
local scale_mod = 0.07-- + 0.02*math.cos(1.8*G.TIMERS.REAL) + 0.00*math.cos((G.TIMERS.REAL - math.floor(G.TIMERS.REAL))*math.pi*14)*(1 - (G.TIMERS.REAL - math.floor(G.TIMERS.REAL)))^3
local rotate_mod = 0--0.05*math.cos(1.219*G.TIMERS.REAL) + 0.00*math.cos((G.TIMERS.REAL)*math.pi*5)*(1 - (G.TIMERS.REAL - math.floor(G.TIMERS.REAL)))^2
self.children.floating_sprite2:draw_shader('dissolve',0, nil, nil, self.children.center,scale_mod, rotate_mod,nil, 0.1--[[ + 0.03*math.cos(1.8*G.TIMERS.REAL)--]],nil, 0.6)
self.children.floating_sprite2:draw_shader('dissolve', nil, nil, nil, self.children.center, scale_mod, rotate_mod)
end
'''
match_indent = true
[[patches]]
[patches.pattern]
target = "card.lua"
pattern = '''if k ~= 'focused_ui' and k ~= "front" and k ~= "back" and k ~= "soul_parts" and k ~= "center" and k ~= 'floating_sprite' and k~= "shadow" and k~= "use_button" and k ~= 'buy_button' and k ~= 'buy_and_use_button' and k~= "debuff" and k ~= 'price' and k~= 'particles' and k ~= 'h_popup' then v:draw() end'''
position = "at"
payload = '''if k ~= 'focused_ui' and k ~= "front" and k ~= "back" and k ~= "soul_parts" and k ~= "center" and k ~= 'floating_sprite' and k ~= 'floating_sprite2' and k~= "shadow" and k~= "use_button" and k ~= 'buy_button' and k ~= 'buy_and_use_button' and k~= "debuff" and k ~= 'price' and k~= 'particles' and k ~= 'h_popup' then v:draw() end'''
match_indent = true
# Custom variables in info queue
[[patches]]
[patches.pattern]
target = "functions/common_events.lua"
pattern = "function generate_card_ui(_c, full_UI_table, specific_vars, card_type, badges, hide_desc, main_start, main_end)"
position = "after"
payload = "if _c.specific_vars then specific_vars = _c.specific_vars end"
match_indent = true
# Fix not all cards returning to hand on big hands
[[patches]]
[patches.pattern]
target = "game.lua"
pattern = "{card_limit = 500, type = 'discard'})"
position = "at"
payload = "{card_limit = 1e308, type = 'discard'})"
match_indent = true
# When hand size exceeds deck size, space the cards as if the hand size was equal to the deck size
[[patches]]
[patches.pattern]
target = "cardarea.lua"
pattern = "function CardArea:align_cards()"
position = "after"
payload = '''
if self.config.type == 'hand' then
self.config.temp_limit = math.min(self.config.card_limit, #G.playing_cards)
end
'''
match_indent = true
# Crash fix
[[patches]]
[patches.pattern]
target = "functions/button_callbacks.lua"
pattern = "if not G.SAVED_GAME.VERSION or G.SAVED_GAME.VERSION < '0.9.2' then"
position = "at"
payload = "if not G.SAVED_GAME or not G.SAVED_GAME.VERSION or G.SAVED_GAME.VERSION < '0.9.2' then"
match_indent = true
# Register banned bosses for rush hour
[[patches]]
[patches.pattern]
target = "game.lua"
pattern = "set_profile_progress()"
position = "before"
payload = '''
for i = 1, #G.CHALLENGES do
if (G.CHALLENGES[i].id == 'c_cry_rush_hour' or G.CHALLENGES[i].id == 'c_cry_rush_hour_ii' or G.CHALLENGES[i].id == 'c_cry_rush_hour_iii') and #G.CHALLENGES[i].restrictions.banned_other == 0 then
for k, v in pairs(G.P_BLINDS) do
if k ~= "bl_cry_clock" and k ~= "bl_cry_lavender_loop" and v.boss then
G.CHALLENGES[i].restrictions.banned_other[#G.CHALLENGES[i].restrictions.banned_other+1] = {id = k, type = 'blind'}
end
end
end
end
'''
match_indent = true
# Apply booster pack edition and stickers to contents - by Jen Walter
[[patches]]
[patches.pattern]
target = "card.lua"
pattern = "card.T.x = self.T.x"
position = "before"
payload = '''
local edi = self.edition or {}
if edi.type and not self.ability.name:find('Standard') then
if card.ability.name ~= "cry-meteor"
and card.ability.name ~= "cry-exoplanet"
and card.ability.name ~= "cry-stardust" then
card:set_edition({[edi.type] = true})
end
end
if self.ability.eternal then
card.ability.eternal = self.ability.eternal
end
if self.ability.perishable then
card.ability.perishable = self.ability.perishable
end
if self.ability.rental then
card.ability.rental = self.ability.rental
end
if self.pinned then
card.pinned = self.pinned
end
if self.ability.banana then
card.ability.banana = self.ability.banana
end
'''
match_indent = true
# catch edition code in standard pack to avoid reapplying edition (HORRIBLE)
[[patches]]
[patches.regex]
target = "card.lua"
pattern = '''local edition \= poll_edition\('standard_edition'\.\.G.GAME\.round_resets\.ante, edition_rate, true\)\n\s+card\:set_edition\(edition\)'''
position = "at"
payload = '''
local edi = self.edition or {}
if edi.type and not (G.GAME.modifiers.cry_force_edition and G.GAME.modifiers.cry_force_edition ~= 'random') then
card:set_edition({[edi.type] = true})
elseif not G.GAME.modifiers.cry_force_random_edition then
local edition = poll_edition('standard_edition'..G.GAME.round_resets.ante, edition_rate, true)
card:set_edition(edition)
end
'''
# Edition + sticker forcing on vouchers (editions are just funny cost increases)
[[patches]]
[patches.pattern]
target = "game.lua"
pattern = "G.shop_vouchers:emplace(card)"
position = "before"
payload = '''
if G.GAME.current_round.cry_voucher_edition then
card:set_edition(G.GAME.current_round.cry_voucher_edition, true, true)
end
if G.GAME.current_round.cry_voucher_stickers then
if G.GAME.current_round.cry_voucher_stickers.eternal == true then -- this is dumb but i'm not sure how to call functions from a string
card:set_eternal(true)
card.ability.eternal = true
end
if G.GAME.current_round.cry_voucher_stickers.perishable == true then
card.ability.perishable = true
end
if G.GAME.current_round.cry_voucher_stickers.rental == true then
card:set_rental(true)
card.ability.rental = true
end
if G.GAME.current_round.cry_voucher_stickers.pinned == true then
card.pinned = true
end
if G.GAME.current_round.cry_voucher_stickers.banana == true then
card.ability.banana = true
end
end
'''
match_indent = true
# don't forget voucher tags
[[patches]]
[patches.pattern]
target = "tag.lua"
pattern = "G.shop_vouchers:emplace(card)"
position = "before"
payload = '''
if G.GAME.modifiers.cry_force_edition and not G.GAME.modifiers.cry_force_random_edition then
card:set_edition(nil, true)
elseif G.GAME.modifiers.cry_force_random_edition then
local edition = cry_poll_random_edition()
card:set_edition(edition, true)
end
if G.GAME.modifiers.cry_force_sticker == 'eternal' or G.GAME.modifiers.cry_sticker_sheet_plus then
card:set_eternal(true)
card.ability.eternal = true
end
if G.GAME.modifiers.cry_force_sticker == 'perishable' or G.GAME.modifiers.cry_sticker_sheet_plus then
card:set_perishable(true)
card.ability.perishable = true
end
if G.GAME.modifiers.cry_force_sticker == 'rental' or G.GAME.modifiers.cry_sticker_sheet_plus then
card:set_rental(true)
card.ability.rental = true
end
if G.GAME.modifiers.cry_force_sticker == 'pinned' or G.GAME.modifiers.cry_sticker_sheet_plus then
card.pinned = true
end
if G.GAME.modifiers.cry_force_sticker == 'banana' or G.GAME.modifiers.cry_sticker_sheet_plus then
card.ability.banana = true
end
if G.GAME.modifiers.cry_sticker_sheet_plus then
for k, v in pairs(SMODS.Stickers) do
if v.apply and not v.no_sticker_sheet then v:apply(card, true) end
end
end
'''
match_indent = true
# show owned vouchers
[[patches]]
[patches.pattern]
target = "functions/UI_definitions.lua"
pattern = "if G.GAME.used_vouchers[v.key] then"
position = "after"
payload = '''
if not G.GAME.cry_owned_vouchers[v.key] then
G.GAME.cry_owned_vouchers[v.key] = G.GAME.used_vouchers[v.key]
end
end
if G.GAME.cry_owned_vouchers[v.key] then
'''
match_indent = true
# show in voucher menu
[[patches]]
[patches.pattern]
target = "functions/UI_definitions.lua"
pattern = "voucher_areas[#voucher_areas]:emplace(card)"
position = "before"
payload = '''
if G.GAME.voucher_edition_index[card.ability.name] then -- i just made it a function so i can look at it less
local edition = cry_edition_to_table(G.GAME.voucher_edition_index[card.ability.name])
if edition then
card:set_edition(edition, true, true)
end
end
if G.GAME.voucher_sticker_index.eternal[card.ability.name] then
card:set_eternal(true)
card.ability.eternal = true
end
if G.GAME.voucher_sticker_index.perishable[card.ability.name] then
card:set_perishable(true)
card.ability.perish_tally = G.GAME.voucher_sticker_index.perishable[card.ability.name]
card.ability.perishable = true
if G.GAME.voucher_sticker_index.perishable[card.ability.name] == 0 then
card.debuff = true
end
end
if G.GAME.voucher_sticker_index.rental[card.ability.name] then
card:set_rental(true)
card.ability.rental = true
end
if G.GAME.voucher_sticker_index.pinned[card.ability.name] then
card.pinned = true
end
if G.GAME.voucher_sticker_index.banana[card.ability.name] then
card.ability.banana = true
end
card.ability.extra = G.GAME.cry_voucher_centers[card.config.center_key].config.extra
if card.ability.extra_disp then card.ability.extra_disp = G.GAME.cry_voucher_centers[card.config.center_key].config.extra_disp end
'''
match_indent = true
# sticker tagging
[[patches]]
[patches.pattern]
target = "card.lua"
pattern = "if center_table.name == 'Overstock' or center_table.name == 'Overstock Plus' then"
position = "before"
payload = '''
if not G.GAME.voucher_edition_index then G.GAME.voucher_edition_index = {} end
if self and self.edition then
G.GAME.voucher_edition_index[center_table.name] = self.edition.type
end
if not G.GAME.voucher_sticker_index then G.GAME.voucher_sticker_index = {eternal = {}, perishable = {}, rental = {}, pinned = {}, banana = {}} end
if self and self.ability and self.ability.eternal and self.ability.eternal == true then
G.GAME.voucher_sticker_index.eternal[center_table.name] = true
end
if self and self.ability and self.ability.perishable and self.ability.perishable == true then
G.GAME.voucher_sticker_index.perishable[center_table.name] = G.GAME.cry_voucher_perishable_rounds
end
if self and self.ability and self.ability.rental and self.ability.rental == true then
G.GAME.voucher_sticker_index.rental[center_table.name] = true
end
if self and self.pinned and self.pinned == true then
G.GAME.voucher_sticker_index.pinned[center_table.name] = true
end
if self and self.ability and self.ability.banana and self.ability.banana == true then
G.GAME.voucher_sticker_index.banana[center_table.name] = true
end
'''
match_indent = true
# apply end of round stuff
[[patches]]
[patches.pattern]
target = "functions/state_events.lua"
pattern = "if G.GAME.round_resets.ante == G.GAME.win_ante and G.GAME.blind:get_type() == 'Boss' then"
position = "before"
payload = '''
if G.GAME.voucher_sticker_index then
if G.GAME.voucher_sticker_index.perishable then
for k, v in pairs(G.GAME.voucher_sticker_index.perishable) do
if v > 1 then
G.GAME.voucher_sticker_index.perishable[k] = v - 1
end
if v == 1 then
G.GAME.voucher_sticker_index.perishable[k] = v - 1
for kk, vv in pairs(G.P_CENTERS) do
if k == vv.name then
cry_debuff_voucher(kk)
G.GAME.used_vouchers.vv = nil
G.GAME.used_vouchers[kk] = nil
break
end
end
end
end
end
if G.GAME.voucher_sticker_index.rental then
local cumulative_rental = 0
for k, v in pairs(G.GAME.voucher_sticker_index.rental) do
cumulative_rental = cumulative_rental + G.GAME.cry_voucher_rental_rate
end
if cumulative_rental > 0 then
G.E_MANAGER:add_event(Event({
trigger = 'immediate',
blocking = false,
blockable = false,
func = (function()
ease_dollars(-cumulative_rental)
return true
end)}))
end
end
if G.GAME.voucher_sticker_index.banana then -- i'm pretty sure unredeem breaks if spectrals are disabled? unsure though
local voucher_queue = {}
local current_round_voucher=G.GAME.current_round.voucher
for k, v in pairs(G.GAME.voucher_sticker_index.banana) do
if (pseudorandom('byebyevoucher') < G.GAME.probabilities.normal/G.GAME.cry_voucher_banana_odds) then
area = G.play
local unredeemed_voucher = ''
for kk, vv in pairs(G.P_CENTERS) do
if k == vv.name then
unredeemed_voucher = kk
break
end
end
local card = create_card('Voucher', area, nil, nil, nil, nil, unredeemed_voucher)
if G.GAME.voucher_edition_index[card.ability.name] then -- i made this bullshit a function
local edition = cry_edition_to_table(G.GAME.voucher_edition_index[card.ability.name])
if edition then
card:set_edition(edition, true, true)
end
end
if G.GAME.voucher_sticker_index.eternal[card.ability.name] then
card:set_eternal(true)
card.ability.eternal = true
end
if G.GAME.voucher_sticker_index.perishable[card.ability.name] then
card:set_perishable(true)
card.ability.perish_tally = G.GAME.voucher_sticker_index.perishable[card.ability.name]
card.ability.perishable = true
if G.GAME.voucher_sticker_index.perishable[card.ability.name] == 0 then
card.debuff = true
end
end
if G.GAME.voucher_sticker_index.rental[card.ability.name] then
card:set_rental(true)
card.ability.rental = true
end
if G.GAME.voucher_sticker_index.pinned[card.ability.name] then
card.pinned = true
end
if G.GAME.voucher_sticker_index.banana[card.ability.name] then
card.ability.banana = true
end
card:start_materialize()
area:emplace(card)
card.cost=0
card.shop_voucher=false
voucher_queue[#voucher_queue+1] = card
end
end
for k, v in pairs(voucher_queue) do
v:unredeem()
G.E_MANAGER:add_event(Event({
trigger = 'after',
delay = 0,
func = function()
v:start_dissolve()
return true
end}))
end
G.GAME.current_round.voucher=current_round_voucher
end
end
'''
match_indent = true
# Affect booster packs
[[patches]]
[patches.pattern]
target = "game.lua"
pattern = "G.shop_booster:emplace(card)"
position = "before"
payload = '''
if G.GAME.modifiers.cry_force_edition and not G.GAME.modifiers.cry_force_random_edition then
card:set_edition(nil, true, true)
elseif G.GAME.modifiers.cry_force_random_edition then
local edition = cry_poll_random_edition()
card:set_edition(edition, true, true)
end
local eternal_perishable_poll = pseudorandom('cry_bpet'..(key_append or '')..G.GAME.round_resets.ante)
if (G.GAME.modifiers.cry_force_sticker == 'eternal') or (G.GAME.modifiers.cry_sticker_sheet_plus) or (G.GAME.modifiers.cry_any_stickers and (G.GAME.modifiers.enable_eternals_in_shop and eternal_perishable_poll > 0.8)) then
card:set_eternal(true)
card.ability.eternal = true
end
if G.GAME.modifiers.enable_perishables_in_shop and G.GAME.modifiers.cry_any_stickers then -- i don't feel like messing with this, whatever
if not G.GAME.modifiers.cry_eternal_perishable_compat and ((eternal_perishable_poll > 0.6) and (eternal_perishable_poll <= 0.8)) then
card:set_perishable(true)
card.ability.perishable = true
end
if G.GAME.modifiers.cry_eternal_perishable_compat and pseudorandom('cry_bpper'..(key_append or '')..G.GAME.round_resets.ante) > 0.8 then
card:set_perishable(true)
card.ability.perishable = true
end
end
if (G.GAME.modifiers.cry_force_sticker == 'perishable') or (G.GAME.modifiers.cry_sticker_sheet_plus) then
card:set_perishable(true)
card.ability.perishable = true
end
if (G.GAME.modifiers.cry_force_sticker == 'rental') or (G.GAME.modifiers.cry_sticker_sheet_plus) or (G.GAME.modifiers.cry_any_stickers and (G.GAME.modifiers.enable_rentals_in_shop and pseudorandom('cry_bpssjr'..(key_append or '')..G.GAME.round_resets.ante) > 0.8)) then -- i should really just make this a function? so messy
card.ability.rental = true -- do not set_rental here to prevent cost from decreasing
end
if (G.GAME.modifiers.cry_force_sticker == 'pinned') or (G.GAME.modifiers.cry_sticker_sheet_plus) or (G.GAME.modifiers.cry_any_stickers and (G.GAME.modifiers.cry_enable_pinned_in_shop and pseudorandom('cry_bppin'..(key_append or '')..G.GAME.round_resets.ante) > 0.8)) then
card.pinned = true
end
if G.GAME.modifiers.cry_force_sticker == 'banana' or G.GAME.modifiers.cry_sticker_sheet_plus then
card.ability.banana = true
end
if not G.GAME.modifiers.cry_eternal_perishable_compat and G.GAME.modifiers.enable_banana and G.GAME.modifiers.cry_any_stickers and (pseudorandom('cry_bpbanana'..(key_append or '')..G.GAME.round_resets.ante) > 0.8) and (eternal_perishable_poll <= 0.8) then
card.ability.banana = true
end
if G.GAME.modifiers.cry_eternal_perishable_compat and G.GAME.modifiers.enable_banana and G.GAME.modifiers.cry_any_stickers and (pseudorandom('cry_bpbanana'..(key_append or '')..G.GAME.round_resets.ante) > 0.8) then
card.ability.banana = true
end
if G.GAME.modifiers.cry_sticker_sheet_plus then
for k, v in pairs(SMODS.Stickers) do
if v.apply and not v.no_sticker_sheet then v:apply(card, true) end
end
end
'''
match_indent = true
# world's first actually good multi-patch
[[patches]]
[patches.pattern]
target = "tag.lua"
pattern = "card:start_materialize()"
position = "before"
payload = '''
if G.GAME.modifiers.cry_force_edition and not G.GAME.modifiers.cry_force_random_edition then
card:set_edition(nil, true, true)
elseif G.GAME.modifiers.cry_force_random_edition then
local edition = cry_poll_random_edition()
card:set_edition(edition, true, true)
end
'''
match_indent = true
# Prevent Jokers from spitting empty messages
[[patches]]
[patches.pattern]
target = "functions/common_events.lua"
pattern = "text = extra.message or text"
position = "after"
payload = "if not text or text == '' then return end"
match_indent = true
# Add default pool value for Consumeables
[[patches]]
[patches.pattern]
target = "functions/common_events.lua"
pattern = 'else _pool[#_pool + 1] = "j_joker"'
position = "before"
payload = '''elseif _type == 'Consumeables' then _pool[#_pool + 1] = "c_ceres"'''
match_indent = true
# make the cat tag meow (can probably do this without injecting?)
[[patches]]
[patches.pattern]
target = "tag.lua"
pattern = '''play_sound('tarot2', math.random()*0.1 + 0.55, 0.09)'''
position = "before"
payload = '''if self.key == 'tag_cry_cat' then
local rand = math.random(4)
play_sound('cry_meow'..rand, 1.26, 0.25)
end
'''
match_indent = true
# hi it's me toneblock and i'm being stupid again! (Game:update inject)
[[patches]]
[patches.pattern]
target = "game.lua"
pattern = '''if G.FILE_HANDLER and G.FILE_HANDLER and G.FILE_HANDLER.update_queued and ('''
position = "before"
payload = '''
if not GLOBAL_cry_member_count_delay then GLOBAL_cry_member_count_delay = 0 end
if (GLOBAL_cry_member_count_delay > 5) or not GLOBAL_cry_member_count then -- it doesn't need to update this frequently? but it also doesn't need to be higher tbh...
if update_cry_member_count then update_cry_member_count() end -- i honestly hate nil checks like this, wish there was a shorthand
GLOBAL_cry_member_count_delay = 0
else
GLOBAL_cry_member_count_delay = GLOBAL_cry_member_count_delay + dt
end
'''
match_indent = true
# call update_cry_member_count() whenever the collection is opened to ensure it updates properly on title collection if it can (better than running it on loc_vars)
# it's not computationally intense at all, so whatever
[[patches]]
[patches.pattern]
target = "functions/button_callbacks.lua"
pattern = '''G.FUNCS.your_collection = function(e)'''
position = "after"
payload = '''
if update_cry_member_count then update_cry_member_count() end
'''
match_indent = true
# notice if https is disabled (by default)
# also does some other things since this is patching in the same spot
[[patches]]
[patches.pattern]
target = "functions/common_events.lua"
pattern = "if _c.set == 'Other' then"
position = "before"
payload = '''
if _c.name == 'cry-membershipcard' or _c.name == 'cry-membershipcardtwo' then
if not Cryptid.enabled["HTTPS Module"] then
if G.localization.descriptions.Other.cry_https_disabled then
main_end = {}
localize{type = 'other', key = 'cry_https_disabled', nodes = main_end, vars = {}}
main_end = main_end[1]
end
end
end
if _c.name == 'cry-translucent Joker' then
if G.jokers and G.jokers.cards then
for k, v in ipairs(G.jokers.cards) do
if (v.edition and v.edition.negative) and (G.localization.descriptions.Other.remove_negative)then
main_end = {}
localize{type = 'other', key = 'remove_negative', nodes = main_end, vars = {}}
main_end = main_end[1]
break
end
end
end
end
if _c.name == 'cry-blurred Joker' then
if (SMODS.Mods["sdm0sstuff"] or {}).can_load then
if G.localization.descriptions.Other.blurred_sdm0 then
main_end = {}
localize{type = 'other', key = 'blurred_sdm0', nodes = main_end, vars = {}}
main_end = main_end[1]
end
end
end
'''
match_indent = true
# hand size forgiveness if playing negative or antimatter deck (someone please fix)
[[patches]]
[patches.pattern]
target = "game.lua"
pattern = "function Game:update_draw_to_hand(dt)"
position = "after"
payload = '''
if G.GAME.selected_back and (G.GAME.selected_back.name == 'cry--Negative Deck' or G.GAME.selected_back.name == 'cry-Antimatter') and G.hand.config.card_limit <= 0 then -- 'cry--Negative Deck'... sure
G.hand.config.card_limit = 1
end
'''
match_indent = true
# don't draw old perishable texture
[[patches]]
[patches.pattern]
target = "card.lua"
pattern = '''if self.ability.perishable then'''
position = "at"
payload = '''if self.ability.perishable and not layer then'''
match_indent = true
# init Cryptid global through lovely
# so other mods can add things to memepack pool
[[patches]]
[patches.pattern]
target = "main.lua"
pattern = '''function love.load()'''
position = "before"
payload = '''
Cryptid = {}
Cryptid.memepack = {}
Cryptid.aliases = {}
Cryptid.food = {}
Cryptid.M_jokers = {}
Cryptid.Megavouchers = {}
'''
match_indent = true
# Adds cry_creating_card event
[[patches]]
[patches.pattern]
target = "functions/common_events.lua"
pattern = '''
check_for_unlock({type = 'have_edition'})
end
'''
position = "after"
payload = '''
for i = 1, #G.jokers.cards do
G.jokers.cards[i]:calculate_joker({cry_creating_card = true, card = card})
end
'''
match_indent = true
# Adds cry_debuff_immune card modifier
[[patches]]
[patches.pattern]
target = "card.lua"
pattern = 'if self.ability and self.ability.perma_debuff then self.debuff = true end'
position = "after"
payload = '''
if self.cry_debuff_immune then
self.debuff = false
end
'''
match_indent = true
# Removes cry_debuff_immune at the end of the round
[[patches]]
[patches.pattern]
target = "functions/state_events.lua"
pattern = 'for i = 1, #G.jokers.cards do'
position = "before"
payload = '''
for i = 1, #G.playing_cards do
local CARD = G.playing_cards[i]
CARD.cry_debuff_immune = false
end
'''
match_indent = true
# Joker Sell List
[[patches]]
[patches.pattern]
target = "card.lua"
pattern = 'self:calculate_joker{selling_self = true}'
position = "before"
payload = '''
if self.config.center.set == 'Joker' then
if G.GAME.jokers_sold then
local contained = false
for i = 1, #G.GAME.jokers_sold do
if self.config.center.key == G.GAME.jokers_sold[i] then contained = true end
end
if not contained then table.insert(G.GAME.jokers_sold, self.config.center.key) end
else
G.GAME.jokers_sold = {self.config.center.key}
end
end
'''
match_indent = true