@@ -43,6 +43,18 @@ function Card:calculate_dollar_bonus(blueprintnum)
4343'''
4444match_indent = true
4545
46+ # be careful!
47+ [[patches ]]
48+ [patches .pattern ]
49+ target = " card.lua"
50+ pattern = ''' if other_joker_ret then'''
51+ position = " before"
52+ payload = '''
53+ if other_joker_ret and other_joker_ret == true then
54+ return other_joker_ret
55+ end
56+ '''
57+ match_indent = true
4658
4759
4860
@@ -150,7 +162,7 @@ function Card:soft_add_to_deck()
150162 if self.ability.name == "Pareidolia" then
151163 exb_pareiupd()
152164 end
153- if self.ability.name == 'Credit Card' then
165+ if self.ability.name == 'Credit Card' and true then
154166 G.GAME.bankrupt_at = G.GAME.bankrupt_at - self.ability.extra
155167 end
156168 --[[ yeah don't do this one
@@ -209,7 +221,7 @@ function Card:soft_remove_from_deck()
209221 if self.ability.name == "Pareidolia" then
210222 exb_pareiupd()
211223 end
212- if self.ability.name == 'Credit Card' then
224+ if self.ability.name == 'Credit Card' and true then
213225 G.GAME.bankrupt_at = G.GAME.bankrupt_at + self.ability.extra
214226 end
215227 if self.ability.name == 'Chaos the Clown' then
@@ -482,47 +494,38 @@ match_indent = true
482494
483495
484496
485- # remove sixth sense breaking loop, gives one speccy per copy
497+ # sixth sense
486498[[patches ]]
487499[patches .pattern ]
488- target = " functions/state_events .lua"
489- pattern = ''' if destroyed then break end '''
500+ target = " card .lua"
501+ pattern = ''' elseif context.destroying_card and not context.blueprint then '''
490502position = " at"
491503payload = '''
492- if destroyed then _destroyed = true end
493- '''
494- match_indent = true
495-
496- # this is scuffed
497- [[patches ]]
498- [patches .pattern ]
499- target = " functions/state_events.lua"
500- pattern = ''' local destroyed = nil'''
501- position = " after"
502- payload = '''
503- local _destroyed = nil
504+ elseif context.destroying_card then
504505'''
505506match_indent = true
506507
507- # juggling practice
508+ # don't break loop
508509[[patches ]]
509510[patches .pattern ]
510- target = " functions/state_events.lua"
511- pattern = ''' if scoring_hand[i].will_shatter then destroyed = true end'''
512- position = " before"
511+ target = ''' =[SMODS _ "src/utils.lua"]'''
512+ pattern = '''
513+ if should_break then break end'''
514+ position = " at"
513515payload = '''
514- if _destroyed then destroyed = true end
515516'''
516517match_indent = true
517518
518- # make sixth sense compatible with blueprint
519+ # again
519520[[patches ]]
520521[patches .pattern ]
521- target = " card.lua"
522- pattern = ''' elseif context.destroying_card and not context.blueprint then'''
522+ target = ''' =[SMODS _ "src/utils.lua"]'''
523+ pattern = '''
524+ should_break = true
525+ break'''
523526position = " at"
524527payload = '''
525- elseif context.destroying_card then
528+ should_break = true
526529'''
527530match_indent = true
528531
@@ -598,88 +601,6 @@ match_indent = true
598601
599602
600603
601- # splash might get messy
602- # we switch the generic "score all" into the same mechanism as stone cards
603- # while the original is fast, it's not flexible. this allows us to easily find cards that aren't part of the poker hand
604- [[patches ]]
605- [patches .pattern ]
606- target = " functions/state_events.lua"
607- pattern = ''' scoring_hand[i] = G.play.cards[i]'''
608- position = " at"
609- payload = '''
610- local inside = false
611- for j=1, #scoring_hand do
612- if scoring_hand[j] == G.play.cards[i] then
613- inside = true
614- end
615- end
616- if not inside then table.insert(pures, G.play.cards[i]) end
617- '''
618- match_indent = true
619-
620- # define a local function to check if it's in pures
621- [[patches ]]
622- [patches .pattern ]
623- target = " functions/state_events.lua"
624- pattern = ''' local percent_delta = 0.08'''
625- position = " after"
626- payload = '''
627- local function exb_check_unscoring(_ccard, _ppures)
628- local inside = false
629- for i = 1, #_ppures do
630- if _ccard == _ppures[i] then inside = true end
631- end
632- return inside
633- end
634- '''
635- match_indent = true
636-
637- # terrifying overwrite
638- [[patches ]]
639- [patches .pattern ]
640- target = " functions/state_events.lua"
641- pattern = ''' local eval = eval_card(G.jokers.cards[j], {cardarea = G.play, full_hand = G.play.cards, scoring_hand = scoring_hand, scoring_name = text, poker_hands = poker_hands, other_card = scoring_hand[i], repetition = true, callback = function(card, ret) eval = {jokers = ret}'''
642- position = " at"
643- payload = '''
644- local eval = eval_card(G.jokers.cards[j], {cardarea = G.play, full_hand = G.play.cards, scoring_hand = scoring_hand, scoring_name = text, poker_hands = poker_hands, other_card = scoring_hand[i], orig_unscoring = exb_check_unscoring(scoring_hand[i], pures), repetition = true, callback = function(card, ret) eval = {jokers = ret}
645- '''
646- match_indent = true
647-
648- # splash calculate, it sucks a little bit but it should be fine
649- [[patches ]]
650- [patches .pattern ]
651- target = " card.lua"
652- pattern = ''' if self.ability.name == 'Hack' and ('''
653- position = " before"
654- payload = '''
655- if self.ability.name == 'Splash' and context.orig_unscoring then
656- local initial = false
657- if not context.blueprint then
658- -- check if self is the leftmost splash. the leftmost splash will be used to score the cards originally
659- -- don't do this for bloopies
660- for i = 1, #G.jokers.cards do
661- if G.jokers.cards[i].ability.name == 'Splash' and G.jokers.cards[i] ~= self then
662- break
663- elseif G.jokers.cards[i] == self then
664- initial = true
665- break
666- end
667- end
668- end
669- if not initial then
670- return {
671- message = localize('k_again_ex'),
672- repetitions = 1,
673- card = self
674- }
675- end
676- end
677- '''
678- match_indent = true
679-
680-
681-
682-
683604# pareidolia stacking, this is dumb
684605[[patches ]]
685606[patches .pattern ]
0 commit comments