1
0
mirror of https://github.com/veden/Rampant.git synced 2024-12-26 20:54:12 +02:00

added base mutation limit

This commit is contained in:
Aaron Veden 2021-11-25 09:04:52 -08:00
parent abe8f57dfb
commit 3a2d4fa29e
No known key found for this signature in database
GPG Key ID: FF5990B1C6DD3F84
6 changed files with 51 additions and 6 deletions

View File

@ -418,6 +418,19 @@ function upgrade.attempt(universe)
game.print("Rampant - Version 1.1.4")
end
if global.version < 117 then
global.version = 117
if (universe.maps) then
for _,map in pairs(universe.maps) do
for _,base in pairs(map.bases) do
base.mutations = 0
end
end
end
game.print("Rampant - Version 1.2.0")
end
return (starting ~= global.version) and global.version
end

View File

@ -3,6 +3,7 @@ Version: 1.1.5
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
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

@ -192,6 +192,9 @@ local function onModSettingsChange(event)
upgrade.compareTable(universe.safeEntities,
"lamp",
settings.global["rampant--safeBuildings-lamps"].value)
upgrade.compareTable(universe,
"MAX_BASE_MUTATIONS",
settings.global["rampant--max-base-mutations"].value)
local changed, newValue = upgrade.compareTable(universe.safeEntities,
"big-electric-pole",

View File

@ -336,19 +336,23 @@ local function pickMutationFromDamageType(map, damageType, roll, base)
end
end
if (map.universe.printBaseAdaptation) then
if (baseAlignment[2]) then
if baseAlignment[2] then
game.print({"description.rampant--adaptation2DebugMessage",
damageType,
{"description.rampant--"..baseAlignment[1].."EnemyName"},
{"description.rampant--"..baseAlignment[2].."EnemyName"},
base.x,
base.y})
base.y,
base.mutations,
map.universe.MAX_BASE_MUTATIONS})
else
game.print({"description.rampant--adaptation1DebugMessage",
damageType,
{"description.rampant--"..baseAlignment[1].."EnemyName"},
base.x,
base.y})
base.y,
base.mutations,
map.universe.MAX_BASE_MUTATIONS})
end
end
end
@ -421,7 +425,17 @@ function baseUtils.processBase(chunk, map, tick, base)
deathThreshold = universe.adaptationModifier * deathThreshold
if ((base.deathEvents > deathThreshold) and (upgradeRoll > 0.95)) then
upgradeBaseBasedOnDamage(map, base)
if (base.mutations < universe.MAX_BASE_MUTATIONS) then
upgradeBaseBasedOnDamage(map, base)
base.mutations = base.mutations + 1
elseif (base.mutations == universe.MAX_BASE_MUTATIONS) then
local roll = mRandom()
if (roll < 0.001) then
base.mutations = 0
elseif (roll > 0.999) then
base.mutations = base.mutations + 1
end
end
base.damagedBy = {}
base.deathEvents = 0
end
@ -486,6 +500,7 @@ function baseUtils.createBase(map, chunk, tick, rebuilding)
state = BASE_AI_STATE_ACTIVE,
damagedBy = {},
deathEvents = 0,
mutations = 0,
stateTick = 0,
createdTick = tick,
points = 0,

View File

@ -18789,6 +18789,7 @@ poison-worm-v20-t10-rampant=Poison worm: t10 Leviathan
[entity-description]
[mod-setting-name]
rampant--max-base-mutations=World: Max Mutations per faction
rampant--baseDistanceModifier=AI: Faction Base Distance Modifier
rampant--printBaseAdaptation=AI: Print Faction Mutations
rampant--adaptationModifier=AI: Adaption Modifier
@ -18893,6 +18894,7 @@ rampant--enableFadeTime=Enable corpse fade time
rampant--temperamentRateModifier=AI: Temperament Rate Modifier
[mod-setting-description]
rampant--max-base-mutations=Requires Rampant new enemies to have any affect. This number represents the number of times a regional faction group can mutate into other factions.
rampant--baseDistanceModifier=Modifies the distance between factions as a percentage change. Low percentages may impact performance.
rampant--printBaseAdaptation=Display a message to the chat console when a faction mutates based on the number of enemies killed
rampant--adaptationModifier=Modifies the number of units or enemy buildings that must be destroyed before the adaptation happens based on the damage types that killed the units or buildings. This modifier is a percentage change using the following as starting place (Default deaths events starts at 3000 under 0.5 evo, 0.7 is 4500, 0.9 is 6000, and +0.9 is 7500)
@ -18996,8 +18998,8 @@ rampant--temperamentRateModifier=Change how quickly Rampant will hit extremes in
[description]
rampant-bobs-nee-newEnemies=Bobs enemies or NEE has been detected with Rampants new enemies,\nthe artifacts from each of these mods will still work with Rampants new enemies.\nThe generation of bobs or NEE unit spawners explicitly by Rampant is\nno longer supported when the Rampants new enemies are active.
rampant--adaptation2DebugMessage=Faction has mutated bacause the damage type called __1__. Now the Faction will produce __2__ and __3__. [gps=__4__,__5__]
rampant--adaptation1DebugMessage=Faction has mutated bacause the damage type called __1__. Now the Faction will produce __2__. [gps=__3__,__4__]
rampant--adaptation2DebugMessage=Faction has mutated bacause the damage type called __1__. Now the Faction will produce __2__ and __3__. Faction mutations __6__ out of __7__. [gps=__4__,__5__]
rampant--adaptation1DebugMessage=Faction has mutated bacause the damage type called __1__. Now the Faction will produce __2__. Faction mutations __5__ out of __6__. [gps=__3__,__4__]
rampant--laserEnemyName=Laser Biter
rampant--waspEnemyName=Wasp Biter
rampant--spawnerEnemyName=Spawner Biter

View File

@ -59,6 +59,17 @@ data:extend({
per_user = false
},
{
type = "int-setting",
name = "rampant--max-base-mutations",
setting_type = "runtime-global",
minimum_value = 0,
maximum_value = 9999999999,
default_value = 2,
order = "b[modifier]-i[wave]",
per_user = false
},
{
type = "int-setting",
name = "rampant--maxNumberOfBuilders",