Anonymous

Module:Skills: Difference between revisions

From Melvor Idle
Implement getSkillUnlockCostTable()
m (getMasteryTokenTable: Amend CCI logic to match in-game)
(Implement getSkillUnlockCostTable())
Line 534: Line 534:
   table.insert(resultPart, '\r\n|-\r\n!Without ' .. CCIIcon .. '!!With ' .. CCIIcon)
   table.insert(resultPart, '\r\n|-\r\n!Without ' .. CCIIcon .. '!!With ' .. CCIIcon)


   for i, m in pairs(masterySkills) do
   for i, m in ipairs(masterySkills) do
     local token = masteryTokens[m.tokenRef]
     local token = masteryTokens[m.tokenRef]
     local denom = math.floor(baseTokenChance / m['milestoneCount'])
     local denom = math.floor(baseTokenChance / m['milestoneCount'])
Line 548: Line 548:
    
    
   return table.concat(resultPart)
   return table.concat(resultPart)
end
function p.getSkillUnlockCostTable()
  local returnPart = {}
  table.insert(returnPart, '{| class="wikitable stickyHeader"\r\n|- class="headerRow-0"\r\n!Unlock!!Cost!!Cumulative Cost')
  local accCost = 0
  for i, cost in ipairs(SkillData.SkillUnlockCosts) do
    accCost = accCost + cost
    table.insert(returnPart, '|-')
    table.insert(returnPart, '|' .. i .. '||' .. Icons.GP(cost) .. '||' .. Icons.GP(accCost))
  end
  table.insert(returnPart, '|}')
  return table.concat(returnPart, '\r\n')
end
end


return p
return p