Add new blind: The Improbable

This commit is contained in:
Emik 2025-03-25 18:04:32 +01:00
parent f3fe645e47
commit 3f5d86af73
Signed by untrusted user who does not match committer: emik
GPG key ID: 09CDFF9E5703688D
2 changed files with 52 additions and 5 deletions

View file

@ -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 = {

View file

@ -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,
}