1
0
mirror of https://github.com/veden/Rampant.git synced 2025-03-11 14:49:32 +02:00

see changelog

This commit is contained in:
Aaron Veden 2018-02-11 19:21:28 -08:00
parent 1712639ee7
commit be25ea1378
32 changed files with 902 additions and 432 deletions

View File

@ -197,10 +197,10 @@ function upgrade.attempt(natives)
game.surfaces[1].print("Rampant - Version 0.16.16")
global.version = constants.VERSION_51
end
if (global.version < constants.VERSION_54) then
if (global.version < constants.VERSION_55) then
game.surfaces[1].print("Rampant - Version 0.16.19")
global.version = constants.VERSION_54
game.surfaces[1].print("Rampant - Version 0.16.20")
global.version = constants.VERSION_55
end
return starting ~= global.version, natives

View File

@ -1,3 +1,21 @@
---------------------------------------------------------------------------------------------------
Version: 0.16.20
Date: 2. 11. 2018
Features:
Improvements:
- Removed squad movement penalty before disband
- Combat robots now take damage from biter projectiles and explosions
- Spawner biters are now put into groups after they are spawned
Bugfixes:
- Removed Deadzone nests and worms from the internal memory map
- Fix for unit spawner scaling based on tier (Existing saves will have spawners overlap due to scale increase)
- Removed movement from spawner egg sacks
- Fixed local of worm spawner eggs
Tweaks:
- Increased damage spawner spitters take when shooting
Optimizations:
- Added property garbage collection for certain chunk properties
---------------------------------------------------------------------------------------------------
Version: 0.16.19
Date: 2. 09. 2018

View File

@ -18,6 +18,7 @@ local chunkUtils = require("libs/ChunkUtils")
local upgrade = require("Upgrade")
local mathUtils = require("libs/MathUtils")
local config = require("config")
local stringUtils = require("StringUtils")
-- constants
@ -26,6 +27,7 @@ local INTERVAL_PROCESS = constants.INTERVAL_PROCESS
local INTERVAL_CHUNK = constants.INTERVAL_CHUNK
local INTERVAL_SCAN = constants.INTERVAL_SCAN
local INTERVAL_SQUAD = constants.INTERVAL_SQUAD
local INTERVAL_SPAWNER = constants.INTERVAL_SPAWNER
local MOVEMENT_PHEROMONE = constants.MOVEMENT_PHEROMONE
@ -57,6 +59,7 @@ local entityForPassScan = chunkUtils.entityForPassScan
local processPendingChunks = chunkProcessor.processPendingChunks
local processScanChunks = chunkProcessor.processScanChunks
local processSpawnerChunks = chunkProcessor.processSpawnerChunks
local processMap = mapProcessor.processMap
local processPlayers = mapProcessor.processPlayers
@ -84,11 +87,16 @@ local retreatUnits = squadDefense.retreatUnits
local getChunkBase = chunkPropertyUtils.getChunkBase
local isSpawner = stringUtils.isSpawner
local addRemovePlayerEntity = chunkUtils.addRemovePlayerEntity
local unregisterEnemyBaseStructure = chunkUtils.unregisterEnemyBaseStructure
local registerEnemyBaseStructure = chunkUtils.registerEnemyBaseStructure
local makeImmortalEntity = chunkUtils.makeImmortalEntity
local getChunkSpawnerEggTick = chunkPropertyUtils.getChunkSpawnerEggTick
local setChunkSpawnerEggTick = chunkPropertyUtils.setChunkSpawnerEggTick
local upgradeEntity = baseUtils.upgradeEntity
local rebuildNativeTables = baseUtils.rebuildNativeTables
@ -163,15 +171,19 @@ local function rebuildMap()
map.scanIndex = 1
map.chunkToBase = {}
map.chunkToHives = {}
map.chunkToNests = {}
map.chunkToWorms = {}
map.chunkToRetreats = {}
map.chunkToRallys = {}
map.chunkToPlayerBase = {}
map.chunkToResource = {}
map.chunkToPassScan = {}
map.chunkToSquad = {}
map.chunkToRetreats = {}
map.chunkToRallys = {}
map.chunkToSpawner = {}
map.queueSpawners = {}
-- preallocating memory to be used in code, making it fast by reducing garbage generated.
map.neighbors = { SENTINEL_IMPASSABLE_CHUNK,
@ -328,7 +340,9 @@ local function onTick(event)
processPendingChunks(natives, map, surface, pendingChunks, tick, gameRef.forces.enemy.evolution_factor)
scanMap(map, surface, natives)
scanMap(map, surface, natives, tick)
map.queueSpawners = processSpawnerChunks(map, surface, natives, tick)
map.chunkToPassScan = processScanChunks(map, surface)
end
@ -466,7 +480,7 @@ local function onEnemyBaseBuild(event)
end
entity = upgradeEntity(entity, surface, base.alignment, natives, evolutionFactor)
end
if entity then
if entity and entity.valid then
event.entity = registerEnemyBaseStructure(map, entity, natives, evolutionFactor, surface, event.tick)
end
end
@ -515,7 +529,22 @@ local function onResourceDepleted(event)
end
local function onTriggerEntityCreated(event)
local entity = event.entity
if entity and entity.valid then
local name = event.entity.name
if isSpawner(name) then
local tick = event.tick
local chunk = getChunkByPosition(map, entity.position)
if chunk and ((tick - getChunkSpawnerEggTick(map, chunk)) > INTERVAL_SPAWNER) then
setChunkSpawnerEggTick(map, chunk, tick)
map.queueSpawners[#map.queueSpawners+1] = {
tick,
chunk,
entity.position
}
end
end
end
end
local function onUsedCapsule(event)

View File

@ -31,6 +31,13 @@ if settings.startup["rampant-useDumbProjectiles"].value then
end
end
for _, robot in pairs(data.raw["combat-robot"]) do
if not robot.collision_mask then
robot.collision_mask = {}
end
robot.collision_mask[#robot.collision_mask+1] = "layer-11"
end
--[[
try to make sure new maps use the correct map settings without having to completely load the mod.
done because seeing desync issues with dynamic map-settings changes before re-saving the map.

View File

@ -1,7 +1,7 @@
{
"name" : "Rampant",
"factorio_version" : "0.16",
"version" : "0.16.19",
"version" : "0.16.20",
"title" : "Rampant",
"author" : "Veden",
"homepage" : "https://forums.factorio.com/viewtopic.php?f=94&t=31445",

View File

@ -19,7 +19,7 @@ local MOVEMENT_PHEROMONE = constants.MOVEMENT_PHEROMONE
local AI_SQUAD_COST = constants.AI_SQUAD_COST
local AI_VENGENCE_SQUAD_COST = constants.AI_VENGENCE_SQUAD_COST
local INTERVAL_LOGIC = constants.INTERVAL_LOGIC
local INTERVAL_RALLY = constants.INTERVAL_RALLY
local TRIPLE_CHUNK_SIZE = constants.TRIPLE_CHUNK_SIZE
local CHUNK_ALL_DIRECTIONS = constants.CHUNK_ALL_DIRECTIONS
@ -96,7 +96,7 @@ local function validUnitGroupLocation(map, neighborChunk)
end
function aiAttackWave.rallyUnits(chunk, map, surface, natives, tick)
if ((tick - getRallyTick(map, chunk) > INTERVAL_LOGIC) and (natives.points >= AI_VENGENCE_SQUAD_COST)
if ((tick - getRallyTick(map, chunk) > INTERVAL_RALLY) and (natives.points >= AI_VENGENCE_SQUAD_COST)
) then
setRallyTick(map, chunk, tick)
local cX = chunk.x
@ -106,8 +106,7 @@ function aiAttackWave.rallyUnits(chunk, map, surface, natives, tick)
if (x ~= cX) and (y ~= cY) then
local rallyChunk = getChunkByXY(map, x, y)
if (rallyChunk ~= SENTINEL_IMPASSABLE_CHUNK) and (getNestCount(map, rallyChunk) > 0) then
aiAttackWave.formSquads(map, surface, natives, rallyChunk, AI_VENGENCE_SQUAD_COST)
if (natives.points < AI_VENGENCE_SQUAD_COST) then
if not aiAttackWave.formSquads(map, surface, natives, rallyChunk, AI_VENGENCE_SQUAD_COST) then
return
end
end
@ -151,6 +150,8 @@ function aiAttackWave.formSquads(map, surface, natives, chunk, cost)
end
end
end
return (natives.points - cost) > 0
end
return aiAttackWave

View File

@ -256,11 +256,11 @@ function baseUtils.upgradeEntity(entity, surface, baseAlignment, natives, evolut
if spawnerName then
local newPosition = surface.find_non_colliding_position(spawnerName, position, CHUNK_SIZE, 4)
if newPosition then
entity = surface.create_entity({name = spawnerName, position = newPosition})
return surface.create_entity({name = spawnerName, position = newPosition})
end
end
return entity
return nil
end
local function upgradeBase(base)

View File

@ -4,15 +4,24 @@ local chunkProcessor = {}
local chunkUtils = require("ChunkUtils")
local constants = require("Constants")
local squadDefense = require("SquadDefense")
local unitGroupUtils = require("UnitGroupUtils")
-- constants
local CHUNK_SIZE = constants.CHUNK_SIZE
local RETREAT_GRAB_RADIUS = constants.RETREAT_GRAB_RADIUS
local SPAWNER_EGG_TIMEOUT = constants.SPAWNER_EGG_TIMEOUT
local SENTINEL_IMPASSABLE_CHUNK = constants.SENTINEL_IMPASSABLE_CHUNK
-- imported functions
local retreatUnits = squadDefense.retreatUnits
local findNearbySquad = unitGroupUtils.findNearbySquad
local createChunk = chunkUtils.createChunk
local initialScan = chunkUtils.initialScan
local chunkPassScan = chunkUtils.chunkPassScan
@ -89,4 +98,34 @@ function chunkProcessor.processScanChunks(map, surface)
return {}
end
function chunkProcessor.processSpawnerChunks(map, surface, natives, tick)
local queue = map.queueSpawners
local result = {}
for i=1, #queue do
local o = queue[i]
if ((tick - o[1]) > SPAWNER_EGG_TIMEOUT) then
local chunk = o[2]
local position = o[3]
retreatUnits(chunk,
position,
nil,
map,
surface,
natives,
tick,
RETREAT_GRAB_RADIUS,
false,
true)
else
result[#result+1] = o
end
end
return result
end
return chunkProcessor

View File

@ -74,6 +74,14 @@ function chunkPropertyUtils.setResourceGenerator(map, chunk, resourceGenerator)
end
end
function chunkPropertyUtils.setChunkSpawnerEggTick(map, chunk, tick)
map.chunkToSpawner[chunk] = tick
end
function chunkPropertyUtils.getChunkSpawnerEggTick(map, chunk)
return map.chunkToSpawner[chunk] or 0
end
function chunkPropertyUtils.getResourceGenerator(map, chunk)
return map.chunkToResource[chunk] or 0
end

View File

@ -280,6 +280,8 @@ function chunkUtils.initialScan(chunk, natives, surface, map, tick, evolutionFac
end
if natives.newEnemies and ((#nests > 0) or (#worms > 0)) then
local nestCount = 0
local wormCount = 0
local base = findNearbyBase(map, chunk, natives)
if base then
if (base.alignment ~= BASE_ALIGNMENT_DEADZONE) then
@ -293,10 +295,14 @@ function chunkUtils.initialScan(chunk, natives, surface, map, tick, evolutionFac
for i = 1, #nests do
if rebuilding then
if not isRampant(nests[i].name) then
upgradeEntity(nests[i], surface, alignment, natives, evolutionFactor)
if upgradeEntity(nests[i], surface, alignment, natives, evolutionFactor) then
nestCount = nestCount + 1
end
end
else
upgradeEntity(nests[i], surface, alignment, natives, evolutionFactor)
if upgradeEntity(nests[i], surface, alignment, natives, evolutionFactor) then
nestCount = nestCount + 1
end
end
end
end
@ -304,19 +310,27 @@ function chunkUtils.initialScan(chunk, natives, surface, map, tick, evolutionFac
for i = 1, #worms do
if rebuilding then
if not isRampant(worms[i].name) then
upgradeEntity(worms[i], surface, alignment, natives, evolutionFactor)
if upgradeEntity(worms[i], surface, alignment, natives, evolutionFactor) then
wormCount = wormCount + 1
end
end
else
upgradeEntity(worms[i], surface, alignment, natives, evolutionFactor)
if upgradeEntity(worms[i], surface, alignment, natives, evolutionFactor) then
wormCount = wormCount + 1
end
end
end
end
setNestCount(map, chunk, nestCount)
setWormCount(map, chunk, wormCount)
else
setNestCount(map, chunk, #nests)
setWormCount(map, chunk, #worms)
end
setNestCount(map, chunk, #nests)
setPlayerBaseGenerator(map, chunk, playerObjects)
setResourceGenerator(map, chunk, resources)
setWormCount(map, chunk, #worms)
chunk[PASSABLE] = pass
chunk[PATH_RATING] = passScore

View File

@ -20,7 +20,7 @@ constants.VERSION_38 = 38
constants.VERSION_41 = 41
constants.VERSION_44 = 44
constants.VERSION_51 = 51
constants.VERSION_54 = 54
constants.VERSION_55 = 55
-- misc
@ -44,6 +44,9 @@ constants.INTERVAL_SCAN = 21
constants.INTERVAL_CHUNK = 17
constants.INTERVAL_LOGIC = 61
constants.INTERVAL_SQUAD = 41
constants.INTERVAL_SPAWNER = constants.TICKS_A_SECOND * 10
constants.INTERVAL_RALLY = constants.TICKS_A_SECOND * 10
constants.INTERVAL_RETREAT = constants.TICKS_A_SECOND * 10
constants.RESOURCE_GENERATOR_INCREMENT = 0.001
@ -368,6 +371,8 @@ local wormTiers = settings.startup["rampant-newEnemyWormTiers"].value
local unitVariations = settings.startup["rampant-newEnemyUnitVariations"].value
local unitTiers = settings.startup["rampant-newEnemyUnitTiers"].value
constants.SPAWNER_EGG_TIMEOUT = constants.TICKS_A_SECOND * 5
constants.NEUTRAL_NEST_TIERS = nestTiers
constants.NEUTRAL_NEST_VARIATIONS = nestVariations
constants.NEUTRAL_WORM_TIERS = wormTiers

View File

@ -32,6 +32,10 @@ local AI_VENGENCE_SQUAD_COST = constants.AI_VENGENCE_SQUAD_COST
local MOVEMENT_PHEROMONE = constants.MOVEMENT_PHEROMONE
local INTERVAL_RALLY = constants.INTERVAL_RALLY
local INTERVAL_RETREAT = constants.INTERVAL_RETREAT
local INTERVAL_SPAWNER = constants.INTERVAL_SPAWNER
local BASE_PROCESS_INTERVAL = constants.BASE_PROCESS_INTERVAL
-- imported functions
@ -115,8 +119,7 @@ function mapProcessor.processMap(map, surface, natives, tick, evolutionFactor)
local chunkRoll = mRandom()
if squads and (getNestCount(map, chunk) > 0) and (chunkRoll < 0.90) then
formSquads(map, surface, natives, chunk, AI_SQUAD_COST)
squads = (natives.points >= AI_SQUAD_COST)
squads = formSquads(map, surface, natives, chunk, AI_SQUAD_COST)
end
if newEnemies then
@ -185,12 +188,10 @@ function mapProcessor.processPlayers(players, map, surface, natives, tick)
if (getNestCount(map, chunk) > 0) then
if squads then
formSquads(map, surface, natives, chunk, AI_SQUAD_COST)
squads = (natives.points >= AI_SQUAD_COST)
squads = formSquads(map, surface, natives, chunk, AI_SQUAD_COST)
end
if vengence then
formSquads(map, surface, natives, chunk, AI_VENGENCE_SQUAD_COST)
vengence = (natives.points >= AI_VENGENCE_SQUAD_COST)
vengence = formSquads(map, surface, natives, chunk, AI_VENGENCE_SQUAD_COST)
end
end
@ -206,13 +207,17 @@ end
--[[
Passive scan to find entities that have been generated outside the factorio event system
--]]
function mapProcessor.scanMap(map, surface, natives)
function mapProcessor.scanMap(map, surface, natives, tick)
local index = map.scanIndex
local unitCountQuery = map.filteredEntitiesEnemyUnitQuery
local offset = unitCountQuery.area[2]
local chunkBox = unitCountQuery.area[1]
local retreats = map.chunkToRetreats
local rallys = map.chunkToRallys
local spawners = map.chunkToSpawner
local processQueue = map.processQueue
local endIndex = mMin(index + SCAN_QUEUE_SIZE, #processQueue)
@ -224,7 +229,22 @@ function mapProcessor.scanMap(map, surface, natives)
offset[1] = chunk.x + CHUNK_SIZE
offset[2] = chunk.y + CHUNK_SIZE
local retreatTick = retreats[chunk]
if retreatTick and ((tick - retreatTick) > INTERVAL_RETREAT) then
retreats[chunk] = nil
end
local rallyTick = rallys[chunk]
if rallyTick and ((tick - rallyTick) > INTERVAL_RALLY) then
rallys[chunk] = nil
end
local SpawnerTick = spawners[chunk]
if SpawnerTick and ((tick - SpawnerTick) > INTERVAL_SPAWNER) then
spawners[chunk] = nil
end
local unitCount = surface.count_entities_filtered(unitCountQuery)
if (unitCount > 300) then

View File

@ -45,13 +45,13 @@ function movementUtils.addMovementPenalty(natives, units, chunk)
local penalty = penalties[i]
if (penalty.c == chunk) then
penalty.v = penalty.v + MOVEMENT_PHEROMONE_GENERATOR_AMOUNT
if (penalty.v > MAX_PENALTY_BEFORE_PURGE) then
local group = units.group
if group then
recycleBiters(natives, group.members)
group.destroy()
end
end
-- if (penalty.v > MAX_PENALTY_BEFORE_PURGE) then
-- local group = units.group
-- if group then
-- recycleBiters(natives, group.members)
-- group.destroy()
-- end
-- end
return
end
end

View File

@ -17,7 +17,7 @@ local BASE_PHEROMONE = constants.BASE_PHEROMONE
local SQUAD_RETREATING = constants.SQUAD_RETREATING
local INTERVAL_LOGIC = constants.INTERVAL_LOGIC
local INTERVAL_RETREAT = constants.INTERVAL_RETREAT
local SENTINEL_IMPASSABLE_CHUNK = constants.SENTINEL_IMPASSABLE_CHUNK
@ -49,8 +49,8 @@ local function scoreRetreatLocation(map, neighborChunk)
return -(neighborChunk[BASE_PHEROMONE] + -neighborChunk[MOVEMENT_PHEROMONE] + (neighborChunk[PLAYER_PHEROMONE] * 100) + (getPlayerBaseGenerator(map, neighborChunk) * 20))
end
function aiDefense.retreatUnits(chunk, position, squad, map, surface, natives, tick, radius, force)
if (tick - getRetreatTick(map, chunk) > INTERVAL_LOGIC) and ((getEnemyStructureCount(map, chunk) == 0) or force) then
function aiDefense.retreatUnits(chunk, position, squad, map, surface, natives, tick, radius, artilleryBlast, force)
if (tick - getRetreatTick(map, chunk) > INTERVAL_RETREAT) and ((getEnemyStructureCount(map, chunk) == 0) or artilleryBlast or force) then
local performRetreat = false
local enemiesToSquad = nil
@ -58,7 +58,7 @@ function aiDefense.retreatUnits(chunk, position, squad, map, surface, natives, t
enemiesToSquad = surface.find_enemy_units(position, radius)
performRetreat = #enemiesToSquad > 0
if (mRandom() < calculateKamikazeThreshold(#enemiesToSquad, natives)) then
setRetreatTick(map, chunk, tick + (INTERVAL_LOGIC * 10))
setRetreatTick(map, chunk, tick)
performRetreat = false
end
elseif squad.group and squad.group.valid and (squad.status ~= SQUAD_RETREATING) and not squad.kamikaze then
@ -95,7 +95,7 @@ function aiDefense.retreatUnits(chunk, position, squad, map, surface, natives, t
local cmd = map.retreatCommand
cmd.group = newSquad.group
if enemiesToSquad then
membersToSquad(cmd, enemiesToSquad, force)
membersToSquad(cmd, enemiesToSquad, artilleryBlast)
else
membersToSquad(cmd, squad.group.members, true)
newSquad.penalties = squad.penalties

View File

@ -4,6 +4,10 @@ function stringUtils.isRampant(str)
return stringUtils.ends(str, "rampant")
end
function stringUtils.isSpawner(str)
return stringUtils.starts(str, "spawner")
end
function stringUtils.starts(str, start)
return (string.sub(str,1,string.len(start)) == start)
end

File diff suppressed because it is too large Load Diff

View File

@ -76,15 +76,15 @@ buildUnitSpawner(
resistances = {},
scales = {
[1] = 0.5,
[2] = 0.5,
[3] = 0.5,
[4] = 0.5,
[5] = 0.5,
[6] = 0.5,
[7] = 0.5,
[8] = 0.5,
[9] = 0.5,
[10] = 0.5
[2] = 0.6,
[3] = 0.7,
[4] = 0.8,
[5] = 0.9,
[6] = 1.0,
[7] = 1.1,
[8] = 1.2,
[9] = 1.3,
[10] = 1.4
},
tint = {r=0, g=0.85, b=0.13, a=0.65}
}
@ -611,15 +611,15 @@ buildUnitSpawner(
scales = {
[1] = 0.5,
[2] = 0.5,
[3] = 0.5,
[4] = 0.5,
[5] = 0.5,
[6] = 0.5,
[7] = 0.5,
[8] = 0.5,
[9] = 0.5,
[10] = 0.5
[2] = 0.6,
[3] = 0.7,
[4] = 0.8,
[5] = 0.9,
[6] = 1.0,
[7] = 1.1,
[8] = 1.2,
[9] = 1.3,
[10] = 1.4
},
tint = {r=0, g=0.85, b=0.13, a=1}
}

View File

@ -86,15 +86,15 @@ buildUnitSpawner(
resistances = {},
scales = {
[1] = 0.5,
[2] = 0.5,
[3] = 0.5,
[4] = 0.5,
[5] = 0.5,
[6] = 0.5,
[7] = 0.5,
[8] = 0.5,
[9] = 0.5,
[10] = 0.5
[2] = 0.6,
[3] = 0.7,
[4] = 0.8,
[5] = 0.9,
[6] = 1.0,
[7] = 1.1,
[8] = 1.2,
[9] = 1.3,
[10] = 1.4
},
tint = {r=0, g=0.25, b=0.83, a=0.65}
}

View File

@ -75,15 +75,15 @@ buildUnitSpawner(
resistances = {},
scales = {
[1] = 0.5,
[2] = 0.5,
[3] = 0.5,
[4] = 0.5,
[5] = 0.5,
[6] = 0.5,
[7] = 0.5,
[8] = 0.5,
[9] = 0.5,
[10] = 0.5
[2] = 0.6,
[3] = 0.7,
[4] = 0.8,
[5] = 0.9,
[6] = 1.0,
[7] = 1.1,
[8] = 1.2,
[9] = 1.3,
[10] = 1.4
},
tint = {r=0.26, g=0.76, b=0.72, a=0.65}
}
@ -576,15 +576,15 @@ buildUnitSpawner(
scales = {
[1] = 0.5,
[2] = 0.5,
[3] = 0.5,
[4] = 0.5,
[5] = 0.5,
[6] = 0.5,
[7] = 0.5,
[8] = 0.5,
[9] = 0.5,
[10] = 0.5
[2] = 0.6,
[3] = 0.7,
[4] = 0.8,
[5] = 0.9,
[6] = 1.0,
[7] = 1.1,
[8] = 1.2,
[9] = 1.3,
[10] = 1.4
},
tint = {r=0.26, g=0.76, b=0.72, a=1}
}

View File

@ -104,15 +104,15 @@ buildUnitSpawner(
scales = {
[1] = 0.5,
[2] = 0.5,
[3] = 0.5,
[4] = 0.5,
[5] = 0.5,
[6] = 0.5,
[7] = 0.5,
[8] = 0.5,
[9] = 0.5,
[10] = 0.5
[2] = 0.6,
[3] = 0.7,
[4] = 0.8,
[5] = 0.9,
[6] = 1.0,
[7] = 1.1,
[8] = 1.2,
[9] = 1.3,
[10] = 1.4
},
tint = {r=0.99, g=0.09, b=0.09, a=1}
}

View File

@ -85,15 +85,15 @@ buildUnitSpawner(
resistances = {},
scales = {
[1] = 0.5,
[2] = 0.5,
[3] = 0.5,
[4] = 0.5,
[5] = 0.5,
[6] = 0.5,
[7] = 0.5,
[8] = 0.5,
[9] = 0.5,
[10] = 0.5
[2] = 0.6,
[3] = 0.7,
[4] = 0.8,
[5] = 0.9,
[6] = 1.0,
[7] = 1.1,
[8] = 1.2,
[9] = 1.3,
[10] = 1.4
},
tint = {r=0, g=0, b=0.42, a=0.65}
}
@ -651,15 +651,15 @@ buildUnitSpawner(
scales = {
[1] = 0.5,
[2] = 0.5,
[3] = 0.5,
[4] = 0.5,
[5] = 0.5,
[6] = 0.5,
[7] = 0.5,
[8] = 0.5,
[9] = 0.5,
[10] = 0.5
[2] = 0.6,
[3] = 0.7,
[4] = 0.8,
[5] = 0.9,
[6] = 1.0,
[7] = 1.1,
[8] = 1.2,
[9] = 1.3,
[10] = 1.4
},
tint = {r=0, g=0, b=0.42, a=0.65}
}

View File

@ -75,15 +75,15 @@ buildUnitSpawner(
resistances = {},
scales = {
[1] = 0.5,
[2] = 0.5,
[3] = 0.5,
[4] = 0.5,
[5] = 0.5,
[6] = 0.5,
[7] = 0.5,
[8] = 0.5,
[9] = 0.5,
[10] = 0.5
[2] = 0.6,
[3] = 0.7,
[4] = 0.8,
[5] = 0.9,
[6] = 1.0,
[7] = 1.1,
[8] = 1.2,
[9] = 1.3,
[10] = 1.4
},
tint = {r=0.56, g=0.46, b=0.42, a=0.65}
}
@ -554,15 +554,15 @@ buildUnitSpawner(
scales = {
[1] = 0.5,
[2] = 0.5,
[3] = 0.5,
[4] = 0.5,
[5] = 0.5,
[6] = 0.5,
[7] = 0.5,
[8] = 0.5,
[9] = 0.5,
[10] = 0.5
[2] = 0.6,
[3] = 0.7,
[4] = 0.8,
[5] = 0.9,
[6] = 1.0,
[7] = 1.1,
[8] = 1.2,
[9] = 1.3,
[10] = 1.4
},
tint = {r=0.99, g=0.09, b=0.09, a=1}
}

View File

@ -78,15 +78,15 @@ buildUnitSpawner(
resistances = {},
scales = {
[1] = 0.5,
[2] = 0.5,
[3] = 0.5,
[4] = 0.5,
[5] = 0.5,
[6] = 0.5,
[7] = 0.5,
[8] = 0.5,
[9] = 0.5,
[10] = 0.5
[2] = 0.6,
[3] = 0.7,
[4] = 0.8,
[5] = 0.9,
[6] = 1.0,
[7] = 1.1,
[8] = 1.2,
[9] = 1.3,
[10] = 1.4
},
tint = {r=0.76, g=0.76, b=0, a=0.65}
}

View File

@ -76,16 +76,16 @@ buildUnitSpawner(
attributes = {},
resistances = {},
scales = {
[1] = 0.5,
[2] = 0.5,
[3] = 0.5,
[4] = 0.5,
[5] = 0.5,
[6] = 0.5,
[7] = 0.5,
[8] = 0.5,
[9] = 0.5,
[10] = 0.5
[1] = 0.7,
[2] = 0.8,
[3] = 0.9,
[4] = 1.0,
[5] = 1.1,
[6] = 1.2,
[7] = 1.3,
[8] = 1.4,
[9] = 1.5,
[10] = 1.6
},
tint = {r=0.1, g=0.1, b=0.1, a=1}
}

View File

@ -245,16 +245,16 @@ buildUnits(
{
type = "attribute",
name = "movement",
[1] = 0.01,
[2] = 0.01,
[3] = 0.02,
[4] = 0.02,
[5] = 0.03,
[6] = 0.03,
[7] = 0.04,
[8] = 0.04,
[9] = 0.05,
[10] = 0.05
[1] = 0.00,
[2] = 0.00,
[3] = 0.00,
[4] = 0.00,
[5] = 0.00,
[6] = 0.00,
[7] = 0.00,
[8] = 0.00,
[9] = 0.00,
[10] = 0.00
},
{
type = "attribute",
@ -568,16 +568,16 @@ buildUnits(
{
type = "attribute",
name = "movement",
[1] = 0.01,
[2] = 0.01,
[3] = 0.02,
[4] = 0.02,
[5] = 0.03,
[6] = 0.03,
[7] = 0.04,
[8] = 0.04,
[9] = 0.05,
[10] = 0.05
[1] = 0.0,
[2] = 0.0,
[3] = 0.0,
[4] = 0.0,
[5] = 0.0,
[6] = 0.0,
[7] = 0.0,
[8] = 0.0,
[9] = 0.0,
[10] = 0.0
},
{
type = "attribute",
@ -930,6 +930,7 @@ buildUnitSpawner(
attack = {
type = "projectile",
softSmokeName = softSmoke,
triggerCreated = true,
directionOnly = true,
sourceEffect = function (attributes)
return
@ -957,7 +958,7 @@ buildUnitSpawner(
[9] = 1.3,
[10] = 1.4
},
attackName = "spawner-worm-drone",
attackName = "spawner-drone",
tint = {r=1, g=0, b=1, a=1},
pTint = {r=1, g=0, b=1, a=1},
sTint = {r=1, g=0, b=1, a=1}
@ -972,15 +973,15 @@ buildUnitSpawner(
scales = {
[1] = 0.5,
[2] = 0.5,
[3] = 0.5,
[4] = 0.5,
[5] = 0.5,
[6] = 0.5,
[7] = 0.5,
[8] = 0.5,
[9] = 0.5,
[10] = 0.5
[2] = 0.6,
[3] = 0.7,
[4] = 0.8,
[5] = 0.9,
[6] = 1.0,
[7] = 1.1,
[8] = 1.2,
[9] = 1.3,
[10] = 1.4
},
tint = {r=1, g=0, b=1, a=1}
}
@ -1411,11 +1412,9 @@ buildUnitSpawner(
function (attack, attributes)
local divider
if attributes.health < 100 then
divider = 3
elseif attributes.health < 1000 then
divider = 5
divider = 2
else
divider = 7
divider = 2.5
end
attack.healthDamage = attributes.health / divider
return createProjectileAttack(attack,
@ -1446,6 +1445,7 @@ buildWorm(
},
attack = {
type = "projectile",
triggerCreated = true,
softSmokeName = softSmoke
},
resistances = {},
@ -1462,7 +1462,7 @@ buildWorm(
[9] = 1.3,
[10] = 1.4
},
attackName = "spawner-drone",
attackName = "spawner-worm-drone",
tint = {r=1, g=0, b=1, a=1},
pTint = {r=1, g=0, b=1, a=1},
sTint = {r=1, g=0, b=1, a=1}

View File

@ -80,15 +80,15 @@ buildUnitSpawner(
resistances = {},
scales = {
[1] = 0.5,
[2] = 0.5,
[3] = 0.5,
[4] = 0.5,
[5] = 0.5,
[6] = 0.5,
[7] = 0.5,
[8] = 0.5,
[9] = 0.5,
[10] = 0.5
[2] = 0.6,
[3] = 0.7,
[4] = 0.8,
[5] = 0.9,
[6] = 1.0,
[7] = 1.1,
[8] = 1.2,
[9] = 1.3,
[10] = 1.4
},
tint = {r=0.56, g=0.46, b=0, a=0.65}
}

View File

@ -74,15 +74,15 @@ buildUnitSpawner(
resistances = {},
scales = {
[1] = 0.5,
[2] = 0.5,
[3] = 0.5,
[4] = 0.5,
[5] = 0.5,
[6] = 0.5,
[7] = 0.5,
[8] = 0.5,
[9] = 0.5,
[10] = 0.5
[2] = 0.6,
[3] = 0.7,
[4] = 0.8,
[5] = 0.9,
[6] = 1.0,
[7] = 1.1,
[8] = 1.2,
[9] = 1.3,
[10] = 1.4
},
tint = {r=1.0, g=1.0, b=1.0, a=1.0}
}
@ -582,15 +582,15 @@ buildUnitSpawner(
scales = {
[1] = 0.5,
[2] = 0.5,
[3] = 0.5,
[4] = 0.5,
[5] = 0.5,
[6] = 0.5,
[7] = 0.5,
[8] = 0.5,
[9] = 0.5,
[10] = 0.5
[2] = 0.6,
[3] = 0.7,
[4] = 0.8,
[5] = 0.9,
[6] = 1.0,
[7] = 1.1,
[8] = 1.2,
[9] = 1.3,
[10] = 1.4
},
tint = {r=0.99, g=0.09, b=0.09, a=1}
}

View File

@ -167,6 +167,7 @@ local function generateLocal()
for v = 1, 20 do
print("spawner-drone-v" .. v .. "-t" .. t .. "-drone-rampant=" .. name .. " eggs: " .. size .. " class")
print("spawner-spitter-v" .. v .. "-t" .. t .. "-rampant=" .. name .. " spitter: " .. size .. " class")
print("spawner-worm-drone-v" .. v .. "-t" .. t .. "-drone-rampant=" .. name .. " eggs: " .. size .. " class")
print("spawner-biter-v" .. v .. "-t" .. t .. "-rampant=" .. name .. " biter: " .. size .. " class")
print("spawner-spitter-nest-v" .. v .. "-t" .. t .. "-rampant=" .. name .. " spitter nest: " .. size .. " class")
print("spawner-worm-v" .. v .. "-t" .. t .. "-rampant=" .. name .. " worm: " .. size .. " class")

View File

@ -629,15 +629,15 @@ buildUnitSpawner(
scales = {
[1] = 0.5,
[2] = 0.5,
[3] = 0.5,
[4] = 0.5,
[5] = 0.5,
[6] = 0.5,
[7] = 0.5,
[8] = 0.5,
[9] = 0.5,
[10] = 0.5
[2] = 0.6,
[3] = 0.7,
[4] = 0.8,
[5] = 0.9,
[6] = 1.0,
[7] = 1.1,
[8] = 1.2,
[9] = 1.3,
[10] = 1.4
},
tint = {r=1, g=1, b=0, a=1}
}

View File

@ -1,5 +1,6 @@
-- import
local stickerUtils = require("StickerUtils")
local streamUtils = require("StreamUtils")
local projectileUtils = require("ProjectileUtils")
@ -16,6 +17,11 @@ local makeProjectile = projectileUtils.makeProjectile
-- dumb acid projectiles
local AttackBall = {}
stickerUtils.makeSticker({
name = "the-sticker"
})
function AttackBall.createAttackBall(attributes)
if (attributes.type == "stream") or FORCE_OLD_PROJECTILES then
@ -53,8 +59,14 @@ function AttackBall.createAttackBall(attributes)
type = "instant",
target_effects = (attributes.pointEffects and attributes.pointEffects(attributes)) or
{
{
type= "create-entity",
entity_name = attributes.crater or "acid-splash-purple"
},
{
type = "damage",
damage = templateDamage
}
}
}
}

View File

@ -1,7 +1,16 @@
local biterFunctions = {}
local unitSpawnerUtils = require("UnitSpawnerUtils")
local FORCE_OLD_PROJECTILES = settings.startup["rampant-forceOldProjectiles"].value
local spawner_idle_animation = unitSpawnerUtils.spawner_idle_animation
local spawner_die_animation = unitSpawnerUtils.spawner_die_animation
function biterFunctions.makeSpitterCorpse(attributes)
local name = attributes.name .. "-corpse-rampant"
data:extend(
@ -66,10 +75,10 @@ function biterFunctions.makeUnitSpawnerCorpse(attributes)
final_render_layer = "remnants",
animation =
{
spawner_die_animation(0, attributes.tint),
spawner_die_animation(1, attributes.tint),
spawner_die_animation(2, attributes.tint),
spawner_die_animation(3, attributes.tint)
spawner_die_animation(0, attributes.tint, attributes.scale),
spawner_die_animation(1, attributes.tint, attributes.scale),
spawner_die_animation(2, attributes.tint, attributes.scale),
spawner_die_animation(3, attributes.tint, attributes.scale)
}
}
})
@ -219,7 +228,7 @@ function biterFunctions.makeUnitSpawner(name, biterAttributes, biterResistances,
},
healing_per_tick = biterAttributes.healing or 0.02,
collision_box = {{-3.2 * biterAttributes.scale, -2.2 * biterAttributes.scale}, {2.2 * biterAttributes.scale, 2.2 * biterAttributes.scale}},
selection_box = {{-3.5 * biterAttributes.scale, -2.5 * biterAttributes.scale}, {2.5 * biterAttributes.scale, 2.5 * biterAttributes.scale}},
selection_box = {{-3.6 * biterAttributes.scale, -2.6 * biterAttributes.scale}, {2.6 * biterAttributes.scale, 2.6 * biterAttributes.scale}},
-- in ticks per 1 pu
pollution_absorbtion_absolute = biterAttributes.pollutionAbsorbtionAbs or 20,
pollution_absorbtion_proportional = biterAttributes.pollutionAbsorbtionPro or 0.01,
@ -229,10 +238,10 @@ function biterFunctions.makeUnitSpawner(name, biterAttributes, biterResistances,
max_friends_around_to_spawn = biterAttributes.unitsToSpawn or 5,
animations =
{
spawner_idle_animation(0, biterAttributes.tint),
spawner_idle_animation(1, biterAttributes.tint),
spawner_idle_animation(2, biterAttributes.tint),
spawner_idle_animation(3, biterAttributes.tint)
spawner_idle_animation(0, biterAttributes.tint, biterAttributes.scale),
spawner_idle_animation(1, biterAttributes.tint, biterAttributes.scale),
spawner_idle_animation(2, biterAttributes.tint, biterAttributes.scale),
spawner_idle_animation(3, biterAttributes.tint, biterAttributes.scale)
},
result_units = unitSet,
-- With zero evolution the spawn rate is 6 seconds, with max evolution it is 2.5 seconds

View File

@ -0,0 +1,103 @@
local unitSpawnerUtils = {}
function unitSpawnerUtils.spawner_idle_animation(variation, tint, scale)
return
{
layers =
{
{
filename = "__base__/graphics/entity/spawner/spawner-idle.png",
line_length = 8,
width = 243,
height = 181,
frame_count = 8,
animation_speed = 0.18,
direction_count = 1,
scale = scale,
run_mode = "forward-then-backward",
shift = {0.140625 - 0.65, -0.234375},
y = variation * 181
},
{
filename = "__base__/graphics/entity/spawner/spawner-idle-mask.png",
flags = { "mask" },
width = 166,
height = 148,
frame_count = 8,
scale = scale,
animation_speed = 0.18,
run_mode = "forward-then-backward",
shift = {-0.34375 - 0.65, -0.375},
line_length = 8,
tint = tint,
y = variation * 148
}
}
}
end
function unitSpawnerUtils.spawner_die_animation(variation, tint, scale)
return
{
layers =
{
{
width = 255,
height = 184,
frame_count = 20,
direction_count = 1,
scale = scale,
shift = {-0.015625 - 0.65, -0.28125},
stripes =
{
{
filename = "__base__/graphics/entity/spawner/spawner-die-01.png",
width_in_frames = 7,
height_in_frames = 4,
y = variation * 184
},
{
filename = "__base__/graphics/entity/spawner/spawner-die-02.png",
width_in_frames = 7,
height_in_frames = 4,
y = variation * 184
},
{
filename = "__base__/graphics/entity/spawner/spawner-die-03.png",
width_in_frames = 6,
height_in_frames = 4,
y = variation * 184
}
}
},
{
flags = { "mask" },
width = 166,
height = 148,
frame_count = 20,
direction_count = 1,
scale = scale,
shift = {-0.34375 - 0.65, -0.375},
tint = tint,
stripes =
{
{
filename = "__base__/graphics/entity/spawner/spawner-die-mask-01.png",
width_in_frames = 10,
height_in_frames = 4,
y = variation * 148
},
{
filename = "__base__/graphics/entity/spawner/spawner-die-mask-02.png",
width_in_frames = 10,
height_in_frames = 4,
y = variation * 148
}
}
}
}
}
end
return unitSpawnerUtils