1
0
mirror of https://github.com/veden/Rampant.git synced 2025-03-17 20:58:35 +02:00

active nests are now processed across all surfaces

This commit is contained in:
Aaron Veden 2021-12-05 20:56:08 -08:00
parent b81c96c043
commit 2f87808593
No known key found for this signature in database
GPG Key ID: FF5990B1C6DD3F84
4 changed files with 26 additions and 11 deletions

View File

@ -426,6 +426,7 @@ function upgrade.attempt(universe)
universe.maps = {}
universe.groupNumberToSquad = {}
universe.pendingUpgrades = {}
universe.processActiveNest = {}
universe.deployVengenceIterator = nil
universe.pendingUpgradeIterator = nil
universe.squadIterator = nil
@ -526,7 +527,6 @@ function upgrade.prepMap(universe, surface)
map.chunkScanCounts = {}
map.chunkRemovals = {}
map.processActiveNest = {}
map.tickActiveNest = {}
map.emptySquadsOnChunk = {}

View File

@ -17,7 +17,8 @@ Date: 23. 11. 2021
- Map processing around player now changes to the surface the player is standing on
- Squads now get processed regardless of the current active surface being processed
- Added max number of move commands that touch the same chunk to squads before disbanding or settling based on if migration is enabled
- Enemy structure upgrades now are processed regardless of active surface
- Enemy structure upgrades now are processed regardless of current active surface
- Spawners covered by pollution are now processed regardless of current active surface
Tweaks:
- Increase chance to upgrade an enemy structure from 5% to 30%
- New enemy regional bases that have two factions now do 75% on one faction and 25% on the faction for building and upgrading enemy structures

View File

@ -1006,7 +1006,7 @@ script.on_event(defines.events.on_tick,
processScanChunks(map)
end
processActiveNests(map, tick)
processActiveNests(universe, tick)
processPendingUpgrades(universe, tick)
processPendingUpgrades(universe, tick)
cleanSquads(universe, tick)

View File

@ -182,7 +182,7 @@ local function queueNestSpawners(map, chunk, tick)
local limitPerActiveChunkTick =
(map.activeNests + map.activeRaidNests) * DURATION_ACTIVE_NEST_DIVIDER
local processActiveNest = map.processActiveNest
local processActiveNest = map.universe.processActiveNest
if ((getNestActiveness(map, chunk) > 0) or (getRaidNestActiveness(map, chunk) > 0)) and
(getNestActiveTick(map, chunk) == 0)
@ -192,7 +192,10 @@ local function queueNestSpawners(map, chunk, tick)
if not slot then
slot = {}
processActiveNest[nextTick] = slot
slot[#slot+1] = chunk
slot[#slot+1] = {
chunk = chunk,
map = map
}
else
if (#slot > limitPerActiveChunkTick) then
while (#slot > limitPerActiveChunkTick) do
@ -201,15 +204,24 @@ local function queueNestSpawners(map, chunk, tick)
if not slot then
slot = {}
processActiveNest[nextTick] = slot
slot[#slot+1] = chunk
slot[#slot+1] = {
chunk = chunk,
map = map
}
break
elseif (#slot < limitPerActiveChunkTick) then
slot[#slot+1] = chunk
slot[#slot+1] = {
chunk = chunk,
map = map
}
break
end
end
else
slot[#slot+1] = chunk
slot[#slot+1] = {
chunk = chunk,
map = map
}
end
end
setNestActiveTick(map, chunk, tick)
@ -438,12 +450,14 @@ function mapProcessor.scanResourceMap(map, tick)
end
end
function mapProcessor.processActiveNests(map, tick)
local processActiveNest = map.processActiveNest
function mapProcessor.processActiveNests(universe, tick)
local processActiveNest = universe.processActiveNest
local slot = processActiveNest[tick]
if slot then
for i=1,#slot do
local chunk = slot[i]
local chunkPack = slot[i]
local chunk = chunkPack.chunk
local map = chunkPack.map
if (getNestActiveness(map, chunk) > 0) or (getRaidNestActiveness(map, chunk) > 0) then
processNestActiveness(map, chunk)
local nextTick = tick + DURATION_ACTIVE_NEST