Compare commits
4 commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 91660bfeea | |||
| 7c64a5d8fa | |||
| dcf9d55fcf | |||
| 2f55344a90 |
7 changed files with 130 additions and 22 deletions
|
|
@ -3,7 +3,7 @@
|
||||||
"id": "Roland",
|
"id": "Roland",
|
||||||
"name": "Roland",
|
"name": "Roland",
|
||||||
"prefix": "Roland",
|
"prefix": "Roland",
|
||||||
"version": "2.9.24",
|
"version": "2.9.28",
|
||||||
"badge_colour": "8BE9FD",
|
"badge_colour": "8BE9FD",
|
||||||
"display_name": "Roland",
|
"display_name": "Roland",
|
||||||
"main_file": "src/main.lua",
|
"main_file": "src/main.lua",
|
||||||
|
|
|
||||||
|
|
@ -261,7 +261,7 @@ local orig_apply_to_run = Tag.apply_to_run
|
||||||
|
|
||||||
function Tag:apply_to_run(...)
|
function Tag:apply_to_run(...)
|
||||||
if G.GAME.Bakery_charm == "BakeryCharm_Roland_wii" and
|
if G.GAME.Bakery_charm == "BakeryCharm_Roland_wii" and
|
||||||
G.Bakery_charm_area.cards[1].config.center.ability.extra.active then
|
G.Bakery_charm_area.cards[1].ability.extra.active then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -648,7 +648,7 @@ joker {
|
||||||
local _ = card.area == G.jokers and self:cerulean(false)
|
local _ = card.area == G.jokers and self:cerulean(false)
|
||||||
end,
|
end,
|
||||||
cerulean = function(_, value)
|
cerulean = function(_, value)
|
||||||
f(G.jokers.cards):each(function(v)
|
local _ = G.jokers and f(G.jokers.cards):each(function(v)
|
||||||
f {"click", "drag", "focus", "hover"}:map(f.index_into(v.states)):each(function(s)
|
f {"click", "drag", "focus", "hover"}:map(f.index_into(v.states)):each(function(s)
|
||||||
s.can = value or v.config.center.key == "j_Roland_cerulean"
|
s.can = value or v.config.center.key == "j_Roland_cerulean"
|
||||||
end)
|
end)
|
||||||
|
|
@ -675,7 +675,7 @@ 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()
|
||||||
f(G.jokers.cards, ipairs_reversed):where(is_frozen, false):each(function(v)
|
local _ = G.jokers and f(G.jokers.cards, ipairs_reversed):where(is_frozen, false):each(function(v)
|
||||||
local right = G.jokers.cards[v.rank + 1]
|
local right = G.jokers.cards[v.rank + 1]
|
||||||
|
|
||||||
local debuffed_by_crimson = right and
|
local debuffed_by_crimson = right and
|
||||||
|
|
@ -757,7 +757,7 @@ joker {
|
||||||
key = "violet",
|
key = "violet",
|
||||||
pronouns = "she_they",
|
pronouns = "she_they",
|
||||||
idea = "hamester",
|
idea = "hamester",
|
||||||
config = {extra = {before = 0.1, xmult = 9}},
|
config = {extra = {before = 0.1, xmult = 6}},
|
||||||
pixel_size = {w = 68, h = 68},
|
pixel_size = {w = 68, h = 68},
|
||||||
attributes = {"xmult"},
|
attributes = {"xmult"},
|
||||||
cost = 6,
|
cost = 6,
|
||||||
|
|
@ -1258,7 +1258,7 @@ joker {
|
||||||
return {card = card, numerator = extra.probability}
|
return {card = card, numerator = extra.probability}
|
||||||
end
|
end
|
||||||
|
|
||||||
if context.end_of_round and extra.probability ~= extra.reset then
|
if context.end_of_round and not context.repetition and extra.probability ~= extra.reset then
|
||||||
extra.probability = extra.reset
|
extra.probability = extra.reset
|
||||||
return {message = localize "k_reset", colour = G.C.RED, message_card = card, repetitions = 0}
|
return {message = localize "k_reset", colour = G.C.RED, message_card = card, repetitions = 0}
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -128,13 +128,6 @@ local function autopairs(tbl, fpairs)
|
||||||
return (fpairs or (tbl[#tbl] and ipairs or pairs))(tbl)
|
return (fpairs or (tbl[#tbl] and ipairs or pairs))(tbl)
|
||||||
end
|
end
|
||||||
|
|
||||||
---@param any any
|
|
||||||
---@return boolean
|
|
||||||
---@nodiscard
|
|
||||||
local function is_f(any)
|
|
||||||
return type(any) == "table" and any.from == f.from and any.new == f.new
|
|
||||||
end
|
|
||||||
|
|
||||||
--- Always returns nil.
|
--- Always returns nil.
|
||||||
---@return nil
|
---@return nil
|
||||||
---@nodiscard
|
---@nodiscard
|
||||||
|
|
@ -202,6 +195,15 @@ function f.const(v)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---@param i integer
|
||||||
|
---@return fun(...: any): any
|
||||||
|
---@nodiscard
|
||||||
|
function f.arg(i)
|
||||||
|
return function(...)
|
||||||
|
return ({...})[i]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
---@generic K, V
|
---@generic K, V
|
||||||
---@param v K
|
---@param v K
|
||||||
---@return fun(x: { [K]: V }): V
|
---@return fun(x: { [K]: V }): V
|
||||||
|
|
@ -240,21 +242,32 @@ function f.indices(v)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---@param any any
|
||||||
|
---@return boolean
|
||||||
|
---@nodiscard
|
||||||
|
function f.isf(any)
|
||||||
|
return type(any) == "table" and any.from == f.from and any.new == f.new
|
||||||
|
end
|
||||||
|
|
||||||
f[true and "chain"] = function(...)
|
f[true and "chain"] = function(...)
|
||||||
for _, v in ipairs(...) do
|
local ret
|
||||||
|
|
||||||
|
for _, v in ipairs {...} do
|
||||||
if type(v) == "table" then
|
if type(v) == "table" then
|
||||||
for _, vv in ipairs(v) do
|
for _, vv in ipairs(v) do
|
||||||
|
local copy = ret
|
||||||
vv = autofunc(vv)
|
vv = autofunc(vv)
|
||||||
|
|
||||||
ret = ret and function(...)
|
ret = ret and function(...)
|
||||||
return vv(ret(...))
|
return vv(copy(...))
|
||||||
end or vv
|
end or vv
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
local copy = ret
|
||||||
v = autofunc(v)
|
v = autofunc(v)
|
||||||
|
|
||||||
ret = ret and function(...)
|
ret = ret and function(...)
|
||||||
return v(ret(...))
|
return v(copy(...))
|
||||||
end or v
|
end or v
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -271,6 +284,7 @@ function f.new(fnext)
|
||||||
return {
|
return {
|
||||||
all = f.all,
|
all = f.all,
|
||||||
any = f.any,
|
any = f.any,
|
||||||
|
arg = f.arg,
|
||||||
chain = f.chain,
|
chain = f.chain,
|
||||||
concat = f.concat,
|
concat = f.concat,
|
||||||
const = f.const,
|
const = f.const,
|
||||||
|
|
@ -285,6 +299,7 @@ function f.new(fnext)
|
||||||
index = f.index,
|
index = f.index,
|
||||||
index_into = f.index_into,
|
index_into = f.index_into,
|
||||||
indices = f.indices,
|
indices = f.indices,
|
||||||
|
isf = f.isf,
|
||||||
keys = f.keys,
|
keys = f.keys,
|
||||||
map = f.map,
|
map = f.map,
|
||||||
new = f.new,
|
new = f.new,
|
||||||
|
|
@ -371,7 +386,7 @@ function f:concat(...)
|
||||||
local sum, last = 0, 0
|
local sum, last = 0, 0
|
||||||
|
|
||||||
for i = 1, #fs do
|
for i = 1, #fs do
|
||||||
fs[i] = is_f(fs[i]) and fs[i] or f.from(fs[i])
|
fs[i] = f.isf(fs[i]) and fs[i] or f.from(fs[i])
|
||||||
end
|
end
|
||||||
|
|
||||||
return f.new(function()
|
return f.new(function()
|
||||||
|
|
|
||||||
|
|
@ -19,15 +19,21 @@ Balatest = Balatest
|
||||||
--- @type { constants?: { TEN: table }, new: (fun(self: self, arr?: number[], sign?: number, noNormalize?: boolean): table), pow: (fun(x: number, y: number): number) }
|
--- @type { constants?: { TEN: table }, new: (fun(self: self, arr?: number[], sign?: number, noNormalize?: boolean): table), pow: (fun(x: number, y: number): number) }
|
||||||
Big = Big
|
Big = Big
|
||||||
|
|
||||||
--- @type table
|
--- @type table?
|
||||||
CardSleeves = CardSleeves
|
CardSleeves = CardSleeves
|
||||||
|
|
||||||
--- @type fun(obj: SMODS.Back): SMODS.Back
|
--- @type table|fun(obj: SMODS.Back): SMODS.Back
|
||||||
CardSleeves.Sleeve = CardSleeves.Sleeve
|
CardSleeves.Sleeve = CardSleeves.Sleeve
|
||||||
|
|
||||||
|
--- @type {aliases: { [string]: [string] }}
|
||||||
|
Cryptid = Cryptid
|
||||||
|
|
||||||
--- @type fun(area: CardArea, ...: ...): Card
|
--- @type fun(area: CardArea, ...: ...): Card
|
||||||
create_card_for_shop = create_card_for_shop
|
create_card_for_shop = create_card_for_shop
|
||||||
|
|
||||||
|
--- @type boolean|table
|
||||||
|
G.Bakery_charm_area.cards[1].ability.extra = G.Bakery_charm_area.cards[1].ability.extra
|
||||||
|
|
||||||
SMODS.Mods.Roland.config = require "config"
|
SMODS.Mods.Roland.config = require "config"
|
||||||
|
|
||||||
---@type userdata|{getWidth: fun(self: self): number}
|
---@type userdata|{getWidth: fun(self: self): number}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,59 @@
|
||||||
local f = assert(SMODS.load_file "src/lib/funky.lua")() or require "lib.funky"
|
local f = assert(SMODS.load_file "src/lib/funky.lua")() or require "lib.funky"
|
||||||
|
|
||||||
|
---@param v string
|
||||||
|
---@return Card|Tag
|
||||||
|
local function add(v)
|
||||||
|
if not G.P_TAGS[v] then
|
||||||
|
return SMODS.add_card {no_edition = true, key = v}
|
||||||
|
end
|
||||||
|
|
||||||
|
local tag = Tag(v)
|
||||||
|
|
||||||
|
if tag.name == "Orbital Tag" then
|
||||||
|
local hands = f(G.GAME.hands):where "visible":keys():table()
|
||||||
|
tag.ability.orbital_hand = pseudorandom_element(hands, pseudoseed "Roland_c_orbital_tag")
|
||||||
|
end
|
||||||
|
|
||||||
|
add_tag(tag)
|
||||||
|
return tag
|
||||||
|
end
|
||||||
|
|
||||||
|
local function simplify(x)
|
||||||
|
return type(x) == "string" and x:lower():gsub("%s", ""):gsub("_", ""):gsub("^the", "") or x
|
||||||
|
end
|
||||||
|
|
||||||
|
local function flatten(v)
|
||||||
|
return type(v) ~= "table" and {v} or (f.isf(v) and v:table() or v)
|
||||||
|
end
|
||||||
|
|
||||||
|
---@param it string
|
||||||
|
local function find(it)
|
||||||
|
if (G.P_CENTERS[it] or {}).config then
|
||||||
|
return it
|
||||||
|
end
|
||||||
|
|
||||||
|
local match = simplify(it)
|
||||||
|
local pool = f(G.P_CENTER_POOLS):any(f.chain(f.arg(2), simplify, f.eq(match)))
|
||||||
|
|
||||||
|
if type(pool) == "table" and next(pool) then
|
||||||
|
return pseudorandom_element(pool, pseudoseed "Roland_c").key
|
||||||
|
end
|
||||||
|
|
||||||
|
if Cryptid and Cryptid.aliases and Cryptid.aliases[it] then
|
||||||
|
return Cryptid.aliases[it]
|
||||||
|
end
|
||||||
|
|
||||||
|
return f(G.localization.descriptions)
|
||||||
|
:flatmap(flatten)
|
||||||
|
:where(type, "table")
|
||||||
|
:where(f.chain(f.arg(2), f.index_into(G.P_CENTERS), "config"))
|
||||||
|
:where(function(v, k)
|
||||||
|
return match == simplify(k) or match == simplify(v.name)
|
||||||
|
end)
|
||||||
|
:keys()
|
||||||
|
:any()
|
||||||
|
end
|
||||||
|
|
||||||
local function protect(fun)
|
local function protect(fun)
|
||||||
return function()
|
return function()
|
||||||
local res, ret = pcall(fun)
|
local res, ret = pcall(fun)
|
||||||
|
|
@ -56,4 +110,35 @@ local function u()
|
||||||
G.STATE ~= G.STATES.PLAY_TAROT)
|
G.STATE ~= G.STATES.PLAY_TAROT)
|
||||||
end
|
end
|
||||||
|
|
||||||
return {f, q, u}
|
--- Creates one or more cards.
|
||||||
|
---@param ... any
|
||||||
|
---@return Card|Tag|(Card|Tag[])
|
||||||
|
local function c(...)
|
||||||
|
local cards = f {...}
|
||||||
|
:flatmap(flatten)
|
||||||
|
:where(type, "string")
|
||||||
|
:map(string.lower)
|
||||||
|
:map(find)
|
||||||
|
:where(f.id)
|
||||||
|
:map(add)
|
||||||
|
:values()
|
||||||
|
:table()
|
||||||
|
|
||||||
|
return #cards > 1 and cards or cards[1]
|
||||||
|
end
|
||||||
|
|
||||||
|
return {f, q, u, setmetatable({}, {
|
||||||
|
__call = function(_, ...)
|
||||||
|
return c(...)
|
||||||
|
end,
|
||||||
|
__index = function(_, k)
|
||||||
|
return c(k)
|
||||||
|
end,
|
||||||
|
__newindex = function(_, k, v)
|
||||||
|
local n = tonumber(v)
|
||||||
|
|
||||||
|
for _ = 1, type(n) == "number" and n or 1 do
|
||||||
|
c(k)
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})}
|
||||||
|
|
|
||||||
|
|
@ -52,9 +52,11 @@ q {
|
||||||
-- G.ARGS.LOC_COLOURS["Bakery_credit_bg_Roland_" .. k] = v.bg
|
-- G.ARGS.LOC_COLOURS["Bakery_credit_bg_Roland_" .. k] = v.bg
|
||||||
end)
|
end)
|
||||||
|
|
||||||
if SMODS.Mods.DebugPlus and SMODS.Mods.Roland.config.import_funky then
|
if not SMODS.Mods.DebugPlus or not SMODS.Mods.Roland.config.import_funky then
|
||||||
_G.f, _G.q, _G.u = unpack(qol)
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
_G.f, _G.q, _G.u, _G.c = unpack(qol)
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue