diff --git a/Cryptid.lua b/Cryptid.lua index a57245285..aa35aaf4c 100644 --- a/Cryptid.lua +++ b/Cryptid.lua @@ -6,7 +6,7 @@ --- MOD_DESCRIPTION: Adds unbalanced ideas to Balatro. --- BADGE_COLOUR: 708b91 --- DEPENDENCIES: [Talisman>=2.0.0-beta8, Steamodded>=1.0.0~ALPHA-1225a] ---- VERSION: 0.5.3b +--- VERSION: 0.5.3c --- PRIORITY: 99999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 ---------------------------------------------- diff --git a/Items/CodeCards.lua b/Items/CodeCards.lua index d1b7b336a..dad229f44 100644 --- a/Items/CodeCards.lua +++ b/Items/CodeCards.lua @@ -1475,7 +1475,7 @@ local alttab = { can_bulk_use = true, loc_vars = function(self, info_queue, card) local ret = localize("k_none") - if G.GAME and G.GAME.blind then + if G.GAME and G.GAME.blind and G.GAME.blind.in_blind then if G.GAME.blind:get_type() == 'Small' then ret = localize{type = 'name_text', key = G.GAME.round_resets.blind_tags.Small, set = 'Tag'} elseif G.GAME.blind:get_type() == 'Big' then @@ -1487,7 +1487,7 @@ local alttab = { return { vars = { ret } } end, can_use = function(self, card) - return G.GAME and G.GAME.blind + return G.GAME.blind and G.GAME.blind.in_blind end, use = function(self, card, area, copier) local used_consumable = copier or card @@ -1774,13 +1774,13 @@ local copypaste = { pos = { x = 3, y = 4 }, order = 110, immune_to_chemach = true, - config = { extra = { odds = 2, ckt = 0 } }, + config = { extra = { odds = 2, ckt = 0 } }, -- what is a ckt rarity = "cry_epic", cost = 14, blueprint_compat = true, - loc_vars = function(self, info_queue, center) + loc_vars = function(self, info_queue, card) return { - vars = { "" .. (G.GAME and G.GAME.probabilities.normal or 1), math.max(2, (center and center.ability.extra.odds or 2)) }, + vars = { cry_prob(math.min(card.ability.extra.odds/2, card.ability.cry_prob), card.ability.extra.odds, card.ability.cry_rigged), card.ability.extra.odds }, -- this effectively prevents a copypaste from ever initially misprinting at above 50% odds. still allows rigging/oops } end, atlas = "atlasepic", @@ -1791,7 +1791,7 @@ local copypaste = { and not context.consumeable.beginning_end then if #G.consumeables.cards + G.GAME.consumeable_buffer < G.consumeables.config.card_limit then - if pseudorandom("cry_copypaste_joker") < G.GAME.probabilities.normal / math.max(2, card.ability.extra.odds) then + if pseudorandom("cry_copypaste_joker") < cry_prob(math.min(card.ability.extra.odds/2, card.ability.cry_prob), card.ability.extra.odds, card.ability.cry_rigged) / card.ability.extra.odds then G.E_MANAGER:add_event(Event({ func = function() local cards = copy_card(context.consumeable) diff --git a/Items/EpicJokers.lua b/Items/EpicJokers.lua index d4ae99106..d1de8c279 100644 --- a/Items/EpicJokers.lua +++ b/Items/EpicJokers.lua @@ -102,12 +102,12 @@ local googol_play = { blueprint_compat = true, atlas = "atlasepic", soul_pos = { x = 10, y = 0, extra = { x = 4, y = 0 } }, - loc_vars = function(self, info_queue, center) + loc_vars = function(self, info_queue, card) return { vars = { - "" .. (G.GAME and G.GAME.probabilities.normal or 1), - center.ability.extra.odds, - center.ability.extra.Xmult, + cry_prob(card.ability.cry_prob, card.ability.extra.odds, card.ability.cry_rigged), + card.ability.extra.odds, + card.ability.extra.Xmult, }, } end, @@ -116,7 +116,7 @@ local googol_play = { context.cardarea == G.jokers and not context.before and not context.after - and pseudorandom("cry_googol_play") < G.GAME.probabilities.normal / card.ability.extra.odds + and pseudorandom("cry_googol_play") < cry_prob(card.ability.cry_prob, card.ability.extra.odds, card.ability.cry_rigged) / card.ability.extra.odds then return { message = localize({ type = "variable", key = "a_xmult", vars = { card.ability.extra.Xmult } }), @@ -540,13 +540,13 @@ local boredom = { order = 32, cost = 14, blueprint_compat = true, - loc_vars = function(self, info_queue, center) - return { vars = { "" .. (G.GAME and G.GAME.probabilities.normal or 1), center.ability.extra.odds } } + loc_vars = function(self, info_queue, card) + return { vars = { cry_prob(card.ability.cry_prob, card.ability.extra.odds, card.ability.cry_rigged), card.ability.extra.odds } } end, atlas = "atlasepic", calculate = function(self, card, context) if context.retrigger_joker_check and not context.retrigger_joker and context.other_card ~= self then - if pseudorandom("cry_boredom_joker") < G.GAME.probabilities.normal / card.ability.extra.odds then + if pseudorandom("cry_boredom_joker") < cry_prob(card.ability.cry_prob, card.ability.extra.odds, card.ability.cry_rigged) / card.ability.extra.odds then return { message = localize("k_again_ex"), repetitions = 1, @@ -559,7 +559,7 @@ local boredom = { if context.repetition and context.cardarea == G.play - and pseudorandom("cry_boredom_card") < G.GAME.probabilities.normal / card.ability.extra.odds + and pseudorandom("cry_boredom_card") < cry_prob(card.ability.cry_prob, card.ability.extra.odds, card.ability.cry_rigged) / card.ability.extra.odds then return { message = localize("k_again_ex"), @@ -1010,16 +1010,16 @@ local bonusjoker = { order = 75, blueprint_compat = true, enhancement_gate = "m_bonus", - loc_vars = function(self, info_queue, center) + loc_vars = function(self, info_queue, card) info_queue[#info_queue + 1] = G.P_CENTERS.m_bonus - return { vars = { "" .. (G.GAME and G.GAME.probabilities.normal or 1), center.ability.extra.odds, center.ability.extra.add } } + return { vars = { cry_prob(card.ability.cry_prob, card.ability.extra.odds, card.ability.cry_rigged), card.ability.extra.odds, card.ability.extra.add } } end, atlas = "atlasepic", calculate = function(self, card, context) if context.individual and context.cardarea == G.play then if context.other_card.ability.effect == "Bonus Card" then if - pseudorandom("bonusjoker") < G.GAME.probabilities.normal / math.min(1e8, card.ability.extra.odds) + pseudorandom("bonusjoker") < cry_prob(card.ability.cry_prob, card.ability.extra.odds, card.ability.cry_rigged) / card.ability.extra.odds and card.ability.extra.check < 2 and not context.retrigger_joker then @@ -1081,10 +1081,10 @@ local multjoker = { cost = 11, blueprint_compat = true, enhancement_gate = "m_mult", - loc_vars = function(self, info_queue, center) + loc_vars = function(self, info_queue, card) info_queue[#info_queue + 1] = G.P_CENTERS.m_mult info_queue[#info_queue + 1] = G.P_CENTERS.c_cryptid - return { vars = { "" .. (G.GAME and G.GAME.probabilities.normal or 1), center.ability.extra.odds } } + return { vars = { cry_prob(card.ability.cry_prob, card.ability.extra.odds, card.ability.cry_rigged), card.ability.extra.odds } } end, atlas = "atlasepic", calculate = function(self, card, context) @@ -1093,7 +1093,7 @@ local multjoker = { context.other_card.ability.effect == "Mult Card" and #G.consumeables.cards + G.GAME.consumeable_buffer < G.consumeables.config.card_limit then - if pseudorandom("multjoker") < G.GAME.probabilities.normal / card.ability.extra.odds then + if pseudorandom("multjoker") < cry_prob(card.ability.cry_prob, card.ability.extra.odds, card.ability.cry_rigged) / card.ability.extra.odds then G.GAME.consumeable_buffer = G.GAME.consumeable_buffer + 1 G.E_MANAGER:add_event(Event({ func = function() diff --git a/Items/M.lua b/Items/M.lua index 7192c5986..a6a8cb576 100644 --- a/Items/M.lua +++ b/Items/M.lua @@ -413,7 +413,7 @@ local notebook = { rarity = 3, cost = 9, perishable_compat = false, - loc_vars = function(self, info_queue, center) + loc_vars = function(self, info_queue, card) info_queue[#info_queue + 1] = { set = "Joker", key = "j_jolly", @@ -421,12 +421,12 @@ local notebook = { } return { vars = { - "" .. (G.GAME and G.GAME.probabilities.normal or 1), - center.ability.extra.odds, - center.ability.extra.slot, - center.ability.extra.active, - center.ability.extra.jollies, - center.ability.extra.add, + cry_prob(card.ability.cry_prob, card.ability.extra.odds, card.ability.cry_rigged), + card.ability.extra.odds, + card.ability.extra.slot, + card.ability.extra.active, + card.ability.extra.jollies, + card.ability.extra.add, }, } end, @@ -448,7 +448,7 @@ local notebook = { end if jollycount >= card.ability.extra.jollies --if there are 5 or more jolly jokers - or pseudorandom("cry_notebook") < G.GAME.probabilities.normal / card.ability.extra.odds + or pseudorandom("cry_notebook") < cry_prob(card.ability.cry_prob, card.ability.extra.odds, card.ability.cry_rigged) / card.ability.extra.odds then card.ability.extra.slot = card.ability.extra.slot + card.ability.extra.add G.jokers.config.card_limit = G.jokers.config.card_limit + card.ability.extra.add @@ -657,20 +657,20 @@ local scrabble = { cost = 8, blueprint_compat = true, atlas = "atlasone", - loc_vars = function(self, info_queue, center) + loc_vars = function(self, info_queue, card) info_queue[#info_queue + 1] = G.P_CENTERS.e_cry_m - return { vars = { "" .. (G.GAME and G.GAME.probabilities.normal or 1), center.ability.extra.odds } } + return { vars = { cry_prob(card.ability.cry_prob, card.ability.extra.odds, card.ability.cry_rigged), card.ability.extra.odds } } end, calculate = function(self, card, context) if context.cardarea == G.jokers and context.before and not context.retrigger_joker then local check = false - --if pseudorandom('scrabble') < G.GAME.probabilities.normal/card.ability.extra.odds then + --if pseudorandom('scrabble') < cry_prob(card.ability.cry_prob, card.ability.extra.odds, card.ability.cry_rigged)/card.ability.extra.odds then --check = true --local card = create_card('Joker', G.jokers, nil, nil, nil, nil, 'j_jolly') --card:add_to_deck() --G.jokers:emplace(card) --end - if pseudorandom("scrabbleother") < G.GAME.probabilities.normal / card.ability.extra.odds then + if pseudorandom("scrabbleother") < cry_prob(card.ability.cry_prob, card.ability.extra.odds, card.ability.cry_rigged) / card.ability.extra.odds then check = true local card = create_card("Joker", G.jokers, nil, 0.9, nil, nil, nil, "scrabbletile") card:set_edition({ cry_m = true }) diff --git a/Items/Misc.lua b/Items/Misc.lua index 3b0952470..dbe080d5c 100644 --- a/Items/Misc.lua +++ b/Items/Misc.lua @@ -956,8 +956,8 @@ local echo = { atlas = "cry_misc", pos = { x = 2, y = 0 }, config = { retriggers = 2, extra = 2 }, - loc_vars = function(self, info_queue) - return { vars = { self.config.retriggers, G.GAME.probabilities.normal, self.config.extra } } + loc_vars = function(self, info_queue, card) + return { vars = { self.config.retriggers, card and cry_prob(card.ability.cry_prob, card.ability.extra, card.ability.cry_rigged) or 1, self.config.extra } } -- idk how this works end, } local eclipse = { @@ -1605,7 +1605,7 @@ return { local total_repetitions = ret and ret.repetitions or 0 if self.config.center == G.P_CENTERS.m_cry_echo then - if pseudorandom("echo") < G.GAME.probabilities.normal / (self.ability.extra or 2) then --hacky crash fix + if pseudorandom("echo") < cry_prob(self.ability.cry_prob, self.ability.extra or 2, self.ability.cry_rigged) / (self.ability.extra or 2) then --hacky crash fix total_repetitions = total_repetitions + self.ability.retriggers end end diff --git a/Items/MiscJokers.lua b/Items/MiscJokers.lua index 078c19033..22c201960 100644 --- a/Items/MiscJokers.lua +++ b/Items/MiscJokers.lua @@ -3393,7 +3393,7 @@ local rnjoker = { or (card.ability.extra and card.ability.extra.value) or 0, card.ability.extra and card.ability.extra.cond_value or 0, - G.GAME and G.GAME.probabilities.normal or 1, + cry_prob(card.ability.cry_prob, card.ability.extra and card.ability.extra.cond_value or 0, card.ability.cry_rigged), }, } if card.ability.extra and card.ability.extra.color then @@ -3626,7 +3626,7 @@ local rnjoker = { elseif j.cond == "odds" then if pseudorandom("rnj") - < ((G.GAME and G.GAME.probabilities.normal or 1) / card.ability.extra.cond_value) + < (cry_prob(card.ability.cry_prob, card.ability.extra.cond_value, card.ability.cry_rigged) / card.ability.extra.cond_value) then cond_passed = true end @@ -3903,7 +3903,7 @@ local rnjoker = { elseif j.cond == "odds" then if pseudorandom("rnj") - < ((G.GAME and G.GAME.probabilities.normal or 1) / card.ability.extra.cond_value) + < (cry_prob(card.ability.cry_prob, card.ability.extra.cond_value, card.ability.cry_rigged) / card.ability.extra.cond_value) then cond_passed = true end @@ -3987,7 +3987,7 @@ local rnjoker = { elseif j.cond == "odds" then if pseudorandom("rnj") - < ((G.GAME and G.GAME.probabilities.normal or 1) / card.ability.extra.cond_value) + < (cry_prob(card.ability.cry_prob, card.ability.extra.cond_value, card.ability.cry_rigged) / card.ability.extra.cond_value) then cond_passed = true end @@ -4555,7 +4555,7 @@ local filler = { key = "filler", pos = { x = 0, y = 1 }, pools = {["Meme"] = true}, - config = { Xmult = 1.00000000000002, type = "High Card" }, + config = { Xmult = 1.00000000000003, type = "High Card" }, loc_vars = function(self, info_queue, card) return { vars = { card.ability.x_mult, localize(card.ability.type, "poker_hands") } } end, @@ -5440,7 +5440,7 @@ local oldblueprint = { loc_vars = function(self, info_queue, card) card.ability.blueprint_compat_ui = card.ability.blueprint_compat_ui or ''; card.ability.blueprint_compat_check = nil return { - vars = { "" .. (G.GAME and G.GAME.probabilities.normal or 1), card.ability.extra.odds }, + vars = { cry_prob(card.ability.cry_prob, card.ability.extra.odds, card.ability.cry_rigged), card.ability.extra.odds }, main_end = (card.area and card.area == G.jokers) and { {n=G.UIT.C, config={align = "bm", minh = 0.4}, nodes={ {n=G.UIT.C, config={ref_table = card, align = "m", colour = G.C.JOKER_GREY, r = 0.05, padding = 0.06, func = 'blueprint_compat'}, nodes={ @@ -5461,7 +5461,7 @@ local oldblueprint = { and not context.blueprint and not context.retrigger_joker then - if pseudorandom("oldblueprint") < G.GAME.probabilities.normal / card.ability.extra.odds then + if pseudorandom("oldblueprint") < cry_prob(card.ability.cry_prob, card.ability.extra.odds, card.ability.cry_rigged) / card.ability.extra.odds then G.E_MANAGER:add_event(Event({ func = function() play_sound("tarot1") @@ -5631,15 +5631,15 @@ local busdriver = { order = 46, atlas = "atlasthree", blueprint_compat = true, - loc_vars = function(self, info_queue, center) - local prob = (G.GAME and G.GAME.probabilities.normal or 1) - local oddy = math.max(1, center.ability.extra.odds) + loc_vars = function(self, info_queue, card) + local prob = cry_prob(card.ability.cry_prob, card.ability.extra.odds, card.ability.cry_rigged) + local oddy = math.max(1, card.ability.extra.odds) return { vars = { - "" .. ( oddy - 1/prob ), - center.ability.extra.mult, + ( oddy - 1/prob ), + card.ability.extra.mult, oddy, - "" .. ( 1/prob ), + ( 1/prob ), }, } end, @@ -5651,7 +5651,7 @@ local busdriver = { and not context.after then local oddy = math.max(1, card.ability.extra.odds) - if pseudorandom("busdriver") < 1-(1/(G.GAME.probabilities.normal*oddy)) then + if pseudorandom("busdriver") < 1-(1/(cry_prob(card.ability.cry_prob, card.ability.extra.cond_value, card.ability.cry_rigged)*oddy)) then return { message = localize({ type = "variable", key = "a_mult", vars = { card.ability.extra.mult } }), mult_mod = card.ability.extra.mult, @@ -6770,7 +6770,7 @@ local digitalhallucinations = { order = 130, config = { odds = 2 }, loc_vars = function(self, info_queue, card) - return { vars = { G.GAME and G.GAME.probabilities.normal or 1, card.ability.odds } } + return { vars = { cry_prob(card.ability.cry_prob, card.ability.odds, card.ability.cry_rigged), card.ability.odds } } end, atlas = "atlasthree", rarity = 2, @@ -6781,7 +6781,7 @@ local digitalhallucinations = { -- you know, i was totally ready to do something smart here but vanilla hardcodes this stuff, so i will too -- some cards need to be handled slightly differently anyway, adding mod support can't really be automatic in some circumstances - if context.open_booster and (pseudorandom("digi") < G.GAME.probabilities.normal/card.ability.odds) then + if context.open_booster and (pseudorandom("digi") < cry_prob(card.ability.cry_prob, card.ability.extra.cond_value, card.ability.cry_rigged)/card.ability.odds) then local boosty = context.card local consums = {'Arcana', 'Celestial', 'Spectral'} local short1 = {'tarot', 'planet', 'spectral'} diff --git a/Items/Planets.lua b/Items/Planets.lua index ed71be62a..7fa6b5caa 100644 --- a/Items/Planets.lua +++ b/Items/Planets.lua @@ -344,15 +344,15 @@ local planetlua = { aurinko = true, atlas = "atlasnotjokers", order = 1, - loc_vars = function(self, info_queue, center) - return { vars = { "" .. (G.GAME and G.GAME.probabilities.normal or 1), self.config.extra.odds } } + loc_vars = function(self, info_queue, card) + return { vars = { card and cry_prob(card.ability.cry_prob, card.ability.extra.odds, card.ability.cry_rigged) or 1, card and card.ability.extra.odds or self.config.extra.odds} } end, can_use = function(self, card) return true end, use = function(self, card, area, copier) local used_consumable = copier or card - if pseudorandom("planetlua") < G.GAME.probabilities.normal / card.ability.extra.odds then --Code "borrowed" from black hole + if pseudorandom("planetlua") < cry_prob(card.ability.cry_prob, card.ability.extra.odds, card.ability.cry_rigged) / card.ability.extra.odds then --Code "borrowed" from black hole update_hand_text( { sound = "button", volume = 0.7, pitch = 0.8, delay = 0.3 }, { handname = localize("k_all_hands"), chips = "...", mult = "...", level = "" } @@ -495,7 +495,7 @@ local planetlua = { else for i = 1, number do quota = quota - + (pseudorandom("planetlua") < G.GAME.probabilities.normal / card.ability.extra.odds and 1 or 0) + + (pseudorandom("planetlua") < cry_prob(card.ability.cry_prob, card.ability.extra.odds, card.ability.cry_rigged) / card.ability.extra.odds and 1 or 0) end if quota > 0 then update_hand_text( @@ -593,7 +593,7 @@ local planetlua = { calculate = function(self, card, context) --Observatory effect: (G.GAME.probabilities.normal) in (odds) chance for (G.P_CENTERS.v_observatory.config.extra) Mult if G.GAME.used_vouchers.v_observatory - and (pseudorandom("nstar") < G.GAME.probabilities.normal / card.ability.extra.odds) + and (pseudorandom("nstar") < cry_prob(card.ability.cry_prob, card.ability.extra.odds, card.ability.cry_rigged) / card.ability.extra.odds) then local value = G.P_CENTERS.v_observatory.config.extra return { diff --git a/Items/Spooky.lua b/Items/Spooky.lua index 7bde2c231..c45e9fd4d 100644 --- a/Items/Spooky.lua +++ b/Items/Spooky.lua @@ -810,7 +810,7 @@ local ghost = { no_dbl = true, calculate = function(self, card, context) if context.end_of_round and not context.individual and not context.repetition and not context.blueprint and not context.retrigger_joker then - if pseudorandom(pseudoseed("cry_ghost_destroy")) < G.GAME.probabilities.normal/card.ability.extra.destroy_rate then + if pseudorandom(pseudoseed("cry_ghost_destroy")) < cry_prob(card.ability.cry_prob, card.ability.extra.destroy_rate, card.ability.cry_rigged)/card.ability.extra.destroy_rate then G.E_MANAGER:add_event(Event({ func = function() card:start_dissolve() @@ -829,7 +829,7 @@ local ghost = { return end --todo: let multiple ghosts possess multiple jokers - if pseudorandom(pseudoseed("cry_ghost_possess")) < G.GAME.probabilities.normal/card.ability.extra.possess_rate then + if pseudorandom(pseudoseed("cry_ghost_possess")) < cry_prob(card.ability.cry_prob, card.ability.extra.possess_rate, card.ability.cry_rigged)/card.ability.extra.possess_rate then for i = 1, #G.jokers.cards do G.jokers.cards[i].ability.cry_possessed = nil end @@ -846,9 +846,9 @@ local ghost = { end end end, - loc_vars = function(self, info_queue, center) + loc_vars = function(self, info_queue, card) info_queue[#info_queue + 1] = { set = "Other", key = "cry_possessed"} - return { vars = { G.GAME.probabilities.normal or 1, center.ability.extra.possess_rate, center.ability.extra.destroy_rate } } + return { vars = { cry_prob(card.ability.cry_prob, card.ability.extra.destroy_rate, card.ability.cry_rigged), card.ability.extra.possess_rate, card.ability.extra.destroy_rate } } end, } local possessed = { @@ -1224,7 +1224,7 @@ local monopoly_money = { no_dbl = true, calculate = function(self, card, context) if context.buying_card and not context.blueprint_card and not context.retrigger_joker and not (context.card == card) then - if pseudorandom(pseudoseed("cry_monopoly")) < G.GAME.probabilities.normal/card.ability.extra.fail_rate then + if pseudorandom(pseudoseed("cry_monopoly")) < cry_prob(card.ability.cry_prob, card.ability.extra.fail_rate, card.ability.cry_rigged)/card.ability.extra.fail_rate then G.E_MANAGER:add_event(Event({ func = function() context.card:start_dissolve() @@ -1248,8 +1248,8 @@ local monopoly_money = { return nil, true end end, - loc_vars = function(self, info_queue, center) - return { vars = { G.GAME.probabilities.normal or 1, center.ability.extra.fail_rate} } + loc_vars = function(self, info_queue, card) + return { vars = { cry_prob(card.ability.cry_prob, card.ability.extra.fail_rate, card.ability.cry_rigged), card.ability.extra.fail_rate} } end, } local candy_sticks = { diff --git a/lovely/Probability.toml b/lovely/Probability.toml new file mode 100644 index 000000000..1b4e67891 --- /dev/null +++ b/lovely/Probability.toml @@ -0,0 +1,288 @@ +[manifest] +version = "1.0.0" +dump_lua = true +priority = 5 + +# there's gonna be a lot of this +# init all cards with ability.cry_prob +[[patches]] +[patches.pattern] +target = "card.lua" +pattern = "self.base_cost = center.cost or 1" +position = "before" +payload = ''' +self.ability.cry_prob = 1 +''' +match_indent = true + +# define function in lovely +[[patches]] +[patches.pattern] +target = "functions/misc_functions.lua" +pattern = "function save_run()" +position = "before" +payload = ''' +function cry_prob(owned, den, rigged) + prob = G.GAME and G.GAME.probabilities.normal or 1 + if rigged then + return den + else + return prob*owned + end +end +''' +match_indent = true + +# lucky +[[patches]] +[patches.pattern] +target = "functions/common_events.lua" +pattern = '''elseif _c.effect == 'Lucky Card' then loc_vars = {G.GAME.probabilities.normal, cfg.mult, 5, cfg.p_dollars, 15}''' +position = "at" +payload = ''' +elseif _c.effect == 'Lucky Card' then loc_vars = {cfg.cry_prob and cry_prob(cfg.cry_prob, 15, cfg.cry_rigged) or G.GAME.probabilities.normal, cfg.mult, 5, cfg.p_dollars, 15} +''' +match_indent = true + +[[patches]] +[patches.pattern] +target = "card.lua" +pattern = '''if pseudorandom('lucky_money') < G.GAME.probabilities.normal/15 then''' +position = "at" +payload = ''' +if pseudorandom('lucky_money') < cry_prob(self.ability.cry_prob, 15, self.ability.cry_rigged)/15 then +''' +match_indent = true + +[[patches]] +[patches.pattern] +target = "card.lua" +pattern = '''if pseudorandom('lucky_mult') < G.GAME.probabilities.normal/5 then''' +position = "at" +payload = ''' +if pseudorandom('lucky_mult') < cry_prob(self.ability.cry_prob, 5, self.ability.cry_rigged)/5 then +''' +match_indent = true + +# glass +[[patches]] +[patches.pattern] +target = "functions/common_events.lua" +pattern = '''elseif _c.effect == 'Glass Card' then loc_vars = {cfg.Xmult, G.GAME.probabilities.normal, cfg.extra}''' +position = "at" +payload = ''' +elseif _c.effect == 'Glass Card' then loc_vars = {cfg.Xmult, cfg.cry_prob and cry_prob(cfg.cry_prob, cfg.extra, cfg.cry_rigged) or G.GAME.probabilities.normal, cfg.extra} +''' +match_indent = true + +# wow this is a fat line +[[patches]] +[patches.pattern] +target = "functions/state_events.lua" +pattern = '''if SMODS.has_enhancement(scoring_hand[i], 'm_glass') and not scoring_hand[i].debuff and pseudorandom('glass') < G.GAME.probabilities.normal/(scoring_hand[i].ability.name == 'Glass Card' and scoring_hand[i].ability.extra or G.P_CENTERS.m_glass.config.extra) then''' +position = "at" +payload = ''' +if SMODS.has_enhancement(scoring_hand[i], 'm_glass') and not scoring_hand[i].debuff and pseudorandom('glass') < cry_prob(scoring_hand[i].cry_prob, scoring_hand[i].ability.extra or G.P_CENTERS.m_glass.config.extra, scoring_hand[i].cry_rigged)/(scoring_hand[i].ability.name == 'Glass Card' and scoring_hand[i].ability.extra or G.P_CENTERS.m_glass.config.extra) then +''' +match_indent = true + +# wheeeeeeeeeeel +[[patches]] +[patches.pattern] +target = "functions/common_events.lua" +pattern = '''elseif _c.name == "The Wheel of Fortune" then loc_vars = {G.GAME.probabilities.normal, cfg.extra}; info_queue[#info_queue+1] = G.P_CENTERS.e_foil; info_queue[#info_queue+1] = G.P_CENTERS.e_holo; info_queue[#info_queue+1] = G.P_CENTERS.e_polychrome;''' +position = "at" +payload = ''' +elseif _c.name == "The Wheel of Fortune" then loc_vars = {cfg.cry_prob and cry_prob(cfg.cry_prob, cfg.extra, cfg.cry_rigged) or G.GAME.probabilities.normal, cfg.extra}; info_queue[#info_queue+1] = G.P_CENTERS.e_foil; info_queue[#info_queue+1] = G.P_CENTERS.e_holo; info_queue[#info_queue+1] = G.P_CENTERS.e_polychrome; +''' +match_indent = true + +[[patches]] +[patches.pattern] +target = "card.lua" +pattern = '''if self.ability.name == 'Ectoplasm' or self.ability.name == 'Hex' or pseudorandom('wheel_of_fortune') < G.GAME.probabilities.normal/self.ability.extra then''' +position = "at" +payload = ''' +if self.ability.name == 'Ectoplasm' or self.ability.name == 'Hex' or pseudorandom('wheel_of_fortune') < cry_prob(self.ability.cry_prob, self.ability.extra, self.ability.cry_rigged)/self.ability.extra then +''' +match_indent = true + +# ok now onto jonklers + +# space +[[patches]] +[patches.pattern] +target = "card.lua" +pattern = '''elseif self.ability.name == 'Space Joker' then loc_vars = {''..(G.GAME and G.GAME.probabilities.normal or 1), self.ability.extra}''' +position = "at" +payload = ''' +elseif self.ability.name == 'Space Joker' then loc_vars = {cry_prob(self.ability.cry_prob, self.ability.extra, self.ability.cry_rigged), self.ability.extra} +''' +match_indent = true + +[[patches]] +[patches.pattern] +target = "card.lua" +pattern = '''if self.ability.name == 'Space Joker' and pseudorandom('space') < G.GAME.probabilities.normal/self.ability.extra then''' +position = "at" +payload = ''' +if self.ability.name == 'Space Joker' and pseudorandom('space') < cry_prob(self.ability.cry_prob, self.ability.extra, self.ability.cry_rigged)/self.ability.extra then +''' +match_indent = true + +# 8ball +[[patches]] +[patches.pattern] +target = "card.lua" +pattern = '''elseif self.ability.name == '8 Ball' then loc_vars = {''..(G.GAME and G.GAME.probabilities.normal or 1),self.ability.extra}''' +position = "at" +payload = ''' +elseif self.ability.name == '8 Ball' then loc_vars = {cry_prob(self.ability.cry_prob, self.ability.extra, self.ability.cry_rigged),self.ability.extra} +''' +match_indent = true + +[[patches]] +[patches.pattern] +target = "card.lua" +pattern = '''if (context.other_card:get_id() == 8) and (pseudorandom('8ball') < G.GAME.probabilities.normal/self.ability.extra) then''' +position = "at" +payload = ''' +if (context.other_card:get_id() == 8) and (pseudorandom('8ball') < cry_prob(self.ability.cry_prob, self.ability.extra, self.ability.cry_rigged)/self.ability.extra) then +''' +match_indent = true + +# business +[[patches]] +[patches.pattern] +target = "card.lua" +pattern = '''elseif self.ability.name == 'Business Card' then loc_vars = {''..(G.GAME and G.GAME.probabilities.normal or 1), self.ability.extra}''' +position = "at" +payload = ''' +elseif self.ability.name == 'Business Card' then loc_vars = {cry_prob(self.ability.cry_prob, self.ability.extra, self.ability.cry_rigged),self.ability.extra} +''' +match_indent = true + +[[patches]] +[patches.pattern] +target = "card.lua" +pattern = '''pseudorandom('business') < G.GAME.probabilities.normal/self.ability.extra then''' +position = "at" +payload = ''' +pseudorandom('business') < cry_prob(self.ability.cry_prob, self.ability.extra, self.ability.cry_rigged)/self.ability.extra then +''' +match_indent = true + +# gros michel + cavendish +[[patches]] +[patches.pattern] +target = "card.lua" +pattern = '''elseif self.ability.name == 'Gros Michel' then loc_vars = {self.ability.extra.mult, ''..(G.GAME and G.GAME.probabilities.normal or 1), self.ability.extra.odds}''' +position = "at" +payload = ''' +elseif self.ability.name == 'Gros Michel' then loc_vars = {self.ability.extra.mult, cry_prob(self.ability.cry_prob, self.ability.extra.odds, self.ability.cry_rigged), self.ability.extra.odds} +''' +match_indent = true + +[[patches]] +[patches.pattern] +target = "card.lua" +pattern = '''elseif self.ability.name == 'Cavendish' then loc_vars = {self.ability.extra.Xmult, ''..(G.GAME and G.GAME.probabilities.normal or 1), self.ability.extra.odds}''' +position = "at" +payload = ''' +elseif self.ability.name == 'Cavendish' then loc_vars = {self.ability.extra.Xmult, cry_prob(self.ability.cry_prob, self.ability.extra.odds, self.ability.cry_rigged), self.ability.extra.odds} +''' +match_indent = true + +[[patches]] +[patches.pattern] +target = "card.lua" +pattern = '''if pseudorandom(self.ability.name == 'Cavendish' and 'cavendish' or 'gros_michel') < G.GAME.probabilities.normal/self.ability.extra.odds then''' +position = "at" +payload = ''' +if pseudorandom(self.ability.name == 'Cavendish' and 'cavendish' or 'gros_michel') < cry_prob(self.ability.cry_prob, self.ability.extra.odds, self.ability.cry_rigged)/self.ability.extra.odds then +''' +match_indent = true + +# business +[[patches]] +[patches.pattern] +target = "card.lua" +pattern = '''elseif self.ability.name == 'Business Card' then loc_vars = {''..(G.GAME and G.GAME.probabilities.normal or 1), self.ability.extra}''' +position = "at" +payload = ''' +elseif self.ability.name == 'Business Card' then loc_vars = {cry_prob(self.ability.cry_prob, self.ability.extra, self.ability.cry_rigged),self.ability.extra} +''' +match_indent = true + +[[patches]] +[patches.pattern] +target = "card.lua" +pattern = '''pseudorandom('business') < G.GAME.probabilities.normal/self.ability.extra then''' +position = "at" +payload = ''' +pseudorandom('business') < cry_prob(self.ability.cry_prob, self.ability.extra, self.ability.cry_rigged)/self.ability.extra then +''' +match_indent = true + +# bloodstone +[[patches]] +[patches.pattern] +target = "card.lua" +pattern = '''elseif self.ability.name == 'Bloodstone' then loc_vars = {''..(G.GAME and G.GAME.probabilities.normal or 1), self.ability.extra.odds, self.ability.extra.Xmult}''' +position = "at" +payload = ''' +elseif self.ability.name == 'Bloodstone' then loc_vars = {cry_prob(self.ability.cry_prob, self.ability.extra.odds, self.ability.cry_rigged), self.ability.extra.odds, self.ability.extra.Xmult} +''' +match_indent = true + +[[patches]] +[patches.pattern] +target = "card.lua" +pattern = '''pseudorandom('bloodstone') < G.GAME.probabilities.normal/self.ability.extra.odds then''' +position = "at" +payload = ''' +pseudorandom('bloodstone') < cry_prob(self.ability.cry_prob, self.ability.extra.odds, self.ability.cry_rigged)/self.ability.extra.odds then +''' +match_indent = true + +# reserved parking +[[patches]] +[patches.pattern] +target = "card.lua" +pattern = '''elseif self.ability.name == 'Reserved Parking' then loc_vars = {self.ability.extra.dollars, ''..(G.GAME and G.GAME.probabilities.normal or 1), self.ability.extra.odds}''' +position = "at" +payload = ''' +elseif self.ability.name == 'Reserved Parking' then loc_vars = {self.ability.extra.dollars, cry_prob(self.ability.cry_prob, self.ability.extra.odds, self.ability.cry_rigged), self.ability.extra.odds} +''' +match_indent = true + +[[patches]] +[patches.pattern] +target = "card.lua" +pattern = '''pseudorandom('parking') < G.GAME.probabilities.normal/self.ability.extra.odds then''' +position = "at" +payload = ''' +pseudorandom('parking') < cry_prob(self.ability.cry_prob, self.ability.extra.odds, self.ability.cry_rigged)/self.ability.extra.odds then +''' +match_indent = true + +# hallucination +[[patches]] +[patches.pattern] +target = "card.lua" +pattern = '''elseif self.ability.name == 'Hallucination' then loc_vars = {G.GAME.probabilities.normal, self.ability.extra}''' +position = "at" +payload = ''' +elseif self.ability.name == 'Hallucination' then loc_vars = {cry_prob(self.ability.cry_prob, self.ability.extra, self.ability.cry_rigged), self.ability.extra} +''' +match_indent = true + +[[patches]] +[patches.pattern] +target = "card.lua" +pattern = '''if pseudorandom('halu'..G.GAME.round_resets.ante) < G.GAME.probabilities.normal/self.ability.extra then''' +position = "at" +payload = ''' +if pseudorandom('halu'..G.GAME.round_resets.ante) < cry_prob(self.ability.cry_prob, self.ability.extra, self.ability.cry_rigged)/self.ability.extra then +''' +match_indent = true