From dfc2eb9a26b19c6690dd001a6f246e7814b4c4e2 Mon Sep 17 00:00:00 2001 From: Aaron Veden Date: Sun, 8 May 2022 12:58:21 -0700 Subject: [PATCH] FACTO-127: moved enemy phermone multipler to pheromone processor instead of squads movement --- libs/PheromoneUtils.lua | 3 ++- libs/SquadAttack.lua | 9 ++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libs/PheromoneUtils.lua b/libs/PheromoneUtils.lua index 8fc9bfb..98f340e 100644 --- a/libs/PheromoneUtils.lua +++ b/libs/PheromoneUtils.lua @@ -27,6 +27,7 @@ local chunkPropertyUtils = require("ChunkPropertyUtils") -- constants +local ENEMY_PHEROMONE_MULTIPLER = constants.ENEMY_PHEROMONE_MULTIPLER local VICTORY_SCENT_MULTIPLER = constants.VICTORY_SCENT_MULTIPLER local VICTORY_SCENT_BOUND = constants.VICTORY_SCENT_BOUND @@ -377,7 +378,7 @@ function pheromoneUtils.processStaticPheromone(map, chunk) chunk[BASE_PHEROMONE] = chunkBase * chunkPathRating end - pheromone = getNestCount(map, chunk) + getHiveCount(map, chunk) + pheromone = (getNestCount(map, chunk) + getHiveCount(map, chunk)) * ENEMY_PHEROMONE_MULTIPLER if chunkEnemy < pheromone then chunk[ENEMY_PHEROMONE] = pheromone * chunkPathRating else diff --git a/libs/SquadAttack.lua b/libs/SquadAttack.lua index 6e25941..eff5dfb 100644 --- a/libs/SquadAttack.lua +++ b/libs/SquadAttack.lua @@ -49,7 +49,6 @@ local BASE_AI_STATE_SIEGE = constants.BASE_AI_STATE_SIEGE local BASE_AI_STATE_AGGRESSIVE = constants.BASE_AI_STATE_AGGRESSIVE local PLAYER_PHEROMONE_MULTIPLER = constants.PLAYER_PHEROMONE_MULTIPLER -local ENEMY_PHEROMONE_MULTIPLER = constants.ENEMY_PHEROMONE_MULTIPLER local DEFINES_DISTRACTION_NONE = defines.distraction.none local DEFINES_DISTRACTION_BY_ENEMY = defines.distraction.by_enemy @@ -92,14 +91,14 @@ local function scoreResourceLocationKamikaze(_, neighborChunk) local settle = neighborChunk[RESOURCE_PHEROMONE] return settle - (neighborChunk[PLAYER_PHEROMONE] * PLAYER_PHEROMONE_MULTIPLER) - - (neighborChunk[ENEMY_PHEROMONE] * ENEMY_PHEROMONE_MULTIPLER) + - neighborChunk[ENEMY_PHEROMONE] end local function scoreSiegeLocationKamikaze(_, neighborChunk) local settle = neighborChunk[BASE_PHEROMONE] + neighborChunk[RESOURCE_PHEROMONE] + (neighborChunk[PLAYER_PHEROMONE] * PLAYER_PHEROMONE_MULTIPLER) - - (neighborChunk[ENEMY_PHEROMONE] * ENEMY_PHEROMONE_MULTIPLER) + - neighborChunk[ENEMY_PHEROMONE] return settle end @@ -108,14 +107,14 @@ local function scoreResourceLocation(map, neighborChunk) local settle = (getDeathGeneratorRating(map, neighborChunk) * neighborChunk[RESOURCE_PHEROMONE]) return settle - (neighborChunk[PLAYER_PHEROMONE] * PLAYER_PHEROMONE_MULTIPLER) - - (neighborChunk[ENEMY_PHEROMONE] * ENEMY_PHEROMONE_MULTIPLER) + - neighborChunk[ENEMY_PHEROMONE] end local function scoreSiegeLocation(map, neighborChunk) local settle = neighborChunk[BASE_PHEROMONE] + neighborChunk[RESOURCE_PHEROMONE] + (neighborChunk[PLAYER_PHEROMONE] * PLAYER_PHEROMONE_MULTIPLER) - - (neighborChunk[ENEMY_PHEROMONE] * ENEMY_PHEROMONE_MULTIPLER) + - neighborChunk[ENEMY_PHEROMONE] return settle * getDeathGeneratorRating(map, neighborChunk) end