1
0
mirror of https://github.com/veden/Rampant.git synced 2024-12-28 21:08:22 +02:00
Rampant/data-final-fixes.lua
2020-03-21 18:27:42 -07:00

78 lines
2.6 KiB
Lua
Executable File

local vanillaBuildings = require("prototypes/buildings/UpdatesVanilla")
local biterFunctions = require("prototypes/utils/BiterUtils")
local swarmUtils = require("prototypes/SwarmUtils")
if settings.startup["rampant-newEnemies"].value then
swarmUtils.processFactions()
end
if settings.startup["rampant-removeBloodParticles"].value then
local explosions = data.raw["explosion"]
for k,v in pairs(explosions) do
if string.find(k, "blood") then
v["created_effect"] = nil
end
end
end
if settings.startup["rampant-unitSpawnerBreath"].value then
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"
end
end
end
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}
}
end
unit.affected_by_tiles = settings.startup["rampant-unitsAffectedByTiles"].value
unit.ai_settings = {
destroy_when_commands_fail = false,
allow_try_return_to_spawner = true,
path_resolution_modifier = -5,
do_seperation = true
}
end
end
if settings.startup["rampant-enableShrinkNestsAndWorms"].value then
for k, unit in pairs(data.raw["unit-spawner"]) do
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}
}
end
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
end
end
if settings.startup["rampant-addWallResistanceAcid"].value then
vanillaBuildings.addWallAcidResistance()
end