1
0
mirror of https://github.com/veden/Rampant.git synced 2025-01-30 04:30:52 +02:00

removing conditional requires everywhere

This commit is contained in:
Aaron Veden 2018-04-14 16:02:40 -07:00
parent bf74de8051
commit 868eb2f3d7
19 changed files with 13880 additions and 13761 deletions

View File

@ -304,9 +304,6 @@ local function onConfigChanged()
upgraded, natives = upgrade.attempt(natives)
if upgraded and onModSettingsChange(nil) then
rebuildMap()
if natives.newEnemies then
rebuildNativeTables(natives, game.surfaces[1], game.create_random_generator(natives.enemySeed))
end
-- clear pending chunks, will be added when loop runs below
global.pendingChunks = {}
@ -324,6 +321,9 @@ local function onConfigChanged()
processPendingChunks(natives, map, surface, pendingChunks, tick, game.forces.enemy.evolution_factor, true)
end
if natives.newEnemies then
rebuildNativeTables(natives, game.surfaces[1], game.create_random_generator(natives.enemySeed))
end
end
script.on_nth_tick(INTERVAL_PROCESS,

View File

@ -1,22 +1,40 @@
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")
-- require("prototypes/Decaying")
-- require("prototypes/Poison")
-- require("prototypes/Undying")
local spawner = require("prototypes/Spawner")
local wasp = require("prototypes/Wasp")
local laser = require("prototypes/Laser")
if settings.startup["rampant-newEnemies"].value then
require("prototypes/Neutral")
require("prototypes/Acid")
require("prototypes/Physical")
require("prototypes/Suicide")
require("prototypes/Fire")
require("prototypes/Electric")
require("prototypes/Nuclear")
require("prototypes/Inferno")
require("prototypes/Fast")
require("prototypes/Troll")
neutral.addFaction()
acid.addFaction()
physical.addFaction()
suicide.addFaction()
fire.addFaction()
electric.addFaction()
nuclear.addFaction()
inferno.addFaction()
fast.addFaction()
troll.addFaction()
-- require("prototypes/Decaying")
-- require("prototypes/Poison")
-- require("prototypes/Undying")
require("prototypes/Spawner")
require("prototypes/Wasp")
require("prototypes/Laser")
spawner.addFaction()
wasp.addFaction()
laser.addFaction()
for _, unitSpawner in pairs(data.raw["unit-spawner"]) do
if (unitSpawner.name ~= "biter-spawner") then

View File

@ -3,6 +3,9 @@ local bobsUpdates = require("prototypes/utils/UpdatesBobs")
local NEUpdates = require("prototypes/utils/UpdatesNE")
local constants = require("libs/Constants")
local attackBobs = require("prototypes/utils/AttackBobs")
local attackNE = require("prototypes/utils/AttackNE")
if settings.startup["rampant-removeBloodParticles"].value then
local explosions = data.raw["explosion"]
@ -16,14 +19,13 @@ if settings.startup["rampant-useDumbProjectiles"].value then
local option = settings.startup["bobmods-enemies-enableartifacts"]
if option then
require("prototypes/utils/AttackBobs")
attackBobs.addAttacks()
bobsUpdates.useDumbProjectiles()
end
option = settings.startup["NE_Difficulty"]
if option then
require("prototypes/utils/AttackNE")
attackNE.addAttacks()
NEUpdates.useDumbProjectiles()
if settings.startup["rampant-useNEUnitLaunchers"].value then
NEUpdates.useNEUnitLaunchers()

View File

@ -369,6 +369,8 @@ end
function chunkUtils.analyzeChunk(chunk, natives, surface, map)
local playerObjects = chunkUtils.scorePlayerBuildings(surface, map, natives)
setPlayerBaseGenerator(map, chunk, playerObjects)
local resources = surface.count_entities_filtered(map.countResourcesQuery) * RESOURCE_NORMALIZER
setResourceGenerator(map, chunk, resources)
end
function chunkUtils.createChunk(topX, topY)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -9,6 +9,8 @@ local constants = require("Constants")
-- constants
local wasp = {}
local WASP_UNIT_TIERS = constants.WASP_UNIT_TIERS
local WASP_UNIT_VARIATIONS = constants.WASP_UNIT_VARIATIONS
@ -36,6 +38,8 @@ local makeUnitAlienLootTable = biterUtils.makeUnitAlienLootTable
local makeSpawnerAlienLootTable = biterUtils.makeSpawnerAlienLootTable
local makeWormAlienLootTable = biterUtils.makeWormAlienLootTable
function wasp.addFaction()
local biterLoot = makeUnitAlienLootTable("purple")
local spawnerLoot = makeSpawnerAlienLootTable("purple")
local wormLoot = makeWormAlienLootTable("purple")
@ -1399,3 +1403,6 @@ buildWorm(
WASP_WORM_VARIATIONS,
WASP_WORM_TIERS
)
end
return wasp

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,7 @@
-- import
local attacks = {}
local attackBall = require("AttackBall")
local FORCE_OLD_PROJECTILES = settings.startup["rampant-forceOldProjectiles"].value
@ -9,230 +11,233 @@ local FORCE_OLD_PROJECTILES = settings.startup["rampant-forceOldProjectiles"].va
local softSmoke = "the-soft-smoke-rampant"
local createAttackBall = attackBall.createAttackBall
local multipler = (FORCE_OLD_PROJECTILES and 1) or 2.7
function attacks.addAttacks()
createAttackBall(
{
name = "ne-infected-unit-ball",
pTint = {r=0, g=0.97, b=0.34, a=0.5},
sTint = {r=0, g=0.1, b=1, a=1},
softSmokeName = softSmoke,
type = "projectile",
pointEffects = function (attributes)
return {
{
type = "create-entity",
entity_name = "unit-cluster",
trigger_created_entity = "true"
},
{
type = "create-sticker",
sticker = "slowdown-sticker",
},
{
type = "create-entity",
entity_name = "Infected-Poison-Cloud"
},
{
type = "damage",
damage = {amount = 10 * multipler, type = "explosion"}
},
{
type = "damage",
damage = {amount = 24 * multipler, type = "poison"}
}
}
end,
radius = 1,
areaEffects = function (attributes)
return
{
{
type = "damage",
damage = { amount = 0, type = "explosion" }
}
}
end
}
)
local multipler = (FORCE_OLD_PROJECTILES and 1) or 2.7
--
createAttackBall(
{
name = "ne-mutated-unit-ball",
pTint = {r=0.5, g=0.7, b=0.34, a=0.5},
sTint = {r=0.5, g=0.97, b=0.34, a=0.5},
softSmokeName = softSmoke,
type = "projectile",
pointEffects = function (attributes)
return {
{
type = "create-entity",
entity_name = "unit-cluster",
trigger_created_entity = "true"
},
{
type = "create-sticker",
sticker = "slowdown-sticker",
},
{
type = "create-entity",
entity_name = "acid-splash-purple"
}
}
end,
radius = 2,
areaEffects = function (attributes)
return
{
{
type = "damage",
damage = { amount = 8 * multipler, type = "explosion" }
},
{
type = "damage",
damage = { amount = 18 * multipler, type = "acid" }
}
}
end
}
)
--
createAttackBall(
{
name = "ne-infected-ball",
pTint = {r=0.5, g=0.7, b=0.34, a=0.5},
sTint = {r=0.5, g=0.97, b=0.34, a=0.5},
softSmokeName = softSmoke,
type = "projectile",
pointEffects = function (attributes)
return {
{
type = "create-entity",
entity_name = "Infected-Poison-Cloud"
}
}
end,
radius = 1.5,
areaEffects = function (attributes)
return
{
{
type = "damage",
damage = { amount = 5 * multipler, type = "explosion" }
},
{
type = "damage",
damage = { amount = 12 * multipler, type = "poison" }
}
}
end
}
)
if not FORCE_OLD_PROJECTILES then
createAttackBall(
{
name = "ne-infected-ball-direction",
pTint = {r=0.5, g=0.7, b=0.34, a=0.5},
sTint = {r=0.5, g=0.97, b=0.34, a=0.5},
softSmokeName = softSmoke,
directionOnly = true,
type = "projectile",
pointEffects = function (attributes)
return {
{
type = "create-entity",
entity_name = "Infected-Poison-Cloud"
}
}
end,
radius = 1.5,
areaEffects = function (attributes)
return
{
{
name = "ne-infected-unit-ball",
pTint = {r=0, g=0.97, b=0.34, a=0.5},
sTint = {r=0, g=0.1, b=1, a=1},
softSmokeName = softSmoke,
type = "projectile",
pointEffects = function (attributes)
return {
{
type = "damage",
damage = { amount = 5 * multipler, type = "explosion" }
type = "create-entity",
entity_name = "unit-cluster",
trigger_created_entity = "true"
},
{
type = "create-sticker",
sticker = "slowdown-sticker",
},
{
type = "create-entity",
entity_name = "Infected-Poison-Cloud"
},
{
type = "damage",
damage = { amount = 12 * multipler, type = "poison" }
}
}
end
}
)
end
--
createAttackBall(
{
name = "ne-mutated-ball",
pTint = {r=0.5, g=0.7, b=0.34, a=0.5},
sTint = {r=0.5, g=0.97, b=0.34, a=0.5},
softSmokeName = softSmoke,
type = "projectile",
pointEffects = function (attributes)
return {
{
type = "create-entity",
entity_name = "acid-splash-purple"
}
}
end,
radius = 1.5,
areaEffects = function (attributes)
return
{
{
type = "damage",
damage = { amount = 5 * multipler, type = "explosion" }
damage = {amount = 10 * multipler, type = "explosion"}
},
{
type = "damage",
damage = { amount = 12 * multipler, type = "acid" }
damage = {amount = 24 * multipler, type = "poison"}
}
}
end
}
)
end,
radius = 1,
areaEffects = function (attributes)
return
{
{
type = "damage",
damage = { amount = 0, type = "explosion" }
}
}
end
}
)
--
if not FORCE_OLD_PROJECTILES then
createAttackBall(
{
name = "ne-mutated-ball-direction",
pTint = {r=0.5, g=0.7, b=0.34, a=0.5},
sTint = {r=0.5, g=0.97, b=0.34, a=0.5},
softSmokeName = softSmoke,
directionOnly = true,
type = "projectile",
pointEffects = function (attributes)
return {
{
type = "create-entity",
entity_name = "acid-splash-purple"
}
}
end,
radius = 1.5,
areaEffects = function (attributes)
return
{
{
name = "ne-mutated-unit-ball",
pTint = {r=0.5, g=0.7, b=0.34, a=0.5},
sTint = {r=0.5, g=0.97, b=0.34, a=0.5},
softSmokeName = softSmoke,
type = "projectile",
pointEffects = function (attributes)
return {
{
type = "damage",
damage = { amount = 5 * multipler, type = "explosion" }
type = "create-entity",
entity_name = "unit-cluster",
trigger_created_entity = "true"
},
{
type = "damage",
damage = { amount = 12 * multipler, type = "acid" }
type = "create-sticker",
sticker = "slowdown-sticker",
},
{
type = "create-entity",
entity_name = "acid-splash-purple"
}
}
end
}
)
end,
radius = 2,
areaEffects = function (attributes)
return
{
{
type = "damage",
damage = { amount = 8 * multipler, type = "explosion" }
},
{
type = "damage",
damage = { amount = 18 * multipler, type = "acid" }
}
}
end
}
)
--
createAttackBall(
{
name = "ne-infected-ball",
pTint = {r=0.5, g=0.7, b=0.34, a=0.5},
sTint = {r=0.5, g=0.97, b=0.34, a=0.5},
softSmokeName = softSmoke,
type = "projectile",
pointEffects = function (attributes)
return {
{
type = "create-entity",
entity_name = "Infected-Poison-Cloud"
}
}
end,
radius = 1.5,
areaEffects = function (attributes)
return
{
{
type = "damage",
damage = { amount = 5 * multipler, type = "explosion" }
},
{
type = "damage",
damage = { amount = 12 * multipler, type = "poison" }
}
}
end
}
)
if not FORCE_OLD_PROJECTILES then
createAttackBall(
{
name = "ne-infected-ball-direction",
pTint = {r=0.5, g=0.7, b=0.34, a=0.5},
sTint = {r=0.5, g=0.97, b=0.34, a=0.5},
softSmokeName = softSmoke,
directionOnly = true,
type = "projectile",
pointEffects = function (attributes)
return {
{
type = "create-entity",
entity_name = "Infected-Poison-Cloud"
}
}
end,
radius = 1.5,
areaEffects = function (attributes)
return
{
{
type = "damage",
damage = { amount = 5 * multipler, type = "explosion" }
},
{
type = "damage",
damage = { amount = 12 * multipler, type = "poison" }
}
}
end
}
)
end
--
createAttackBall(
{
name = "ne-mutated-ball",
pTint = {r=0.5, g=0.7, b=0.34, a=0.5},
sTint = {r=0.5, g=0.97, b=0.34, a=0.5},
softSmokeName = softSmoke,
type = "projectile",
pointEffects = function (attributes)
return {
{
type = "create-entity",
entity_name = "acid-splash-purple"
}
}
end,
radius = 1.5,
areaEffects = function (attributes)
return
{
{
type = "damage",
damage = { amount = 5 * multipler, type = "explosion" }
},
{
type = "damage",
damage = { amount = 12 * multipler, type = "acid" }
}
}
end
}
)
if not FORCE_OLD_PROJECTILES then
createAttackBall(
{
name = "ne-mutated-ball-direction",
pTint = {r=0.5, g=0.7, b=0.34, a=0.5},
sTint = {r=0.5, g=0.97, b=0.34, a=0.5},
softSmokeName = softSmoke,
directionOnly = true,
type = "projectile",
pointEffects = function (attributes)
return {
{
type = "create-entity",
entity_name = "acid-splash-purple"
}
}
end,
radius = 1.5,
areaEffects = function (attributes)
return
{
{
type = "damage",
damage = { amount = 5 * multipler, type = "explosion" }
},
{
type = "damage",
damage = { amount = 12 * multipler, type = "acid" }
}
}
end
}
)
end
end