Add critical tables

This commit is contained in:
2024-11-16 09:31:15 +01:00
parent 4061371945
commit aa179a92ff
29 changed files with 3509 additions and 7 deletions

View File

@ -106,17 +106,24 @@ for file in lfs.dir("./") do
for _, key in ipairs(_CRIT_KEYS) do
local effects = {}
local line = c[key]
if not line then
break
end
-- Get description (ie all text befire the first \n)
local desc = line:match("([^\n]+)")
-- Get the rest of the text
local rest = line:match("\n(.+)")
if rest:match("with ") then
local reasonwith, with, reasonwithout , without = rest:match("(with[^:]*): ([^w]+)(w/o[^:]*): (.+)")
print("SPLITTEW WITH", desc)
effects[1] = process_values(with, reasonwith)
effects[2] = process_values(without, reasonwithout)
else
effects[1] = process_values(rest)
if rest then
if rest:match("with ") then
local reasonwith, with, reasonwithout , without = rest:match("(with[^:]*): ([^w]+)(w/o[^:]*): (.+)")
print("SPLITTEW WITH", desc)
effects[1] = process_values(with, reasonwith)
effects[2] = process_values(without, reasonwithout)
else
effects[1] = process_values(rest)
end
else
print("NO REST", desc)
end
new_crit.levels[key] = {
key = key,