1
0
mirror of https://github.com/veden/Rampant.git synced 2025-03-11 14:49:32 +02:00

fixed naming and bobs

This commit is contained in:
Aaron Veden 2018-02-05 17:50:36 -08:00
parent ace8a4a90c
commit a2c0adec14
7 changed files with 45 additions and 30 deletions

View File

@ -197,10 +197,10 @@ function upgrade.attempt(natives)
game.surfaces[1].print("Rampant - Version 0.16.16")
global.version = constants.VERSION_51
end
if (global.version < constants.VERSION_52) then
if (global.version < constants.VERSION_53) then
game.surfaces[1].print("Rampant - Version 0.16.17")
global.version = constants.VERSION_52
game.surfaces[1].print("Rampant - Version 0.16.18")
global.version = constants.VERSION_53
end
return starting ~= global.version, natives

View File

@ -1,3 +1,10 @@
---------------------------------------------------------------------------------------------------
Version: 0.16.18
Date: 2. 05. 2018
Bugfixes:
- Fixed the enemy naming so the enemy tiers can be changed without losing enemies (https://forums.factorio.com/viewtopic.php?f=94&t=31445&start=240#p340944)
- Fixed bob enemies load error (https://forums.factorio.com/viewtopic.php?f=94&t=31445&start=240#p340897)
---------------------------------------------------------------------------------------------------
Version: 0.16.17
Date: 2. 02. 2018

View File

@ -1,7 +1,7 @@
{
"name" : "Rampant",
"factorio_version" : "0.16",
"version" : "0.16.17",
"version" : "0.16.18",
"title" : "Rampant",
"author" : "Veden",
"homepage" : "https://forums.factorio.com/viewtopic.php?f=94&t=31445",

View File

@ -10,8 +10,8 @@ local bobsUnits = require("BobsBaseUtils")
-- constants
local TIER_SET_10 = constants.TIER_SET_10
local TIER_SET_5 = constants.TIER_SET_5
local TIER_NAMING_SET_10 = constants.TIER_NAMING_SET_10
local TIER_NAMING_SET_5 = constants.TIER_NAMING_SET_5
local ENABLED_BOBS_UNITS = constants.ENABLED_BOBS_UNITS
local ENABLED_NE_UNITS = constants.ENABLED_NE_UNITS
@ -382,7 +382,7 @@ local function processUnitClass(biterVariation, biterTier, spitterVariation, spi
local position = { x = 0, y = 0 }
for tier=1,biterTier do
local t = ((biterTier == 5) and TIER_SET_5[tier]) or TIER_SET_10[tier]
local t = ((biterTier == 5) and TIER_NAMING_SET_5[tier]) or TIER_NAMING_SET_10[tier]
for v=1,biterVariation do
local entity = surface.create_entity({
name= baseAlignmentString .. "-biter-nest-v" .. v .. "-t" .. t .. "-rampant",
@ -393,7 +393,7 @@ local function processUnitClass(biterVariation, biterTier, spitterVariation, spi
end
end
for tier=1,spitterTier do
local t = ((spitterTier == 5) and TIER_SET_5[tier]) or TIER_SET_10[tier]
local t = ((spitterTier == 5) and TIER_NAMING_SET_5[tier]) or TIER_NAMING_SET_10[tier]
for v=1,spitterVariation do
local entity = surface.create_entity({
name=baseAlignmentString .. "-spitter-nest-v" .. v .. "-t" .. t .. "-rampant",
@ -404,7 +404,7 @@ local function processUnitClass(biterVariation, biterTier, spitterVariation, spi
end
end
for tier=1,wormTier do
local t = ((wormTier == 5) and TIER_SET_5[tier]) or TIER_SET_10[tier]
local t = ((wormTier == 5) and TIER_NAMING_SET_5[tier]) or TIER_NAMING_SET_10[tier]
for v=1,wormVariation do
local entity = surface.create_entity({
name=baseAlignmentString .. "-worm-v" .. v .. "-t" .. t .. "-rampant",

View File

@ -20,7 +20,7 @@ constants.VERSION_38 = 38
constants.VERSION_41 = 41
constants.VERSION_44 = 44
constants.VERSION_51 = 51
constants.VERSION_52 = 52
constants.VERSION_53 = 53
-- misc
@ -347,8 +347,11 @@ for i=tierStart,tierEnd,step10 do
tiers10[#tiers10+1] = math.ceil(i)
end
constants.TIER_SET_5 = tiers5
constants.TIER_SET_10 = tiers10
constants.TIER_UPGRADE_SET_5 = tiers5
constants.TIER_UPGRADE_SET_10 = tiers10
constants.TIER_NAMING_SET_5 = { 1, 3, 5, 7, 10 }
constants.TIER_NAMING_SET_10 = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }
local nestVariations = settings.startup["rampant-newEnemyNestVariations"].value
local nestTiers = settings.startup["rampant-newEnemyNestTiers"].value

View File

@ -20,8 +20,11 @@ local mFloor = math.floor
local deepcopy = util.table.deepcopy
local TIER_SET_10 = constants.TIER_SET_10
local TIER_SET_5 = constants.TIER_SET_5
local TIER_UPGRADE_SET_5 = constants.TIER_UPGRADE_SET_5
local TIER_UPGRADE_SET_10 = constants.TIER_UPGRADE_SET_10
local TIER_NAMING_SET_10 = constants.TIER_NAMING_SET_10
local TIER_NAMING_SET_5 = constants.TIER_NAMING_SET_5
local xorRandom = mathUtils.xorRandom(settings.startup["rampant-enemySeed"].value)
@ -264,22 +267,23 @@ function swarmUtils.buildUnits(template, attackGenerator, upgradeTable, variatio
local unitSet = {}
for tier=1, tiers do
local t = ((tiers == 5) and TIER_SET_5[tier]) or TIER_SET_10[tier]
local t = ((tiers == 5) and TIER_NAMING_SET_5[tier]) or TIER_NAMING_SET_10[tier]
local ut = ((tiers == 5) and TIER_UPGRADE_SET_5[tier]) or TIER_UPGRADE_SET_10[tier]
local result = {}
for i=1,variations do
local unit = deepcopy(template)
unit.name = unit.name .. "-v" .. i .. "-t" .. t
unit.attributes.tier = "-v" .. i .. "-t" .. t
generateApperance(unit, t)
upgradeEntity(unit, upgradeTable, t)
generateApperance(unit, ut)
upgradeEntity(unit, upgradeTable, ut)
if unit.attackName then
unit.attack.name = unit.attackName .. "-v" .. i .. "-t" .. t
end
if unit.loot then
unit.attributes.loot = { unit.loot[t] }
unit.attributes.loot = { unit.loot[ut] }
end
local entity
@ -322,22 +326,22 @@ function swarmUtils.buildUnitSpawner(templates, upgradeTable, attackGenerator, v
tiers.unit)
for tier=1, tiers.unitSpawner do
local t = ((tiers.unitSpawner == 5) and TIER_SET_5[tier]) or TIER_SET_10[tier]
local t = ((tiers.unitSpawner == 5) and TIER_NAMING_SET_5[tier]) or TIER_NAMING_SET_10[tier]
local ut = ((tiers.unitSpawner == 5) and TIER_UPGRADE_SET_5[tier]) or TIER_UPGRADE_SET_10[tier]
for i=1,variations.unitSpawner do
local unitSpawner = deepcopy(templates.unitSpawner)
unitSpawner.name = unitSpawner.name .. "-v" .. i .. "-t" .. t
local unitTable = unitSetToProbabilityTable(upgradeTable.probabilityTable,
unitSet)
generateApperance(unitSpawner, t)
upgradeEntity(unitSpawner, upgradeTable.unitSpawner, t)
generateApperance(unitSpawner, ut)
upgradeEntity(unitSpawner, upgradeTable.unitSpawner, ut)
if unitSpawner.loot then
unitSpawner.attributes.loot = { unitSpawner.loot[t] }
unitSpawner.attributes.loot = { unitSpawner.loot[ut] }
end
if unitSpawner.autoplace then
unitSpawner.attributes["autoplace"] = unitSpawner.autoplace[t]
unitSpawner.attributes["autoplace"] = unitSpawner.autoplace[ut]
end
unitSpawner.attributes.corpse = makeUnitSpawnerCorpse(unitSpawner)
data:extend({
@ -353,23 +357,24 @@ end
function swarmUtils.buildWorm(template, upgradeTable, attackGenerator, variations, tiers)
for tier=1, tiers do
local t = ((tiers == 5) and TIER_SET_5[tier]) or TIER_SET_10[tier]
local t = ((tiers == 5) and TIER_NAMING_SET_5[tier]) or TIER_NAMING_SET_10[tier]
local ut = ((tiers == 5) and TIER_UPGRADE_SET_5[tier]) or TIER_UPGRADE_SET_10[tier]
for i=1,variations do
local worm = deepcopy(template)
worm.name = worm.name .. "-v" .. i .. "-t" .. t
generateApperance(worm, t)
upgradeEntity(worm, upgradeTable, t)
generateApperance(worm, ut)
upgradeEntity(worm, upgradeTable, ut)
if worm.attackName then
worm.attack.name = worm.attackName .. "-v" .. i .. "-t" .. t
end
if worm.loot then
worm.attributes.loot = { worm.loot[t] }
worm.attributes.loot = { worm.loot[ut] }
end
if worm.autoplace then
worm.attributes["autoplace"] = worm.autoplace[t]
worm.attributes["autoplace"] = worm.autoplace[ut]
end
worm.attributes.corpse = makeWormCorpse(worm)
data:extend({

View File

@ -95,7 +95,7 @@ makeStream({
name = name,
particleTint = {r=1, g=0.17, b=0.17, a=0.5},
spineAnimationTint = {r=1, g=0.43, b=0.17, a=0.5},
softSmokeTint = softSmoke,
softSmokeName = softSmoke,
actions = {
{
type = "direct",