1
0
mirror of https://github.com/veden/Rampant.git synced 2025-02-05 13:14:51 +02:00

added regional base dormancy state

This commit is contained in:
Aaron Veden 2021-11-25 09:49:54 -08:00
parent 8a5a6a939a
commit 3c1b39e3eb
No known key found for this signature in database
GPG Key ID: FF5990B1C6DD3F84
2 changed files with 9 additions and 10 deletions

View File

@ -4,6 +4,7 @@ Date: 23. 11. 2021
Improvements:
- Removed bounding box check when placing enemy buildings or upgrading buildings inplace
- Limited base faction mutations to 2 (configurable) with a small probability to be granted additional mutations or be locked into those factions forever
- Readded regional bases going dormant in regards to upgrading structures to allow for a buildup of base points to upgrade larger structures like hives. DOES NOT EFFECT ATTACK WAVES.
Tweaks:
- Doubled the processing rate of regional faction bases with new enemies
- Added a small chance (0.5%) that Hives can spawn outside resource patches (Thank you Dimm2101)

View File

@ -19,6 +19,7 @@ local MAGIC_MAXIMUM_NUMBER = constants.MAGIC_MAXIMUM_NUMBER
local FACTIONS_BY_DAMAGE_TYPE = constants.FACTIONS_BY_DAMAGE_TYPE
local BASE_AI_STATE_ACTIVE = constants.BASE_AI_STATE_ACTIVE
local BASE_AI_STATE_DORMANT = constants.BASE_AI_STATE_DORMANT
local FACTION_SET = constants.FACTION_SET
@ -395,7 +396,7 @@ function baseUtils.processBase(chunk, map, tick, base)
point.y = chunk.y + (CHUNK_SIZE * mRandom())
local upgradeRoll = mRandom()
if (upgradeRoll < 0.05) then
if (base.state == BASE_AI_STATE_ACTIVE) and (upgradeRoll < 0.05) then
local entities = surface.find_entities_filtered(universe.filteredEntitiesPointQueryLimited)
if #entities ~= 0 then
local entity = entities[1]
@ -446,16 +447,13 @@ function baseUtils.processBase(chunk, map, tick, base)
base.points = universe.maxPoints
end
-- print("baseStats", base.points, base.state, base.deathEvents-- , serpent.dump(base.damagedBy)
-- )
if (base.stateTick <= tick) then
-- local roll = mRandom()
-- if (roll < 0.85) then
base.state = BASE_AI_STATE_ACTIVE
-- else
-- base.state = BASE_AI_STATE_MUTATE
-- end
local roll = mRandom()
if (roll < 0.85) then
base.state = BASE_AI_STATE_ACTIVE
else
base.state = BASE_AI_STATE_DORMANT
end
base.stateTick = randomTickEvent(tick,
BASE_AI_MIN_STATE_DURATION,
BASE_AI_MAX_STATE_DURATION)