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")
|
2018-04-15 01:02:40 +02:00
|
|
|
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")
|
2018-04-15 01:02:40 +02:00
|
|
|
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-04-15 01:02:40 +02:00
|
|
|
|
2018-01-24 08:02:06 +02:00
|
|
|
if settings.startup["rampant-newEnemies"].value then
|
2019-02-03 08:01:28 +02:00
|
|
|
|
2018-04-15 01:02:40 +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-10-21 06:38:36 +02:00
|
|
|
-- data:extend({
|
|
|
|
-- biterFunctions.makeUnitSpawner("tester",
|
|
|
|
-- {
|
|
|
|
-- scale=3.0,
|
|
|
|
-- spawningRadius=20,
|
2019-10-22 07:30:23 +02:00
|
|
|
-- spawningSpacing=20,
|
2019-10-21 06:38:36 +02:00
|
|
|
-- unitsToSpawn=1000
|
|
|
|
-- },
|
|
|
|
-- {},
|
|
|
|
-- {
|
2019-10-22 07:30:23 +02:00
|
|
|
-- {"cliff", {{0.0, 0.3}, {1.0, 1.0}}},
|
2019-10-21 06:38:36 +02:00
|
|
|
-- -- {"medium-worm-turret", {{0.0, 0.3}, {1.0, 1.0}}},
|
|
|
|
-- -- {"big-worm-turret", {{0.0, 0.3}, {1.0, 1.0}}}
|
2019-10-22 07:30:23 +02:00
|
|
|
-- -- {"chunk-scanner-3-nest-rampant", {{0.0, 0.3}, {1.0, 1.0}}},
|
|
|
|
-- -- {"chunk-scanner-8-nest-rampant", {{0.0, 0.001}, {1.0, 1.0}}}
|
2019-10-21 06:38:36 +02:00
|
|
|
-- })
|
|
|
|
-- })
|
2019-10-20 22:45:43 +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"
|
2018-01-21 09:42:47 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2019-04-07 06:41:00 +02:00
|
|
|
if settings.startup["rampant-enableSwarm"].value then
|
2017-11-27 00:10:56 +02:00
|
|
|
for k, unit in pairs(data.raw["unit"]) do
|
2019-10-14 07:49:52 +02:00
|
|
|
if (string.find(k, "biter") or string.find(k, "spitter")) and unit.collision_box 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}
|
|
|
|
}
|
2019-10-06 20:57:33 +02:00
|
|
|
|
2019-10-21 02:53:16 +02:00
|
|
|
unit.affected_by_tiles = true
|
|
|
|
|
2019-10-20 22:45:43 +02:00
|
|
|
unit.ai_settings = { destroy_when_commands_fail = false, allow_try_return_to_spawner = true, path_resolution_modifier = -5, do_seperation = true }
|
2019-10-14 07:49:52 +02:00
|
|
|
end
|
2017-11-27 00:10:56 +02:00
|
|
|
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-10-14 07:49:52 +02:00
|
|
|
if (string.find(k, "biter") or string.find(k, "spitter")) 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
|
|
|
}
|
2019-10-14 07:49:52 +02:00
|
|
|
end
|
2019-03-28 05:55:13 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
for k, unit in pairs(data.raw["turret"]) do
|
2019-10-14 07:49:52 +02:00
|
|
|
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
|
2017-11-27 00:10:56 +02:00
|
|
|
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
|