Skip to content

Commit 181daac

Browse files
committed
bugfixes
Fixed: ://ALTTAB not being affected by Kitty Printer Some Jokers displaying as blueprint-incompatible incorrectly (LeBaron James, Pity Prize) Refactored shiny tag utility functions
1 parent 6461976 commit 181daac

File tree

7 files changed

+32
-33
lines changed

7 files changed

+32
-33
lines changed

items/code.lua

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3543,6 +3543,9 @@ local alttab = {
35433543
ret = "???"
35443544
end
35453545
end
3546+
if next(SMODS.find_card('j_cry_kittyprinter')) then
3547+
ret = localize({ type = "name_text", key = "tag_cry_cat", set = "Tag" })
3548+
end
35463549
return { vars = { ret } }
35473550
end,
35483551
can_use = function(self, card)
@@ -3558,7 +3561,9 @@ local alttab = {
35583561
play_sound("tarot1")
35593562
local tag = nil
35603563
local type = G.GAME.blind:get_type()
3561-
if type == "Boss" then
3564+
if next(SMODS.find_card('j_cry_kittyprinter')) then
3565+
tag = Tag("tag_cry_cat")
3566+
elseif type == "Boss" then
35623567
tag = Tag(get_next_tag_key())
35633568
else
35643569
tag = Tag(G.GAME.round_resets.blind_tags[type])
@@ -4097,6 +4102,7 @@ local pointer = {
40974102
instantiate = "://INSTANTIATE",
40984103
inst = "://INSTANTIATE",
40994104
spaghetti = "://spaghetti",
4105+
alttab = "://alttab",
41004106
-- Tags
41014107
topuptag = "top-up tag",
41024108
gamblerstag = "gambler's tag",

items/m.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1061,7 +1061,7 @@ local smallestm = {
10611061
--This isn't retrigger joker compatible for some reason
10621062
if context.scoring_name == card.ability.extra.type then
10631063
local tag = Tag("tag_cry_double_m")
1064-
tag.ability.shiny = cry_rollshinybool()
1064+
tag.ability.shiny = Cryptid.is_shiny()
10651065
add_tag(tag)
10661066
play_sound("generic1", 0.9 + math.random() * 0.1, 0.8)
10671067
play_sound("holo1", 1.2 + math.random() * 0.1, 0.4)

items/misc_joker.lua

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ local pickle = {
629629
end
630630
tag.ability.orbital_hand = pseudorandom_element(_poker_hands, pseudoseed("cry_pickle_orbital"))
631631
end
632-
tag.ability.shiny = cry_rollshinybool()
632+
tag.ability.shiny = Cryptid.is_shiny()
633633
add_tag(tag)
634634
end
635635
end
@@ -7307,7 +7307,7 @@ local tax_fraud = {
73077307
},
73087308
},
73097309
}
7310-
--TODO update desc
7310+
73117311
local pity_prize = {
73127312
object_type = "Joker",
73137313
dependencies = {
@@ -7317,6 +7317,7 @@ local pity_prize = {
73177317
},
73187318
name = "cry-Pity-Prize",
73197319
key = "pity_prize",
7320+
blueprint_compat = true,
73207321
pos = { x = 5, y = 5 },
73217322
config = {},
73227323
rarity = 1,
@@ -7334,7 +7335,7 @@ local pity_prize = {
73347335
until tag_key ~= "tag_boss" --I saw pickle not generating boss tags because it apparently causes issues, so I did the same here
73357336
-- this is my first time seeing repeat... wtf
73367337
local tag = Tag(tag_key)
7337-
tag.ability.shiny = cry_rollshinybool()
7338+
tag.ability.shiny = Cryptid.is_shiny()
73387339
if tag.name == "Orbital Tag" then
73397340
local _poker_hands = {}
73407341
for k, v in pairs(G.GAME.hands) do
@@ -7672,6 +7673,7 @@ local lebaron_james = {
76727673
key = "lebaron_james",
76737674
pos = { x = 2, y = 5 },
76747675
config = { extra = { h_mod = 1 } },
7676+
blueprint_compat = true,
76757677
rarity = 3,
76767678
cost = 6,
76777679
atlas = "atlasone",

items/tag.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ local gambler = {
332332
tag:yep("+", G.C.SECONDARY_SET.Spectral, function()
333333
local emp = Tag("tag_cry_empowered")
334334
if tag.ability.shiny then -- good fucking luck
335-
emp.ability.shiny = cry_rollshinybool()
335+
emp.ability.shiny = Cryptid.is_shiny()
336336
end
337337
add_tag(emp)
338338
tag.triggered = true
@@ -396,7 +396,7 @@ local bundle = {
396396
local tags = { "standard", "charm", "meteor", "buffoon" }
397397
for i, v in ipairs(tags) do
398398
local _tag = Tag("tag_" .. v)
399-
_tag.ability.shiny = cry_rollshinybool()
399+
_tag.ability.shiny = Cryptid.is_shiny()
400400
add_tag(_tag)
401401
if i == 1 then
402402
tag.triggered = true

lib/misc.lua

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -738,3 +738,19 @@ function Controller:key_press_update(key, dt)
738738
G.CHOOSE_CARD:align_to_major()
739739
end
740740
end
741+
742+
function Cryptid.roll_shiny()
743+
local prob = 1
744+
if next(SMODS.find_card('j_lucky_cat')) then prob = 3 end
745+
if pseudorandom("cry_shiny") < prob / 4096 then
746+
return 'shiny'
747+
end
748+
return 'normal'
749+
end
750+
751+
function Cryptid.is_shiny()
752+
if Cryptid.roll_shiny() == 'shiny' then
753+
return true
754+
end
755+
return false
756+
end

lib/modifiers.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,7 @@ function Tag:set_ability()
783783
G.GAME.cry_shiny_choices[G.GAME.round_resets.ante] = G.GAME.cry_shiny_choices[G.GAME.round_resets.ante] or {}
784784

785785
if not G.GAME.cry_shiny_choices[G.GAME.round_resets.ante][self.ability.blind_type] then
786-
G.GAME.cry_shiny_choices[G.GAME.round_resets.ante][self.ability.blind_type] = cry_rollshiny()
786+
G.GAME.cry_shiny_choices[G.GAME.round_resets.ante][self.ability.blind_type] = Cryptid.roll_shiny()
787787
end
788788
self.ability.shiny = G.GAME.cry_shiny_choices[G.GAME.round_resets.ante][self.ability.blind_type] == "shiny"
789789
and true

lovely/cat.toml

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -205,31 +205,6 @@ local tag_sprite = Sprite(0,0,_size*1,_size*1,tagatlas, (self.hide_ability) and
205205
'''
206206
match_indent = true
207207

208-
# define function
209-
[[patches]]
210-
[patches.pattern]
211-
target = "functions/misc_functions.lua"
212-
pattern = "function save_run()"
213-
position = "before"
214-
payload = '''
215-
function cry_rollshiny()
216-
local prob = 1
217-
if next(SMODS.find_card('j_lucky_cat')) then prob = 3 end
218-
if pseudorandom("cry_shiny") < prob / 4096 then
219-
return 'shiny'
220-
end
221-
return 'normal'
222-
end
223-
224-
function cry_rollshinybool()
225-
if cry_rollshiny() == 'shiny' then
226-
return true
227-
end
228-
return false
229-
end
230-
'''
231-
match_indent = true
232-
233208
# collection
234209
# nice pattern match?
235210
[[patches]]

0 commit comments

Comments
 (0)