diff --git a/localization/en-us.lua b/localization/en-us.lua index d487b68..2542663 100644 --- a/localization/en-us.lua +++ b/localization/en-us.lua @@ -1,12 +1,13 @@ return { descriptions = { Blind = { + bl_Roland_improbable = { + name = "The Improbable", + text = {"{C:attention}All probabilities", "cannot happen"} + }, bl_Roland_nimble = { name = "The Nimble", - text = { - "The first {C:attention}5 cards", - "drawn are {C:attention}played", - } + text = {"The first {C:attention}5 cards", "drawn are {C:attention}played"} }, }, Joker = { diff --git a/src/blind.lua b/src/blind.lua index 214f22e..ac78084 100644 --- a/src/blind.lua +++ b/src/blind.lua @@ -9,7 +9,7 @@ SMODS.Atlas { SMODS.Blind { key = "nimble", - boss = {min = 1, max = 10, no_orb = true, hardcore = true}, + boss = {min = 1, max = 10}, boss_colour = HEX("0291fb"), atlas = "blind", pos = {x = 0, y = 0}, @@ -48,3 +48,49 @@ SMODS.Blind { self.disabled = false end, } + +local function disable() + local orig = (getmetatable(G.GAME.probabilities) or {}).orig + + if orig then + G.GAME.probabilities = orig + end +end + +local orig_pseudorandom = pseudorandom + +---@diagnostic disable-next-line: lowercase-global +function pseudorandom(seed, min, max) + return getmetatable(G.GAME.probabilities) and 0 / 0 or orig_pseudorandom(seed, min, max) +end + +SMODS.Blind { + key = "improbable", + boss = {min = 1, max = 10}, + boss_colour = HEX("aaaaaa"), + atlas = "blind", + pos = {x = 0, y = 0}, + mult = 2, + dollars = 5, + defeat = disable, + disable = disable, + set_blind = function(_) + local orig = G.GAME.probabilities + + local mt = { + orig = orig, + __index = function (_, k) + return k == "normal" and 0 or orig[k] + end, + __newindex = function (_, k, v) + if k ~= "normal" or v ~= 0 then + orig[k] = v + end + end, + } + + local proxy = {} + setmetatable(proxy, mt) + G.GAME.probabilities = proxy + end, +}