Module:Calculator/AgilityObstacle: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 144: Line 144:


function p._getCourseList(args)
function p._getCourseList(args)
local obstacleNames = parseObstacleArgs(args)
-- Parse optional parameters
local courseRequirements = p.calculateCourse(obstacleNames, true)
local includeItems = args['includeitems'] or true
local includeItems = args['includeitems'] or true
local includeSkills = args['includeskills'] or true
local includeSkills = args['includeskills'] or true
local includeObstacles = args['includeObstacles'] or true
local includeObstacles = args['includeObstacles'] or true
local costReduction = {
['GP']  = args['gpCostReduction'] or 0,
['SC']  = args['scCostReduction'] or 0,
['Item'] = args['itemCostReduction'] or 0,
}
local obstacleNames = parseObstacleArgs(args)
local courseRequirements = p.calculateCourse(obstacleNames, true, costReduction)
local html = mw.html.create()
local html = mw.html.create()
Line 277: Line 284:
end
end


--== Start of table formatting ==--
--== Parse optional parameters==--
local showTotals = args['showtotals'] or true
local obstacleMastery = args['obstacleMastery'] or false
local costReduction = {
['GP']  = args['gpCostReduction'] or 0,
['SC']  = args['scCostReduction'] or 0,
['Item'] = args['itemCostReduction'] or 0,
}
local obstacleNames = parseObstacleArgs(args)
local obstacleNames = parseObstacleArgs(args)
local courseRequirements = p.calculateCourse(obstacleNames, true)
local courseRequirements = p.calculateCourse(obstacleNames, true, costReduction)
 
-- Todo: Add cost reduction?
local showTotals = args['showtotals'] or true
local obstacleMastery = args['obstacleMastry'] or false


--== Start of table formatting ==--
local tbl = mw.html.create("table")
local tbl = mw.html.create("table")
       :addClass("wikitable stickyHeader")
       :addClass("wikitable stickyHeader")
918

edits