Anonymous

Module:Sandbox/GauTest/ModifierTables: Difference between revisions

From Melvor Idle
no edit summary
No edit summary
No edit summary
Line 463: Line 463:
end
end


-- Special biomeModifiers for Township buildings
-- Special for Township buildings
if townshipBuildingName ~= nil then
if townshipBuildingName ~= nil then
local building = Township._GetBuildingByName(townshipBuildingName)
local building = Shared.clone(Township._GetBuildingByName(townshipBuildingName))
-- biomeModifiers
for _, biome in ipairs(building.biomeModifiers) do
for _, biome in ipairs(building.biomeModifiers) do
local biomename = GameData.getEntityByID(GameData.skillData.Township.biomes, biome.biomeID).name
local biomename = GameData.getEntityByID(GameData.skillData.Township.biomes, biome.biomeID).name
Line 474: Line 475:
row.val = biome.value
row.val = biome.value
local color = biome.value < 0 and 'red' or 'green'
local color = biome.value < 0 and 'red' or 'green'
row.modifierText = '<span style="color:'..color..'">'..Shared.numStrWithSign(biome.value)..'% Production for this Building</span>'
row.modifierText = '<span style="color:'..color..'">'..Shared.numStrWithSign(biome.value)..'% Production for '..townshipBuildingName..'</span>'
row.otherModifiers = ''
row.otherModifiers = ''
table.insert(tableArray, row)
if not hasOtherModifiers and string.len(row.otherModifiers) > 0 then
end
hasOtherModifiers = true
-- Education
end
if #building.provides.resources > 0 then
row.icon = Icons.Icon({'Education', type='township'})
row.type = 'Township'
row.val = 100
row.modifierText, row.otherModifiers = getModText({increasedTownshipResourceProduction = 100})
table.insert(tableArray, row)
table.insert(tableArray, row)
end
end
572

edits