Demolisher resistances are set inside /data/space-age/prototypes/entity/enemies.lua and all use the same demolisher_resistances table. It seems this is setting the resulting resistances to a reference of that table rather than making a copy of the values.
Tested with the following:
Code: Select all
log("START TEST")
local i = 0
for name, unit in pairs(data.raw["segmented-unit"]) do
i = i + 1
unit.resistances[1].decrease = i
log("Setting resistance of " .. name .. " to: " .. unit.resistances[1].decrease)
end
log("Result:")
for name, unit in pairs(data.raw["segmented-unit"]) do
log("Resistance of " .. name .. " is: " .. unit.resistances[1].decrease)
end
log("END TEST")
Code: Select all
START TEST
Setting resistance of small-demolisher to: 1
Setting resistance of medium-demolisher to: 2
Setting resistance of big-demolisher to: 3
Result:
Resistance of small-demolisher is: 3
Resistance of medium-demolisher is: 3
Resistance of big-demolisher is: 3
END TEST