1
0
mirror of https://github.com/veden/Rampant.git synced 2025-01-20 02:59:47 +02:00
Rampant/data-final-fixes.lua

86 lines
3.1 KiB
Lua
Raw Normal View History

2017-05-16 23:18:25 -07:00
local vanillaBuildings = require("prototypes/buildings/UpdatesVanilla")
local swarmUtils = require("prototypes/SwarmUtils")
2019-02-02 22:01:28 -08:00
2020-04-27 20:41:18 -07:00
if settings.startup["rampant--newEnemies"].value then
2019-11-29 16:49:22 -08:00
swarmUtils.processFactions()
2020-04-27 20:41:18 -07:00
swarmUtils.generateSpawnerProxy(data.raw["unit-spawner"]["neutral-biter-spawner-v1-t10-rampant"].result_units)
else
swarmUtils.generateSpawnerProxy(data.raw["unit-spawner"]["biter-spawner"].result_units)
2019-03-17 21:54:53 -07:00
end
2019-02-02 22:01:28 -08:00
if settings.startup["rampant--removeBloodParticles"].value then
local explosions = data.raw["explosion"]
2019-10-20 13:45:43 -07:00
for k,v in pairs(explosions) do
if string.find(k, "blood") then
v["created_effect"] = nil
end
end
end
2019-10-20 13:45:43 -07:00
if settings.startup["rampant--unitSpawnerBreath"].value then
2019-11-29 16:49:22 -08:00
for _, unitSpawner in pairs(data.raw["unit-spawner"]) do
if (string.find(unitSpawner.name, "hive") or string.find(unitSpawner.name, "biter") or
string.find(unitSpawner.name, "spitter")) then
if not unitSpawner.flags then
unitSpawner.flags = {}
end
unitSpawner.flags[#unitSpawner.flags+1] = "breaths-air"
2020-04-27 20:41:18 -07:00
end
end
end
2020-03-21 18:27:42 -07:00
for k, unit in pairs(data.raw["unit"]) do
if (string.find(k, "biter") or string.find(k, "spitter")) and unit.collision_box then
if settings.startup["rampant--enableSwarm"].value then
unit.collision_box = {
{unit.collision_box[1][1] * 0.20, unit.collision_box[1][2] * 0.20},
{unit.collision_box[2][1] * 0.20, unit.collision_box[2][2] * 0.20}
}
2020-03-21 18:27:42 -07:00
end
2019-10-06 11:57:33 -07:00
unit.affected_by_tiles = settings.startup["rampant--unitsAffectedByTiles"].value
2019-10-20 17:53:16 -07:00
2020-03-21 18:27:42 -07:00
unit.ai_settings = {
destroy_when_commands_fail = false,
2021-03-28 22:00:49 -07:00
allow_try_return_to_spawner = true
2020-03-21 18:27:42 -07:00
}
end
2019-04-06 21:41:00 -07:00
end
2019-03-27 20:55:13 -07:00
if settings.startup["rampant--enableShrinkNestsAndWorms"].value then
2019-03-27 20:55:13 -07:00
for k, unit in pairs(data.raw["unit-spawner"]) do
2019-11-29 16:49:22 -08:00
if (string.find(k, "biter") or string.find(k, "spitter") or string.find(k, "hive")) and unit.collision_box then
unit.collision_box = {
{unit.collision_box[1][1] * 0.50, unit.collision_box[1][2] * 0.50},
{unit.collision_box[2][1] * 0.50, unit.collision_box[2][2] * 0.50}
2019-11-03 22:19:22 -08:00
}
end
2019-03-27 20:55:13 -07:00
end
for k, unit in pairs(data.raw["turret"]) do
if string.find(k, "worm") and unit.collision_box then
unit.collision_box = {
{unit.collision_box[1][1] * 0.50, unit.collision_box[1][2] * 0.50},
{unit.collision_box[2][1] * 0.50, unit.collision_box[2][2] * 0.50}
}
end
2019-11-03 22:19:22 -08:00
end
end
if settings.startup["rampant--enableFadeTime"].value then
2021-02-08 21:55:16 -08:00
for k, corpse in pairs(data.raw["corpse"]) do
if (string.find(k, "biter") or string.find(k, "spitter") or string.find(k, "hive") or
string.find(k, "worm") or string.find(k, "spawner")) then
corpse.time_before_removed = settings.startup["rampant--unitAndSpawnerFadeTime"].value * 60
2021-02-08 21:55:16 -08:00
end
end
end
2020-10-18 20:33:01 -07:00
if settings.startup["rampant--addWallResistanceAcid"].value then
2017-05-16 23:18:25 -07:00
vanillaBuildings.addWallAcidResistance()
end