2,869
edits
(Add expansion icon to obstacle) |
m (Fix derp again) |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 4: | Line 4: | ||
local Num = require('Module:Number') | local Num = require('Module:Number') | ||
local Constants = require('Module:Constants') | local Constants = require('Module:Constants') | ||
local Modifiers = require('Module:Modifiers') | |||
local Agility = require('Module:Skills/Agility') | local Agility = require('Module:Skills/Agility') | ||
local Shared = require('Module:Shared') | local Shared = require('Module:Shared') | ||
local Icons = require('Module:Icons') | local Icons = require('Module:Icons') | ||
local iconTable = { | |||
['GP'] = function(amount) return Icons._Currency('GP', amount) end, | |||
['SC'] = function(amount) return Icons._Currency('SC', amount) end, | |||
['AP'] = function(amount) return Icons._Currency('AP', amount) end, | |||
['ASC'] = function(amount) return Icons._Currency('ASC', amount) end, | |||
} | |||
local function getItemIcon(itemName, amount) | local function getItemIcon(itemName, amount) | ||
local iconFunc = iconTable[itemName] | |||
if iconFunc then | |||
return iconFunc(amount) | |||
else | |||
return Icons.Icon({itemName, type='item', qty = amount, notext=true}) | |||
end | |||
end | end | ||
Line 231: | Line 236: | ||
--== Local Functions for formatting Obstacle MetaData ==-- | --== Local Functions for formatting Obstacle MetaData ==-- | ||
local function getBonusses(obstacle) | local function getBonusses(obstacle) | ||
if obstacle.modifiers == nil then | |||
return '<span style="color:red">None :(</span>' | |||
else | |||
return Modifiers.getModifiersText(obstacle.modifiers, true, false, 10) | |||
end | end | ||
end | end | ||
Line 271: | Line 273: | ||
local function getTotalBonuses(obstacles) | local function getTotalBonuses(obstacles) | ||
--[==[ | |||
local bonuses = {} | local bonuses = {} | ||
for _, obstacle in pairs(obstacles) do | for _, obstacle in pairs(obstacles) do | ||
Line 289: | Line 292: | ||
return table.concat(ret, '<br/>') | return table.concat(ret, '<br/>') | ||
--]==] | |||
return '' | |||
end | end | ||
edits