Skip to content

Commit

Permalink
3 significant figures is excessive
Browse files Browse the repository at this point in the history
  • Loading branch information
Aurelius7309 committed Aug 12, 2024
1 parent 30d7710 commit 3515470
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
21 changes: 0 additions & 21 deletions core/game_object.lua
Original file line number Diff line number Diff line change
Expand Up @@ -607,27 +607,6 @@ Set `prefix_config.key = false` on your object instead.]]):format(obj.key), obj.
end
end

function SMODS.get_blind_amount(ante)
local scale = G.GAME.modifiers.scaling
local amounts = {
300,
700 + 100*scale,
1400 + 600*scale,
2100 + 2900*scale,
15000 + 5000*scale*math.log(scale),
12000 + 8000*(scale+1)*(0.4*scale),
10000 + 25000*(scale+1)*((scale/4)^2),
50000 * (scale+1)^2 * (scale/7)^2
}

if ante < 1 then return 100 end
if ante <= 8 then return amounts[ante] - amounts[ante]%(10^math.floor(math.log10(amounts[ante])-2)) end
local a, b, c, d = amounts[8], amounts[8]/amounts[7], ante-8, 1 + 0.2*(ante-8)
local amount = math.floor(a*(b + (b*0.75*c)^d)^c)
amount = amount - amount%(10^math.floor(math.log10(amount)-1))
return amount
end

--Register vanilla stakes
G.P_STAKES = {}
SMODS.Stake {
Expand Down
21 changes: 21 additions & 0 deletions core/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,27 @@ function SMODS.poll_seal(args)
end
end

function SMODS.get_blind_amount(ante)
local scale = G.GAME.modifiers.scaling
local amounts = {
300,
700 + 100*scale,
1400 + 600*scale,
2100 + 2900*scale,
15000 + 5000*scale*math.log(scale),
12000 + 8000*(scale+1)*(0.4*scale),
10000 + 25000*(scale+1)*((scale/4)^2),
50000 * (scale+1)^2 * (scale/7)^2
}

if ante < 1 then return 100 end
if ante <= 8 then return amounts[ante] - amounts[ante]%(10^math.floor(math.log10(amounts[ante])-1)) end
local a, b, c, d = amounts[8], amounts[8]/amounts[7], ante-8, 1 + 0.2*(ante-8)
local amount = math.floor(a*(b + (b*0.75*c)^d)^c)
amount = amount - amount%(10^math.floor(math.log10(amount)-1))
return amount
end

function SMODS.stake_from_index(index)
local stake = G.P_CENTER_POOLS.Stake[index] or nil
if not stake then return "error" end
Expand Down

0 comments on commit 3515470

Please sign in to comment.