Editing Module:Infobox Animal/sandbox

From Eco - English Wiki

Your changes will be displayed to readers once an authorized user accepts them. (help)

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

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 18: Line 18:
     local animalimagename = string.gsub(animalEN, ' ', '')
     local animalimagename = string.gsub(animalEN, ' ', '')
      
      
     local subheaderClass = '|- class=\"subheader\" \n'
    -- string used to build the infobox
     local subheaderClass = 'class=\"subheader\"'
    local valueColumnClass = 'class=\"value-column\"'
     local wideColumnClass = 'class=\"value-column wide-column\"'
     local wideColumnClass = 'class=\"value-column wide-column\"'
      
      
    -- string used to build the infobox
     local infobox = '{| class=\"infobox animal-infobox\"\n'
     local infobox = '{| class=\"infobox animal-infobox\"\n'
     -- name of the animal
     -- name of the animal
Line 43: Line 44:
     end
     end
      
      
     infobox = infobox .. '|- class=\"animal-image\"\n| colspan=\"2\" | [[File:' .. image .. '|center|frameless|250x250px]]\n'
     infobox = infobox .. '|-\n| colspan=\"2\" style=\"padding:0;\" | [[File:' .. image .. '|center|frameless|250x250px]]\n'
      
      
     -- 'General' section header
     -- 'General' section header
     infobox = infobox .. subheaderClass .. '| colspan=\"2\" | General\n'
     infobox = infobox .. '|-' .. subheaderClass .. '\n| colspan=\"2\" | \'\'\'General\'\'\'\n'


     -- Health
     -- Health
     if animalTable.health ~= nil then
     if animalTable.health ~= nil then
         infobox = infobox .. '|-\n| Health:\n|' .. animalTable.health .. '\n'
         infobox = infobox .. '|-\n| Health:\n|' .. valueColumnClass .. '| ' .. animalTable.health .. '\n'
     end     
     end     
      
      
     -- Idle Speed
     -- Idle Speed
     if animalTable.wanderingSpeed ~= nil then
     if animalTable.wanderingSpeed ~= nil then
         infobox = infobox .. '|-\n| Idle Speed:\n|' .. Unit._unit(animalTable.wanderingSpeed, 'm/s') .. '\n'
         infobox = infobox .. '| Idle Speed:\n|' .. valueColumnClass .. '| ' .. Unit._unit(animalTable.wanderingSpeed, 'm/s') .. '\n'
     end         
     end         


Line 67: Line 68:
     -- Climbing
     -- Climbing
     if animalTable.climbHeight ~= nil then
     if animalTable.climbHeight ~= nil then
         infobox = infobox .. '|-\n| Climb Height:\n|' .. Unit._unit(animalTable.climbHeight, 'm') .. '\n'
         infobox = infobox .. '| Climb Height:\n|' .. valueColumnClass .. '| ' .. Unit._unit(animalTable.climbHeight, 'm') .. '\n'
     end     
     end     
      
      
     -- Carbon Released
     -- Carbon Released
     if animalTable.carbonRelease ~= nil then
     if animalTable.carbonRelease ~= nil then
         infobox = infobox .. '|-\n| Carbon Released:\n|' .. Unit._unit(animalTable.carbonRelease, 'ppm') .. '\n'
         infobox = infobox .. '|-\n| Carbon Released:\n|' .. valueColumnClass .. '| ' .. Unit._unit(animalTable.carbonRelease, 'ppm') .. '\n'
     end     
     end     
      
      
     -- 'Hunting Information' section header
     -- 'Hunting Information' section header
     infobox = infobox .. subheaderClass .. '| colspan=\"2\" | Hunting\n'     
     infobox = infobox .. '|-' .. subheaderClass .. '\n| colspan=\"2\" | \'\'\'Hunting\'\'\'\n'     


     -- Harvest
     -- Harvest
     if animalTable.resourceItem ~= nil then
     if animalTable.resourceItem ~= nil then
         infobox = infobox .. '|-\n| Harvest Item:\n|' .. animalTable.resourceItem .. '\n'
         infobox = infobox .. '|-\n| Harvest Item:\n|' .. valueColumnClass .. '| ' .. animalTable.resourceItem .. '\n'
     end     
     end     
      
      
     -- Flees
     -- Flees
     infobox = infobox .. '|-\n| Flees:\n|' .. Utils.formatNilToYesNo(animalTable.flees) .. '\n'
     infobox = infobox .. '| Flees:\n|' .. valueColumnClass .. '| ' .. Utils.formatNilToYesNo(animalTable.flees) .. '\n'


     -- Animals Fear
     -- Animals Fear
     if animalTable.fearFactor ~= nil then
     if animalTable.fearFactor ~= nil then
         infobox = infobox .. '|-\n| [[Fear Factor]]:\n|' .. animalTable.fearFactor .. '\n'
         infobox = infobox .. '|-\n| [[Fear Factor]]:\n|' .. valueColumnClass .. '| ' .. animalTable.fearFactor .. '\n'
     end
     end
      
      
     -- Running Speed
     -- Running Speed
     if animalTable.speed ~= nil then
     if animalTable.speed ~= nil then
         infobox = infobox .. '|-\n| Flee Speed:\n|' .. Unit._unit(animalTable.speed, 'm/s') .. '\n'
         infobox = infobox .. '| Flee Speed:\n|' .. valueColumnClass .. '| ' .. Unit._unit(animalTable.speed, 'm/s') .. '\n'
     end         
     end         


     -- Attack Chance
     -- Attack Chance
     if animalTable.chanceToAttack ~= nil then
     if animalTable.chanceToAttack ~= nil then
         infobox = infobox .. '|-\n| Attack Chance:\n|' .. (animalTable.chanceToAttack * 100) .. ' % \n'
         infobox = infobox .. '|-\n| Attack Chance:\n|' .. valueColumnClass .. '| ' .. (animalTable.chanceToAttack*100) .. ' % \n'
     end
     end
      
      
     -- Attack Damage
     -- Attack Damage
     if animalTable.damage ~= nil then
     if animalTable.damage ~= nil then
         infobox = infobox .. '|-\n| Attack Damage:\n|' .. animalTable.damage .. '\n'
         infobox = infobox .. '| Attack Damage:\n|' .. valueColumnClass .. '| ' .. animalTable.damage .. '\n'
     end
     end
      
      
     -- Detect Range
     -- Detect Range
     if animalTable.detectRange ~= nil then
     if animalTable.detectRange ~= nil then
         infobox = infobox .. '|-\n| Detect Range:\n|' .. Unit._unit(animalTable.detectRange, 'm') .. '\n'
         infobox = infobox .. '|-\n| Detect Range:\n|' .. valueColumnClass .. '| ' .. Unit._unit(animalTable.detectRange, 'm') .. '\n'
     end
     end


     -- Attack Range
     -- Attack Range
     if animalTable.attackRange ~= nil then
     if animalTable.attackRange ~= nil then
         infobox = infobox .. '|-\n| Attack Range:\n|' .. Unit._unit(animalTable.attackRange, 'm') .. '\n'
         infobox = infobox .. '| Attack Range:\n|' .. valueColumnClass .. '| ' .. Unit._unit(animalTable.attackRange, 'm') .. '\n'
     end         
     end         
      
      
Please note that all contributions to Eco - English Wiki are considered to be released under the CC BY-NC-SA 4.0 (see Eco:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following hCaptcha:

Cancel Editing help (opens in new window)

Template used on this page: