Files
barotrauma-gamefiles/cookmods.yml
2025-04-01 08:50:32 +02:00

121 lines
3.0 KiB
YAML

- name: removehash
regex: (expectedhash="[^"]+")
lua: |
s1 = ""
files:
- "LocalMods/**/filelist.xml"
- name: containers
regex: '(?-s)capacity="(?<capacity>!num)"(?:!anyslotsperrow="(?<slotsperrow>!num))?'
lua: |
if capacity == 1 then return false end
-- file:find("fabricators.xml") then
-- apacity=round(capacity*1.5)
-- eturn true
--
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:
- "LocalMods/**/*.xml"
- name: containerscontainable
# Just to be safe... Probably not needed though...
isolate: true
regex: capacity="(?<capacity>!num).{0,200}?Containable.{0,50}?items="([^"]+)"
lua: |
-- If we fuck with the diving gear the game fucking explodes
-- Thinking we don't have oxygen tanks and killing us
if file:find("divinggear.xml") then return false end
if file:find("weapons.xml") then return false end
if capacity == 1 then return false end
print(s1)
local gurantee = {"ammobox", "deepdiving", "smallitem", "mediumitem", "largeitem"}
local has = {}
local items = strsplit(s1, ",")
for i, item in pairs(items) do
for _, g in pairs(gurantee) do
if string.find(item, g) then
has[g] = true
end
end
end
for _, g in pairs(gurantee) do
if not has[g] then
s1 = s1 .. "," .. g
end
end
files:
- "LocalMods/**/*.xml"
- name: excludeditems
regex: <Containable!any(\s?excludeditems="[^"]+")
lua: |
s1 = ""
files:
- "LocalMods/**/*.xml"
- name: maxstacksize
regex: 'maxstacksize="!num'
lua: |
=60
files:
- "LocalMods/**/*.xml"
- name: maxstacksizecharacterinventory
regex: 'maxstacksizecharacterinventory="!num'
lua: |
=60
files:
- "LocalMods/**/*.xml"
- name: morebetterquality
regex: (?-s)QualityStat!anyvalue="!num"
lua: |
round(v1 * 3, 2)
files:
- "LocalMods/**/*.xml"
- name: morewires
nodedup: true
regex: (?-s)<output!any(maxwires="(?<maxwires>!num)"|/>)
lua: |
print(maxwires, v1, s1)
if maxwires then
maxwires = round(maxwires * 4, 2)
else
s1 = " maxwires=\"10\" />"
end
files:
- "LocalMods/**/*.xml"
- name: deconstruction
isolate: true
regex: <Deconstruct.{0,50}?>(.{0,400}?)</Deconstruct>
lua: |
-- print("start:", s1)
local lines = strsplit(s1, "\n")
local newLines = {}
for _, line in pairs(lines) do
if line:find("Item identifier=") then
local amount = line:match("amount=\"(%d+)\"")
if amount then
line = line:gsub("amount=\"%d+\"", "amount=\"" .. amount*2 .. "\"")
else
line = line:gsub("(identifier=\"%w+\")", "%1 amount=\"2\"")
end
end
newLines[#newLines + 1] = line
end
-- print("end:", table.concat(newLines, "\n"))
s1 = table.concat(newLines, "\n")
files:
- "LocalMods/**/*.xml"