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

added minimum cost building check to upgrades

This commit is contained in:
Aaron Veden 2021-11-26 12:25:07 -08:00
parent 9d16d058a8
commit c4fea8f598
No known key found for this signature in database
GPG Key ID: FF5990B1C6DD3F84
3 changed files with 10 additions and 1 deletions

View File

@ -10,6 +10,7 @@ Date: 23. 11. 2021
- Number of groups that can be active in aggressive AI state now scales with the number of active nests. Rougly for every 30 pollution covered nests you will get an additional attack group.
- Optimized regional base upgrades so that the work is spread over many ticks reducing lag spikes
- Optimized adding new chunks to the Rampant in-memory state map
- Added minimum building cost upgrade check before base upgrade performs scanning
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

@ -12,6 +12,7 @@ local mapUtils = require("MapUtils")
-- constants
local MINIMUM_BUILDING_COST = constants.MINIMUM_BUILDING_COST
local FACTION_MUTATION_MAPPING = constants.FACTION_MUTATION_MAPPING
local MAGIC_MAXIMUM_NUMBER = constants.MAGIC_MAXIMUM_NUMBER
@ -402,7 +403,7 @@ function baseUtils.processBase(chunk, map, tick, base)
point.y = chunk.y + (CHUNK_SIZE * mRandom())
local upgradeRoll = mRandom()
if (base.state == BASE_AI_STATE_ACTIVE) and (upgradeRoll < 0.30) then
if (base.state == BASE_AI_STATE_ACTIVE) and (base.points >= MINIMUM_BUILDING_COST) and (upgradeRoll < 0.30) then
local entities = surface.find_entities_filtered(universe.filteredEntitiesPointQueryLimited)
if #entities ~= 0 then
local entity = entities[1]

View File

@ -1598,6 +1598,13 @@ constants.HIVE_BUILDINGS_COST["spitter-spawner"] = constants.BASE_SPAWNER_UPGRAD
constants.HIVE_BUILDINGS_COST["biter-spawner"] = constants.BASE_SPAWNER_UPGRADE
constants.HIVE_BUILDINGS_COST["hive"] = constants.BASE_SPAWNER_UPGRADE * 2
constants.MINIMUM_BUILDING_COST = constants.MAGIC_MAXIMUM_NUMBER
for _,cost in pairs(constants.HIVE_BUILDINGS_COST) do
if cost < constants.MINIMUM_BUILDING_COST then
constants.MINIMUM_BUILDING_COST = cost
end
end
constants.FACTION_MUTATION_MAPPING = {}
constants.FACTION_MUTATION_MAPPING["spitter-spawner"] = {"biter-spawner", "hive"}
constants.FACTION_MUTATION_MAPPING["biter-spawner"] = {"spitter-spawner", "hive"}