mirror of
https://github.com/veden/Rampant.git
synced 2024-12-26 20:54:12 +02:00
see changelog
This commit is contained in:
parent
d071a8d0b2
commit
874343fa6a
12
Upgrade.lua
12
Upgrade.lua
@ -2,6 +2,7 @@ local upgrade = {}
|
||||
|
||||
-- imports
|
||||
|
||||
local squadAttack = require("libs/SquadAttack")
|
||||
local constants = require("libs/Constants")
|
||||
local mathUtils = require("libs/MathUtils")
|
||||
|
||||
@ -16,6 +17,8 @@ local SQUAD_GUARDING = constants.SQUAD_GUARDING
|
||||
|
||||
-- imported functions
|
||||
|
||||
local scoreAttackLocation = squadAttack.scoreAttackLocation
|
||||
|
||||
local roundToNearest = mathUtils.roundToNearest
|
||||
|
||||
-- module code
|
||||
@ -242,6 +245,15 @@ function upgrade.attempt(natives)
|
||||
game.surfaces[natives.activeSurface].print("Rampant - Version 0.16.37")
|
||||
global.version = constants.VERSION_72
|
||||
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
|
||||
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
|
||||
Date: 2. 10. 2019
|
||||
|
@ -393,10 +393,7 @@ script.on_nth_tick(INTERVAL_SCAN,
|
||||
|
||||
scanMap(map, surface, natives, tick)
|
||||
|
||||
-- map.queueSpawners = processSpawnerChunks(map, surface, natives, tick)
|
||||
|
||||
map.chunkToPassScan = processScanChunks(map, surface)
|
||||
|
||||
end)
|
||||
|
||||
script.on_nth_tick(INTERVAL_LOGIC,
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name" : "Rampant",
|
||||
"factorio_version" : "0.16",
|
||||
"version" : "0.16.37",
|
||||
"version" : "0.16.38",
|
||||
"title" : "Rampant",
|
||||
"author" : "Veden",
|
||||
"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_57 = 57
|
||||
constants.VERSION_72 = 72
|
||||
constants.VERSION_73 = 73
|
||||
|
||||
-- misc
|
||||
|
||||
|
@ -40,8 +40,6 @@ local DEFINES_DISTRACTION_BY_ANYTHING = defines.distraction.by_anything
|
||||
|
||||
local SENTINEL_IMPASSABLE_CHUNK = constants.SENTINEL_IMPASSABLE_CHUNK
|
||||
|
||||
local RETREAT_MOVEMENT_PHEROMONE_LEVEL_MAX = constants.RETREAT_MOVEMENT_PHEROMONE_LEVEL_MAX
|
||||
|
||||
-- imported functions
|
||||
|
||||
local mRandom = math.random
|
||||
@ -82,7 +80,7 @@ local function scoreSiegeLocation(squad, neighborChunk)
|
||||
return settle - lookupMovementPenalty(squad, neighborChunk)
|
||||
end
|
||||
|
||||
local function scoreAttackLocation(natives, squad, neighborChunk)
|
||||
function squadAttack.scoreAttackLocation(natives, squad, neighborChunk)
|
||||
local damage
|
||||
|
||||
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)
|
||||
end
|
||||
|
||||
-- (neighborChunk[BASE_PHEROMONE] ) + (neighborChunk[PLAYER_PHEROMONE] * PLAYER_PHEROMONE_MULTIPLER)
|
||||
return damage - lookupMovementPenalty(squad, neighborChunk)
|
||||
end
|
||||
|
||||
@ -263,7 +260,7 @@ function squadAttack.squadsBeginAttack(natives, players)
|
||||
if squad.kamikaze and (mRandom() < (kamikazeThreshold * 0.75)) then
|
||||
squad.attackScoreFunction = scoreAttackKamikazeLocation
|
||||
else
|
||||
squad.attackScoreFunction = scoreAttackLocation
|
||||
squad.attackScoreFunction = squadAttack.scoreAttackLocation
|
||||
end
|
||||
squad.status = SQUAD_RAIDING
|
||||
end
|
||||
|
@ -276,11 +276,11 @@ function unitGroupUtils.regroupSquads(natives, map)
|
||||
for x=1,#neighbors do
|
||||
local maybeMerge
|
||||
maybeMerge, memberCount, maxed = mergeGroups(getSquadsOnChunk(map, neighbors[x]),
|
||||
squad,
|
||||
group,
|
||||
status,
|
||||
squadPosition,
|
||||
memberCount)
|
||||
squad,
|
||||
group,
|
||||
status,
|
||||
squadPosition,
|
||||
memberCount)
|
||||
if maybeMerge then
|
||||
mergedSquads = true
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user