Files
barotrauma-gamefiles/cookother.yml
2025-03-28 02:08:38 +01:00

77 lines
2.1 KiB
YAML

- name: containers
regex: '(?-s)capacity="(?<capacity>!num)"(?:!anyslotsperrow="(?<slotsperrow>!num))?'
lua: |
capacity=capacity*2
if not slotsperrow then return true end
slotsperrow=1
while slotsperrow * slotsperrow < capacity do
slotsperrow = slotsperrow + 1
end' \
'**/*.xml'
modify \
'<Containable!any(\s?excludeditems="[^"]+")' \
'print(s1) s1=""
files:
- '**/*.xml'
- name: upgrade
regex: (?:maxforce|capacity|maxrechargespeed|overloadvoltage|healthmultiplier|maxhealth|fabricationspeed|deconstructionspeed|rotationspeedlowskill|offsetonselectedmultiplier|range|maxpoweroutput|meltdowndelay|maxflow|fixdurationlowskill|skillrequirementmultiplier)="\+?!num%?"
lua: |
*2
files:
- '**/UpgradeModules.xml'
- name: upgradetooltip
regex: 'increaseontooltip="(?<increaseontooltip>!num)"'
lua: |
increaseontooltip=increaseontooltip*2
files:
- '**/UpgradeModules.xml'
- name: missionreward
regex: 'reward="!num'
lua: |
*4
files:
- '**/Missions.xml'
- name: maxstacksize
regex: 'maxstacksize="!num'
lua: |
*2
files:
- '**/*.xml'
- name: lightrange
regex: '(?-s)LightComponent!anyrange="(!num)"'
lua: |
*4
files:
- '**/*.xml'
- name: talenttrees
regex: (<TalentOptions!any>!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'