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:
parent
32672f6b83
commit
90e5ff1a8d
@ -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
|
||||
|
@ -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,
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user