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

added vengence becoming settlers at 7.5% chance

This commit is contained in:
Aaron Veden 2021-12-12 10:19:59 -08:00
parent 704b42e910
commit a9ead2e293
No known key found for this signature in database
GPG Key ID: FF5990B1C6DD3F84
3 changed files with 56 additions and 1 deletions

View File

@ -35,6 +35,7 @@ Date: 23. 11. 2021
- Siege AI state now sends roughly 1 raid group every 2 settler groups if raiding is enabled
- Siege groups now try to settle just outside player structures as opposed to attacking
- Added Raid AI state to lower temperament scores @ 20% at 0 temperament and 15% at (0.2, 0.4)
- Vengence squads now have a 7.5% chance to be a settler group if migration is enabled
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

@ -315,6 +315,55 @@ function aiAttackWave.formVengenceSquad(map, chunk)
end
end
function aiAttackWave.formVengenceSettler(map, chunk)
local universe = map.universe
if (universe.builderCount < universe.AI_MAX_BUILDER_COUNT) and
(map.random() < universe.formSquadThreshold) and
((map.points - AI_VENGENCE_SQUAD_COST) > 0)
then
local surface = map.surface
local squadPath, squadDirection = scoreNeighborsForFormation(getNeighborChunks(map, chunk.x, chunk.y),
validUnitGroupLocation,
scoreUnitGroupLocation,
map)
if (squadPath ~= -1) then
local squadPosition = surface.find_non_colliding_position("chunk-scanner-squad-rampant",
positionFromDirectionAndChunk(squadDirection,
chunk,
0.98),
CHUNK_SIZE,
4,
true)
if squadPosition then
local squad = createSquad(squadPosition, map, nil, true)
squad.rabid = map.random() < 0.03
local scaledWaveSize = settlerWaveScaling(universe)
universe.formGroupCommand.group = squad.group
universe.formCommand.unit_count = scaledWaveSize
local foundUnits = surface.set_multi_command(universe.formCommand)
if (foundUnits > 0) then
if universe.NEW_ENEMIES then
squad.base = findNearbyBase(map, chunk)
end
squad.kamikaze = map.random() < calculateKamikazeSettlerThreshold(foundUnits, universe)
universe.groupNumberToSquad[squad.groupNumber] = squad
universe.builderCount = universe.builderCount + 1
map.points = map.points - AI_VENGENCE_SQUAD_COST
if universe.aiPointsPrintSpendingToChat then
game.print(map.surface.name .. ": Points: -" .. AI_VENGENCE_SQUAD_COST .. ". [Vengence Settlers] Total: " .. string.format("%.2f", map.points) .. " [gps=" .. squadPosition.x .. "," .. squadPosition.y .. "]")
end
else
if (squad.group.valid) then
squad.group.destroy()
end
end
end
end
end
end
function aiAttackWave.formSquads(map, chunk)
local universe = map.universe
if (universe.squadCount < universe.AI_MAX_SQUAD_COUNT) and

View File

@ -57,6 +57,7 @@ local getChunkBase = chunkPropertyUtils.getChunkBase
local formSquads = aiAttackWave.formSquads
local formVengenceSquad = aiAttackWave.formVengenceSquad
local formVengenceSettler = aiAttackWave.formVengenceSettler
local formSettlers = aiAttackWave.formSettlers
local getChunkByPosition = mapUtils.getChunkByPosition
@ -430,7 +431,11 @@ function mapProcessor.processVengence(universe)
vengenceQueue[chunkId] = nil
return
end
formVengenceSquad(map, getChunkById(vengencePack.map, chunkId))
if universe.enabledMigration and (universe.random() < 0.075) then
formVengenceSettler(map, getChunkById(vengencePack.map, chunkId))
else
formVengenceSquad(map, getChunkById(vengencePack.map, chunkId))
end
vengenceQueue[chunkId] = nil
end
end