Module:Param Parse: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
No edit summary |
(Add a real smw property for quest difficulty) |
||
Line 352: | Line 352: | ||
return "N/A" |
return "N/A" |
||
end |
end |
||
function parse.difficulty_smw(val) |
|||
val = tonumber(val) -- Intentionally do not use parse.tonumber here |
|||
if val >= 0 and val <= 5 and math.floor(val) == val then |
|||
return val |
|||
end |
|||
return nil |
|||
end |
|||
-- Quest difficulty |
-- Quest difficulty |
||
parse.difficulty = { |
parse.difficulty = { |
||
Line 358: | Line 364: | ||
func = parse.difficulty_func, |
func = parse.difficulty_func, |
||
smw_property = 'Difficulty', |
smw_property = 'Difficulty', |
||
smw_func = parse.difficulty_smw, |
|||
category_incomplete = 'Needs difficulty' |
category_incomplete = 'Needs difficulty' |
||
} |
} |