1
0
mirror of https://github.com/veden/Rampant.git synced 2025-01-05 22:53:24 +02:00
Rampant/data-final-fixes.lua

86 lines
3.1 KiB
Lua
Raw Normal View History

2017-05-17 08:18:25 +02:00
local vanillaBuildings = require("prototypes/buildings/UpdatesVanilla")
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
if settings.startup["rampant--unitSpawnerBreath"].value then
2019-11-30 02:49:22 +02: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-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
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,
2021-03-29 07:00:49 +02:00
allow_try_return_to_spawner = true
2020-03-22 03:27:42 +02:00
}
end
2019-04-07 06:41:00 +02:00
end
2019-03-28 05:55:13 +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
if settings.startup["rampant--enableFadeTime"].value then
2021-02-09 07:55:16 +02: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-09 07:55:16 +02:00
end
end
end
2020-10-19 05:33:01 +02:00
if settings.startup["rampant--addWallResistanceAcid"].value then
2017-05-17 08:18:25 +02:00
vanillaBuildings.addWallAcidResistance()
end