mirror of
https://github.com/veden/Rampant.git
synced 2025-03-17 20:58:35 +02:00
FACTO-240: Hives now produce upper tier units instead of prototyp entity spawning
This commit is contained in:
parent
d4fed8bc0c
commit
984f5afcbe
@ -15,6 +15,7 @@ Version: 3.2.0
|
||||
- Added a mod setting to toggle the purple settler cloud
|
||||
- When enemies die there body parts can fill in water tiles. Can be disabled in mod settings.
|
||||
- Added base mutation history to prevent mutations to previously mutated factions. Configurable amount of history in Mod Settings.
|
||||
- Hives now produce a single upper tier unit
|
||||
Compatibility:
|
||||
- Added interface for adding and removing excluded surfaces
|
||||
Tweaks:
|
||||
|
3
data.lua
3
data.lua
@ -151,7 +151,4 @@ end
|
||||
|
||||
if settings.startup["rampant--newEnemies"].value then
|
||||
swarmUtils.processFactions()
|
||||
swarmUtils.generateSpawnerProxy(data.raw["unit-spawner"]["neutral-biter-spawner-v1-t"..constants.TIERS.."-rampant"].result_units)
|
||||
else
|
||||
swarmUtils.generateSpawnerProxy(data.raw["unit-spawner"]["biter-spawner"].result_units)
|
||||
end
|
||||
|
@ -34,7 +34,6 @@ local MapUtils = require("MapUtils")
|
||||
|
||||
local TIERS = Constants.TIERS
|
||||
local EVO_TO_TIER_MAPPING = Constants.EVO_TO_TIER_MAPPING
|
||||
local PROXY_ENTITY_LOOKUP = Constants.PROXY_ENTITY_LOOKUP
|
||||
local BUILDING_HIVE_TYPE_LOOKUP = Constants.BUILDING_HIVE_TYPE_LOOKUP
|
||||
local COST_LOOKUP = Constants.COST_LOOKUP
|
||||
local UPGRADE_LOOKUP = Constants.UPGRADE_LOOKUP
|
||||
@ -289,8 +288,7 @@ function BaseUtils.findEntityUpgrade(baseAlignment, currentEvo, evoIndex, origin
|
||||
and
|
||||
(
|
||||
(
|
||||
(roll <= 0.01) and
|
||||
not PROXY_ENTITY_LOOKUP[entityName]
|
||||
(roll <= 0.01)
|
||||
)
|
||||
or
|
||||
(
|
||||
|
@ -544,13 +544,11 @@ constants.FACTION_SET[#constants.FACTION_SET+1] = {
|
||||
majorResistances = {},
|
||||
minorResistances = {},
|
||||
acceptRate = {tierStart=2, tierEnd=10, tierChanceStart=0.001, tierChanceEnd=0.0175},
|
||||
attributes = {"spawnDuringDays"},
|
||||
attributes = {"spawnDuringDays", "singleUnit"},
|
||||
drops = {"nilArtifact"},
|
||||
buildSets = {
|
||||
{name="biter-spawner", tierStart=1, tierEnd=10, tierChanceStart=0.15, tierChanceEnd=0.3},
|
||||
{name="spitter-spawner", tierStart=1, tierEnd=10, tierChanceStart=0.15, tierChanceEnd=0.3},
|
||||
{name="turret", tierStart=1, tierEnd=10, tierChanceStart=0.8, tierChanceEnd=0.57},
|
||||
{name="hive", tierStart=2, tierEnd=10, tierChanceStart=0.002, tierChanceEnd=0.02}
|
||||
{name="biter", tierStart=1, tierEnd=10},
|
||||
{name="spitter", tierStart=1, tierEnd=10}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -630,13 +628,11 @@ if settings.startup["rampant--acidEnemy"].value then
|
||||
majorResistances = {"acid"},
|
||||
minorResistances = {"poison"},
|
||||
acceptRate = {tierStart=2, tierEnd=10, tierChanceStart=0.001, tierChanceEnd=0.0175},
|
||||
attributes = {"spawnDuringDays"},
|
||||
attributes = {"spawnDuringDays", "singleUnit"},
|
||||
drops = {"greenArtifact"},
|
||||
buildSets = {
|
||||
{name="biter-spawner", tierStart=1, tierEnd=10, tierChanceStart=0.15, tierChanceEnd=0.3},
|
||||
{name="spitter-spawner", tierStart=1, tierEnd=10, tierChanceStart=0.15, tierChanceEnd=0.3},
|
||||
{name="turret", tierStart=1, tierEnd=10, tierChanceStart=0.8, tierChanceEnd=0.57},
|
||||
{name="hive", tierStart=2, tierEnd=10, tierChanceStart=0.002, tierChanceEnd=0.02}
|
||||
{name="biter", tierStart=1, tierEnd=10},
|
||||
{name="spitter", tierStart=1, tierEnd=10}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -708,14 +704,12 @@ if settings.startup["rampant--laserEnemy"].value then
|
||||
type = "hive",
|
||||
name = "hive",
|
||||
majorResistances = {"laser", "electric"},
|
||||
attributes = {"spawnDuringDays"},
|
||||
attributes = {"spawnDuringDays", "singleUnit"},
|
||||
acceptRate = {tierStart=2, tierEnd=10, tierChanceStart=0.001, tierChanceEnd=0.0175},
|
||||
drops = {"blueArtifact"},
|
||||
buildSets = {
|
||||
{name="biter-spawner", tierStart=1, tierEnd=10, tierChanceStart=0.15, tierChanceEnd=0.3},
|
||||
{name="spitter-spawner", tierStart=1, tierEnd=10, tierChanceStart=0.15, tierChanceEnd=0.3},
|
||||
{name="turret", tierStart=1, tierEnd=10, tierChanceStart=0.8, tierChanceEnd=0.57},
|
||||
{name="hive", tierStart=2, tierEnd=10, tierChanceStart=0.002, tierChanceEnd=0.02}
|
||||
{name="biter", tierStart=1, tierEnd=10},
|
||||
{name="spitter", tierStart=1, tierEnd=10}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -793,14 +787,12 @@ if settings.startup["rampant--fireEnemy"].value then
|
||||
name = "hive",
|
||||
majorResistances = {"fire", "acid"},
|
||||
minorResistances = {},
|
||||
attributes = {"spawnDuringDays"},
|
||||
attributes = {"spawnDuringDays", "singleUnit"},
|
||||
acceptRate = {tierStart=2, tierEnd=10, tierChanceStart=0.001, tierChanceEnd=0.0175},
|
||||
drops = {"redArtifact"},
|
||||
buildSets = {
|
||||
{name="biter-spawner", tierStart=1, tierEnd=10, tierChanceStart=0.15, tierChanceEnd=0.3},
|
||||
{name="spitter-spawner", tierStart=1, tierEnd=10, tierChanceStart=0.15, tierChanceEnd=0.3},
|
||||
{name="turret", tierStart=1, tierEnd=10, tierChanceStart=0.8, tierChanceEnd=0.57},
|
||||
{name="hive", tierStart=2, tierEnd=10, tierChanceStart=0.002, tierChanceEnd=0.02}
|
||||
{name="biter", tierStart=1, tierEnd=10},
|
||||
{name="spitter", tierStart=1, tierEnd=10}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -857,13 +849,11 @@ if settings.startup["rampant--infernoEnemy"].value then
|
||||
name = "hive",
|
||||
majorResistances = {"fire", "acid"},
|
||||
minorResistances = {},
|
||||
attributes = {"spawnDuringDays"},
|
||||
attributes = {"spawnDuringDays", "singleUnit"},
|
||||
acceptRate = {tierStart=2, tierEnd=10, tierChanceStart=0.001, tierChanceEnd=0.0175},
|
||||
drops = {"orangeArtifact"},
|
||||
buildSets = {
|
||||
{name="spitter-spawner", tierStart=1, tierEnd=10, tierChanceStart=0.15, tierChanceEnd=0.3},
|
||||
{name="turret", tierStart=1, tierEnd=10, tierChanceStart=0.8, tierChanceEnd=0.57},
|
||||
{name="hive", tierStart=2, tierEnd=10, tierChanceStart=0.002, tierChanceEnd=0.02}
|
||||
{name="spitter", tierStart=1, tierEnd=10}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -926,13 +916,11 @@ if settings.startup["rampant--waspEnemy"].value then
|
||||
{
|
||||
type = "hive",
|
||||
name = "hive",
|
||||
attributes = {"spawnDuringDays"},
|
||||
attributes = {"spawnDuringDays", "singleUnit"},
|
||||
acceptRate = {tierStart=2, tierEnd=10, tierChanceStart=0.001, tierChanceEnd=0.0175},
|
||||
drops = {"purpleArtifact"},
|
||||
buildSets = {
|
||||
{name="spitter-spawner", tierStart=1, tierEnd=10, tierChanceStart=0.15, tierChanceEnd=0.3},
|
||||
{name="turret", tierStart=1, tierEnd=10, tierChanceStart=0.8, tierChanceEnd=0.57},
|
||||
{name="hive", tierStart=2, tierEnd=10, tierChanceStart=0.002, tierChanceEnd=0.02}
|
||||
{name="spitter", tierStart=1, tierEnd=10}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1004,13 +992,11 @@ if settings.startup["rampant--spawnerEnemy"].value then
|
||||
{
|
||||
type = "hive",
|
||||
name = "hive",
|
||||
attributes = {"spawnDuringDays"},
|
||||
attributes = {"spawnDuringDays", "singleUnit"},
|
||||
acceptRate = {tierStart=2, tierEnd=10, tierChanceStart=0.001, tierChanceEnd=0.0175},
|
||||
drops = {"orangeArtifact"},
|
||||
buildSets = {
|
||||
{name="spitter-spawner", tierStart=1, tierEnd=10, tierChanceStart=0.15, tierChanceEnd=0.3},
|
||||
{name="turret", tierStart=1, tierEnd=10, tierChanceStart=0.8, tierChanceEnd=0.57},
|
||||
{name="hive", tierStart=2, tierEnd=10, tierChanceStart=0.002, tierChanceEnd=0.02}
|
||||
{name="spitter", tierStart=1, tierEnd=10}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1067,13 +1053,11 @@ if settings.startup["rampant--electricEnemy"].value then
|
||||
name = "hive",
|
||||
majorResistances = {"electric"},
|
||||
minorResistances = {"laser"},
|
||||
attributes = {"spawnDuringDays"},
|
||||
attributes = {"spawnDuringDays", "singleUnit"},
|
||||
acceptRate = {tierStart=2, tierEnd=10, tierChanceStart=0.001, tierChanceEnd=0.0175},
|
||||
drops = {"blueArtifact"},
|
||||
buildSets = {
|
||||
{name="biter-spawner", tierStart=1, tierEnd=10, tierChanceStart=0.15, tierChanceEnd=0.3},
|
||||
{name="turret", tierStart=1, tierEnd=10, tierChanceStart=0.8, tierChanceEnd=0.57},
|
||||
{name="hive", tierStart=2, tierEnd=10, tierChanceStart=0.002, tierChanceEnd=0.02}
|
||||
{name="biter", tierStart=1, tierEnd=10}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1131,13 +1115,11 @@ if settings.startup["rampant--physicalEnemy"].value then
|
||||
name = "hive",
|
||||
majorResistances = {"physical", "explosion"},
|
||||
minorResistances = {"laser", "electric"},
|
||||
attributes = {"highHealth", "bigger", "spawnDuringDays"},
|
||||
attributes = {"highHealth", "bigger", "spawnDuringDays", "singleUnit"},
|
||||
acceptRate = {tierStart=2, tierEnd=10, tierChanceStart=0.001, tierChanceEnd=0.0175},
|
||||
drops = {"redArtifact"},
|
||||
buildSets = {
|
||||
{name="biter-spawner", tierStart=1, tierEnd=10, tierChanceStart=0.15, tierChanceEnd=0.3},
|
||||
{name="turret", tierStart=1, tierEnd=10, tierChanceStart=0.8, tierChanceEnd=0.57},
|
||||
{name="hive", tierStart=2, tierEnd=10, tierChanceStart=0.002, tierChanceEnd=0.02}
|
||||
{name="biter", tierStart=1, tierEnd=10}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1196,13 +1178,11 @@ if settings.startup["rampant--trollEnemy"].value then
|
||||
name = "hive",
|
||||
minorResistances = {"physical", "explosion"},
|
||||
majorWeaknesses = {"fire"},
|
||||
attributes = {"highestHealth", "bigger", "highRegen","spawnDuringDays"},
|
||||
attributes = {"highestHealth", "bigger", "highRegen","spawnDuringDays", "singleUnit"},
|
||||
acceptRate = {tierStart=2, tierEnd=10, tierChanceStart=0.001, tierChanceEnd=0.0175},
|
||||
drops = {"greenArtifact"},
|
||||
buildSets = {
|
||||
{name="biter-spawner", tierStart=1, tierEnd=10, tierChanceStart=0.15, tierChanceEnd=0.3},
|
||||
{name="turret", tierStart=1, tierEnd=10, tierChanceStart=0.8, tierChanceEnd=0.57},
|
||||
{name="hive", tierStart=2, tierEnd=10, tierChanceStart=0.002, tierChanceEnd=0.02}
|
||||
{name="biter", tierStart=1, tierEnd=10}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1264,13 +1244,11 @@ if settings.startup["rampant--poisonEnemy"].value then
|
||||
majorResistances = {"poison"},
|
||||
minorResistances = {"fire"},
|
||||
minorWeaknesses = {"electric", "explosion", "laser"},
|
||||
attributes = {"spawnDuringDays"},
|
||||
attributes = {"spawnDuringDays", "singleUnit"},
|
||||
acceptRate = {tierStart=2, tierEnd=10, tierChanceStart=0.001, tierChanceEnd=0.0175},
|
||||
drops = {"greenArtifact"},
|
||||
buildSets = {
|
||||
{name="biter-spawner", tierStart=1, tierEnd=10, tierChanceStart=0.15, tierChanceEnd=0.3},
|
||||
{name="turret", tierStart=1, tierEnd=10, tierChanceStart=0.8, tierChanceEnd=0.57},
|
||||
{name="hive", tierStart=2, tierEnd=10, tierChanceStart=0.002, tierChanceEnd=0.02}
|
||||
{name="biter", tierStart=1, tierEnd=10}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1327,13 +1305,11 @@ if settings.startup["rampant--suicideEnemy"].value then
|
||||
name = "hive",
|
||||
majorResistances = {"explosion"},
|
||||
minorResistances = {"poison"},
|
||||
attributes = {"spawnDuringDays"},
|
||||
attributes = {"spawnDuringDays", "singleUnit"},
|
||||
acceptRate = {tierStart=2, tierEnd=10, tierChanceStart=0.001, tierChanceEnd=0.0175},
|
||||
drops = {"yellowArtifact"},
|
||||
buildSets = {
|
||||
{name="biter-spawner", tierStart=1, tierEnd=10, tierChanceStart=0.15, tierChanceEnd=0.3},
|
||||
{name="turret", tierStart=1, tierEnd=10, tierChanceStart=0.8, tierChanceEnd=0.57},
|
||||
{name="hive", tierStart=2, tierEnd=10, tierChanceStart=0.002, tierChanceEnd=0.02}
|
||||
{name="biter", tierStart=1, tierEnd=10}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1389,13 +1365,11 @@ if settings.startup["rampant--nuclearEnemy"].value then
|
||||
name = "hive",
|
||||
majorResistances = {"explosion"},
|
||||
minorResistances = {"fire"},
|
||||
attributes = {"spawnDuringDays"},
|
||||
attributes = {"spawnDuringDays", "singleUnit"},
|
||||
acceptRate = {tierStart=2, tierEnd=10, tierChanceStart=0.001, tierChanceEnd=0.0175},
|
||||
drops = {"yellowArtifact"},
|
||||
buildSets = {
|
||||
{name="biter-spawner", tierStart=1, tierEnd=10, tierChanceStart=0.15, tierChanceEnd=0.3},
|
||||
{name="turret", tierStart=1, tierEnd=10, tierChanceStart=0.8, tierChanceEnd=0.57},
|
||||
{name="hive", tierStart=2, tierEnd=10, tierChanceStart=0.002, tierChanceEnd=0.02}
|
||||
{name="biter", tierStart=1, tierEnd=10}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1451,13 +1425,11 @@ if settings.startup["rampant--energyThiefEnemy"].value then
|
||||
type = "hive",
|
||||
name = "hive",
|
||||
majorResistances = {"electric", "laser"},
|
||||
attributes = {"spawnDuringDays"},
|
||||
attributes = {"spawnDuringDays", "singleUnit"},
|
||||
acceptRate = {tierStart=2, tierEnd=10, tierChanceStart=0.001, tierChanceEnd=0.0175},
|
||||
drops = {"blueArtifact"},
|
||||
buildSets = {
|
||||
{name="biter-spawner", tierStart=1, tierEnd=10, tierChanceStart=0.15, tierChanceEnd=0.3},
|
||||
{name="turret", tierStart=1, tierEnd=10, tierChanceStart=0.8, tierChanceEnd=0.57},
|
||||
{name="hive", tierStart=2, tierEnd=10, tierChanceStart=0.002, tierChanceEnd=0.02}
|
||||
{name="biter", tierStart=1, tierEnd=10}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1536,14 +1508,12 @@ if settings.startup["rampant--fastEnemy"].value then
|
||||
name = "hive",
|
||||
majorResistances = {},
|
||||
minorResistances = {"explosion"},
|
||||
attributes = {"quickSpawning", "spawnDuringDays"},
|
||||
attributes = {"quickSpawning", "spawnDuringDays", "singleUnit"},
|
||||
acceptRate = {tierStart=2, tierEnd=10, tierChanceStart=0.001, tierChanceEnd=0.0175},
|
||||
drops = {"purpleArtifact"},
|
||||
buildSets = {
|
||||
{name="biter-spawner", tierStart=1, tierEnd=10, tierChanceStart=0.15, tierChanceEnd=0.3},
|
||||
{name="spitter-spawner", tierStart=1, tierEnd=10, tierChanceStart=0.15, tierChanceEnd=0.3},
|
||||
{name="turret", tierStart=1, tierEnd=10, tierChanceStart=0.8, tierChanceEnd=0.57},
|
||||
{name="hive", tierStart=2, tierEnd=10, tierChanceStart=0.002, tierChanceEnd=0.02}
|
||||
{name="spitter", tierStart=1, tierEnd=10},
|
||||
{name="biter", tierStart=1, tierEnd=10}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1619,8 +1589,6 @@ local rg = mathUtils.xorRandom(settings.startup["rampant--enemySeed"].value)
|
||||
|
||||
local alignmentSet = {}
|
||||
constants.EVOLUTION_TABLE_ALIGNMENT = alignmentSet -- evolutionTableAlignment
|
||||
local buildingSpaceLookup = {}
|
||||
constants.BUILDING_SPACE_LOOKUP = buildingSpaceLookup -- buildingSpaceLookup
|
||||
local enemyAlignmentLookup = {}
|
||||
constants.ENEMY_ALIGNMENT_LOOKUP = enemyAlignmentLookup -- enemyAlignmentLookup
|
||||
local upgradeLookup = {}
|
||||
@ -1631,8 +1599,6 @@ local costLookup = {}
|
||||
constants.COST_LOOKUP = costLookup --costLookup
|
||||
local buildingHiveTypeLookup = {}
|
||||
constants.BUILDING_HIVE_TYPE_LOOKUP = buildingHiveTypeLookup --buildingHiveTypeLookup
|
||||
local proxyEntityLookup = {}
|
||||
constants.PROXY_ENTITY_LOOKUP = proxyEntityLookup --proxyEntityLookup
|
||||
local vanillaEntityLookup = {}
|
||||
constants.VANILLA_ENTITY_TYPE_LOOKUP = vanillaEntityLookup --vanillaEntityTypeLookup
|
||||
local entitySkipCountLookup = {}
|
||||
@ -1728,14 +1694,8 @@ for i=1,#constants.FACTION_SET do
|
||||
do
|
||||
local entry = faction.type .. "-" .. building.name .. "-v" .. v .. "-t" .. t .. "-rampant"
|
||||
enemyAlignmentLookup[entry] = faction.type
|
||||
local proxyEntity = "entity-proxy-" .. building.type .. "-t" .. t .. "-rampant"
|
||||
proxyEntityLookup[proxyEntity] = true
|
||||
buildingSpaceLookup[entry] = proxyEntity
|
||||
costLookup[entry] = constants.HIVE_BUILDINGS_COST[building.type]
|
||||
buildingHiveTypeLookup[entry] = building.type
|
||||
if not buildingHiveTypeLookup[proxyEntity] then
|
||||
buildingHiveTypeLookup[proxyEntity] = building.type
|
||||
end
|
||||
variationSet[#variationSet+1] = entry
|
||||
for _,unit in pairs(faction.units) do
|
||||
if isMember(unit.attributes, "skipKillCount") then
|
||||
|
@ -52,11 +52,8 @@ local AI_VENGENCE_SQUAD_COST = Constants.AI_VENGENCE_SQUAD_COST
|
||||
local COOLDOWN_DRAIN = Constants.COOLDOWN_DRAIN
|
||||
local COOLDOWN_RALLY = Constants.COOLDOWN_RALLY
|
||||
local COOLDOWN_RETREAT = Constants.COOLDOWN_RETREAT
|
||||
local PROXY_ENTITY_LOOKUP = Constants.PROXY_ENTITY_LOOKUP
|
||||
local BASE_DISTANCE_TO_EVO_INDEX = Constants.BASE_DISTANCE_TO_EVO_INDEX
|
||||
|
||||
local BUILDING_SPACE_LOOKUP = Constants.BUILDING_SPACE_LOOKUP
|
||||
|
||||
-- imported functions
|
||||
|
||||
local findInsertionPoint = MapUtils.findInsertionPoint
|
||||
@ -555,7 +552,7 @@ function Processor.processPendingUpgrades(tick)
|
||||
entityData.evolve)
|
||||
|
||||
local entityName = entity.name
|
||||
if not name and PROXY_ENTITY_LOOKUP[entityName] then
|
||||
if not name then
|
||||
entity.destroy()
|
||||
return
|
||||
elseif (name == entityName) or not name then
|
||||
@ -568,7 +565,7 @@ function Processor.processPendingUpgrades(tick)
|
||||
|
||||
unregisterEnemyBaseStructure(map, entity, nil, true)
|
||||
entity.destroy()
|
||||
local foundPosition = surface.find_non_colliding_position(BUILDING_SPACE_LOOKUP[name],
|
||||
local foundPosition = surface.find_non_colliding_position(name,
|
||||
position,
|
||||
2,
|
||||
1,
|
||||
|
@ -71,11 +71,8 @@ acid-ball-3-direction-acid-fire-rampant=Acid Pool
|
||||
acid-ball-4-acid-fire-rampant=Acid Pool
|
||||
acid-ball-5-acid-fire-rampant=Acid Pool
|
||||
|
||||
spawner-proxy-1-rampant=Spawner Proxy
|
||||
spawner-proxy-2-rampant=Spawner Proxy
|
||||
spawner-proxy-3-rampant=Spawner Proxy
|
||||
|
||||
[entity-description]
|
||||
hive=Spawns enemy structures
|
||||
|
||||
[mod-setting-name]
|
||||
rampant--scaleParticleCount=Optimization: Scale blood particle count
|
||||
|
@ -534,15 +534,15 @@ end
|
||||
local function unitSetToProbabilityTable(unitSet, tier)
|
||||
local result = {}
|
||||
|
||||
fillUnitTable(tier, result, unitSet, 1, {{0, 1}, {0.65, 0.0}})
|
||||
fillUnitTable(tier, result, unitSet, 2, {{0.3, 0}, {0.35, 0.5}, {0.80, 0.0}})
|
||||
fillUnitTable(tier, result, unitSet, 3, {{0.4, 0}, {0.45, 0.5}, {0.90, 0.0}})
|
||||
fillUnitTable(tier, result, unitSet, 4, {{0.5, 0}, {0.55, 0.5}, {0.90, 0.0}})
|
||||
fillUnitTable(tier, result, unitSet, 5, {{0.6, 0}, {0.65, 0.5}, {0.95, 0.0}})
|
||||
fillUnitTable(tier, result, unitSet, 6, {{0.7, 0}, {0.75, 0.5}, {0.975, 0.0}})
|
||||
fillUnitTable(tier, result, unitSet, 7, {{0.8, 0}, {0.825, 0.5}, {0.975, 0.0}})
|
||||
fillUnitTable(tier, result, unitSet, 8, {{0.85, 0}, {0.875, 0.5}, {0.975, 0.0}})
|
||||
fillUnitTable(tier, result, unitSet, 9, {{0.90, 0}, {0.925, 0.5}, {0.975, 0.0}})
|
||||
fillUnitTable(tier, result, unitSet, 1, {{0, 1}, {0.50, 0.0}})
|
||||
fillUnitTable(tier, result, unitSet, 2, {{0.3, 0}, {0.35, 1.0}, {0.80, 0.0}})
|
||||
fillUnitTable(tier, result, unitSet, 3, {{0.4, 0}, {0.45, 1.0}, {0.90, 0.0}})
|
||||
fillUnitTable(tier, result, unitSet, 4, {{0.5, 0}, {0.55, 1.0}, {0.90, 0.0}})
|
||||
fillUnitTable(tier, result, unitSet, 5, {{0.6, 0}, {0.65, 1.0}, {0.95, 0.0}})
|
||||
fillUnitTable(tier, result, unitSet, 6, {{0.7, 0}, {0.75, 1.0}, {0.975, 0.0}})
|
||||
fillUnitTable(tier, result, unitSet, 7, {{0.8, 0}, {0.825, 1.0}, {0.975, 0.0}})
|
||||
fillUnitTable(tier, result, unitSet, 8, {{0.85, 0}, {0.875, 1.0}, {0.975, 0.0}})
|
||||
fillUnitTable(tier, result, unitSet, 9, {{0.90, 0}, {0.925, 1.0}, {0.975, 0.0}})
|
||||
fillUnitTable(tier, result, unitSet, 10, {{0.93, 0}, {1, 1.0}})
|
||||
|
||||
return result
|
||||
@ -822,6 +822,9 @@ local function fillEntityTemplate(entity)
|
||||
entity.maxSpawnDarkness = 0.45
|
||||
elseif (attribute == "followsPlayer") then
|
||||
entity.followsPlayer = true
|
||||
elseif (attribute == "singleUnit") then
|
||||
entity.unitsOwned = 1
|
||||
entity.unitsToSpawn = 30
|
||||
elseif (attribute == "stationary") then
|
||||
entity.movement = 0
|
||||
entity.distancePerFrame = 0
|
||||
@ -991,30 +994,7 @@ local function buildUnits(template)
|
||||
return unitSet
|
||||
end
|
||||
|
||||
local function buildEntities(entityTemplates)
|
||||
local unitSet = {}
|
||||
|
||||
for tier=1, TIERS do
|
||||
local effectiveLevel = TIER_UPGRADE_SET[tier]
|
||||
|
||||
local entityTemplate = entityTemplates[effectiveLevel]
|
||||
|
||||
for ei=1,#entityTemplate do
|
||||
local template = entityTemplate[ei]
|
||||
|
||||
local probability = deepcopy(propTables[tier])
|
||||
|
||||
for z=1,#probability do
|
||||
probability[z][2] = probability[z][2] * template[2]
|
||||
end
|
||||
unitSet[#unitSet+1] = {template[1] .. "-t" .. tier .. "-rampant", probability}
|
||||
end
|
||||
end
|
||||
|
||||
return unitSet
|
||||
end
|
||||
|
||||
local function buildEntitySpawner(template)
|
||||
local function buildEntitySpawner(template, tierBonus)
|
||||
local variations = constants.ENEMY_VARIATIONS
|
||||
|
||||
for tier=1, TIERS do
|
||||
@ -1027,6 +1007,11 @@ local function buildEntitySpawner(template)
|
||||
unitSpawner.effectiveLevel = effectiveLevel
|
||||
unitSpawner.variation = i
|
||||
generateApperance(unitSpawner, true)
|
||||
local unitTable = unitSetToProbabilityTable(
|
||||
template.unitSet,
|
||||
tier + (tierBonus or 0)
|
||||
)
|
||||
unitSpawner.unitSet = unitTable
|
||||
unitSpawner.death = (unitSpawner.deathGenerator and unitSpawner.deathGenerator(unitSpawner)) or nil
|
||||
fillEntityTemplate(unitSpawner)
|
||||
|
||||
@ -1564,7 +1549,7 @@ local function buildUnitSpawnerTemplate(faction, incomingTemplate, unitSets)
|
||||
return template
|
||||
end
|
||||
|
||||
local function buildHiveTemplate(faction, incomingTemplate)
|
||||
local function buildHiveTemplate(faction, incomingTemplate, unitSets)
|
||||
local template = deepcopy(incomingTemplate)
|
||||
|
||||
template.name = faction.type .. "-" .. template.name
|
||||
@ -1594,35 +1579,24 @@ local function buildHiveTemplate(faction, incomingTemplate)
|
||||
local unitSet = {}
|
||||
|
||||
for t=1,TIERS do
|
||||
local unitSetTier = unitSet[t]
|
||||
for i=1,#template.buildSets do
|
||||
local buildSet = template.buildSets[i]
|
||||
if (buildSet.tierStart <= t) and (t <= buildSet.tierEnd) then
|
||||
if not unitSetTier then
|
||||
unitSetTier = {}
|
||||
unitSet[t] = unitSetTier
|
||||
local activeUnitSet = unitSets[buildSet.name][t]
|
||||
local unitSetTier = unitSet[t]
|
||||
if unitSetTier then
|
||||
for b=1,#activeUnitSet do
|
||||
unitSetTier[#unitSetTier+1] = activeUnitSet[b]
|
||||
end
|
||||
else
|
||||
unitSet[t] = deepcopy(activeUnitSet)
|
||||
end
|
||||
|
||||
unitSetTier[#unitSetTier+1] = {
|
||||
"entity-proxy-" .. buildSet.name,
|
||||
mathUtils.linearInterpolation(
|
||||
(t-1)/9,
|
||||
buildSet.tierChanceStart,
|
||||
buildSet.tierChanceEnd
|
||||
)
|
||||
}
|
||||
end
|
||||
end
|
||||
local total = 0
|
||||
for i=1,#unitSetTier do
|
||||
total = total + unitSetTier[i][2]
|
||||
end
|
||||
for i=1,#unitSetTier do
|
||||
unitSetTier[i][2] = unitSetTier[i][2] / total
|
||||
end
|
||||
end
|
||||
|
||||
template.unitSet = buildEntities(unitSet)
|
||||
|
||||
template.unitSet = unitSet
|
||||
|
||||
if template.drops then
|
||||
template.drops = makeLootTables(template)
|
||||
@ -1631,58 +1605,6 @@ local function buildHiveTemplate(faction, incomingTemplate)
|
||||
return template
|
||||
end
|
||||
|
||||
local function generateSpawnerProxyTemplate(name, health, result_units)
|
||||
return {
|
||||
type = "unit-spawner",
|
||||
name = name,
|
||||
icon = "__base__/graphics/icons/biter-spawner.png",
|
||||
icon_size = 64,
|
||||
icon_mipmaps = 4,
|
||||
flags = {"placeable-player", "placeable-enemy", "not-repairable"},
|
||||
max_health = health,
|
||||
order="b-b-g",
|
||||
subgroup="enemies",
|
||||
loot = nil,
|
||||
resistances = nil,
|
||||
working_sound = nil,
|
||||
dying_sound = nil,
|
||||
damaged_trigger_effect = nil,
|
||||
healing_per_tick = -1,
|
||||
collision_box = nil,
|
||||
selection_box = nil,
|
||||
-- in ticks per 1 pu
|
||||
pollution_absorption_absolute = 10,
|
||||
pollution_absorption_proportional = 0.005,
|
||||
map_generator_bounding_box = nil,
|
||||
corpse = nil,
|
||||
dying_explosion = nil,
|
||||
dying_trigger_effect = nil,
|
||||
max_count_of_owned_units = 0,
|
||||
max_friends_around_to_spawn = 0,
|
||||
enemy_map_color = {r=0,g=0,b=0,a=0},
|
||||
animations = { filename = "__core__/graphics/empty.png", size = 1 },
|
||||
integration = nil,
|
||||
result_units = result_units,
|
||||
-- With zero evolution the spawn rate is 6 seconds, with max evolution it is 2.5 seconds
|
||||
spawning_cooldown = {360, 150},
|
||||
spawning_radius = 10,
|
||||
spawning_spacing = 3,
|
||||
max_spawn_shift = 0,
|
||||
max_richness_for_spawn_shift = 100,
|
||||
build_base_evolution_requirement = 0.0,
|
||||
call_for_help_radius = 50
|
||||
}
|
||||
end
|
||||
|
||||
function swarmUtils.generateSpawnerProxy(result_units)
|
||||
|
||||
data:extend({
|
||||
generateSpawnerProxyTemplate("spawner-proxy-1-rampant", 1 * 60 * 60, result_units),
|
||||
generateSpawnerProxyTemplate("spawner-proxy-2-rampant", 2 * 60 * 60, result_units),
|
||||
generateSpawnerProxyTemplate("spawner-proxy-3-rampant", 3 * 60 * 60, result_units)
|
||||
})
|
||||
end
|
||||
|
||||
function swarmUtils.processFactions()
|
||||
for i=1,#constants.FACTION_SET do
|
||||
local faction = constants.FACTION_SET[i]
|
||||
@ -1729,9 +1651,9 @@ function swarmUtils.processFactions()
|
||||
|
||||
buildWorm(template)
|
||||
elseif (building.type == "hive") then
|
||||
local template = buildHiveTemplate(faction, building)
|
||||
local template = buildHiveTemplate(faction, building, unitSets)
|
||||
|
||||
buildEntitySpawner(template)
|
||||
buildEntitySpawner(template, 5)
|
||||
elseif (building.type == "trap") then
|
||||
|
||||
elseif (building.type == "utility") then
|
||||
|
@ -13,145 +13,8 @@
|
||||
-- You should have received a copy of the GNU General Public License
|
||||
-- along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
local biterUtils = require("prototypes/utils/BiterUtils")
|
||||
local constants = require("libs/Constants")
|
||||
local smokeUtils = require("prototypes/utils/SmokeUtils")
|
||||
|
||||
local function generateCollisionBox(scale, entityType)
|
||||
if entityType == "turret" then
|
||||
return {
|
||||
{-1.1 * scale, -1.0 * scale},
|
||||
{1.1 * scale, 1.0 * scale}
|
||||
}
|
||||
elseif (entityType == "biter-spawner") or (entityType == "spitter-spawner") then
|
||||
return {
|
||||
{-3 * scale, -2 * scale},
|
||||
{2 * scale, 2 * scale}
|
||||
}
|
||||
elseif entityType == "hive" then
|
||||
return {
|
||||
{-3 * scale, -2 * scale},
|
||||
{2 * scale, 2 * scale}
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
local scales = {
|
||||
-- ["trap"] = {},
|
||||
-- ["utility"] = {},
|
||||
["spitter-spawner"] = {
|
||||
[1] = 0.70, [2] = 0.83, [3] = 0.96, [4] = 1.09, [5] = 1.22,
|
||||
[6] = 1.35, [7] = 1.48, [8] = 1.61, [9] = 1.74, [10] = 1.87
|
||||
},
|
||||
["biter-spawner"] = {
|
||||
[1] = 0.83, [2] = 0.96, [3] = 1.09, [4] = 1.22, [5] = 1.35,
|
||||
[6] = 1.48, [7] = 1.61, [8] = 1.74, [9] = 1.87, [10] = 2.0
|
||||
},
|
||||
["hive"] = {
|
||||
[1] = 1.35, [2] = 1.48, [3] = 1.61, [4] = 1.74, [5] = 1.87,
|
||||
[6] = 2.0, [7] = 2.13, [8] = 2.26, [9] = 2.39, [10] = 2.52
|
||||
},
|
||||
["turret"] = {
|
||||
[1] = 0.635, [2] = 0.765, [3] = 0.895, [4] = 1.025, [5] = 1.155,
|
||||
[6] = 1.285, [7] = 1.415, [8] = 1.545, [9] = 1.675, [10] = 1.805
|
||||
}
|
||||
}
|
||||
|
||||
local subTypes = constants.HIVE_BUILDINGS_TYPES
|
||||
|
||||
|
||||
for si=1,#subTypes do
|
||||
local st = subTypes[si]
|
||||
if scales[st] then
|
||||
for t=1,constants.TIERS do
|
||||
-- local scale = scales[st][t]
|
||||
local scale = scales["biter-spawner"][t]
|
||||
|
||||
local eggPicture
|
||||
if (st == "turret") then
|
||||
eggPicture = {
|
||||
filename = "__base__/graphics/entity/spawner/hr-spawner-idle-integration.png",
|
||||
-- priority = "very-low",
|
||||
-- flags = {"low-object"},
|
||||
draw_as_shadow = true,
|
||||
scale = 0.25,
|
||||
width = 522,
|
||||
height = 380
|
||||
}
|
||||
elseif (st == "biter-spawner") or (st == "spitter-spawner") then
|
||||
eggPicture = {
|
||||
filename = "__base__/graphics/entity/spawner/hr-spawner-idle-integration.png",
|
||||
-- priority = "very-low",
|
||||
-- flags = {"low-object"},
|
||||
draw_as_shadow = true,
|
||||
scale = 0.5,
|
||||
width = 522,
|
||||
height = 380
|
||||
}
|
||||
elseif (st == "hive") then
|
||||
eggPicture = {
|
||||
filename = "__base__/graphics/entity/spawner/hr-spawner-idle-integration.png",
|
||||
-- priority = "very-low",
|
||||
-- flags = {"low-object"},
|
||||
draw_as_shadow = true,
|
||||
scale = 0.75,
|
||||
width = 522,
|
||||
height = 380
|
||||
}
|
||||
-- else
|
||||
-- eggPicture = {
|
||||
-- filename = "__core__/graphics/empty.png",
|
||||
-- priority = "extra-high",
|
||||
-- width = 1,
|
||||
-- height = 1
|
||||
-- }
|
||||
end
|
||||
|
||||
data:extend(
|
||||
{
|
||||
{
|
||||
type = "simple-entity-with-force",
|
||||
name = "entity-proxy-" .. st .. "-t" .. t .. "-rampant",
|
||||
localised_name = biterUtils.getLocalisedName({
|
||||
faction="entity-proxy",
|
||||
unit_name=st,
|
||||
tier=t,
|
||||
isRampant=true
|
||||
}),
|
||||
icon = "__base__/graphics/icons/steel-chest.png",
|
||||
icon_size = 32,
|
||||
flags = {},
|
||||
build_base_evolution_requirement = 0.08 * (t-1),
|
||||
collision_mask = {"player-layer", "object-layer", "water-tile", "train-layer"},
|
||||
minable = nil,
|
||||
max_health = 300 * t,
|
||||
corpse = nil,
|
||||
collision_box = generateCollisionBox(scale, "biter-spawner"),
|
||||
selection_box = generateCollisionBox(scale, "biter-spawner"),
|
||||
|
||||
picture = eggPicture,
|
||||
|
||||
created_effect = {
|
||||
{
|
||||
type = "direct",
|
||||
action_delivery = {
|
||||
type = "instant",
|
||||
source_effects = {
|
||||
type = "script",
|
||||
effect_id = "hive-spawned--rampant"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
smokeUtils.makeNewCloud(
|
||||
{
|
||||
name = "build-clear",
|
||||
|
@ -281,6 +281,17 @@ function biterUtils.getLocalisedName(attributes)
|
||||
return {attributes.name .. "-rampant"}
|
||||
end
|
||||
|
||||
function biterUtils.getLocalisedDescription(attributes)
|
||||
if attributes.isRampant then
|
||||
return {
|
||||
"",
|
||||
{"entity-description."..attributes.unit_name}
|
||||
}
|
||||
end
|
||||
|
||||
return {attributes.name .. "-rampant"}
|
||||
end
|
||||
|
||||
function biterUtils.makeBiter(attributes)
|
||||
local resistances = {}
|
||||
for k,v in pairs(attributes.resistances) do
|
||||
@ -410,6 +421,7 @@ function biterUtils.makeUnitSpawner(attributes)
|
||||
type = "unit-spawner",
|
||||
name = attributes.name .. "-rampant",
|
||||
localised_name = biterUtils.getLocalisedName(attributes),
|
||||
localised_description = biterUtils.getLocalisedDescription(attributes),
|
||||
icon = "__base__/graphics/icons/biter-spawner.png",
|
||||
icon_size = 64,
|
||||
icon_mipmaps = 4,
|
||||
|
Loading…
x
Reference in New Issue
Block a user