diff --git a/changelog.txt b/changelog.txt index 0d19b9c..d7e588f 100755 --- a/changelog.txt +++ b/changelog.txt @@ -3,6 +3,7 @@ Version: 0.16.27 Date: 5. 23. 2018 Tweaks: - Changed spawner faction loot drops from green to orange. + - Changed attack prototype for wasps so it doesn't show up in bonuses bullet gui Improvements: - Changes to player accounting to enable multi player forces in a pvp scenario. - Check for battle_surface_1 & 2 used in pvp and store and use discovered surface index. diff --git a/libs/BaseUtils.lua b/libs/BaseUtils.lua index 9c72569..9bc7368 100755 --- a/libs/BaseUtils.lua +++ b/libs/BaseUtils.lua @@ -432,13 +432,11 @@ function baseUtils.rebuildNativeTables(natives, surface, rg) natives.evolutionTableAlignment) end - local option = settings.startup["NE_Difficulty"] - if option and option.value and ENABLED_NE_UNITS then + if ENABLED_NE_UNITS then processNEUnitClass(natives, surface) end - local option = settings.startup["bobmods-enemies-enableartifacts"] - if option and option.value and ENABLED_BOBS_UNITS then + if ENABLED_BOBS_UNITS then processBobsUnitClass(natives, surface) end diff --git a/libs/ChunkProcessor.lua b/libs/ChunkProcessor.lua index dd34ee9..2fbe821 100755 --- a/libs/ChunkProcessor.lua +++ b/libs/ChunkProcessor.lua @@ -20,8 +20,6 @@ local SENTINEL_IMPASSABLE_CHUNK = constants.SENTINEL_IMPASSABLE_CHUNK local retreatUnits = squadDefense.retreatUnits -local findNearbySquad = unitGroupUtils.findNearbySquad - local createChunk = chunkUtils.createChunk local initialScan = chunkUtils.initialScan local chunkPassScan = chunkUtils.chunkPassScan diff --git a/libs/ChunkUtils.lua b/libs/ChunkUtils.lua index 3d602fb..7ca63bf 100755 --- a/libs/ChunkUtils.lua +++ b/libs/ChunkUtils.lua @@ -219,10 +219,9 @@ function chunkUtils.scorePlayerBuildings(surface, map, natives) local entities = surface.find_entities_filtered(map.filteredEntitiesPlayerQuery) local playerObjects = 0 - local safeBuildings = natives.safeBuildings local safeEntities = natives.safeEntities local safeEntityName = natives.safeEntityName - if safeBuildings then + if natives.safeBuildings then for i=1, #entities do local entity = entities[i] local entityType = entity.type diff --git a/libs/Constants.lua b/libs/Constants.lua index 4dee593..7a23504 100755 --- a/libs/Constants.lua +++ b/libs/Constants.lua @@ -201,12 +201,9 @@ constants.BASE_ALIGNMENT_EVOLUTION_BASELINE = { [constants.BASE_ALIGNMENT_NUCLEAR] = 0.7 } -local detectNE = settings.startup["NE_Difficulty"] -constants.ENABLED_NE_UNITS = settings.startup["rampant-enableNEUnits"].value and detectNE - -local detectBobs = settings.startup["bobmods-enemies-enableartifacts"] -constants.ENABLED_BOBS_UNITS = settings.startup["rampant-enableBobsUnits"].value and detectBobs +constants.ENABLED_NE_UNITS = settings.startup["rampant-enableNEUnits"].value and (settings.startup["NE_Difficulty"] ~= nil) +constants.ENABLED_BOBS_UNITS = settings.startup["rampant-enableBobsUnits"].value and (settings.startup["bobmods-enemies-enableartifacts"] ~= nil) if constants.ENABLED_BOBS_UNITS then constants.BASE_ALIGNMENT_EVOLUTION_BASELINE[constants.BASE_ALIGNMENT_BOBS] = 0.1 diff --git a/libs/MapProcessor.lua b/libs/MapProcessor.lua index 5739156..f5a8db5 100755 --- a/libs/MapProcessor.lua +++ b/libs/MapProcessor.lua @@ -174,8 +174,10 @@ function mapProcessor.processPlayers(players, map, surface, natives, tick) end end end - for i=1,#playerOrdering do - local player = players[playerOrdering[i]] + + -- not looping everyone because the cost is high enough already in multiplayer + if (#playerOrdering > 0) then + local player = players[playerOrdering[1]] if validPlayer(player, natives) then local playerChunk = getChunkByPosition(map, player.character.position) @@ -258,13 +260,12 @@ function mapProcessor.scanMap(map, surface, natives, tick) settlers[chunk] = nil end + local closeBy = findNearbySquad(map, chunk, chunk) - local unitCount = surface.count_entities_filtered(unitCountQuery) - - if (unitCount > 300) then - local closeBy = findNearbySquad(map, chunk, chunk) + if closeBy then + local deadGroup = surface.count_entities_filtered(unitCountQuery) > 300 - if not closeBy then + if deadGroup then recycleBiters(natives, surface.find_enemy_units(chunk, TRIPLE_CHUNK_SIZE)) end end diff --git a/prototypes/Spawner.lua b/prototypes/Spawner.lua index 97bcfea..443f865 100755 --- a/prototypes/Spawner.lua +++ b/prototypes/Spawner.lua @@ -102,7 +102,7 @@ function spawner.addFaction() function (attack) return { type = "projectile", - ammo_category = "bullet", + ammo_category = "biological", cooldown = attack.cooldown or 20, projectile_center = {0, 1}, projectile_creation_distance = 0.6, @@ -110,7 +110,7 @@ function spawner.addFaction() sound = biterAttackSounds(), ammo_type = { - category = "bullet", + category = "biological", action = { type = "direct", @@ -425,7 +425,7 @@ function spawner.addFaction() function (attack) return { type = "projectile", - ammo_category = "bullet", + ammo_category = "biological", cooldown = attack.cooldown or 20, projectile_center = {0, 1}, projectile_creation_distance = 0.6, @@ -433,7 +433,7 @@ function spawner.addFaction() sound = biterAttackSounds(), ammo_type = { - category = "bullet", + category = "biological", action = { type = "direct", diff --git a/prototypes/Wasp.lua b/prototypes/Wasp.lua index 087433b..0cae0aa 100755 --- a/prototypes/Wasp.lua +++ b/prototypes/Wasp.lua @@ -94,7 +94,7 @@ buildUnits( function (attack) return { type = "projectile", - ammo_category = "bullet", + ammo_category = "biological", cooldown = attack.cooldown or 20, projectile_center = {0, 1}, projectile_creation_distance = 0.6, @@ -102,7 +102,7 @@ buildUnits( sound = biterAttackSounds(), ammo_type = { - category = "bullet", + category = "biological", action = { type = "direct", @@ -364,7 +364,7 @@ buildUnits( function (attack) return { type = "projectile", - ammo_category = "bullet", + ammo_category = "biological", cooldown = attack.cooldown or 20, projectile_center = {0, 1}, projectile_creation_distance = 0.6, @@ -372,7 +372,7 @@ buildUnits( sound = biterAttackSounds(), ammo_type = { - category = "bullet", + category = "biological", action = { type = "direct", diff --git a/prototypes/utils/DroneUtils.lua b/prototypes/utils/DroneUtils.lua index 78d0a8e..224d897 100755 --- a/prototypes/utils/DroneUtils.lua +++ b/prototypes/utils/DroneUtils.lua @@ -16,7 +16,7 @@ function droneUtils.makeDrone(name, attributes, biterResistances, biterAttack, b name = n, icon = "__base__/graphics/icons/defender.png", icon_size = 32, - flags = {"placeable-player", "player-creation", "placeable-off-grid", "not-on-map", "not-repairable", "breaths-air"}, + flags = {"placeable-off-grid", "not-on-map", "not-repairable", "breaths-air"}, subgroup="capsule", order="e-a-a", max_health = attributes.health or 60, diff --git a/tests.lua b/tests.lua index ad5f71a..e70f4d9 100755 --- a/tests.lua +++ b/tests.lua @@ -208,8 +208,9 @@ function tests.gaussianRandomTest() end function tests.reveal (size) + local pos = game.player.character.position game.player.force.chart(game.player.surface, - {{x=-size, y=-size}, {x=size, y=size}}) + {{x=-size+pos.x, y=-size+pos.y}, {x=size+pos.x, y=size+pos.y}}) end function tests.baseStats()