Clean up globs a little
This commit is contained in:
128
cookother.yml
128
cookother.yml
@@ -6,14 +6,15 @@
|
||||
capacity=round(capacity*1.5)
|
||||
return true
|
||||
end
|
||||
capacity=round(capacity*2.2)
|
||||
capacity=round(capacity*3)
|
||||
if capacity > 50 then capacity=50 end
|
||||
if not slotsperrow then return true end
|
||||
slotsperrow=1
|
||||
while slotsperrow * slotsperrow < capacity do
|
||||
slotsperrow = slotsperrow + 1
|
||||
end
|
||||
files:
|
||||
- "**/*.xml"
|
||||
- "Content/Items/**/*.xml"
|
||||
|
||||
- name: containerscontainable
|
||||
regex: (?-s)Containable!anyitems="([^"]+)"
|
||||
@@ -42,14 +43,14 @@
|
||||
end
|
||||
end
|
||||
files:
|
||||
- "**/*.xml"
|
||||
- "Content/Items/**/*.xml"
|
||||
|
||||
- name: excludeditems
|
||||
regex: <Containable!any(\s?excludeditems="[^"]+")
|
||||
lua: |
|
||||
s1 = ""
|
||||
files:
|
||||
- "**/*.xml"
|
||||
- "Content/Items/**/*.xml"
|
||||
|
||||
- name: upgrade
|
||||
regex: (?:maxforce|capacity|maxrechargespeed|overloadvoltage|healthmultiplier|maxhealth|fabricationspeed|deconstructionspeed|rotationspeedlowskill|offsetonselectedmultiplier|range|maxpoweroutput|meltdowndelay|maxflow|fixdurationlowskill|skillrequirementmultiplier)="\+?!num%?"
|
||||
@@ -76,127 +77,28 @@
|
||||
lua: |
|
||||
*8
|
||||
files:
|
||||
- "**/*.xml"
|
||||
- "Content/Items/**/*.xml"
|
||||
|
||||
- name: maxstacksizecharacterinventory
|
||||
regex: 'maxstacksizecharacterinventory="!num'
|
||||
lua: |
|
||||
*8
|
||||
files:
|
||||
- "**/*.xml"
|
||||
- "Content/Items/**/*.xml"
|
||||
|
||||
- name: lightrange
|
||||
regex: '(?-s)LightComponent!anyrange="(!num)"'
|
||||
lua: |
|
||||
*4
|
||||
files:
|
||||
- "**/*.xml"
|
||||
- "Content/Items/**/*.xml"
|
||||
|
||||
- name: toolrange
|
||||
regex: (?-s)RepairTool!anyrange="!num"
|
||||
lua: |
|
||||
*4
|
||||
files:
|
||||
- "**/*.xml"
|
||||
|
||||
- name: talentnoblocks
|
||||
isolate: true
|
||||
regex: (\s?blocks="[^"]+")
|
||||
lua: |
|
||||
s1 = ""
|
||||
files:
|
||||
- "**/TalentTrees.xml"
|
||||
|
||||
- name: maxchosentalents
|
||||
isolate: true
|
||||
regex: (<TalentOptions!any</TalentOptions>)
|
||||
lua: |
|
||||
local talentOptions = 0
|
||||
local lines = strsplit(s1, "\n")
|
||||
for i, line in pairs(lines) do
|
||||
if string.find(line, "<TalentOption ") then
|
||||
talentOptions = talentOptions + 1
|
||||
end
|
||||
end
|
||||
|
||||
if lines[1]:find("maxchosentalents") then
|
||||
--print("maxchosentalents found, updating")
|
||||
local optionsElement = lines[1]
|
||||
optionsElement = optionsElement:gsub("maxchosentalents=\"%d+\"", "maxchosentalents=\"" .. talentOptions .. "\"")
|
||||
replacement = s1:gsub(lines[1], optionsElement)
|
||||
return false
|
||||
end
|
||||
|
||||
print("maxchosentalents not found, creating")
|
||||
local optionsElement = lines[1]
|
||||
local optionsElement = optionsElement:gsub("<TalentOptions", "<TalentOptions maxchosentalents=\"" .. talentOptions .. "\"")
|
||||
replacement = s1:gsub(lines[1], optionsElement)
|
||||
files:
|
||||
- "**/TalentTrees.xml"
|
||||
|
||||
- name: norequiredtalents
|
||||
isolate: true
|
||||
regex: (?-s)(<TalentOptions )(?:!anyrequiredtalents="(?<requiredtalents>!num)")?
|
||||
lua: |
|
||||
if requiredtalents then
|
||||
requiredtalents = 1
|
||||
else
|
||||
print("requiredtalents not found, creating")
|
||||
replacement = s1 .. "requiredtalents=\"1\" "
|
||||
end
|
||||
files:
|
||||
- "**/TalentTrees.xml"
|
||||
|
||||
- name: alltalents
|
||||
isolate: true
|
||||
regex: <TalentTrees>(!any)</TalentTrees>
|
||||
lua: |
|
||||
-- group by job
|
||||
local subtrees = {}
|
||||
local lines = strsplit(s1, "\n")
|
||||
local cookedlines = {}
|
||||
|
||||
local isInSubtree = false
|
||||
local currentjob = nil
|
||||
for i, line in pairs(lines) do
|
||||
if line:match("<TalentTree jobidentifier=\"(%w+)\"") then
|
||||
currentjob = line:match("<TalentTree jobidentifier=\"(%w+)\"")
|
||||
subtrees[currentjob] = subtrees[currentjob] or {}
|
||||
end
|
||||
if line:find("<SubTree") then
|
||||
isInSubtree = true
|
||||
end
|
||||
if line:find("</SubTree") then
|
||||
isInSubtree = false
|
||||
subtrees[currentjob][#subtrees[currentjob] + 1] = line
|
||||
end
|
||||
if isInSubtree then
|
||||
subtrees[currentjob][#subtrees[currentjob] + 1] = line
|
||||
else
|
||||
if not line:find("SubTree") then
|
||||
cookedlines[#cookedlines + 1] = line
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
currentjob = nil
|
||||
local alltalents = {}
|
||||
for i, line in pairs(cookedlines) do
|
||||
alltalents[#alltalents + 1] = line
|
||||
if line:match("<TalentTree jobidentifier=\"(%w+)\"") then
|
||||
currentjob = line:match("<TalentTree jobidentifier=\"(%w+)\"")
|
||||
|
||||
if currentjob then
|
||||
for job, subtree in pairs(subtrees) do
|
||||
alltalents[#alltalents + 1] = table.concat(subtree, "\n")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
s1 = table.concat(alltalents, "\n")
|
||||
files:
|
||||
- "Content/**/TalentTrees.xml"
|
||||
- "Content/Items/**/*.xml"
|
||||
|
||||
- name: merchantstock
|
||||
regex: (?-s)<Price(?:!anymultiplier="(?<multiplier>!num)")?(?:!anyminavailable="(?<minavailable>!num)")?
|
||||
@@ -208,21 +110,21 @@
|
||||
minavailable = round(minavailable * 3, 2)
|
||||
end
|
||||
files:
|
||||
- "**/*.xml"
|
||||
- "Content/Items/**/*.xml"
|
||||
|
||||
- name: repairthroughwalls
|
||||
regex: <RepairTool!anyrepairthroughwalls="(?<repairthroughwalls>!any)"
|
||||
lua: |
|
||||
repairthroughwalls = "true"
|
||||
files:
|
||||
- "**/*.xml"
|
||||
- "Content/Items/**/*.xml"
|
||||
|
||||
- name: itembonanzaamount
|
||||
regex: (?-s)(?i)<Preferredcontainer!anyamount="!num"
|
||||
lua: |
|
||||
v1 = round(v1 * 2, 2)
|
||||
files:
|
||||
- "**/*.xml"
|
||||
- "Content/Items/**/*.xml"
|
||||
- name: itembonanzaspawnprobability
|
||||
regex: (?-s)(?i)<Preferredcontainer!anyspawnprobability="!num"
|
||||
lua: |
|
||||
@@ -231,16 +133,16 @@
|
||||
v1 = 1
|
||||
end
|
||||
files:
|
||||
- "**/*.xml"
|
||||
- "Content/Items/**/*.xml"
|
||||
- name: itembonanzaminamount
|
||||
regex: (?-s)(?i)<Preferredcontainer!anyminamount="!num"
|
||||
lua: |
|
||||
v1 = round(v1 * 2, 2)
|
||||
files:
|
||||
- "**/*.xml"
|
||||
- "Content/Items/**/*.xml"
|
||||
- name: itembonanzamaxamount
|
||||
regex: (?-s)(?i)<Preferredcontainer!anymaxamount="!num"
|
||||
lua: |
|
||||
v1 = round(v1 * 2, 2)
|
||||
files:
|
||||
- "**/*.xml"
|
||||
- "Content/Items/**/*.xml"
|
||||
|
98
cooktalents.yml
Normal file
98
cooktalents.yml
Normal file
@@ -0,0 +1,98 @@
|
||||
- name: talentnoblocks
|
||||
isolate: true
|
||||
regex: (\s?blocks="[^"]+")
|
||||
lua: |
|
||||
s1 = ""
|
||||
files:
|
||||
- "Content/**/TalentTrees.xml"
|
||||
|
||||
- name: maxchosentalents
|
||||
isolate: true
|
||||
regex: (<TalentOptions!any</TalentOptions>)
|
||||
lua: |
|
||||
local talentOptions = 0
|
||||
local lines = strsplit(s1, "\n")
|
||||
for i, line in pairs(lines) do
|
||||
if string.find(line, "<TalentOption ") then
|
||||
talentOptions = talentOptions + 1
|
||||
end
|
||||
end
|
||||
|
||||
if lines[1]:find("maxchosentalents") then
|
||||
--print("maxchosentalents found, updating")
|
||||
local optionsElement = lines[1]
|
||||
optionsElement = optionsElement:gsub("maxchosentalents=\"%d+\"", "maxchosentalents=\"" .. talentOptions .. "\"")
|
||||
replacement = s1:gsub(lines[1], optionsElement)
|
||||
return false
|
||||
end
|
||||
|
||||
print("maxchosentalents not found, creating")
|
||||
local optionsElement = lines[1]
|
||||
local optionsElement = optionsElement:gsub("<TalentOptions", "<TalentOptions maxchosentalents=\"" .. talentOptions .. "\"")
|
||||
replacement = s1:gsub(lines[1], optionsElement)
|
||||
files:
|
||||
- "Content/**/TalentTrees.xml"
|
||||
|
||||
- name: norequiredtalents
|
||||
isolate: true
|
||||
regex: (?-s)(<TalentOptions )(?:!anyrequiredtalents="(?<requiredtalents>!num)")?
|
||||
lua: |
|
||||
if requiredtalents then
|
||||
requiredtalents = 1
|
||||
else
|
||||
print("requiredtalents not found, creating")
|
||||
replacement = s1 .. "requiredtalents=\"1\" "
|
||||
end
|
||||
files:
|
||||
- "Content/**/TalentTrees.xml"
|
||||
|
||||
- name: alltalents
|
||||
isolate: true
|
||||
regex: <TalentTrees>(!any)</TalentTrees>
|
||||
lua: |
|
||||
-- group by job
|
||||
local subtrees = {}
|
||||
local lines = strsplit(s1, "\n")
|
||||
local cookedlines = {}
|
||||
|
||||
local isInSubtree = false
|
||||
local currentjob = nil
|
||||
for i, line in pairs(lines) do
|
||||
if line:match("<TalentTree jobidentifier=\"(%w+)\"") then
|
||||
currentjob = line:match("<TalentTree jobidentifier=\"(%w+)\"")
|
||||
subtrees[currentjob] = subtrees[currentjob] or {}
|
||||
end
|
||||
if line:find("<SubTree") then
|
||||
isInSubtree = true
|
||||
end
|
||||
if line:find("</SubTree") then
|
||||
isInSubtree = false
|
||||
subtrees[currentjob][#subtrees[currentjob] + 1] = line
|
||||
end
|
||||
if isInSubtree then
|
||||
subtrees[currentjob][#subtrees[currentjob] + 1] = line
|
||||
else
|
||||
if not line:find("SubTree") then
|
||||
cookedlines[#cookedlines + 1] = line
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
currentjob = nil
|
||||
local alltalents = {}
|
||||
for i, line in pairs(cookedlines) do
|
||||
alltalents[#alltalents + 1] = line
|
||||
if line:match("<TalentTree jobidentifier=\"(%w+)\"") then
|
||||
currentjob = line:match("<TalentTree jobidentifier=\"(%w+)\"")
|
||||
|
||||
if currentjob then
|
||||
for job, subtree in pairs(subtrees) do
|
||||
alltalents[#alltalents + 1] = table.concat(subtree, "\n")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
s1 = table.concat(alltalents, "\n")
|
||||
files:
|
||||
- "Content/**/TalentTrees.xml"
|
Reference in New Issue
Block a user