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

57 lines
2.2 KiB
TOML

[manifest]
version = "1.0.0"
dump_lua = true
priority = 0
# Misprint-like description
[[patches]]
[patches.pattern]
target = "card.lua"
pattern = "elseif self.ability.name == 'Misprint' then"
position = "before"
payload = '''
elseif self.ability.name == 'cry-Error' then
if G.GAME and G.GAME.pseudorandom and G.STAGE == G.STAGES.RUN then
cry_error_msgs[#cry_error_msgs].string = "%%" .. predict_card_for_shop()
else
cry_error_msgs[#cry_error_msgs].string = "%%J6"
end
main_start = {
{n=G.UIT.O, config={object = DynaText({string = cry_error_operators, colours = {G.C.DARK_EDITION,},pop_in_rate = 9999999, silent = true, random_element = true, pop_delay = 0.30, scale = 0.32, min_cycle_time = 0})}},
{n=G.UIT.O, config={object = DynaText({string = cry_error_numbers, colours = {G.C.DARK_EDITION,},pop_in_rate = 9999999, silent = true, random_element = true, pop_delay = 0.33, scale = 0.32, min_cycle_time = 0})}},
{n=G.UIT.O, config={object = DynaText({string = cry_error_msgs,
colours = {G.C.UI.TEXT_DARK},pop_in_rate = 9999999, silent = true, random_element = true, pop_delay = 0.4011, scale = 0.32, min_cycle_time = 0})}},
}
'''
match_indent = true
# Patch get_current_pool to predict for ERROR desc
# There's also a consumable rarity patch I should do but don't feel like overriding SMODS right now
## Note this breaks one of the regexs for SMODS.Rarity
# [[patches]]
# [patches.pattern]
# target = "functions/common_events.lua"
# pattern = "local rarity = _rarity or pseudorandom('rarity'..G.GAME.round_resets.ante..(_append or ''))"
# position = "at"
# payload = "local rarity = _rarity or pseudorandom(_G[gcparea == 'ERROR' and 'predict_pseudoseed' or 'pseudoseed']('rarity'..G.GAME.round_resets.ante..(_append or '')))"
# match_indent = true
[[patches]]
[patches.pattern]
target = "card.lua"
pattern = "local main_start, main_end = nil,nil"
position = "after"
payload = '''
if self.ability.name == 'cry-Machine Code' then
--"Create a random // glitched consumable"
main_start = {
randomchar(codechars6),
randomchar(codechars6),
randomchar(codechars6),
randomchar(codechars6),
randomchar(codechars6),
randomchar(codechars6),
}
end
'''
match_indent = true