mirror of
https://github.com/veden/Rampant.git
synced 2025-09-16 09:16:43 +02:00
see changelog
This commit is contained in:
12
Upgrade.lua
12
Upgrade.lua
@@ -2,6 +2,7 @@ local upgrade = {}
|
|||||||
|
|
||||||
-- imports
|
-- imports
|
||||||
|
|
||||||
|
local squadAttack = require("libs/SquadAttack")
|
||||||
local constants = require("libs/Constants")
|
local constants = require("libs/Constants")
|
||||||
local mathUtils = require("libs/MathUtils")
|
local mathUtils = require("libs/MathUtils")
|
||||||
|
|
||||||
@@ -16,6 +17,8 @@ local SQUAD_GUARDING = constants.SQUAD_GUARDING
|
|||||||
|
|
||||||
-- imported functions
|
-- imported functions
|
||||||
|
|
||||||
|
local scoreAttackLocation = squadAttack.scoreAttackLocation
|
||||||
|
|
||||||
local roundToNearest = mathUtils.roundToNearest
|
local roundToNearest = mathUtils.roundToNearest
|
||||||
|
|
||||||
-- module code
|
-- module code
|
||||||
@@ -242,6 +245,15 @@ function upgrade.attempt(natives)
|
|||||||
game.surfaces[natives.activeSurface].print("Rampant - Version 0.16.37")
|
game.surfaces[natives.activeSurface].print("Rampant - Version 0.16.37")
|
||||||
global.version = constants.VERSION_72
|
global.version = constants.VERSION_72
|
||||||
end
|
end
|
||||||
|
if (global.version < constants.VERSION_73) then
|
||||||
|
|
||||||
|
for _,squad in pairs(natives.squads) do
|
||||||
|
squad.attackScoreFunction = scoreAttackLocation
|
||||||
|
end
|
||||||
|
|
||||||
|
game.surfaces[natives.activeSurface].print("Rampant - Version 0.16.38")
|
||||||
|
global.version = constants.VERSION_73
|
||||||
|
end
|
||||||
|
|
||||||
return starting ~= global.version, natives
|
return starting ~= global.version, natives
|
||||||
end
|
end
|
||||||
|
@@ -1,3 +1,9 @@
|
|||||||
|
---------------------------------------------------------------------------------------------------
|
||||||
|
Version: 0.16.38
|
||||||
|
Date: 2. 14. 2019
|
||||||
|
Bugfixes:
|
||||||
|
- Fixed squad attack being nil due to timing delay in update
|
||||||
|
|
||||||
---------------------------------------------------------------------------------------------------
|
---------------------------------------------------------------------------------------------------
|
||||||
Version: 0.16.37
|
Version: 0.16.37
|
||||||
Date: 2. 10. 2019
|
Date: 2. 10. 2019
|
||||||
|
@@ -393,10 +393,7 @@ script.on_nth_tick(INTERVAL_SCAN,
|
|||||||
|
|
||||||
scanMap(map, surface, natives, tick)
|
scanMap(map, surface, natives, tick)
|
||||||
|
|
||||||
-- map.queueSpawners = processSpawnerChunks(map, surface, natives, tick)
|
|
||||||
|
|
||||||
map.chunkToPassScan = processScanChunks(map, surface)
|
map.chunkToPassScan = processScanChunks(map, surface)
|
||||||
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
script.on_nth_tick(INTERVAL_LOGIC,
|
script.on_nth_tick(INTERVAL_LOGIC,
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name" : "Rampant",
|
"name" : "Rampant",
|
||||||
"factorio_version" : "0.16",
|
"factorio_version" : "0.16",
|
||||||
"version" : "0.16.37",
|
"version" : "0.16.38",
|
||||||
"title" : "Rampant",
|
"title" : "Rampant",
|
||||||
"author" : "Veden",
|
"author" : "Veden",
|
||||||
"homepage" : "https://forums.factorio.com/viewtopic.php?f=94&t=31445",
|
"homepage" : "https://forums.factorio.com/viewtopic.php?f=94&t=31445",
|
||||||
|
@@ -22,6 +22,7 @@ constants.VERSION_44 = 44
|
|||||||
constants.VERSION_51 = 51
|
constants.VERSION_51 = 51
|
||||||
constants.VERSION_57 = 57
|
constants.VERSION_57 = 57
|
||||||
constants.VERSION_72 = 72
|
constants.VERSION_72 = 72
|
||||||
|
constants.VERSION_73 = 73
|
||||||
|
|
||||||
-- misc
|
-- misc
|
||||||
|
|
||||||
|
@@ -40,8 +40,6 @@ local DEFINES_DISTRACTION_BY_ANYTHING = defines.distraction.by_anything
|
|||||||
|
|
||||||
local SENTINEL_IMPASSABLE_CHUNK = constants.SENTINEL_IMPASSABLE_CHUNK
|
local SENTINEL_IMPASSABLE_CHUNK = constants.SENTINEL_IMPASSABLE_CHUNK
|
||||||
|
|
||||||
local RETREAT_MOVEMENT_PHEROMONE_LEVEL_MAX = constants.RETREAT_MOVEMENT_PHEROMONE_LEVEL_MAX
|
|
||||||
|
|
||||||
-- imported functions
|
-- imported functions
|
||||||
|
|
||||||
local mRandom = math.random
|
local mRandom = math.random
|
||||||
@@ -82,7 +80,7 @@ local function scoreSiegeLocation(squad, neighborChunk)
|
|||||||
return settle - lookupMovementPenalty(squad, neighborChunk)
|
return settle - lookupMovementPenalty(squad, neighborChunk)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function scoreAttackLocation(natives, squad, neighborChunk)
|
function squadAttack.scoreAttackLocation(natives, squad, neighborChunk)
|
||||||
local damage
|
local damage
|
||||||
|
|
||||||
if (neighborChunk[MOVEMENT_PHEROMONE] >= 0) then
|
if (neighborChunk[MOVEMENT_PHEROMONE] >= 0) then
|
||||||
@@ -91,7 +89,6 @@ local function scoreAttackLocation(natives, squad, neighborChunk)
|
|||||||
damage = (neighborChunk[BASE_PHEROMONE] * (1 - (neighborChunk[MOVEMENT_PHEROMONE] / -natives.retreatThreshold))) + (neighborChunk[PLAYER_PHEROMONE] * PLAYER_PHEROMONE_MULTIPLER)
|
damage = (neighborChunk[BASE_PHEROMONE] * (1 - (neighborChunk[MOVEMENT_PHEROMONE] / -natives.retreatThreshold))) + (neighborChunk[PLAYER_PHEROMONE] * PLAYER_PHEROMONE_MULTIPLER)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- (neighborChunk[BASE_PHEROMONE] ) + (neighborChunk[PLAYER_PHEROMONE] * PLAYER_PHEROMONE_MULTIPLER)
|
|
||||||
return damage - lookupMovementPenalty(squad, neighborChunk)
|
return damage - lookupMovementPenalty(squad, neighborChunk)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -263,7 +260,7 @@ function squadAttack.squadsBeginAttack(natives, players)
|
|||||||
if squad.kamikaze and (mRandom() < (kamikazeThreshold * 0.75)) then
|
if squad.kamikaze and (mRandom() < (kamikazeThreshold * 0.75)) then
|
||||||
squad.attackScoreFunction = scoreAttackKamikazeLocation
|
squad.attackScoreFunction = scoreAttackKamikazeLocation
|
||||||
else
|
else
|
||||||
squad.attackScoreFunction = scoreAttackLocation
|
squad.attackScoreFunction = squadAttack.scoreAttackLocation
|
||||||
end
|
end
|
||||||
squad.status = SQUAD_RAIDING
|
squad.status = SQUAD_RAIDING
|
||||||
end
|
end
|
||||||
|
@@ -276,11 +276,11 @@ function unitGroupUtils.regroupSquads(natives, map)
|
|||||||
for x=1,#neighbors do
|
for x=1,#neighbors do
|
||||||
local maybeMerge
|
local maybeMerge
|
||||||
maybeMerge, memberCount, maxed = mergeGroups(getSquadsOnChunk(map, neighbors[x]),
|
maybeMerge, memberCount, maxed = mergeGroups(getSquadsOnChunk(map, neighbors[x]),
|
||||||
squad,
|
squad,
|
||||||
group,
|
group,
|
||||||
status,
|
status,
|
||||||
squadPosition,
|
squadPosition,
|
||||||
memberCount)
|
memberCount)
|
||||||
if maybeMerge then
|
if maybeMerge then
|
||||||
mergedSquads = true
|
mergedSquads = true
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user