Anonymous

Module:Skills: Difference between revisions

From Melvor Idle
Added XP numbers to mastery pool data
(Added getMasteryCheckpointTable and getMasteryUnlockTable)
 
(Added XP numbers to mastery pool data)
Line 8: Line 8:
local Icons = require('Module:Icons')
local Icons = require('Module:Icons')


local MasteryCheckpoints = {'10%', '25%', '50%', '95%'}
local MasteryCheckpoints = {.1, .25, .5, .95}


function p.getSkillID(skillName)
function p.getSkillID(skillName)
Line 52: Line 52:


   local bonuses = SkillData.MasteryCheckpoints[skillID].bonuses
   local bonuses = SkillData.MasteryCheckpoints[skillID].bonuses
  local totalPoolXP = SkillData.MasteryPoolXP[skillID + 1]


   local result = '{|class="wikitable"\r\n!Pool %!!Bonus'
   local result = '{|class="wikitable"\r\n!Pool %!!Pool XP!!Bonus'
   for i, bonus in Shared.skpairs(bonuses) do
   for i, bonus in Shared.skpairs(bonuses) do
     result = result..'\r\n|-'
     result = result..'\r\n|-'
     result = result..'\r\n|'..MasteryCheckpoints[i]..'||'..bonus
     result = result..'\r\n|'..(MasteryCheckpoints[i] * 100)..'%||'
    result = result..Shared.formatnum(totalPoolXP * MasteryCheckpoints[i])..' xp||'..bonus
   end
   end
  result = result..'\r\n!colspan="2"|Total Mastery Pool XP'
  result = result..'\r\n|'..Shared.formatnum(totalPoolXP)
   result = result..'\r\n|}'
   result = result..'\r\n|}'
   return result
   return result