Improve Martingale RNG for Balatro Multiplayer
This commit is contained in:
parent
c451fa6d57
commit
29f29c566d
2 changed files with 10 additions and 3 deletions
|
|
@ -328,7 +328,11 @@ if cry_prob then
|
|||
end
|
||||
|
||||
function SMODS.current_mod:calculate(context)
|
||||
---@diagnostic disable-next-line: undefined-global
|
||||
if context.setting_blind and G.GAME.blind.name == "bl_mp_nemesis" then
|
||||
local modifiers = G.GAME.modifiers
|
||||
modifiers.Roland_martingale_seed = (modifiers.Roland_martingale_seed or 0) + 1
|
||||
end
|
||||
|
||||
local _ = type(G.calc) == "function" and G.calc(f(context):keys():string())
|
||||
local improbable, orig = G.GAME.modifiers.Roland_improbable, G.GAME.probabilities
|
||||
|
||||
|
|
|
|||
|
|
@ -619,11 +619,14 @@ joker {
|
|||
local extra, numerator, xmult = card.ability.extra, 1, 1
|
||||
|
||||
for _ = 1, 64 do
|
||||
if SMODS.pseudorandom_probability(card, self.key, 1, extra.odds, "RolandMartingale") then
|
||||
local g = G.GAME
|
||||
local key = "RolandMartingale" .. (g.modifiers.Roland_martingale_seed or "")
|
||||
|
||||
if SMODS.pseudorandom_probability(card, self.key, 1, extra.odds, key) then
|
||||
break
|
||||
end
|
||||
|
||||
numerator = numerator * (extra.odds - G.GAME.probabilities.normal)
|
||||
numerator = numerator * (extra.odds - g.probabilities.normal)
|
||||
local message = number_format(numerator) .. "/" .. number_format(xmult)
|
||||
SMODS.calculate_effect({card = card, repetitions = 1, message = message}, card)
|
||||
xmult = xmult * extra.odds
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue