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

FACTO-20: Added expanded collision box on enemy structure placement

This commit is contained in:
Aaron Veden 2022-01-14 12:01:57 -08:00
parent a8e57be54c
commit 176ea6c6ec
No known key found for this signature in database
GPG Key ID: FF5990B1C6DD3F84
4 changed files with 18 additions and 3 deletions

View File

@ -5,6 +5,7 @@ Date: 29. 12. 2021
- Added integration with schallAlienLoot (Thank you garrotte for the code snippet)
Tweaks:
- Set maximum value on enemy seed to 4294967295
- Slightly increased spacing between enemy structures
Bugfixes:
- Fixed chunkPack nil in processNests (Thanks Skallywaggz for the report)
- Fixed random generator seed overflow (Thanks NeveHanter for the report)

View File

@ -610,7 +610,7 @@ function baseUtils.rebuildNativeTables(universe, rg)
for v=1,universe.ENEMY_VARIATIONS do
local entry = faction.type .. "-" .. building.name .. "-v" .. v .. "-t" .. t .. "-rampant"
enemyAlignmentLookup[entry] = faction.type
local proxyEntity = "entity-proxy-" .. building.type .. "-t" .. t .. "-rampant"
local proxyEntity = "entity-proxy-" .. building.type .. "-t" .. (t+2) .. "-rampant"
buildingSpaceLookup[entry] = proxyEntity
costLookup[entry] = HIVE_BUILDINGS_COST[building.type]
buildingHiveTypeLookup[entry] = building.type

View File

@ -163,7 +163,20 @@ function chunkProcessor.processPendingUpgrades(universe, tick)
local query = universe.ppuUpgradeEntityQuery
local position = entityData.position or entity.position
query.name = entityData.name
local foundPosition = surface.find_non_colliding_position(entityData.name, position, CHUNK_SIZE, 1, true)
local foundPosition
if universe.NEW_ENEMIES then
foundPosition = surface.find_non_colliding_position(universe.buildingSpaceLookup[entityData.name],
position,
CHUNK_SIZE,
1,
true)
else
foundPosition = surface.find_non_colliding_position(entityData.name,
position,
CHUNK_SIZE,
1,
true)
end
setPositionInQuery(query, foundPosition or position)
unregisterEnemyBaseStructure(entityData.map, entity, nil, true)
entity.destroy()

View File

@ -45,7 +45,8 @@ local scales = {
[8] = 1.8,
[9] = 2.0,
[10] = 2.1,
[11] = 2.2
[11] = 2.2,
[12] = 2.3
}
local subTypes = constants.HIVE_BUILDINGS_TYPES