1
0
mirror of https://github.com/veden/Rampant.git synced 2024-12-30 21:19:46 +02:00
Rampant/data-final-fixes.lua

83 lines
2.8 KiB
Lua
Raw Normal View History

2017-05-17 08:18:25 +02:00
local vanillaBuildings = require("prototypes/buildings/UpdatesVanilla")
2019-10-20 22:45:43 +02:00
local biterFunctions = require("prototypes/utils/BiterUtils")
local swarmUtils = require("prototypes/SwarmUtils")
2019-02-03 08:01:28 +02:00
2020-04-28 05:41:18 +02:00
if settings.startup["rampant-newEnemies"].value then
2019-11-30 02:49:22 +02:00
swarmUtils.processFactions()
2020-04-28 05:41:18 +02: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-18 06:54:53 +02:00
end
2019-02-03 08:01:28 +02:00
if settings.startup["rampant-removeBloodParticles"].value then
local explosions = data.raw["explosion"]
2019-10-20 22:45:43 +02:00
for k,v in pairs(explosions) do
if string.find(k, "blood") then
v["created_effect"] = nil
end
end
end
2019-10-20 22:45:43 +02:00
2019-11-30 02:49:22 +02:00
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"
2020-04-28 05:41:18 +02:00
end
end
end
2020-03-22 03:27:42 +02: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-22 03:27:42 +02:00
end
2019-10-06 20:57:33 +02:00
2020-03-22 03:27:42 +02:00
unit.affected_by_tiles = settings.startup["rampant-unitsAffectedByTiles"].value
2019-10-21 02:53:16 +02:00
2020-03-22 03:27:42 +02:00
unit.ai_settings = {
destroy_when_commands_fail = false,
allow_try_return_to_spawner = true,
path_resolution_modifier = -5,
do_seperation = true
}
end
2019-04-07 06:41:00 +02:00
end
2019-03-28 05:55:13 +02:00
2019-11-04 08:19:22 +02:00
if settings.startup["rampant-enableShrinkNestsAndWorms"].value then
2019-03-28 05:55:13 +02:00
for k, unit in pairs(data.raw["unit-spawner"]) do
2019-11-30 02:49:22 +02: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-04 08:19:22 +02:00
}
end
2019-03-28 05:55:13 +02: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-04 08:19:22 +02:00
end
end
2019-03-28 05:55:13 +02:00
2017-05-17 08:18:25 +02:00
if settings.startup["rampant-addWallResistanceAcid"].value then
vanillaBuildings.addWallAcidResistance()
end