Skip to content

Commit e2db5c4

Browse files
authored
shiny tags
doesn't feel ready for instant commit yet
1 parent 2e817e7 commit e2db5c4

File tree

7 files changed

+73
-0
lines changed

7 files changed

+73
-0
lines changed

assets/1x/shinyc.png

11.6 KB
Loading

assets/1x/shinyv.png

8.49 KB
Loading

assets/2x/shinyc.png

19.8 KB
Loading

assets/2x/shinyv.png

14.7 KB
Loading

lib/content.lua

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,21 @@ SMODS.Atlas({
531531
px = 34,
532532
py = 34,
533533
})
534+
535+
-- shiny tags
536+
SMODS.Atlas({
537+
key = "shinyv",
538+
path = "shinyv.png",
539+
px = 34,
540+
py = 34,
541+
})
542+
SMODS.Atlas({
543+
key = "shinyc",
544+
path = "shinyc.png",
545+
px = 34,
546+
py = 34,
547+
})
548+
534549
SMODS.Atlas({
535550
key = "atlasdeck",
536551
path = "atlasdeck.png",

lib/modifiers.lua

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -674,6 +674,25 @@ SMODS.Sticker({
674674
end
675675
end,
676676
})
677+
678+
-- shiny tag hooks
679+
680+
local tagability = Tag.set_ability
681+
function Tag:set_ability()
682+
tagability(self)
683+
if self.ability.blind_type then
684+
685+
G.GAME.cry_shiny_choices = G.GAME.cry_shiny_choices or {}
686+
G.GAME.cry_shiny_choices[G.GAME.round_resets.ante] = G.GAME.cry_shiny_choices[G.GAME.round_resets.ante] or {}
687+
688+
if not G.GAME.cry_shiny_choices[G.GAME.round_resets.ante][self.ability.blind_type] then
689+
print("rolling")
690+
G.GAME.cry_shiny_choices[G.GAME.round_resets.ante][self.ability.blind_type] = cry_rollshiny()
691+
end
692+
self.ability.shiny = G.GAME.cry_shiny_choices[G.GAME.round_resets.ante][self.ability.blind_type] == 'shiny' and true
693+
end
694+
end
695+
677696
-- temp crappy overwrite for voucher ui until smods does stuff
678697

679698
function G.UIDEF.used_vouchers()

lovely/misc.toml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,4 +422,43 @@ if (not self.ability.orbital_hand) or (not G.GAME.hands[self.ability.orbital_han
422422
self.ability.orbital_hand = pseudorandom_element(_poker_hands, pseudoseed('orbital'))
423423
end
424424
'''
425+
match_indent = true
426+
427+
# shiny tags
428+
[[patches]]
429+
[patches.pattern]
430+
target = "tag.lua"
431+
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)'''
432+
position = "at"
433+
payload = '''
434+
local tagatlas = G.ASSET_ATLAS[(not self.hide_ability) and G.P_TAGS[self.key].atlas or "tags"]
435+
if self.ability.shiny and not self.hide_ability then
436+
if not G.P_TAGS[self.key].atlas then
437+
tagatlas = G.ASSET_ATLAS['cry_shinyv']
438+
elseif G.P_TAGS[self.key].atlas == 'cry_tag_cry' then
439+
tagatlas = G.ASSET_ATLAS['cry_shinyc']
440+
end
441+
end
442+
443+
local tag_sprite = Sprite(0,0,_size*1,_size*1,tagatlas, (self.hide_ability) and G.tag_undiscovered.pos or self.pos)
444+
'''
445+
match_indent = true
446+
447+
# define function
448+
[[patches]]
449+
[patches.pattern]
450+
target = "functions/misc_functions.lua"
451+
pattern = "function save_run()"
452+
position = "before"
453+
payload = '''
454+
function cry_rollshiny()
455+
local prob = 1
456+
if next(SMODS.find_card('j_lucky_cat')) then prob = 3 end
457+
if pseudorandom("shiny") < prob / 4096 then
458+
print("true")
459+
return 'shiny'
460+
end
461+
return 'normal'
462+
end
463+
'''
425464
match_indent = true

0 commit comments

Comments
 (0)