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

123 lines
4.2 KiB
Lua
Raw Normal View History

2017-05-17 08:18:25 +02:00
local vanillaBuildings = require("prototypes/buildings/UpdatesVanilla")
local neutral = require("prototypes/Neutral")
local acid = require("prototypes/Acid")
local physical = require("prototypes/Physical")
local suicide = require("prototypes/Suicide")
local fire = require("prototypes/Fire")
local electric = require("prototypes/Electric")
local nuclear = require("prototypes/Nuclear")
local inferno = require("prototypes/Inferno")
local fast = require("prototypes/Fast")
local troll = require("prototypes/Troll")
2019-02-14 07:53:31 +02:00
local poison = require("prototypes/Poison")
local spawner = require("prototypes/Spawner")
local wasp = require("prototypes/Wasp")
local laser = require("prototypes/Laser")
2019-02-13 07:50:25 +02:00
local energyThief = require("prototypes/EnergyThief")
2019-02-14 07:53:31 +02:00
-- require("prototypes/Decaying")
-- require("prototypes/Undying")
2018-01-24 08:02:06 +02:00
if settings.startup["rampant-newEnemies"].value then
2019-02-03 08:01:28 +02:00
neutral.addFaction()
2019-02-03 08:01:28 +02:00
if settings.startup["rampant-acidEnemy"].value then
acid.addFaction()
end
if settings.startup["rampant-physicalEnemy"].value then
physical.addFaction()
end
if settings.startup["rampant-suicideEnemy"].value then
suicide.addFaction()
end
if settings.startup["rampant-fireEnemy"].value then
fire.addFaction()
end
if settings.startup["rampant-electricEnemy"].value then
electric.addFaction()
end
if settings.startup["rampant-nuclearEnemy"].value then
nuclear.addFaction()
end
if settings.startup["rampant-infernoEnemy"].value then
inferno.addFaction()
end
if settings.startup["rampant-fastEnemy"].value then
fast.addFaction()
end
if settings.startup["rampant-trollEnemy"].value then
troll.addFaction()
end
if settings.startup["rampant-spawnerEnemy"].value then
spawner.addFaction()
end
if settings.startup["rampant-waspEnemy"].value then
wasp.addFaction()
end
if settings.startup["rampant-laserEnemy"].value then
laser.addFaction()
end
2019-02-13 07:50:25 +02:00
if settings.startup["rampant-energyThiefEnemy"].value then
energyThief.addFaction()
end
2019-02-14 07:53:31 +02:00
if settings.startup["rampant-poisonEnemy"].value then
poison.addFaction()
end
-- require("prototypes/Decaying")
-- require("prototypes/Undying")
2019-03-18 06:54:53 +02:00
end
2019-02-03 08:01:28 +02:00
2019-03-18 06:54:53 +02:00
for _, unitSpawner in pairs(data.raw["unit-spawner"]) do
2019-04-07 06:41:00 +02:00
if settings.startup["rampant-unitSpawnerBreath"].value then
2019-03-18 06:54:53 +02:00
if not unitSpawner.flags then
unitSpawner.flags = {}
2019-03-13 07:46:25 +02:00
end
2019-03-18 06:54:53 +02:00
unitSpawner.flags[#unitSpawner.flags+1] = "breaths-air"
end
end
2019-04-07 06:41:00 +02:00
if settings.startup["rampant-enableSwarm"].value then
for k, unit in pairs(data.raw["unit"]) do
if (string.find(k, "biter") or string.find(k, "spitter")) and unit.collision_box then
unit.collision_box = {
2019-10-06 20:57:33 +02:00
{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}
}
2019-10-06 20:57:33 +02:00
-- if unit.collision_mask == nil then
-- unit.collision_mask = {"player-layer", "train-layer", "not-colliding-with-itself"}
-- else
-- unit.collision_mask[#unit.collision_mask+1] = "not-colliding-with-itself"
-- end
unit.ai_settings = { destroy_when_commands_fail = false, allow_try_return_to_spawner = false, path_resolution_modifier = -8, do_seperation = false }
end
end
2019-04-07 06:41:00 +02:00
end
2019-03-28 05:55:13 +02:00
2019-04-07 06:41:00 +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
if (string.find(k, "biter") or string.find(k, "spitter")) and unit.collision_box then
2019-10-06 20:57:33 +02:00
unit.collision_mask = {"player-layer", "train-layer", "not-colliding-with-itself"}
2019-03-28 05:55:13 +02:00
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-10-06 20:57:33 +02:00
}
2019-03-28 05:55:13 +02:00
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
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