Cleanup
This commit is contained in:
parent
9f26d375c6
commit
b11298f675
5 changed files with 78 additions and 74 deletions
|
|
@ -173,14 +173,14 @@ return {
|
||||||
j_Roland_martingale = {
|
j_Roland_martingale = {
|
||||||
name = "Martingale",
|
name = "Martingale",
|
||||||
text = {
|
text = {
|
||||||
"{C:green}#1# in #2#{} chance to give {X:mult,C:white}X#2#{} Mult",
|
"{C:green}#1# in #2#{} chance to give {X:mult,C:white}X#1#{} Mult",
|
||||||
"{s:0.9}Otherwise {C:green,s:0.9}#1# in #2#{s:0.9} chance to give {X:mult,C:white,s:0.9}X#3#{s:0.9} Mult",
|
"{s:0.9}Otherwise {C:green,s:0.9}#1# in #2#{s:0.9} chance to give {X:mult,C:white,s:0.9}X#2#{s:0.9} Mult",
|
||||||
"{s:0.81}Otherwise {C:green,s:0.81}#1# in #2#{s:0.81} chance to give {X:mult,C:white,s:0.81}X#4#{s:0.81} Mult",
|
"{s:0.81}Otherwise {C:green,s:0.81}#1# in #2#{s:0.81} chance to give {X:mult,C:white,s:0.81}X#3#{s:0.81} Mult",
|
||||||
"{s:0.6561}Otherwise {C:green,s:0.6561}#1# in #2#{s:0.6561} chance to give {X:mult,C:white,s:0.6561}X#5#{s:0.6561} Mult",
|
"{s:0.6561}Otherwise {C:green,s:0.6561}#1# in #2#{s:0.6561} chance to give {X:mult,C:white,s:0.6561}X#4#{s:0.6561} Mult",
|
||||||
"{s:0.43046721}Otherwise {C:green,s:0.43046721}#1# in #2#{s:0.43046721} chance to give {X:mult,C:white,s:0.43046721}X#6#{s:0.43046721} Mult",
|
"{s:0.43046721}Otherwise {C:green,s:0.43046721}#1# in #2#{s:0.43046721} chance to give {X:mult,C:white,s:0.43046721}X#5#{s:0.43046721} Mult",
|
||||||
"{s:0.1853020188851841}Otherwise {C:green,s:0.1853020188851841}#1# in #2#{s:0.1853020188851841} chance to give {X:mult,C:white,s:0.1853020188851841}X#7#{s:0.1853020188851841} Mult",
|
"{s:0.1853020188851841}Otherwise {C:green,s:0.1853020188851841}#1# in #2#{s:0.1853020188851841} chance to give {X:mult,C:white,s:0.1853020188851841}X#6#{s:0.1853020188851841} Mult",
|
||||||
"{s:0.0343368382029250877861747139}Otherwise {C:green,s:0.0343368382029250877861747139}#1# in #2#{s:0.0343368382029250877861747139} chance to give {X:mult,C:white,s:0.0343368382029250877861747139}X#8#{s:0.0343368382029250877861747139} Mult",
|
"{s:0.0343368382029250877861747139}Otherwise {C:green,s:0.0343368382029250877861747139}#1# in #2#{s:0.0343368382029250877861747139} chance to give {X:mult,C:white,s:0.0343368382029250877861747139}X#7#{s:0.0343368382029250877861747139} Mult",
|
||||||
"{s:0}Otherwise {C:green,s:0}#1# in #2#{s:0} chance to give {X:mult,C:white,s:0}X#9#{s:0} Mult",
|
"{s:0}Otherwise {C:green,s:0}#1# in #2#{s:0} chance to give {X:mult,C:white,s:0}X#8#{s:0} Mult",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
j_Roland_mrsbones = {
|
j_Roland_mrsbones = {
|
||||||
|
|
|
||||||
103
src/blind.lua
103
src/blind.lua
|
|
@ -4,11 +4,13 @@ local blind = (function()
|
||||||
local y = 0
|
local y = 0
|
||||||
|
|
||||||
---@param tbl SMODS.Blind
|
---@param tbl SMODS.Blind
|
||||||
|
---@return SMODS.Blind
|
||||||
return function(tbl)
|
return function(tbl)
|
||||||
tbl.pos = {x = 0, y = y}
|
tbl.pos = {x = 0, y = y}
|
||||||
tbl.atlas = "blind"
|
tbl.atlas = "blind"
|
||||||
SMODS.Blind(tbl)
|
local ret = SMODS.Blind(tbl)
|
||||||
y = y + 1
|
y = y + 1
|
||||||
|
return ret
|
||||||
end
|
end
|
||||||
end)()
|
end)()
|
||||||
|
|
||||||
|
|
@ -153,7 +155,7 @@ blind {
|
||||||
end)
|
end)
|
||||||
|
|
||||||
q(function()
|
q(function()
|
||||||
pseudoshuffle(G.deck.cards, pseudoseed "Roland_falseshuffle")
|
pseudoshuffle(G.deck.cards, pseudoseed "RolandFalseShuffle")
|
||||||
end)
|
end)
|
||||||
end,
|
end,
|
||||||
calculate = function(_, b, context)
|
calculate = function(_, b, context)
|
||||||
|
|
@ -323,48 +325,6 @@ if cry_prob then
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local orig_update = Game.update
|
|
||||||
|
|
||||||
---@diagnostic disable-next-line: duplicate-set-field
|
|
||||||
function Game.update(...)
|
|
||||||
orig_update(...)
|
|
||||||
|
|
||||||
local boss_colour = (G.P_BLINDS.bl_Roland_venerable_visage or {}).boss_colour
|
|
||||||
|
|
||||||
if boss_colour then
|
|
||||||
boss_colour[1], boss_colour[2], boss_colour[3] = hsv_to_rgb(os.clock() / 6 % 1, 0.25, 0.75)
|
|
||||||
end
|
|
||||||
|
|
||||||
local improbable, orig = G.GAME.modifiers.Roland_improbable, G.GAME.probabilities
|
|
||||||
|
|
||||||
-- Normally unreachable since we set it to nil ourselves,
|
|
||||||
-- but other mods may want to use this modifier.
|
|
||||||
if improbable == false then
|
|
||||||
disable_improbable()
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
if not improbable or getmetatable(orig) then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local normal = orig.normal
|
|
||||||
|
|
||||||
local mt = {
|
|
||||||
orig = orig,
|
|
||||||
__index = function(_, k)
|
|
||||||
return k == "normal" and 0 or orig[k]
|
|
||||||
end,
|
|
||||||
__newindex = function(_, k, v)
|
|
||||||
orig[k] = (k == "normal" and v == 0) and normal or v
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
|
|
||||||
local proxy = {}
|
|
||||||
setmetatable(proxy, mt)
|
|
||||||
G.GAME.probabilities = proxy
|
|
||||||
end
|
|
||||||
|
|
||||||
blind {
|
blind {
|
||||||
key = "equinox",
|
key = "equinox",
|
||||||
boss = {min = 6},
|
boss = {min = 6},
|
||||||
|
|
@ -416,7 +376,7 @@ function UIElement:draw_self(...)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
blind {
|
local venerable_visage = blind {
|
||||||
key = "venerable_visage",
|
key = "venerable_visage",
|
||||||
boss = {showdown = true},
|
boss = {showdown = true},
|
||||||
boss_colour = HEX "f6f6f2ff",
|
boss_colour = HEX "f6f6f2ff",
|
||||||
|
|
@ -433,12 +393,11 @@ blind {
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
if b.Roland_oh_no or not context.end_of_round or not next(G.deck.cards) or not next(G.hand.cards) then
|
if b.Roland_vitriol or not context.end_of_round or not next(G.deck.cards) or not next(G.hand.cards) then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
b.Roland_oh_no = true
|
b.Roland_vitriol = true
|
||||||
b:wiggle()
|
|
||||||
self.vitriol(b)
|
self.vitriol(b)
|
||||||
|
|
||||||
q {
|
q {
|
||||||
|
|
@ -450,6 +409,10 @@ blind {
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
vitriol = function(b)
|
vitriol = function(b)
|
||||||
|
if type(b) == "table" and type(b.wiggle) == "function" then
|
||||||
|
b:wiggle()
|
||||||
|
end
|
||||||
|
|
||||||
local fail = G.localization.descriptions.Blind.bl_Roland_venerable_visage.fail
|
local fail = G.localization.descriptions.Blind.bl_Roland_venerable_visage.fail
|
||||||
local speed = 0.1
|
local speed = 0.1
|
||||||
|
|
||||||
|
|
@ -457,7 +420,7 @@ blind {
|
||||||
play_sound("gong", 0.6)
|
play_sound("gong", 0.6)
|
||||||
|
|
||||||
attention_text {
|
attention_text {
|
||||||
text = pseudorandom_element(fail, pseudoseed "Roland_venerable_visage"),
|
text = pseudorandom_element(fail, pseudoseed "RolandVenerableVisage"),
|
||||||
offset = {x = 0, y = -3.6},
|
offset = {x = 0, y = -3.6},
|
||||||
major = G.play,
|
major = G.play,
|
||||||
scale = 3,
|
scale = 3,
|
||||||
|
|
@ -506,3 +469,45 @@ blind {
|
||||||
delay(1)
|
delay(1)
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
local orig_update = Game.update
|
||||||
|
|
||||||
|
---@diagnostic disable-next-line: duplicate-set-field
|
||||||
|
function Game.update(...)
|
||||||
|
orig_update(...)
|
||||||
|
|
||||||
|
local boss_colour = (venerable_visage or {}).boss_colour
|
||||||
|
|
||||||
|
if boss_colour then
|
||||||
|
boss_colour[1], boss_colour[2], boss_colour[3] = hsv_to_rgb(os.clock() / 6 % 1, 0.25, 0.75)
|
||||||
|
end
|
||||||
|
|
||||||
|
local improbable, orig = G.GAME.modifiers.Roland_improbable, G.GAME.probabilities
|
||||||
|
|
||||||
|
-- Normally unreachable since we set it to nil ourselves,
|
||||||
|
-- but other mods may want to use this modifier.
|
||||||
|
if improbable == false then
|
||||||
|
disable_improbable()
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
if not improbable or getmetatable(orig) then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local normal = orig.normal
|
||||||
|
|
||||||
|
local mt = {
|
||||||
|
orig = orig,
|
||||||
|
__index = function(_, k)
|
||||||
|
return k == "normal" and 0 or orig[k]
|
||||||
|
end,
|
||||||
|
__newindex = function(_, k, v)
|
||||||
|
orig[k] = (k == "normal" and v == 0) and normal or v
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|
||||||
|
local proxy = {}
|
||||||
|
setmetatable(proxy, mt)
|
||||||
|
G.GAME.probabilities = proxy
|
||||||
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
local _, q = unpack(... or require "src.functional")
|
local _, q = unpack(... or require "src.functional")
|
||||||
|
local mod = SMODS.current_mod
|
||||||
|
|
||||||
SMODS.Atlas {
|
SMODS.Atlas {
|
||||||
key = "charm",
|
key = "charm",
|
||||||
|
|
@ -14,7 +15,7 @@ local charm = (function()
|
||||||
return function(tbl)
|
return function(tbl)
|
||||||
q(function()
|
q(function()
|
||||||
local current_mod = SMODS.current_mod
|
local current_mod = SMODS.current_mod
|
||||||
SMODS.current_mod = SMODS.Mods.Roland
|
SMODS.current_mod = mod
|
||||||
|
|
||||||
-- SMODS._save_d_u(charm)
|
-- SMODS._save_d_u(charm)
|
||||||
tbl.alerted = true
|
tbl.alerted = true
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,5 @@
|
||||||
local f, q, u = unpack(... or require "src.functional")
|
local f, q, u = unpack(... or require "src.functional")
|
||||||
|
|
||||||
if false then
|
|
||||||
Cryptid = Cryptid -- Suppresses warnings about the global.
|
|
||||||
end
|
|
||||||
|
|
||||||
local joker = (function()
|
local joker = (function()
|
||||||
local z = 0
|
local z = 0
|
||||||
|
|
||||||
|
|
@ -605,13 +601,13 @@ joker {
|
||||||
local odds = card.ability.extra.odds
|
local odds = card.ability.extra.odds
|
||||||
local vars = {normal}
|
local vars = {normal}
|
||||||
|
|
||||||
for i = #vars, 9 do
|
for i = 0, 7 do
|
||||||
table.insert(vars, math.pow(odds, i))
|
table.insert(vars, math.pow(odds, i))
|
||||||
end
|
end
|
||||||
|
|
||||||
return {vars = vars}
|
return {vars = vars}
|
||||||
end,
|
end,
|
||||||
calculate = function(_, card, context)
|
calculate = function(self, card, context)
|
||||||
if not context.joker_main then
|
if not context.joker_main then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
@ -619,7 +615,7 @@ joker {
|
||||||
local extra, numerator, xmult = card.ability.extra, 1, 1
|
local extra, numerator, xmult = card.ability.extra, 1, 1
|
||||||
|
|
||||||
for _ = 1, 64 do
|
for _ = 1, 64 do
|
||||||
if SMODS.pseudorandom_probability(card, "j_Roland_martingale", 1, extra.odds, "Martingale") then
|
if SMODS.pseudorandom_probability(card, self.key, 1, extra.odds, "RolandMartingale") then
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,25 +1,24 @@
|
||||||
local f, q, u = unpack(... or require "src.functional")
|
local f, q, u = unpack(... or require "src.functional")
|
||||||
|
|
||||||
if false then
|
|
||||||
Cryptid = Cryptid -- Suppresses warnings about the global.
|
|
||||||
end
|
|
||||||
|
|
||||||
local spectral = (function()
|
local spectral = (function()
|
||||||
local x = 0
|
local x = 0
|
||||||
|
|
||||||
---@param tbl SMODS.Consumable|{artist?: string}
|
---@param tbl SMODS.Consumable|{artist?: string}
|
||||||
|
---@return SMODS.Consumable
|
||||||
return function(tbl)
|
return function(tbl)
|
||||||
tbl.cost = 4
|
tbl.cost = 4
|
||||||
tbl.set = "Spectral"
|
tbl.set = "Spectral"
|
||||||
tbl.atlas = "spectral"
|
tbl.atlas = "spectral"
|
||||||
tbl.pos = {x = x, y = 0}
|
tbl.pos = {x = x, y = 0}
|
||||||
SMODS.Consumable(tbl)
|
local ret = SMODS.Consumable(tbl)
|
||||||
x = x + 1
|
x = x + 1
|
||||||
|
|
||||||
local _ = tbl.artist and q(function()
|
local _ = tbl.artist and q(function()
|
||||||
tbl.artist = "Roland_" .. tbl.artist
|
tbl.artist = "Roland_" .. tbl.artist
|
||||||
Bakery_API.credit(tbl)
|
Bakery_API.credit(tbl)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
return ret
|
||||||
end
|
end
|
||||||
end)()
|
end)()
|
||||||
|
|
||||||
|
|
@ -116,13 +115,12 @@ spectral {
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
spectral {
|
local void = spectral {
|
||||||
key = "void",
|
key = "void",
|
||||||
pronouns = "it_its",
|
pronouns = "it_its",
|
||||||
artist = "aster",
|
artist = "aster",
|
||||||
hidden = not Cryptid,
|
soul_rate = 0.003,
|
||||||
soul_rate = not Cryptid and 0.003 or nil,
|
soul_set = "Spectral",
|
||||||
soul_set = not Cryptid and "Spectral" or nil,
|
|
||||||
config = {extra = {amount = 2}},
|
config = {extra = {amount = 2}},
|
||||||
loc_vars = function(_, info_queue, card)
|
loc_vars = function(_, info_queue, card)
|
||||||
table.insert(info_queue, G.P_CENTERS.e_negative)
|
table.insert(info_queue, G.P_CENTERS.e_negative)
|
||||||
|
|
@ -174,3 +172,7 @@ spectral {
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
q(function()
|
||||||
|
void.hidden = not SMODS.Mods.Cryptid
|
||||||
|
end)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue