Add chip setter if mult is too imprecise

This commit is contained in:
Emik 2025-03-25 14:37:16 +01:00
parent 7a99059b7e
commit 56a37927cc
Signed by untrusted user who does not match committer: emik
GPG key ID: 09CDFF9E5703688D

View file

@ -58,6 +58,10 @@ local function offset_operator(by)
end) end)
end end
local function to_number(x)
return type(x) == "table" and x:tonumber() or x
end
SMODS.Blind { SMODS.Blind {
loc_txt = { loc_txt = {
name = "The Descending", name = "The Descending",
@ -87,7 +91,11 @@ SMODS.Blind {
press_play = function(_) press_play = function(_)
offset_operator(0) offset_operator(0)
end, end,
set_blind = function(_) set_blind = function(self)
if to_number(self.mult) == 0 then
self.chips = math.floor(8 * math.sqrt(get_blind_amount(G.GAME.round_resets.ante)))
end
offset_operator(-1) offset_operator(-1)
end, end,
} }
@ -149,4 +157,9 @@ SMODS.Blind {
recalc_debuff = function(_, card, _) recalc_debuff = function(_, card, _)
return card:norank() or card:get_id() ~= 2 return card:norank() or card:get_id() ~= 2
end, end,
set_blind = function(self)
if to_number(self.mult) == 0 then
self.chips = 22
end
end
} }