mirror of
https://github.com/veden/Rampant.git
synced 2025-01-28 03:29:34 +02:00
FACTO-53: Hives only spawn during daylight hours
This commit is contained in:
parent
a931b89a17
commit
f2ed7893c9
@ -3,6 +3,7 @@ Version: 2.2.0
|
||||
Date: 29. 12. 2021
|
||||
Improvements:
|
||||
- Added integration with schallAlienLoot (Thank you garrotte for the code snippet)
|
||||
- New enemy hives only spawn structures during daylight hours now
|
||||
Tweaks:
|
||||
- Set maximum value on enemy seed to 4294967295
|
||||
- Slightly increased spacing between enemy structures
|
||||
@ -11,6 +12,7 @@ Date: 29. 12. 2021
|
||||
- Separated mod setting into printing settlers building and ai spending points
|
||||
- Reduced visual size of spawners and hives
|
||||
- Increased visual size of worms
|
||||
- Inverted Hive colors for easier visual identification
|
||||
Bugfixes:
|
||||
- Fixed Hives spawning excessive amounts of entities
|
||||
- Fixed chunkPack nil in processNests (Thanks Skallywaggz for the report)
|
||||
|
@ -561,7 +561,7 @@ constants.FACTION_SET[#constants.FACTION_SET+1] = {
|
||||
name = "hive",
|
||||
majorResistances = {},
|
||||
minorResistances = {},
|
||||
attributes = {},
|
||||
attributes = {"spawnDuringDays"},
|
||||
acceptRate = {2, 10, 0.001, 0.0175},
|
||||
drops = {"nilArtifact"},
|
||||
buildSets = {
|
||||
@ -646,7 +646,7 @@ if settings.startup["rampant--acidEnemy"].value then
|
||||
majorResistances = {"acid"},
|
||||
minorResistances = {"poison"},
|
||||
acceptRate = {2, 10, 0.001, 0.0175},
|
||||
attributes = {},
|
||||
attributes = {"spawnDuringDays"},
|
||||
drops = {"greenArtifact"},
|
||||
buildSets = {
|
||||
{"biter-spawner", 1, 10, 0.15, 0.3},
|
||||
@ -722,7 +722,7 @@ if settings.startup["rampant--laserEnemy"].value then
|
||||
type = "hive",
|
||||
name = "hive",
|
||||
majorResistances = {"laser", "electric"},
|
||||
attributes = {},
|
||||
attributes = {"spawnDuringDays"},
|
||||
acceptRate = {2, 10, 0.001, 0.0175},
|
||||
drops = {"blueArtifact"},
|
||||
buildSets = {
|
||||
@ -805,7 +805,7 @@ if settings.startup["rampant--fireEnemy"].value then
|
||||
name = "hive",
|
||||
majorResistances = {"fire", "acid"},
|
||||
minorResistances = {},
|
||||
attributes = {},
|
||||
attributes = {"spawnDuringDays"},
|
||||
acceptRate = {2, 10, 0.001, 0.0175},
|
||||
drops = {"redArtifact"},
|
||||
buildSets = {
|
||||
@ -867,7 +867,7 @@ if settings.startup["rampant--infernoEnemy"].value then
|
||||
name = "hive",
|
||||
majorResistances = {"fire", "acid"},
|
||||
minorResistances = {},
|
||||
attributes = {},
|
||||
attributes = {"spawnDuringDays"},
|
||||
acceptRate = {2, 10, 0.001, 0.0175},
|
||||
drops = {"orangeArtifact"},
|
||||
buildSets = {
|
||||
@ -934,7 +934,7 @@ if settings.startup["rampant--waspEnemy"].value then
|
||||
{
|
||||
type = "hive",
|
||||
name = "hive",
|
||||
attributes = {},
|
||||
attributes = {"spawnDuringDays"},
|
||||
acceptRate = {2, 10, 0.001, 0.0175},
|
||||
drops = {"purpleArtifact"},
|
||||
buildSets = {
|
||||
@ -1010,7 +1010,7 @@ if settings.startup["rampant--spawnerEnemy"].value then
|
||||
{
|
||||
type = "hive",
|
||||
name = "hive",
|
||||
attributes = {},
|
||||
attributes = {"spawnDuringDays"},
|
||||
acceptRate = {2, 10, 0.001, 0.0175},
|
||||
drops = {"orangeArtifact"},
|
||||
buildSets = {
|
||||
@ -1071,7 +1071,7 @@ if settings.startup["rampant--electricEnemy"].value then
|
||||
name = "hive",
|
||||
majorResistances = {"electric"},
|
||||
minorResistances = {"laser"},
|
||||
attributes = {},
|
||||
attributes = {"spawnDuringDays"},
|
||||
acceptRate = {2, 10, 0.001, 0.0175},
|
||||
drops = {"blueArtifact"},
|
||||
buildSets = {
|
||||
@ -1133,7 +1133,7 @@ if settings.startup["rampant--physicalEnemy"].value then
|
||||
name = "hive",
|
||||
majorResistances = {"physical", "explosion"},
|
||||
minorResistances = {"laser", "electric"},
|
||||
attributes = {"highHealth", "bigger"},
|
||||
attributes = {"highHealth", "bigger", "spawnDuringDays"},
|
||||
acceptRate = {2, 10, 0.001, 0.0175},
|
||||
drops = {"redArtifact"},
|
||||
buildSets = {
|
||||
@ -1196,7 +1196,7 @@ if settings.startup["rampant--trollEnemy"].value then
|
||||
name = "hive",
|
||||
minorResistances = {"physical", "explosion"},
|
||||
majorWeaknesses = {"fire"},
|
||||
attributes = {"highestHealth", "bigger", "highRegen"},
|
||||
attributes = {"highestHealth", "bigger", "highRegen","spawnDuringDays"},
|
||||
acceptRate = {2, 10, 0.001, 0.0175},
|
||||
drops = {"greenArtifact"},
|
||||
buildSets = {
|
||||
@ -1262,7 +1262,7 @@ if settings.startup["rampant--poisonEnemy"].value then
|
||||
majorResistances = {"poison"},
|
||||
minorResistances = {"fire"},
|
||||
minorWeaknesses = {"electric", "explosion", "laser"},
|
||||
attributes = {},
|
||||
attributes = {"spawnDuringDays"},
|
||||
acceptRate = {2, 10, 0.001, 0.0175},
|
||||
drops = {"greenArtifact"},
|
||||
buildSets = {
|
||||
@ -1323,7 +1323,7 @@ if settings.startup["rampant--suicideEnemy"].value then
|
||||
name = "hive",
|
||||
majorResistances = {"explosion"},
|
||||
minorResistances = {"poison"},
|
||||
attributes = {},
|
||||
attributes = {"spawnDuringDays"},
|
||||
acceptRate = {2, 10, 0.001, 0.0175},
|
||||
drops = {"yellowArtifact"},
|
||||
buildSets = {
|
||||
@ -1383,7 +1383,7 @@ if settings.startup["rampant--nuclearEnemy"].value then
|
||||
name = "hive",
|
||||
majorResistances = {"explosion"},
|
||||
minorResistances = {"fire"},
|
||||
attributes = {},
|
||||
attributes = {"spawnDuringDays"},
|
||||
acceptRate = {2, 10, 0.001, 0.0175},
|
||||
drops = {"yellowArtifact"},
|
||||
buildSets = {
|
||||
@ -1443,7 +1443,7 @@ if settings.startup["rampant--energyThiefEnemy"].value then
|
||||
type = "hive",
|
||||
name = "hive",
|
||||
majorResistances = {"electric", "laser"},
|
||||
attributes = {},
|
||||
attributes = {"spawnDuringDays"},
|
||||
acceptRate = {2, 10, 0.001, 0.0175},
|
||||
drops = {"blueArtifact"},
|
||||
buildSets = {
|
||||
@ -1526,7 +1526,7 @@ if settings.startup["rampant--fastEnemy"].value then
|
||||
name = "hive",
|
||||
majorResistances = {},
|
||||
minorResistances = {"explosion"},
|
||||
attributes = {"quickSpawning"},
|
||||
attributes = {"quickSpawning", "spawnDuringDays"},
|
||||
acceptRate = {2, 10, 0.001, 0.0175},
|
||||
drops = {"purpleArtifact"},
|
||||
buildSets = {
|
||||
|
@ -626,6 +626,9 @@ local function fillEntityTemplate(entity)
|
||||
entity["healing"] = entity["healing"] * -1
|
||||
elseif (attribute == "checkBuildability") then
|
||||
entity.checkBuildability = true
|
||||
elseif (attribute == "spawnDuringDays") then
|
||||
entity.minSpawnDarkness = 0
|
||||
entity.maxSpawnDarkness = 0.45
|
||||
elseif (attribute == "followsPlayer") then
|
||||
entity.followsPlayer = true
|
||||
elseif (attribute == "stationary") then
|
||||
@ -678,27 +681,45 @@ local function fillEntityTemplate(entity)
|
||||
scaleAttributes(entity)
|
||||
end
|
||||
|
||||
local function calculateRGBa(tint, tier, staticAlpha)
|
||||
local r = gaussianRandomRangeRG(tint.r, tint.r * 0.10 + (0.005 * tier), mMax(tint.r * 0.85 - (0.005 * tier), 0), mMin(tint.r * 1.15, 1), xorRandom)
|
||||
local g = gaussianRandomRangeRG(tint.g, tint.g * 0.10 + (0.005 * tier), mMax(tint.g * 0.85 - (0.005 * tier), 0), mMin(tint.g * 1.15, 1), xorRandom)
|
||||
local b = gaussianRandomRangeRG(tint.b, tint.b * 0.10 + (0.005 * tier), mMax(tint.b * 0.85 - (0.005 * tier), 0), mMin(tint.b * 1.15, 1), xorRandom)
|
||||
local function calculateRGBa(tint, tier, staticAlpha, invert)
|
||||
local stdDevMultipler = 0.10 + (0.005 * tier)
|
||||
local lowMultipler = 0.85 - (0.005 * tier)
|
||||
local r = gaussianRandomRangeRG(tint.r,
|
||||
tint.r * stdDevMultipler,
|
||||
mMax(tint.r * lowMultipler, 0),
|
||||
mMin(tint.r * 1.15, 1), xorRandom)
|
||||
local g = gaussianRandomRangeRG(tint.g,
|
||||
tint.g * stdDevMultipler,
|
||||
mMax(tint.g * lowMultipler, 0),
|
||||
mMin((tint.g * 1.15), 1), xorRandom)
|
||||
local b = gaussianRandomRangeRG(tint.b,
|
||||
tint.b * stdDevMultipler,
|
||||
mMax(tint.b * lowMultipler, 0),
|
||||
mMin(tint.b * 1.15, 1), xorRandom)
|
||||
local a = tint.a
|
||||
if not staticAlpha then
|
||||
a = gaussianRandomRangeRG(tint.a, tint.a * 0.10 + (0.005 * tier), mMax(tint.a * 0.85 - (0.005 * tier), 0), mMin(tint.a * 1.15, 1), xorRandom)
|
||||
a = gaussianRandomRangeRG(tint.a,
|
||||
tint.a * stdDevMultipler,
|
||||
mMax(tint.a * lowMultipler, 0),
|
||||
mMin(tint.a * 1.15, 1), xorRandom)
|
||||
end
|
||||
|
||||
return { r=r, g=g, b=b, a=a }
|
||||
if invert then
|
||||
return { r=(1-r), g=(1-g), b=(1-b), a=(1-a) }
|
||||
else
|
||||
return { r=r, g=g, b=b, a=a }
|
||||
end
|
||||
end
|
||||
|
||||
local function generateApperance(unit)
|
||||
local function generateApperance(unit, invert)
|
||||
local tier = unit.effectiveLevel
|
||||
if unit.scale then
|
||||
local scaleValue = unit.scale[tier]
|
||||
local scale = gaussianRandomRangeRG(scaleValue, scaleValue * 0.24, scaleValue * 0.50, scaleValue * 1.30, xorRandom)
|
||||
local scale = gaussianRandomRangeRG(scaleValue, scaleValue * 0.15, scaleValue * 0.70, scaleValue * 1.30, xorRandom)
|
||||
unit.scale = scale
|
||||
end
|
||||
if unit.tint then
|
||||
unit.tint = calculateRGBa(unit.tint, tier, true)
|
||||
unit.tint = calculateRGBa(unit.tint, tier, true, invert)
|
||||
end
|
||||
if unit.tint2 then
|
||||
unit.tint2 = calculateRGBa(unit.tint2, tier, true)
|
||||
@ -793,7 +814,7 @@ function swarmUtils.buildEntitySpawner(template)
|
||||
unitSpawner.name = unitSpawner.name .. "-v" .. i .. "-t" .. tier
|
||||
unitSpawner.effectiveLevel = effectiveLevel
|
||||
unitSpawner.variation = i
|
||||
generateApperance(unitSpawner)
|
||||
generateApperance(unitSpawner, true)
|
||||
fillEntityTemplate(unitSpawner)
|
||||
|
||||
if unitSpawner.autoplace then
|
||||
|
@ -394,6 +394,8 @@ function biterFunctions.makeUnitSpawner(attributes)
|
||||
map_generator_bounding_box = {{-4.2 * attributes.scale, -3.2 * attributes.scale}, {3.2 * attributes.scale, 3.2 * attributes.scale}},
|
||||
corpse = makeUnitSpawnerCorpse(attributes),
|
||||
dying_explosion = attributes.explosion or "blood-explosion-huge",
|
||||
min_darkness_to_spawn = attributes.minSpawnDarkness or 0,
|
||||
max_darkness_to_spawn = attributes.maxSpawnDarkness or 1,
|
||||
dying_trigger_effect = attributes.dyingEffect,
|
||||
max_count_of_owned_units = attributes.unitsOwned or 7,
|
||||
max_friends_around_to_spawn = attributes.unitsToSpawn or 5,
|
||||
|
Loading…
x
Reference in New Issue
Block a user