diff --git a/assets/1x/atlasone.png b/assets/1x/atlasone.png index c743cfd14..c3503b1ee 100644 Binary files a/assets/1x/atlasone.png and b/assets/1x/atlasone.png differ diff --git a/assets/1x/shinyc.png b/assets/1x/shinyc.png new file mode 100644 index 000000000..79e02711f Binary files /dev/null and b/assets/1x/shinyc.png differ diff --git a/assets/1x/shinyv.png b/assets/1x/shinyv.png new file mode 100644 index 000000000..2e307298a Binary files /dev/null and b/assets/1x/shinyv.png differ diff --git a/assets/2x/atlasone.png b/assets/2x/atlasone.png index f21c339c1..1d058fe50 100644 Binary files a/assets/2x/atlasone.png and b/assets/2x/atlasone.png differ diff --git a/assets/2x/shinyc.png b/assets/2x/shinyc.png new file mode 100644 index 000000000..2515d04b1 Binary files /dev/null and b/assets/2x/shinyc.png differ diff --git a/assets/2x/shinyv.png b/assets/2x/shinyv.png new file mode 100644 index 000000000..e13b22ab9 Binary files /dev/null and b/assets/2x/shinyv.png differ diff --git a/items/code.lua b/items/code.lua index 6a86f8887..615e45e59 100644 --- a/items/code.lua +++ b/items/code.lua @@ -2844,6 +2844,7 @@ local rework = { end tag.ability.rework_key = jkr.config.center.key tag.ability.rework_edition = G.P_CENTER_POOLS.Edition[found_index].key + tag.ability.shiny = cry_rollshinybool() add_tag(tag) --SMODS.Tags.tag_cry_rework.apply(tag, {type = "store_joker_create"}) G.E_MANAGER:add_event(Event({ diff --git a/items/m.lua b/items/m.lua index e904dc912..14b09eaa1 100644 --- a/items/m.lua +++ b/items/m.lua @@ -1060,7 +1060,9 @@ local smallestm = { if context.cardarea == G.jokers and context.before then --This isn't retrigger joker compatible for some reason if context.scoring_name == card.ability.extra.type then - add_tag(Tag("tag_cry_double_m")) + local tag = Tag("tag_cry_double_m") + tag.ability.shiny = cry_rollshinybool() + add_tag(tag) play_sound("generic1", 0.9 + math.random() * 0.1, 0.8) play_sound("holo1", 1.2 + math.random() * 0.1, 0.4) card_eval_status_text(context.blueprint_card or card, "extra", nil, nil, nil, { diff --git a/items/misc_joker.lua b/items/misc_joker.lua index d189f3a24..84d26c480 100644 --- a/items/misc_joker.lua +++ b/items/misc_joker.lua @@ -638,19 +638,21 @@ local pickle = { calculate = function(self, card, context) if context.skip_blind then for i = 1, math.min(20, card.ability.extra.tags) do - local tag = Tag(get_next_tag_key("cry_pickle")) - if tag.name == "Orbital Tag" then - local _poker_hands = {} - for k, v in pairs(G.GAME.hands) do - if v.visible then - _poker_hands[#_poker_hands + 1] = k - end - end - tag.ability.orbital_hand = pseudorandom_element(_poker_hands, pseudoseed("cry_pickle_orbital")) - end - if tag.name == "Boss Tag" then + local tag_key = get_next_tag_key("cry_pickle") + if tag_key == "tag_boss" then i = i - 1 --skip these, as they can cause bugs with pack opening from other tags else + local tag = Tag(tag_key) + if tag.name == "Orbital Tag" then + local _poker_hands = {} + for k, v in pairs(G.GAME.hands) do + if v.visible then + _poker_hands[#_poker_hands + 1] = k + end + end + tag.ability.orbital_hand = pseudorandom_element(_poker_hands, pseudoseed("cry_pickle_orbital")) + end + tag.ability.shiny = cry_rollshinybool() add_tag(tag) end end @@ -670,8 +672,8 @@ local pickle = { card_eval_status_text(card, "extra", nil, nil, nil, { message = localize({ type = "variable", - key = card.ability.extra.tags == 1 and "a_tag_minus" or "a_tags_minus", - vars = { card.ability.extra.tags }, + key = card.ability.extra.tags_mod == 1 and "a_tag_minus" or "a_tags_minus", + vars = { card.ability.extra.tags_mod }, })[1], colour = G.C.FILTER, }) @@ -6644,6 +6646,38 @@ local astral_bottle = { end end, } +local kittyprinter = { + dependencies = { + items = { + "tag_cry_cat", + }, + }, + object_type = "Joker", + name = "cry-kittyprinter", + key = "kittyprinter", + config = { extra = { Xmult = 2 } }, + pos = { x = 3, y = 5 }, + rarity = 2, + cost = 6, + atlas = "atlasone", + order = 133, + blueprint_compat = true, + loc_vars = function(self, info_queue, card) + return { vars = { card.ability.extra.Xmult } } + end, + calculate = function(self, card, context) + if context.joker_main then + return { + message = localize({ + type = "variable", + key = "a_xmult", + vars = { card.ability.extra.Xmult }, + }), + Xmult_mod = card.ability.extra.Xmult, + } + end + end, +} local kidnap = { object_type = "Joker", dependencies = { @@ -7280,10 +7314,13 @@ local pity_prize = { end, calculate = function(self, card, context) if context.skipping_booster then - local tag + local tag_key repeat - tag = Tag(get_next_tag_key("cry_pity_prize")) - until tag.name ~= "Boss Tag" and tag.name ~= "Gambler's Tag" and tag.name ~= "Empowered Tag" + tag_key = get_next_tag_key("cry_pity_prize") + until tag_key ~= "tag_boss" --I saw pickle not generating boss tags because it apparently causes issues, so I did the same here + -- this is my first time seeing repeat... wtf + local tag = Tag(tag_key) + tag.ability.shiny = cry_rollshinybool() if tag.name == "Orbital Tag" then local _poker_hands = {} for k, v in pairs(G.GAME.hands) do @@ -7763,6 +7800,7 @@ local miscitems = { savvy, subtle, discreet, + kittyprinter, kidnap, exposed, mask, diff --git a/items/tag.lua b/items/tag.lua index f77220df6..7e66a2a06 100644 --- a/items/tag.lua +++ b/items/tag.lua @@ -224,7 +224,7 @@ local gambler = { order = 13, atlas = "tag_cry", pos = { x = 2, y = 0 }, - config = { type = "immediate", odds = 4 }, + config = { type = "new_blind_choice", odds = 4 }, min_ante = 2, key = "gambler", loc_vars = function(self, info_queue) @@ -232,18 +232,27 @@ local gambler = { return { vars = { G.GAME.probabilities.normal or 1, self.config.odds } } end, apply = function(self, tag, context) - if context.type == "immediate" then + if context.type == "new_blind_choice" then if pseudorandom("cry_gambler_tag") < G.GAME.probabilities.normal / tag.config.odds then local lock = tag.ID G.CONTROLLER.locks[lock] = true tag:yep("+", G.C.SECONDARY_SET.Spectral, function() - local tag = Tag("tag_cry_empowered") - add_tag(tag) + local emp = Tag("tag_cry_empowered") + if tag.ability.shiny then -- good fucking luck + emp.ability.shiny = cry_rollshinybool() + end + add_tag(emp) + emp:apply_to_run({ type = "new_blind_choice" }) G.CONTROLLER.locks[lock] = nil return true end) else tag:nope() + for i = 1, #G.GAME.tags do + if G.GAME.tags[i]:apply_to_run({ type = "new_blind_choice" }) then + break + end + end end tag.triggered = true return true @@ -261,7 +270,7 @@ local bundle = { order = 16, atlas = "tag_cry", pos = { x = 0, y = 0 }, - config = { type = "immediate" }, + config = { type = "new_blind_choice" }, key = "bundle", min_ante = 2, loc_vars = function(self, info_queue) @@ -272,14 +281,19 @@ local bundle = { return { vars = {} } end, apply = function(self, tag, context) - if context.type == "immediate" then + if context.type == "new_blind_choice" then local lock = tag.ID G.CONTROLLER.locks[lock] = true tag:yep("+", G.C.ATTENTION, function() - add_tag(Tag("tag_standard")) - add_tag(Tag("tag_charm")) - add_tag(Tag("tag_meteor")) - add_tag(Tag("tag_buffoon")) + local tags = { "standard", "charm", "meteor", "buffoon" } + for i, v in ipairs(tags) do + local _tag = Tag("tag_" .. v) + _tag.ability.shiny = cry_rollshinybool() + add_tag(_tag) + if i == 1 then + _tag:apply_to_run({ type = "new_blind_choice" }) + end + end G.CONTROLLER.locks[lock] = nil return true end) @@ -1059,7 +1073,7 @@ local booster = { local lock = tag.ID G.CONTROLLER.locks[lock] = true tag:yep("+", G.C.BLUE, function() - G.GAME.boostertag = true + G.GAME.boostertag = (G.GAME.boostertag or 0) + 1 G.CONTROLLER.locks[lock] = nil return true end) diff --git a/lib/content.lua b/lib/content.lua index 355be2b2d..a6541e32c 100644 --- a/lib/content.lua +++ b/lib/content.lua @@ -582,6 +582,21 @@ SMODS.Atlas({ px = 34, py = 34, }) + +-- shiny tags +SMODS.Atlas({ + key = "shinyv", + path = "shinyv.png", + px = 34, + py = 34, +}) +SMODS.Atlas({ + key = "shinyc", + path = "shinyc.png", + px = 34, + py = 34, +}) + SMODS.Atlas({ key = "atlasdeck", path = "atlasdeck.png", diff --git a/lib/misc.lua b/lib/misc.lua index 2860b8f3c..3ce53bfcd 100644 --- a/lib/misc.lua +++ b/lib/misc.lua @@ -486,6 +486,27 @@ function cry_bonusvouchermod(mod) end end +function save_cryptid() + local data = { + shinytags = {}, + } + data.shinytags = copy_table(Cryptid.shinytagdata) + compress_and_save(G.SETTINGS.profile .. "/" .. "cryptidsave.jkr", STR_PACK(data)) +end + +local sppref = set_profile_progress +function set_profile_progress() + sppref() + if not Cryptid.shinytagdata.init then + for k, v in pairs(G.P_TAGS) do + if Cryptid.shinytagdata[k] == nil then + Cryptid.shinytagdata.init = true + Cryptid.shinytagdata[k] = false + end + end + end +end + Cryptid.big_num_whitelist = { j_ride_the_bus = true, j_egg = true, diff --git a/lib/modifiers.lua b/lib/modifiers.lua index b2c1a1106..8be801bf6 100644 --- a/lib/modifiers.lua +++ b/lib/modifiers.lua @@ -734,6 +734,45 @@ SMODS.Sticker({ end end, }) + +-- shiny tag hooks + +local tagability = Tag.set_ability +function Tag:set_ability() + tagability(self) + if self.ability.blind_type then + G.GAME.cry_shiny_choices = G.GAME.cry_shiny_choices or {} + G.GAME.cry_shiny_choices[G.GAME.round_resets.ante] = G.GAME.cry_shiny_choices[G.GAME.round_resets.ante] or {} + + if not G.GAME.cry_shiny_choices[G.GAME.round_resets.ante][self.ability.blind_type] then + G.GAME.cry_shiny_choices[G.GAME.round_resets.ante][self.ability.blind_type] = cry_rollshiny() + end + self.ability.shiny = G.GAME.cry_shiny_choices[G.GAME.round_resets.ante][self.ability.blind_type] == "shiny" + and true + end +end + +local ycollecref = G.FUNCS.your_collection +G.FUNCS.your_collection = function(e) + ycollecref(e) + G.cry_current_tagpage = nil +end +local omuicryref = G.FUNCS.openModUI_Cryptid +G.FUNCS.openModUI_Cryptid = function(e) + omuicryref(e) + G.cry_current_tagpage = nil +end + +function cry_shinytag_tally() + local ret = 0 + for k, v in pairs(Cryptid.shinytagdata) do + if Cryptid.shinytagdata[k] then + ret = ret + 1 + end + end + return ret +end + -- temp crappy overwrite for voucher ui until smods does stuff function G.UIDEF.used_vouchers() diff --git a/localization/en-us.lua b/localization/en-us.lua index 84939f97c..6f843bf5c 100644 --- a/localization/en-us.lua +++ b/localization/en-us.lua @@ -1617,6 +1617,14 @@ return { "{C:attention}Type Chips{} Joker is sold", }, }, + j_cry_kittyprinter = { + name = "Kitty Printer", + text = { + "{X:mult,C:white} X#1# {} Mult", + "All {C:attention}skip{} tags", + "become {C:attention}Cat Tags{}", + }, + }, j_cry_kooky = { name = "Kooky Joker", text = { @@ -4295,6 +4303,7 @@ return { b_pull = "PULL", cry_hooked_ex = "Hooked!", k_end_blind = "End Blind", + k_cry_shiny = "Shiny", cry_code_rank = "ENTER RANK", cry_code_enh = "ENTER ENHANCEMENT", @@ -4312,6 +4321,10 @@ return { b_flip = "FLIP", b_merge = "MERGE", + cry_hand_bulwark = "Bulwark", + cry_hand_clusterfuck = "Clusterfuck", + cry_hand_ultpair = "Ultimate Pair", + cry_asc_hands = "Asc. Hands", cry_p_star = "Star", diff --git a/lovely/cat.toml b/lovely/cat.toml index 4c19679d9..094e42af3 100644 --- a/lovely/cat.toml +++ b/lovely/cat.toml @@ -90,6 +90,13 @@ tag_sprite.click = function(_self) })) other_cat.ability.level = other_cat.ability.level + 1 + + if self.ability.shiny then + if not Cryptid.shinytagdata[self.key] then + Cryptid.shinytagdata[self.key] = true + save_cryptid() + end + end G.E_MANAGER:add_event(Event({ trigger = 'after', @@ -174,3 +181,180 @@ if self.key == 'tag_cry_cat' then play_sound('cry_meow'..math.random(4), 1.26, 0.12); end''' match_indent = true + + + + +# shiny tags +[[patches]] +[patches.pattern] +target = "tag.lua" +pattern = '''local tag_sprite = Sprite(0,0,_size*1,_size*1,G.ASSET_ATLAS[(not self.hide_ability) and G.P_TAGS[self.key].atlas or "tags"], (self.hide_ability) and G.tag_undiscovered.pos or self.pos)''' +position = "at" +payload = ''' +local tagatlas = G.ASSET_ATLAS[(not self.hide_ability) and G.P_TAGS[self.key].atlas or "tags"] +if self.ability.shiny and not self.hide_ability then + if not G.P_TAGS[self.key].atlas then + tagatlas = G.ASSET_ATLAS['cry_shinyv'] + elseif G.P_TAGS[self.key].atlas == 'cry_tag_cry' then + tagatlas = G.ASSET_ATLAS['cry_shinyc'] + end +end + +local tag_sprite = Sprite(0,0,_size*1,_size*1,tagatlas, (self.hide_ability) and G.tag_undiscovered.pos or self.pos) +''' +match_indent = true + +# define function +[[patches]] +[patches.pattern] +target = "functions/misc_functions.lua" +pattern = "function save_run()" +position = "before" +payload = ''' +function cry_rollshiny() + local prob = 1 + if next(SMODS.find_card('j_lucky_cat')) then prob = 3 end + if pseudorandom("cry_shiny") < prob / 4096 then + return 'shiny' + end + return 'normal' +end + +function cry_rollshinybool() + if cry_rollshiny() == 'shiny' then + return true + end + return false +end +''' +match_indent = true + +# collection +# nice pattern match? +[[patches]] +[patches.pattern] +target = '''=[SMODS _ "src/overrides.lua"]''' +pattern = ''' + opt_callback = 'your_collection_tags_page', + focus_args = { snap_to = true, nav = 'wide' }, + current_option = page, + colour = G.C.RED, + no_pips = true + }) + } + }''' +position = "after" +payload = ''' +, + cry_shinytag_tally() > 0 and create_toggle{ -- tally function runs way too often but whatever + label = localize('k_cry_shiny'), + w = 0, + ref_table = G, + ref_value = "showshinytags" + } or nil, +''' +match_indent = true + +[[patches]] +[patches.pattern] +target = '''=[SMODS _ "src/overrides.lua"]''' +pattern = ''' +if not v.discovered then temp_tag.hide_ability = true end +''' +position = "before" +payload = ''' +if G.showshinytags then + temp_tag.ability.shiny = true + if not Cryptid.shinytagdata[temp_tag.key] then + temp_tag.hide_ability = true + end +end +''' +match_indent = true + +# i can't seem to get the tag page easily +# i'm also surprised this doesn't multipatch +[[patches]] +[patches.pattern] +target = '''=[SMODS _ "src/overrides.lua"]''' +pattern = ''' +local page = args.cycle_config.current_option or 1 +''' +position = "at" +payload = ''' +if args then G.cry_current_tagpage = args.cycle_config.current_option end +local page = args and args.cycle_config.current_option or G.cry_current_tagpage or 1 +''' +match_indent = true + +# update collection +# scuffed +[[patches]] +[patches.pattern] +target = '''game.lua''' +pattern = ''' +self.E_MANAGER:update(self.real_dt) +''' +position = "before" +payload = ''' +if not G.showshinytags then G.showshinytags = false end +if not G.showshinytags_b then G.showshinytags_b = false end + +if G.showshinytags ~= G.showshinytags_b then + G.showshinytags_b = G.showshinytags + G.FUNCS.your_collection_tags_page() +end +''' +match_indent = true + +# save+loading time + +# cryptidsave stuff +[[patches]] +[patches.pattern] +target = '''game.lua''' +pattern = ''' +if not love.filesystem.getInfo(G.SETTINGS.profile..'/'..'meta.jkr') then love.filesystem.append( G.SETTINGS.profile..'/'..'meta.jkr', 'return {}') end +''' +position = "after" +payload = ''' +if not love.filesystem.getInfo(G.SETTINGS.profile..'/'..'cryptidsave.jkr') then love.filesystem.append( G.SETTINGS.profile..'/'..'cryptidsave.jkr', 'return {}') end +''' +match_indent = true + +[[patches]] +[patches.pattern] +target = '''game.lua''' +pattern = ''' +local meta = STR_UNPACK(get_compressed(G.SETTINGS.profile..'/'..'meta.jkr') or 'return {}') +''' +position = "after" +payload = ''' +local cryptidsave = STR_UNPACK(get_compressed(G.SETTINGS.profile..'/'..'cryptidsave.jkr') or 'return {}') + +if cryptidsave and cryptidsave.shinytags then + Cryptid.shinytagdata = copy_table(cryptidsave.shinytags) +else + -- populated later when tags actually exist + Cryptid.shinytagdata = {} +end +''' +match_indent = true + +[[patches]] +[patches.pattern] +target = '''tag.lua''' +pattern = ''' +function Tag:yep(message, _colour, func) +''' +position = "after" +payload = ''' +if self.ability.shiny then + if not Cryptid.shinytagdata[self.key] then + Cryptid.shinytagdata[self.key] = true + save_cryptid() + end +end +''' +match_indent = true \ No newline at end of file diff --git a/lovely/misc.toml b/lovely/misc.toml index b942ce875..86c0a9ad1 100644 --- a/lovely/misc.toml +++ b/lovely/misc.toml @@ -252,12 +252,15 @@ payload = '''if true then''' match_indent = true # Energia - detect blind skips from tag +# kitty printer - add cat tag [[patches]] [patches.pattern] target = "functions/button_callbacks.lua" pattern = '''add_tag(_tag.config.ref_table)''' position = "at" -payload = '''add_tag(_tag.config.ref_table, true)''' +payload = ''' +add_tag( next(SMODS.find_card('j_cry_kittyprinter')) and Tag('tag_cry_cat') or _tag.config.ref_table, true) +''' match_indent = true # Energia - don't add tags from save load @@ -424,6 +427,19 @@ end ''' match_indent = true +# kitty printer 2 (for some reason i can't figure out how to not create another object here) +[[patches]] +[patches.pattern] +target = "functions/UI_definitions.lua" +pattern = "local _tag = Tag(G.GAME.round_resets.blind_tags[blind_choice], nil, blind_choice)" +position = "after" +payload = ''' +if next(SMODS.find_card('j_cry_kittyprinter')) then + _tag = Tag('tag_cry_cat', nil, blind_choice) +end +''' +match_indent = true + # avoids a game-locking crash related to opened booster being nil # remove this as soon as a fix is done [[patches]] diff --git a/lovely/misprint.toml b/lovely/misprint.toml index fdb07ecfd..c3e9057f4 100644 --- a/lovely/misprint.toml +++ b/lovely/misprint.toml @@ -55,14 +55,15 @@ if G.GAME.cry_oboe then self.ability.extra = self.ability.extra + G.GAME.cry_oboe G.GAME.pack_choices = G.GAME.pack_choices + G.GAME.cry_oboe G.GAME.cry_oboe = nil - G.GAME.pack_size = self.ability.extra end -if G.GAME.boostertag then - self.ability.extra = self.ability.extra * 2 - G.GAME.pack_choices = G.GAME.pack_choices * 2 - G.GAME.boostertag = nil - G.GAME.pack_size = self.ability.extra +if G.GAME.boostertag and G.GAME.boostertag > 0 then + self.ability.extra = self.ability.extra * (2^G.GAME.boostertag) + G.GAME.pack_choices = G.GAME.pack_choices * (2^G.GAME.boostertag) + G.GAME.boostertag = 0 end +self.ability.extra = math.min(self.ability.extra, 1000) +G.GAME.pack_choices = math.min(G.GAME.pack_choices, 1000) +G.GAME.pack_size = self.ability.extra ''' match_indent = true