17,101
edits
m (getBonesTable: skpairs -> ipairs where table is already sorted) |
(Update for v1.1) |
||
Line 4: | Line 4: | ||
local Shared = require('Module:Shared') | local Shared = require('Module:Shared') | ||
local Constants = require('Module:Constants') | |||
local GameData = require('Module:GameData') | |||
local Icons = require('Module:Icons') | local Icons = require('Module:Icons') | ||
local Items = require('Module:Items') | local Items = require('Module:Items') | ||
local ItemSources = require('Module:Items/SourceTables') | local ItemSources = require('Module:Items/SourceTables') | ||
function p.getPrayerByID(id) | function p.getPrayerByID(id) | ||
return GameData.getEntityByID('prayers', id) | |||
end | end | ||
function p.getPrayer(name) | function p.getPrayer(name) | ||
return GameData.getEntityByName('prayers', name) | |||
end | end | ||
function p.getPrayers(checkFunc) | function p.getPrayers(checkFunc) | ||
return GameData.getEntities('prayer', checkFunc) | |||
end | end | ||
Line 70: | Line 54: | ||
table.insert(bonusLines, chr .. 'Gives the enemy: ' .. Constants._getModifierText(bonusKey, bonusVal, false)) | table.insert(bonusLines, chr .. 'Gives the enemy: ' .. Constants._getModifierText(bonusKey, bonusVal, false)) | ||
end | end | ||
end | end | ||
Line 82: | Line 61: | ||
local xpRatio = 1 / 30 | local xpRatio = 1 / 30 | ||
local val = xpRatio * prayer.pointsPerPlayer | local val = xpRatio * prayer.pointsPerPlayer | ||
table.insert(bonusLines, chr.."+"..Shared.round(val, 3, 3).." Prayer XP per damage done") | table.insert(bonusLines, chr .. "+" .. Shared.round(val, 3, 3) .. " Prayer XP per damage done") | ||
end | end | ||
if asList then | if asList then | ||
Line 109: | Line 88: | ||
return p._getPrayerEffect(prayer) | return p._getPrayerEffect(prayer) | ||
elseif statName == "prayerEffectList" then | elseif statName == "prayerEffectList" then | ||
return p.getPrayerEffect(prayer | return p.getPrayerEffect(prayer) | ||
elseif statName == 'prayerLevel' then | elseif statName == 'prayerLevel' then | ||
return Icons._SkillReq('Prayer', prayer['prayerLevel']) | return Icons._SkillReq('Prayer', prayer['prayerLevel']) | ||
Line 148: | Line 127: | ||
result = result..'!!Effects!!Point Cost' | result = result..'!!Effects!!Point Cost' | ||
local prayerList = | local prayerList = p.getPrayers(function(prayer) return true end) | ||
table.sort(prayerList, function(a, b) | table.sort(prayerList, function(a, b) | ||
if a. | if a.level == b.level then | ||
return a.name < b.name | return a.name < b.name | ||
else | else | ||
return a. | return a.level < b.level | ||
end | end | ||
end) | end) | ||
Line 180: | Line 159: | ||
result = result..'\r\n|'..Icons.Icon({item.name, type='item', notext=true, size='50'}) | result = result..'\r\n|'..Icons.Icon({item.name, type='item', notext=true, size='50'}) | ||
result = result..'||'..Icons.Icon({item.name, type='item', noicon=true}) | result = result..'||'..Icons.Icon({item.name, type='item', noicon=true}) | ||
result = result..'||style="text-align:right;"|'..item.prayerPoints | result = result..'||style="text-align:right;"|'..Shared.formatnum(item.prayerPoints) | ||
result = result..'||'..ItemSources._getItemSources(item, false, false) | result = result..'||'..ItemSources._getItemSources(item, false, false) | ||
end | end |