FANDOM


local utils = require("Module:Utils")
local InfoboxUtils = require("Module:InfoboxUtils")
local yesno = require('Dev:Yesno')
local curr = require("Module:Currency")
 
local p = {}
 
p._format_firstapp = function(args)
    local first = args.firstapp
    if first == "1" then
        return "Chapter 1" .."[[Category:Characters who first appeared in Chapter 1]]"
    elseif first == "2" then
        return "Chapter 2" .."[[Category:Characters who first appeared in Chapter 2]]"
    elseif first == "3" then
        return "Chapter 3" .."[[Category:Characters who first appeared in Chapter 3]]"
    elseif first == "4" then
        return "Chapter 4" .."[[Category:Characters who first appeared in Chapter 4]]"
    elseif first == "5" then
        return "Chapter 5" .."[[Category:Characters who first appeared in Chapter 5]]"
    elseif first == "6" then
        return "Chapter 6" .."[[Category:Characters who first appeared in Chapter 6]]"
    elseif first == "7" then
        return "Chapter 7" .."[[Category:Characters who first appeared in Chapter 7]]"
    elseif first == "8" then
        return "Chapter 8" .."[[Category:Characters who first appeared in Chapter 8]]"
    elseif first == "9" then
        return "Chapter 9" .."[[Category:Characters who first appeared in Chapter 9]]"
    elseif first == "10" then
        return "Chapter 10" .."[[Category:Characters who first appeared in Chapter 10]]"
    elseif first == "11" then
        return "Chapter 11" .."[[Category:Characters who first appeared in Chapter 11]]"
    elseif first == "12" then
        return "Chapter 12" .."[[Category:Characters who first appeared in Chapter 12]]"
    elseif first == "13" then
        return "Chapter 13" .."[[Category:Characters who first appeared in Chapter 13]]"
    elseif first == "Epilogue" then
        return "Epilogue" .."[[Category:Characters who first appeared in the Epilogue]]"
    elseif first == "NR1" then
        return "NR1 Event" .."[[Category:Characters who first appeared in the NR1 event]]"
    elseif first == "NR2" then
        return "NR2 Event" .."[[Category:Characters who first appeared in the NR2 event]]"
    elseif first == "NR3" then
        return "NR3 Event" .."[[Category:Characters who first appeared in the NR3 event]]"
    elseif first == "Christmas Wrath" then
        return "Christmas Wrath Event" .."[[Category:Characters who first appeared in the Christmas Wrath event]]"
    elseif first == "Nature Wrath" then
        return "Nature Wrath Event" .."[[Category:Characters who first appeared in the Nature Wrath event]]"
    elseif first == "Wrath of Souls" then
        return "Wrath of Souls Event" .."[[Category:Characters who first appeared in the Wrath of Souls event]]"
    elseif first == "Armageddon" then
        return "Armageddon Event" .."[[Category:Characters who first appeared in the Armageddon event]]"
    else
        return utils.error_message("firstapp must be an integer 1-13, or a valid non-canon event") .."[[Category:Characters who first appeared in Chapter nil]]"
    end
end
 
p.format_firstapp = utils.make_wrapper_function(p._format_firstapp)
 
p._format_ppaward = function(args)
    if args.pp == "?" then
        return "Unknown" .."[[Category:Characters with unknown Playerpoint awards]]"
    elseif tonumber(args.pp) then
    return curr._format_pp {amount=args.pp}
else
    return utils.error_message("PP must be a number or '?'")
    end
end
 
 
 
p.format_ppaward = utils.make_wrapper_function(p._format_ppaward)
 
p._format_xpaward = function(args)
    if args.xp == "?" then
        return "Unknown" .."[[Category:Characters with unknown XP awards]]"
    elseif tonumber(args.xp) then
    return curr._format_xp {amount=args.xp}
else
    return utils.error_message("XP must be a number or '?'")
    end
end
 
 
 
p.format_xpaward = utils.make_wrapper_function(p._format_xpaward)
 
p._format_pointaward = function(args)
    local amt = args.points
    if amt == '?' then
    return '?' .."[[Category:Characters with unknown Point awards]]"
elseif tonumber(amt) then
    return amt
    --return curr._format_points {amount=args.points}
    end
end
 
p.format_pointaward = utils.make_wrapper_function(p._format_pointaward)
 
p._format_health = function(args)
    local amt = args.health
    if amt == '?' then
    return '?'
elseif tonumber(amt) then
    return curr._format_health {amount=args.health}
    end
end
 
p.format_health = utils.make_wrapper_function(p._format_health)
 
p._format_difficulty = function(args)
    local first = args.difficulty
    if first == "1" or first == "2" or first == "3" or first == "4" or first == "5" or first == "6" or first == "7" or first == "8" or first == "9" or first == "10" or first == "11" then
        return "[[File:"..first.."star.png|140px]]"
    else
        return utils.error_message("difficulty must be an integer between 1 and 10")
    end
end
 
 
 
p.format_difficulty = utils.make_wrapper_function(p._format_difficulty)
 
p._format_myst = function(args)
    local myst = args.immunities
    return "[[File:"..myst.."myst.png]]"
end
 
p.format_myst = utils.make_wrapper_function(p._format_myst)
 
p._format_boss = function(args)
    local IsBoss = args.boss
    if yesno(IsBoss) then
        return "This character is a boss."
    end
end
 
p.format_boss = utils.make_wrapper_function(p._format_boss)
 
return p

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.