Improve debugging for unlock conditions
This commit is contained in:
parent
1f1914e5de
commit
fdd4bb8e16
2 changed files with 35 additions and 11 deletions
|
|
@ -3,7 +3,7 @@
|
||||||
"id": "Roland",
|
"id": "Roland",
|
||||||
"name": "Roland",
|
"name": "Roland",
|
||||||
"prefix": "Roland",
|
"prefix": "Roland",
|
||||||
"version": "2.9.33",
|
"version": "2.9.34",
|
||||||
"badge_colour": "8BE9FD",
|
"badge_colour": "8BE9FD",
|
||||||
"display_name": "Roland",
|
"display_name": "Roland",
|
||||||
"main_file": "src/main.lua",
|
"main_file": "src/main.lua",
|
||||||
|
|
|
||||||
|
|
@ -332,23 +332,47 @@ if cry_prob then
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function SMODS.current_mod:calculate(context)
|
local function call(key, value)
|
||||||
local _ = type(G.calccontext) == "function" and G.calccontext(context)
|
local obj = G[key .. "obj"]
|
||||||
|
local _ = type(obj) == "function" and obj(value)
|
||||||
|
|
||||||
if type(G.calc) == "function" then
|
if not G[key] or value == "Bakery_nothing" then
|
||||||
G.calc = {G.calc}
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
if type(G[key]) == "function" then
|
||||||
|
G[key] = {G[key]}
|
||||||
|
end
|
||||||
|
|
||||||
|
if type(G[key]) ~= "table" then
|
||||||
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if type(G.calc) == "table" then
|
|
||||||
local str
|
local str
|
||||||
|
|
||||||
f(context):keys():map(f.index_into(G.calc)):where(type, "function"):each(function(v)
|
local _ = f(type(value) == "table" and value or {[value] = true})
|
||||||
str = str or f(context):keys():string()
|
:keys()
|
||||||
|
:map(f.index_into(G[key]))
|
||||||
|
:where(type, "function")
|
||||||
|
:each(function(v)
|
||||||
|
str = str or type(value) == "table" and f(value):keys():string() or value
|
||||||
v(str)
|
v(str)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
local _ = not str and type(G.calc[1]) == "function" and G.calc[1](f(context):keys():string())
|
local _ = not str and
|
||||||
end
|
type(G[key][1]) == "function" and
|
||||||
|
G[key][1](type(value) == "table" and f(value):keys():string() or value)
|
||||||
|
end
|
||||||
|
|
||||||
|
local orig_check_for_unlock = check_for_unlock
|
||||||
|
|
||||||
|
function check_for_unlock(args, ...)
|
||||||
|
call("lock", type(args) == "table" and args.type or args)
|
||||||
|
return orig_check_for_unlock(args, ...)
|
||||||
|
end
|
||||||
|
|
||||||
|
function SMODS.current_mod:calculate(context)
|
||||||
|
call("calc", context)
|
||||||
|
|
||||||
local _ = context.before and
|
local _ = context.before and
|
||||||
f {"v_Roland_ceres", "v_Roland_neptune"}
|
f {"v_Roland_ceres", "v_Roland_neptune"}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue