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

View File

@ -1,22 +1,40 @@
local vanillaBuildings = require("prototypes/buildings/UpdatesVanilla") 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 if settings.startup["rampant-newEnemies"].value then
require("prototypes/Neutral")
require("prototypes/Acid") neutral.addFaction()
require("prototypes/Physical") acid.addFaction()
require("prototypes/Suicide") physical.addFaction()
require("prototypes/Fire") suicide.addFaction()
require("prototypes/Electric") fire.addFaction()
require("prototypes/Nuclear") electric.addFaction()
require("prototypes/Inferno") nuclear.addFaction()
require("prototypes/Fast") inferno.addFaction()
require("prototypes/Troll") fast.addFaction()
troll.addFaction()
-- require("prototypes/Decaying") -- require("prototypes/Decaying")
-- require("prototypes/Poison") -- require("prototypes/Poison")
-- require("prototypes/Undying") -- require("prototypes/Undying")
require("prototypes/Spawner") spawner.addFaction()
require("prototypes/Wasp") wasp.addFaction()
require("prototypes/Laser") laser.addFaction()
for _, unitSpawner in pairs(data.raw["unit-spawner"]) do for _, unitSpawner in pairs(data.raw["unit-spawner"]) do
if (unitSpawner.name ~= "biter-spawner") then 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 NEUpdates = require("prototypes/utils/UpdatesNE")
local constants = require("libs/Constants") local constants = require("libs/Constants")
local attackBobs = require("prototypes/utils/AttackBobs")
local attackNE = require("prototypes/utils/AttackNE")
if settings.startup["rampant-removeBloodParticles"].value then if settings.startup["rampant-removeBloodParticles"].value then
local explosions = data.raw["explosion"] local explosions = data.raw["explosion"]
@ -16,14 +19,13 @@ if settings.startup["rampant-useDumbProjectiles"].value then
local option = settings.startup["bobmods-enemies-enableartifacts"] local option = settings.startup["bobmods-enemies-enableartifacts"]
if option then if option then
attackBobs.addAttacks()
require("prototypes/utils/AttackBobs")
bobsUpdates.useDumbProjectiles() bobsUpdates.useDumbProjectiles()
end end
option = settings.startup["NE_Difficulty"] option = settings.startup["NE_Difficulty"]
if option then if option then
require("prototypes/utils/AttackNE") attackNE.addAttacks()
NEUpdates.useDumbProjectiles() NEUpdates.useDumbProjectiles()
if settings.startup["rampant-useNEUnitLaunchers"].value then if settings.startup["rampant-useNEUnitLaunchers"].value then
NEUpdates.useNEUnitLaunchers() NEUpdates.useNEUnitLaunchers()

View File

@ -369,6 +369,8 @@ end
function chunkUtils.analyzeChunk(chunk, natives, surface, map) function chunkUtils.analyzeChunk(chunk, natives, surface, map)
local playerObjects = chunkUtils.scorePlayerBuildings(surface, map, natives) local playerObjects = chunkUtils.scorePlayerBuildings(surface, map, natives)
setPlayerBaseGenerator(map, chunk, playerObjects) setPlayerBaseGenerator(map, chunk, playerObjects)
local resources = surface.count_entities_filtered(map.countResourcesQuery) * RESOURCE_NORMALIZER
setResourceGenerator(map, chunk, resources)
end end
function chunkUtils.createChunk(topX, topY) 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 -- constants
local wasp = {}
local WASP_UNIT_TIERS = constants.WASP_UNIT_TIERS local WASP_UNIT_TIERS = constants.WASP_UNIT_TIERS
local WASP_UNIT_VARIATIONS = constants.WASP_UNIT_VARIATIONS local WASP_UNIT_VARIATIONS = constants.WASP_UNIT_VARIATIONS
@ -36,6 +38,8 @@ local makeUnitAlienLootTable = biterUtils.makeUnitAlienLootTable
local makeSpawnerAlienLootTable = biterUtils.makeSpawnerAlienLootTable local makeSpawnerAlienLootTable = biterUtils.makeSpawnerAlienLootTable
local makeWormAlienLootTable = biterUtils.makeWormAlienLootTable local makeWormAlienLootTable = biterUtils.makeWormAlienLootTable
function wasp.addFaction()
local biterLoot = makeUnitAlienLootTable("purple") local biterLoot = makeUnitAlienLootTable("purple")
local spawnerLoot = makeSpawnerAlienLootTable("purple") local spawnerLoot = makeSpawnerAlienLootTable("purple")
local wormLoot = makeWormAlienLootTable("purple") local wormLoot = makeWormAlienLootTable("purple")
@ -1399,3 +1403,6 @@ buildWorm(
WASP_WORM_VARIATIONS, WASP_WORM_VARIATIONS,
WASP_WORM_TIERS WASP_WORM_TIERS
) )
end
return wasp

File diff suppressed because it is too large Load Diff

View File

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