Rewrite Arctic Circle to be uncapped without crashing

This commit is contained in:
Emik 2026-07-27 12:55:58 +02:00
parent 9f19d85769
commit 9e84249eef
Signed by: emik
GPG key ID: 6B0CD72A5E503BDF
3 changed files with 30 additions and 15 deletions

View file

@ -3,7 +3,7 @@
"id": "Roland",
"name": "Roland",
"prefix": "Roland",
"version": "2.9.77",
"version": "2.9.78",
"badge_colour": "8BE9FD",
"display_name": "Roland",
"main_file": "src/main.lua",

View file

@ -57,7 +57,7 @@ end)()
---@param card Card
---@return boolean
local function is_frozen(card)
return card and card.edition and card.edition.key == "e_Roland_frozen"
return card and card.edition and card.edition.Roland_frozen
end
---@param card? Card|false|{suit: string, value: string}
@ -531,8 +531,8 @@ joker {
pronouns = "they_them",
cost = 10,
rarity = 3,
config = {extra = {frozen = 1, non_frozen = 0, max_stack = 6, color = "DARK_EDITION"}},
attributes = {"retrigger", "editions"},
config = {extra = {frozen = 1, non_frozen = 0, color = "DARK_EDITION"}},
attributes = {"retrigger", "editions", "copying"},
eternal_compat = true,
blueprint_compat = true,
perishable_compat = true,
@ -542,9 +542,9 @@ joker {
calculate = function(_, card, context)
local extra = card.ability.extra
if extra.max_stack and
context.blueprint_copiers_stack and
extra.max_stack < #context.blueprint_copiers_stack then
if f(context.blueprint_copiers_stack)
:where("config.center.key", card.config.center.key)
:any() then
return
end
@ -557,14 +557,15 @@ joker {
end
return SMODS.merge_effects(
f(G.jokers.cards):where(is_frozen):where(function(v)
return v.config.center.key ~= card.config.center.key
end):map(function(v)
f(G.jokers.cards)
:where(is_frozen)
:map(function(v)
return SMODS.blueprint_effect(card, v, context)
end):where(type, "table"):map(function(v)
v.colour = G.C[extra.color]
return v
end):values():table()
end)
:where(type, "table")
:map(f.assign(G.C[extra.color], "colour"))
:values()
:table()
)
end,
}

View file

@ -340,6 +340,19 @@ function f.arg(i)
end
end
---@generic K, V
---@param v V
---@param k K
---@return fun(x: { [K]: V })
---@nodiscard
function f.assign(v, k)
return function(x)
if type(x) == "table" then
x[k] = v
end
end
end
---@generic K, V
---@param v K
---@return fun(x: { [K]: V }): V
@ -406,7 +419,7 @@ f[true and "call"] = function(self, ...)
local args = {...}
return type(self) == "string" and function(v)
return v[self](self, unpack(args))
return v[self](v, unpack(args))
end or function(v)
return v(unpack(args))
end
@ -454,6 +467,7 @@ function f.new(fnext)
all = f.all,
any = f.any,
arg = f.arg,
assign = f.assign,
call = f.call,
chain = f.chain,
compose = f.compose,