Files
barotrauma-gamefiles/cookother.sh
2025-03-27 20:52:50 +01:00

46 lines
1.8 KiB
Bash

modify \
'<Containable!any(\s?excludeditems="[^"]+")' \
'print(s1) s1=""' \
'**/*.xml'
modify \
'(?:maxforce|capacity|maxrechargespeed|overloadvoltage|healthmultiplier|maxhealth|fabricationspeed|deconstructionspeed|rotationspeedlowskill|offsetonselectedmultiplier|range|maxpoweroutput|meltdowndelay|maxflow|fixdurationlowskill|skillrequirementmultiplier)="\+?!num%?"' \
'*2' \
'**/UpgradeModules.xml'
modify \
'increaseontooltip="(?<increaseontooltip>!num)"' \
'increaseontooltip=increaseontooltip*2' \
'**/UpgradeModules.xml'
modify -loglevel INFO 'reward="!num' '*4' '**/Missions.xml'
modify -loglevel INFO 'maxstacksize="!num' '*2' '**/containers.xml' '**/tools.xml'
modify -loglevel INFO '(?-s)capacity="(?<capacity>!num)"!anyslotsperrow="(?<slotsperrow>!num)' 'capacity=capacity*2 slotsperrow=1 while slotsperrow * slotsperrow < capacity do slotsperrow = slotsperrow + 1 end' '**/containers.xml' '**/*.xml'
modify -loglevel INFO '(blocks="[^"]+")' 's1=""' '**/TalentTrees.xml'
modify -loglevel INFO '(?-s)LightComponent!anyrange="(!num)"' '*4' '**/*.xml'
modify -loglevel INFO \
'(<TalentOptions!any>!any</TalentOptions>)' \
'
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)
' \
'**/TalentTrees.xml'