Add new blind: The Improbable
This commit is contained in:
parent
f3fe645e47
commit
3f5d86af73
2 changed files with 52 additions and 5 deletions
|
|
@ -1,12 +1,13 @@
|
||||||
return {
|
return {
|
||||||
descriptions = {
|
descriptions = {
|
||||||
Blind = {
|
Blind = {
|
||||||
|
bl_Roland_improbable = {
|
||||||
|
name = "The Improbable",
|
||||||
|
text = {"{C:attention}All probabilities", "cannot happen"}
|
||||||
|
},
|
||||||
bl_Roland_nimble = {
|
bl_Roland_nimble = {
|
||||||
name = "The Nimble",
|
name = "The Nimble",
|
||||||
text = {
|
text = {"The first {C:attention}5 cards", "drawn are {C:attention}played"}
|
||||||
"The first {C:attention}5 cards",
|
|
||||||
"drawn are {C:attention}played",
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Joker = {
|
Joker = {
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ SMODS.Atlas {
|
||||||
|
|
||||||
SMODS.Blind {
|
SMODS.Blind {
|
||||||
key = "nimble",
|
key = "nimble",
|
||||||
boss = {min = 1, max = 10, no_orb = true, hardcore = true},
|
boss = {min = 1, max = 10},
|
||||||
boss_colour = HEX("0291fb"),
|
boss_colour = HEX("0291fb"),
|
||||||
atlas = "blind",
|
atlas = "blind",
|
||||||
pos = {x = 0, y = 0},
|
pos = {x = 0, y = 0},
|
||||||
|
|
@ -48,3 +48,49 @@ SMODS.Blind {
|
||||||
self.disabled = false
|
self.disabled = false
|
||||||
end,
|
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,
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue