Make harsh ante scaling even harsher
This commit is contained in:
parent
ce35879117
commit
5204ba71a0
6 changed files with 57 additions and 41 deletions
|
|
@ -3,7 +3,7 @@
|
||||||
"id": "Roland",
|
"id": "Roland",
|
||||||
"name": "Roland",
|
"name": "Roland",
|
||||||
"prefix": "Roland",
|
"prefix": "Roland",
|
||||||
"version": "2.9.69",
|
"version": "2.9.70",
|
||||||
"badge_colour": "8BE9FD",
|
"badge_colour": "8BE9FD",
|
||||||
"display_name": "Roland",
|
"display_name": "Roland",
|
||||||
"main_file": "src/main.lua",
|
"main_file": "src/main.lua",
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
local f, q = (... or require "lib.shared")[1], (... or require "lib.shared")[2]
|
local f, q, r = (... or require "lib.shared")[1], (... or require "lib.shared")[2], (... or require "lib.shared")[4]
|
||||||
|
|
||||||
local atlas = SMODS.Atlas {
|
local atlas = SMODS.Atlas {
|
||||||
key = "joker",
|
key = "joker",
|
||||||
|
|
@ -54,21 +54,6 @@ local joker = (function()
|
||||||
end
|
end
|
||||||
end)()
|
end)()
|
||||||
|
|
||||||
---@generic T
|
|
||||||
---@param tbl T[]
|
|
||||||
---@return fun(t: T[], i: integer): integer, T
|
|
||||||
---@return T[]
|
|
||||||
local function ipairs_reversed(tbl)
|
|
||||||
return function(t, i)
|
|
||||||
local k = i and i - 1 or #t
|
|
||||||
local v = t[k]
|
|
||||||
|
|
||||||
if v ~= nil then
|
|
||||||
return k, v
|
|
||||||
end
|
|
||||||
end, tbl
|
|
||||||
end
|
|
||||||
|
|
||||||
---@param card Card
|
---@param card Card
|
||||||
---@return boolean
|
---@return boolean
|
||||||
local function is_frozen(card)
|
local function is_frozen(card)
|
||||||
|
|
@ -720,9 +705,9 @@ joker {
|
||||||
{card = card, xmult = card.ability.extra.xmult} or nil
|
{card = card, xmult = card.ability.extra.xmult} or nil
|
||||||
end,
|
end,
|
||||||
crimson = function()
|
crimson = function()
|
||||||
local _ = G.jokers and f(G.jokers.cards, ipairs_reversed):where(is_frozen, false):each(function(v)
|
local _ = G.jokers and f(G.jokers.cards, r):where(is_frozen, false):each(function(v)
|
||||||
local r = G.jokers.cards[v.rank + 1]
|
local right = G.jokers.cards[v.rank + 1]
|
||||||
local debuffed_by_crimson = r and not r.debuff and r.config.center.key == "j_Roland_crimson"
|
local debuffed_by_crimson = right and not right.debuff and right.config.center.key == "j_Roland_crimson"
|
||||||
|
|
||||||
if debuffed_by_crimson and v.ability.Roland_crimson == nil then
|
if debuffed_by_crimson and v.ability.Roland_crimson == nil then
|
||||||
local debuff = not not v.debuff
|
local debuff = not not v.debuff
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,9 @@ end
|
||||||
|
|
||||||
SMODS.Mods.Roland.config = require "config"
|
SMODS.Mods.Roland.config = require "config"
|
||||||
|
|
||||||
|
---@type (fun(rem: number): number|table)[]
|
||||||
|
SMODS.Mods.Roland.harsh_ante_scaling = SMODS.Mods.Roland.harsh_ante_scaling
|
||||||
|
|
||||||
--- @type table
|
--- @type table
|
||||||
Talisman = Talisman
|
Talisman = Talisman
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -137,6 +137,21 @@ local function u()
|
||||||
G.STATE ~= G.STATES.PLAY_TAROT)
|
G.STATE ~= G.STATES.PLAY_TAROT)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---@generic T
|
||||||
|
---@param tbl T[]
|
||||||
|
---@return fun(t: T[], i: integer): integer, T
|
||||||
|
---@return T[]
|
||||||
|
local function r(tbl)
|
||||||
|
return function(t, i)
|
||||||
|
local k = i and i - 1 or #t
|
||||||
|
local v = t[k]
|
||||||
|
|
||||||
|
if v ~= nil then
|
||||||
|
return k, v
|
||||||
|
end
|
||||||
|
end, tbl
|
||||||
|
end
|
||||||
|
|
||||||
--- Creates one or more cards.
|
--- Creates one or more cards.
|
||||||
---@param ... any
|
---@param ... any
|
||||||
---@return Card|Tag|(Card|Tag[])
|
---@return Card|Tag|(Card|Tag[])
|
||||||
|
|
@ -154,7 +169,7 @@ local function c(...)
|
||||||
return #cards > 1 and cards or cards[1]
|
return #cards > 1 and cards or cards[1]
|
||||||
end
|
end
|
||||||
|
|
||||||
return {f, q, u, setmetatable({}, {
|
return {f, q, u, r, setmetatable({}, {
|
||||||
__call = function(_, ...)
|
__call = function(_, ...)
|
||||||
return c(...)
|
return c(...)
|
||||||
end,
|
end,
|
||||||
|
|
|
||||||
13
src/main.lua
13
src/main.lua
|
|
@ -1,9 +1,8 @@
|
||||||
local qol = assert(SMODS.load_file "src/lib/shared.lua")() or require "lib.shared"
|
local qol = assert(SMODS.load_file "src/lib/shared.lua")() or require "lib.shared"
|
||||||
local f, q = qol[1], qol[2]
|
local animated = SMODS.current_mod.config.animated_icon
|
||||||
SMODS.current_mod.qol = qol
|
SMODS.current_mod.qol = qol
|
||||||
local animated = SMODS.Mods.Roland.config.animated_icon
|
|
||||||
|
|
||||||
q {
|
qol[2] {
|
||||||
front = true,
|
front = true,
|
||||||
no_delete = true,
|
no_delete = true,
|
||||||
blocking = false,
|
blocking = false,
|
||||||
|
|
@ -15,22 +14,22 @@ q {
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
f(assert(SMODS.load_file("src/credits.lua", "Roland"))() or require "credits"):each(function(v, k)
|
qol[1](assert(SMODS.load_file("src/credits.lua", "Roland"))() or require "credits"):each(function(v, k)
|
||||||
contributors["Roland_" .. k] = v
|
contributors["Roland_" .. k] = v
|
||||||
end)
|
end)
|
||||||
|
|
||||||
if SMODS.Mods.DebugPlus and SMODS.Mods.Roland.config.import_funky then
|
if SMODS.Mods.DebugPlus and SMODS.Mods.Roland.config.import_funky then
|
||||||
_G.f, _G.q, _G.u, _G.c = unpack(qol)
|
_G.f, _G.q, _G.u, _G.r, _G.c = unpack(qol)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
f {"challenge", "spectral", "edition", "voucher", "tweaks", "blind", "charm", "joker", "tarot", "back", "seal", "tag"}
|
qol[1] {"challenge", "spectral", "edition", "voucher", "tweaks", "blind", "charm", "joker", "tarot", "back", "seal", "tag"}
|
||||||
:each(function(v)
|
:each(function(v)
|
||||||
assert(SMODS.load_file("src/" .. v .. ".lua"))(qol)
|
assert(SMODS.load_file("src/" .. v .. ".lua"))(qol)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
local _ = Balatest and f {"joker", "blind", "spectral"}:each(function(v)
|
local _ = Balatest and qol[1] {"joker", "blind", "spectral"}:each(function(v)
|
||||||
assert(SMODS.load_file("src/tests/" .. v .. ".tests.lua"))(qol)
|
assert(SMODS.load_file("src/tests/" .. v .. ".tests.lua"))(qol)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
local f, q = (... or require "lib.shared")[1], (... or require "lib.shared")[2]
|
local f, q, r = (... or require "lib.shared")[1], (... or require "lib.shared")[2], (... or require "lib.shared")[4]
|
||||||
SMODS.Joker:take_ownership("joker", {cost = 1}, true)
|
SMODS.Joker:take_ownership("joker", {cost = 1}, true)
|
||||||
local orig_set_debuff = Card.set_debuff
|
local orig_set_debuff = Card.set_debuff
|
||||||
|
|
||||||
|
|
@ -110,21 +110,35 @@ local function no_harsh_ante_scaling()
|
||||||
return not Talisman or not SMODS.Mods.Roland.config.harsh_ante_scaling
|
return not Talisman or not SMODS.Mods.Roland.config.harsh_ante_scaling
|
||||||
end
|
end
|
||||||
|
|
||||||
function get_blind_amount(ante, ...)
|
---@type (fun(rem: number): number|table)[]
|
||||||
local loop = 39
|
SMODS.current_mod.harsh_ante_scaling = {
|
||||||
|
function(rem)
|
||||||
|
return (Big.constants and Big.constants.TEN or Big:new {10}):pow(blind(rem + 1))
|
||||||
|
end,
|
||||||
|
function(rem)
|
||||||
|
return Big:new {1, rem + 1}
|
||||||
|
end,
|
||||||
|
function(rem)
|
||||||
|
return Big:new {1, 1, [rem + 2] = 1}
|
||||||
|
end,
|
||||||
|
function(rem)
|
||||||
|
return Big:new {1, 1, [blind(rem) + 2] = 1}
|
||||||
|
end,
|
||||||
|
function(rem)
|
||||||
|
return rem <= 1 and Big:new {1.7976931348623157e308, 1, [1.7975e308] = 1} or 1 / 0
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|
||||||
if ante < loop or no_harsh_ante_scaling() then
|
function get_blind_amount(ante, ...)
|
||||||
|
local offset = 40
|
||||||
|
|
||||||
|
if ante < offset or no_harsh_ante_scaling() then
|
||||||
return orig_get_blind_amount(ante, ...)
|
return orig_get_blind_amount(ante, ...)
|
||||||
end
|
end
|
||||||
|
|
||||||
if (ante - 9) / 15 >= loop then
|
local loop = 10
|
||||||
return 1 / 0
|
|
||||||
end
|
|
||||||
|
|
||||||
local rem = tonumber(blind((ante % loop) + 1))
|
return f(SMODS.Mods.Roland.harsh_ante_scaling, r):any(function(_, k)
|
||||||
|
return (ante - offset) / loop + 1 >= k
|
||||||
return ante / 15 >= loop and Big:new(f(blind(ante - (loop * 15))):map(f.const(10)):table()) or
|
end)((ante - offset) % loop + 1)
|
||||||
(ante / 9 >= loop and Big:new(f(ante / loop - 8):map(f.const(10)):concat {rem}:table()) or
|
|
||||||
(ante / 2 >= loop and Big:new {rem, ante / loop} or
|
|
||||||
(Big.constants and Big.constants.TEN or Big:new {10}):pow(rem)))
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue