1
0
mirror of https://github.com/veden/Rampant.git synced 2024-12-26 20:54:12 +02:00

FACTO-266: Base center is now the average of all chunks associated

with base
This commit is contained in:
Aaron Veden 2023-03-12 20:48:44 -07:00
parent 32672f6b83
commit 90e5ff1a8d
No known key found for this signature in database
GPG Key ID: FF5990B1C6DD3F84
3 changed files with 11 additions and 0 deletions

View File

@ -35,6 +35,7 @@ Version: 3.2.0
- Recording the resource chunks covered by a given base as a property of a base
- Use the enemy seed value instead of the map seed for puesdo random generating used by AI
- Vengence settlers now cost ~3x of vengence squad
- Enemy regional bases now are centered on the average of all chunks that are part of the base
Bugfixes:
- Removed layer-13 from projectiles
- script_raised_built now looks for enemy faction and registers as needed

View File

@ -578,6 +578,8 @@ function BaseUtils.createBase(map, chunk, tick)
local base = {
x = x,
y = y,
totalX = x,
totalY = y,
distanceThreshold = distanceThreshold * Universe.baseDistanceModifier,
tick = tick,
alignment = alignment,

View File

@ -234,6 +234,10 @@ function ChunkPropertyUtils.removeChunkBase(chunk, base)
end
base.chunkCount = base.chunkCount - 1
base.totalX = base.totalX - chunk.x
base.totalY = base.totalY - chunk.y
base.x = base.totalX / base.chunkCount
base.y = base.totalY / base.chunkCount
chunk.base = nil
end
@ -243,6 +247,10 @@ function ChunkPropertyUtils.setChunkBase(chunk, base)
end
base.chunkCount = base.chunkCount + 1
base.totalX = base.totalX + chunk.x
base.totalY = base.totalY + chunk.y
base.x = base.totalX / base.chunkCount
base.y = base.totalY / base.chunkCount
chunk.base = base
end