Optimize Arctic Circle
This commit is contained in:
parent
fc29871a43
commit
b4ee906844
3 changed files with 41 additions and 15 deletions
|
|
@ -3,7 +3,7 @@
|
|||
"id": "Roland",
|
||||
"name": "Roland",
|
||||
"prefix": "Roland",
|
||||
"version": "2.8.11",
|
||||
"version": "2.8.12",
|
||||
"badge_colour": "8BE9FD",
|
||||
"display_name": "Roland",
|
||||
"main_file": "src/main.lua",
|
||||
|
|
|
|||
|
|
@ -438,7 +438,7 @@ joker {
|
|||
pronouns = "they_them",
|
||||
cost = 10,
|
||||
rarity = 3,
|
||||
config = {extra = {frozen = 1}},
|
||||
config = {extra = {frozen = 1, non_frozen = 0, max_stack = 6, color = "DARK_EDITION"}},
|
||||
attributes = {"retrigger", "editions"},
|
||||
eternal_compat = true,
|
||||
blueprint_compat = true,
|
||||
|
|
@ -449,26 +449,34 @@ 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
|
||||
return
|
||||
end
|
||||
|
||||
if context.repetition and context.other_card then
|
||||
local repetitions = is_frozen(context.other_card) and extra.frozen or extra.non_frozen
|
||||
|
||||
if repetitions and repetitions > 0 then
|
||||
return {card = card, repetitions = repetitions}
|
||||
return {card = card, colour = G.C[extra.color], repetitions = repetitions}
|
||||
end
|
||||
end
|
||||
|
||||
return SMODS.merge_effects(
|
||||
local key = card.config.center.key
|
||||
|
||||
local merged = SMODS.merge_effects(
|
||||
f(G.jokers.cards):where(is_frozen):where(function(v)
|
||||
return v.config.center.key ~= card.config.center.key
|
||||
return v.config.center.key ~= key
|
||||
end):map(function(v)
|
||||
return SMODS.blueprint_effect(card, v, context) or true
|
||||
end):where(function(v)
|
||||
return type(v) == "table"
|
||||
end):map(function(v)
|
||||
v.colour = G.C.DARK_EDITION
|
||||
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()
|
||||
)
|
||||
|
||||
return merged
|
||||
end,
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -115,7 +115,25 @@ end
|
|||
---@nodiscard
|
||||
function f.index(v)
|
||||
return function(x)
|
||||
return x and x[v]
|
||||
return type(x) == "table" and x[v] or x
|
||||
end
|
||||
end
|
||||
|
||||
---@generic V
|
||||
---@param v string
|
||||
---@return fun(x: { [string]: V }): V
|
||||
---@nodiscard
|
||||
function f.indices(v)
|
||||
return function(x)
|
||||
if type(x) ~= "table" then
|
||||
return x
|
||||
end
|
||||
|
||||
for i in v:gmatch "[^.]+" do
|
||||
x = x[i]
|
||||
end
|
||||
|
||||
return x
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -146,18 +164,18 @@ end
|
|||
---@overload fun(iter: true): fun(): true
|
||||
---@overload fun(iter: nil): F
|
||||
function f.from(iter, fpairs, step)
|
||||
if iter == true then
|
||||
if iter == nil then
|
||||
return none
|
||||
elseif iter == true then
|
||||
return f.tru
|
||||
elseif iter == false then
|
||||
return f.fals
|
||||
elseif iter == nil then
|
||||
return none
|
||||
end
|
||||
|
||||
local t = type(iter)
|
||||
|
||||
if t == "string" then
|
||||
return f.index(iter)
|
||||
return f.indices(iter)
|
||||
elseif t == "number" then
|
||||
local ik, is, start = 0, step or 1, fpairs and iter or 1
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue