|
|
Line 489: |
Line 489: |
|
| |
|
| return table.concat(resultPart) | | return table.concat(resultPart) |
| end
| |
|
| |
| -- Skill unlock costs for Adventure game mode
| |
| function p.getSkillUnlockCostTable()
| |
| local advMode = GameData.getEntityByID('gamemodes', 'melvorF:Adventure')
| |
| if advMode ~= nil then
| |
| local unlockCount = Shared.tableCount(GameData.skillData) - Shared.tableCount(advMode.startingSkills)
| |
| local costLength = Shared.tableCount(advMode.skillUnlockCost)
| |
| local returnPart = {}
| |
| table.insert(returnPart, '{| class="wikitable stickyHeader"\r\n|- class="headerRow-0"\r\n!Unlock!!Cost!!Cumulative Cost')
| |
|
| |
| local accCost = 0
| |
| for i = 1, unlockCount, 1 do
| |
| local cost = advMode.skillUnlockCost[math.min(i, costLength)]
| |
| accCost = accCost + cost
| |
| table.insert(returnPart, '|-')
| |
| table.insert(returnPart, '|' .. i .. '||' .. Icons._Currency('melvorD:GP', cost) .. '||' .. Icons._Currency('melvorD:GP', accCost))
| |
| end
| |
| table.insert(returnPart, '|}')
| |
|
| |
| return table.concat(returnPart, '\r\n')
| |
| end
| |
| end | | end |
|
| |
|