Editing Module:Infobox Plant
From Eco - English Wiki
Your changes will be displayed to readers once an authorized user accepts them. (help)
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 69: | Line 69: | ||
-- name of the plant/tree | -- name of the plant/tree | ||
infobox = infobox .. '|- style=\"color: | infobox = infobox .. '|- style=\"color: #333333; background-color: #1165AF; text-align: center;\"\n| colspan=\"2\" | \'\'\'<big>' .. species .. '</big>\'\'\'\n' | ||
-- the sub heading plant or tree | -- the sub heading plant or tree | ||
infobox = infobox .. '|- style=\"text-align: center; color: | infobox = infobox .. '|- style=\"text-align: center; color: #333333; background-color: ' | ||
if check == 'plant' then | if check == 'plant' then | ||
infobox = infobox .. 'seagreen;\"\n| colspan=\"2\" | \'\'\'Plant\'\'\'[[Category:Plants]]\n' | infobox = infobox .. 'seagreen;\"\n| colspan=\"2\" | \'\'\'Plant\'\'\'[[Category:Plants]]\n' | ||
Line 82: | Line 82: | ||
local checkImage = {'_Plant.png','_Plant.jpg','_Plant.jpeg','_Tree.png','_Tree.jpg','_Tree.jpeg'} | local checkImage = {'_Plant.png','_Plant.jpg','_Plant.jpeg','_Tree.png','_Tree.jpg','_Tree.jpeg'} | ||
local image = '' | local image = '' | ||
local speciesimagename = string.gsub(species, ' ', '') | |||
local speciesimagename = string.gsub( | |||
for i,v in ipairs(checkImage) do | for i,v in ipairs(checkImage) do | ||
Line 92: | Line 91: | ||
if table.getn(checkImage) == i then | if table.getn(checkImage) == i then | ||
image = 'NoImage.png' | image = 'NoImage.png' | ||
if check == ' | if check == 'Plant' then | ||
image = image .. '|link=https://wiki.play.eco/index.php?title=Special:Upload&wpDestFile=' .. speciesimagename .. '_Plant.png|[[Category:Pages_with_missing_plant]]' | image = image .. '|64px|link=https://wiki.play.eco/index.php?title=Special:Upload&wpDestFile=' .. speciesimagename .. '_Plant.png|[[Category:Pages_with_missing_plant]]' | ||
end | end | ||
if check == ' | if check == 'Tree' then | ||
image = image .. '|link=https://wiki.play.eco/index.php?title=Special:Upload&wpDestFile=' .. speciesimagename .. '_Tree.png|[[Category:Pages_with_missing_tree]]' | image = image .. '|64px|link=https://wiki.play.eco/index.php?title=Special:Upload&wpDestFile=' .. speciesimagename .. '_Tree.png|[[Category:Pages_with_missing_tree]]' | ||
end | end | ||
end | end | ||
end | end | ||
infobox = infobox .. '|-\n| colspan=\"2\" style=\"padding: 10px;\" | [[File:' .. image .. '|center|border|240px]]\n' | |||
infobox = infobox .. '|-\n| colspan=\"2\" style=\"padding: 10px;\" | [[File:' .. image .. '|center|border| | |||
-- 'General' section header | -- 'General' section header | ||
Line 111: | Line 109: | ||
-- speciesTable.seedDrop ~= nil or | -- speciesTable.seedDrop ~= nil or | ||
speciesTable.resourceItem ~= nil or speciesTable.requireHarvestable ~= nil then | speciesTable.resourceItem ~= nil or speciesTable.requireHarvestable ~= nil then | ||
infobox = infobox .. '|- valign=\"center\"\n| Harvestable:\n| style=\"text-align: right | infobox = infobox .. '|- valign=\"center\"\n| Harvestable:\n| style=\"text-align: right;\" | Yes \n' | ||
end | end | ||
--Underwater plant | --Underwater plant | ||
if speciesTable.isWater ~= nil then | if speciesTable.isWater ~= nil then | ||
infobox = infobox .. '|- valign=\"center\"\n| Underwater Plant:\n| style=\"text-align: right | infobox = infobox .. '|- valign=\"center\"\n| Underwater Plant:\n| style=\"text-align: right;\" | Yes \n' | ||
end | end | ||
--Decorative Plant | --Decorative Plant | ||
if speciesTable.isDecorative ~= nil then | if speciesTable.isDecorative ~= nil then | ||
infobox = infobox .. '|- valign=\"center\"\n| Decorative Plant:\n| style=\"text-align: right | infobox = infobox .. '|- valign=\"center\"\n| Decorative Plant:\n| style=\"text-align: right;\" | Yes \n' | ||
end | end | ||
--Plant Height | --Plant Height | ||
if speciesTable.height ~= nil then | if speciesTable.height ~= nil then | ||
infobox = infobox .. '|- valign=\"center\"\n| Plant Height:\n| style=\"text-align: right | infobox = infobox .. '|- valign=\"center\"\n| Plant Height:\n| style=\"text-align: right;\" | ' .. speciesTable.height .. ' m \n' | ||
end | end | ||
Line 140: | Line 138: | ||
-- Harvested Tool | -- Harvested Tool | ||
if speciesTable.harvestTool ~= nil then | if speciesTable.harvestTool ~= nil then | ||
infobox = infobox .. '|- valign=\"center\"\n| Harvest Tool:\n| style=\"text-align: right | infobox = infobox .. '|- valign=\"center\"\n| Harvest Tool:\n| style=\"text-align: right;\" | ' .. speciesTable.harvestTool .. ' \n' | ||
end | end | ||
-- Harvested Seed | -- Harvested Seed | ||
-- if speciesTable.seedDrop ~= nil and speciesTable.seedMax ~= '0.0' then | -- if speciesTable.seedDrop ~= nil and speciesTable.seedMax ~= '0.0' then | ||
-- infobox = infobox .. '|- valign=\"center\"\n| Harvested Seed:\n| style=\"text-align: right | -- infobox = infobox .. '|- valign=\"center\"\n| Harvested Seed:\n| style=\"text-align: right;\" | ' .. speciesTable.seedDrop .. '\n' | ||
-- end | -- end | ||
-- Harvested Item | -- Harvested Item | ||
if speciesTable.resourceItem ~= nil then | if speciesTable.resourceItem ~= nil then | ||
infobox = infobox .. '|- valign=\"center\"\n| Harvested Item:\n| style=\"text-align: right | infobox = infobox .. '|- valign=\"center\"\n| Harvested Item:\n| style=\"text-align: right;\" | ' .. speciesTable.resourceItem .. '\n' | ||
end | end | ||
--Plant Calorie Value | --Plant Calorie Value | ||
if speciesTable.calorieValue ~= nil then | if speciesTable.calorieValue ~= nil then | ||
infobox = infobox .. '|- valign=\"center\"\n| Plant Calorie Value:\n| style=\"text-align: right | infobox = infobox .. '|- valign=\"center\"\n| Plant Calorie Value:\n| style=\"text-align: right;\" |' .. speciesTable.calorieValue .. ' \n' | ||
end | end | ||
-- | --Experience Per Harvest | ||
if speciesTable.experiencePerHarvest ~= nil then | if speciesTable.experiencePerHarvest ~= nil then | ||
infobox = infobox .. '|- valign=\"center\"\n| Base | infobox = infobox .. '|- valign=\"center\"\n| Base Experience Per Harvest:\n| style=\"text-align: right;\" |' .. speciesTable.experiencePerHarvest .. ' \n' | ||
end | end | ||
Line 167: | Line 165: | ||
if speciesTable.idealGrowthRate ~= nil then | if speciesTable.idealGrowthRate ~= nil then | ||
speciesTable.idealGrowthRate = speciesTable.idealGrowthRate*100 | speciesTable.idealGrowthRate = speciesTable.idealGrowthRate*100 | ||
infobox = infobox .. '|- valign=\"center\"\n| Ideal Growth Rate:\n| style=\"text-align: right | infobox = infobox .. '|- valign=\"center\"\n| Ideal Growth Rate:\n| style=\"text-align: right;\" |' .. speciesTable.idealGrowthRate .. ' % \n' | ||
end | end | ||
Line 173: | Line 171: | ||
if speciesTable.idealDeathRate ~= nil then | if speciesTable.idealDeathRate ~= nil then | ||
speciesTable.idealDeathRate = speciesTable.idealDeathRate*100 | speciesTable.idealDeathRate = speciesTable.idealDeathRate*100 | ||
infobox = infobox .. '|- valign=\"center\"\n| Ideal Death Rate:\n| style=\"text-align: right | infobox = infobox .. '|- valign=\"center\"\n| Ideal Death Rate:\n| style=\"text-align: right;\" |' .. speciesTable.idealDeathRate .. ' % \n' | ||
end | end | ||
-- Ideal Temp | -- Ideal Temp | ||
if speciesTable.idealTempMin ~= nil then | if speciesTable.idealTempMin ~= nil then | ||
infobox = infobox .. '|- valign=\"center\"\n| Ideal Temperature Range:\n| style=\"text-align: right;\" | ' .. speciesTable.idealTempMin .. ' - ' .. speciesTable.idealTempMax .. '\n' | |||
infobox = infobox .. '|- valign=\"center\"\n| Ideal Temperature Range:\n| style=\"text-align: right | |||
end | end | ||
-- Ideal Moisture | -- Ideal Moisture | ||
if speciesTable.idealMoistureMin ~= nil then | if speciesTable.idealMoistureMin ~= nil then | ||
infobox = infobox .. '|- valign=\"center\"\n| Ideal Moisture Range:\n| style=\"text-align: right;\" | ' .. speciesTable.idealMoistureMin .. ' - ' .. speciesTable.idealMoistureMax .. '\n' | |||
infobox = infobox .. '|- valign=\"center\"\n| Ideal Moisture Range:\n| style=\"text-align: right | |||
end | end | ||
-- Max Pollution Density | -- Max Pollution Density | ||
if speciesTable.maxPollutionDensity ~= nil then | if speciesTable.maxPollutionDensity ~= nil then | ||
infobox = infobox .. '|- valign=\"center\"\n|Max Pollution Density:\n| style=\"text-align: right;\" |' .. speciesTable.maxPollutionDensity .. ' ppm \n' | |||
infobox = infobox .. '|- valign=\"center\"\n|Max | |||
end | end | ||
-- Pollution Tolerance | -- Pollution Tolerance | ||
if speciesTable.pollutionTolerance ~= nil then | if speciesTable.pollutionTolerance ~= nil then | ||
infobox = infobox .. '|- valign=\"center\"\n| Pollution Tolerance:\n| style=\"text-align: right;\" |' .. speciesTable.pollutionTolerance .. ' ppm \n' | |||
infobox = infobox .. '|- valign=\"center\"\n| Pollution Tolerance:\n| style=\"text-align: right | |||
end | end | ||
Line 207: | Line 199: | ||
infobox = infobox .. '|- style=\"text-align: center;\"\n| colspan=\"2\" | \'\'\'Minimum Soil Nutrients\'\'\'\n' | infobox = infobox .. '|- style=\"text-align: center;\"\n| colspan=\"2\" | \'\'\'Minimum Soil Nutrients\'\'\'\n' | ||
if speciesTable.nitrogenHalfSpeed ~= nil then | if speciesTable.nitrogenHalfSpeed ~= nil then | ||
infobox = infobox .. '|- style=\"color: red; valign: center;\"\n| Nitrogen:\n| style=\"text-align: right | infobox = infobox .. '|- style=\"color: red; valign: center;\"\n| Nitrogen:\n| style=\"text-align: right;\" | ' .. speciesTable.nitrogenHalfSpeed .. '\n' | ||
end | end | ||
if speciesTable.phosphorusHalfSpeed ~= nil then | if speciesTable.phosphorusHalfSpeed ~= nil then | ||
infobox = infobox .. '|- style=\"color: darkorange; valign: center;\"\n| Phosphorous:\n| style=\"text-align: right | infobox = infobox .. '|- style=\"color: darkorange; valign: center;\"\n| Phosphorous:\n| style=\"text-align: right;\" | ' .. speciesTable.phosphorusHalfSpeed .. '\n' | ||
end | end | ||
if speciesTable.potassiumHalfSpeed ~= nil then | if speciesTable.potassiumHalfSpeed ~= nil then | ||
infobox = infobox .. '|- style=\"color: | infobox = infobox .. '|- style=\"color: limegreen; valign: center;\"\n| Potassium:\n| style=\"text-align: right;\" | ' .. speciesTable.potassiumHalfSpeed .. '\n' | ||
end | end | ||
if speciesTable.soilMoistureHalfSpeed ~= nil then | if speciesTable.soilMoistureHalfSpeed ~= nil then | ||
infobox = infobox .. '|- style=\"color: dodgerblue; valign: center;\"\n| Soil Moisture:\n| style=\"text-align: right;\" | ' .. speciesTable.soilMoistureHalfSpeed .. '\n' | |||
infobox = infobox .. '|- style=\"color: dodgerblue; valign: center;\"\n| Soil Moisture:\n| style=\"text-align: right | |||
end | end | ||
end | end | ||
Line 228: | Line 219: | ||
if speciesTable.carbonRelease ~= nil then | if speciesTable.carbonRelease ~= nil then | ||
local absoluteCarbon = string.sub(speciesTable.carbonRelease , 2) | local absoluteCarbon = string.sub(speciesTable.carbonRelease , 2) | ||
infobox = infobox .. '|- valign=\"center\"\n| Carbon Absorbed:\n| style=\"text-align: right | infobox = infobox .. '|- valign=\"center\"\n| Carbon Absorbed:\n| style=\"text-align: right;\" | ' .. absoluteCarbon .. ' ppm \n' | ||
end | end | ||