For adding loot just use the tier naming set to have it map correctly
an example) if the tiers is set to 5
then the loot table sizes should be something along the lines of
{small, small, medium, big, behemoth}
Code: Select all
local TIER_NAMING_SET_5 = { 1, 3, 5, 7, 10 }
local TIER_NAMING_SET_10 = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }
-- you will want to check this exist
local nestVariations = settings.startup["rampant-newEnemyNestVariations"].value
local nestTiers = settings.startup["rampant-newEnemyNestTiers"].value
local wormVariations = settings.startup["rampant-newEnemyWormVariations"].value
local wormTiers = settings.startup["rampant-newEnemyWormTiers"].value
local unitVariations = settings.startup["rampant-newEnemyUnitVariations"].value
local unitTiers = settings.startup["rampant-newEnemyUnitTiers"].value
local types = {"neutral", "acid", "physical", "electric", "suicide", "nuclear", "fire", "inferno", "troll", "fast", "laser", "wasp", "spawner" }
-- tiers are either 5 or 10
-- variations can be 1 to 20
local tierSet = {
(nestTiers == 5 and TIER_NAMING_SET_5) or TIER_NAMING_SET_10,
(wormTiers == 5 and TIER_NAMING_SET_5) or TIER_NAMING_SET_10,
(unitTiers == 5 and TIER_NAMING_SET_5) or TIER_NAMING_SET_10
}
for _,tiers in ipairs(tierSet) do
for _, tier in ipairs(tiers) do
for variation=1,nestVariations do
for _, v in ipairs(types) do
local spawnerName = v .. "-spawner-v" .. variation .. "-t" .. tier .. "-rampant"
data.raw["unit"][spawnerName].loot = {} -- add loot
end
end
for variation=1,wormVariations do
for _, v in ipairs(types) do
local wormName = v .. "-worm-v" .. variation .. "-t" .. tier .. "-rampant"
data.raw["unit"][wormName].loot = {} -- add loot
end
end
for variation=1,unitVariations do
for _, v in ipairs(types) do
local biterName = v .. "-biter-v" .. variation .. "-t" .. tier .. "-rampant"
local spitterName = v .. "-spitter-v" .. variation .. "-t" .. tier .. "-rampant"
data.raw["unit"][biterName].loot = {} -- add loot
data.raw["unit"][spitterName].loot = {} -- add loot
end
end
end
end