Module:KeyPageData
Module documentation: Module:KeyPageData/doc
Data stored in Module:KeyPageData/Data
Pages using this module
Outputs key page data based on a given id or name (ID preferred, as it is faster)
Name argument is case insensitive, and ignores non-alphanumeric characters.
Example Usage:
{{#invoke:KeyPageData|getData|name|243003}} {{#invoke:KeyPageData|getData|passives|bamboo hatted kims page}}
Bamboo-hatted Kim’s Page
Speed
Speed Dice Slot +1 (Cannot Overlap)
Singular Strike
When using a Combat Page with one non-Counter die, the die gains +2 Power, and it yields twice as many Emotion Points in a clash.
Unrelenting
Upon taking a lethal blow, reduce all incoming damage including what activated this passive by 25 for the Scene (Activates once per Act)
Swordplay of the Homeland
Slash Dice Power +2
Razor Strike
Upon a successful Slash attack, inflict 1 Bleed next Scene
Minimum Offense
Slash Stagger Damage +1
local getArgs = require('Module:Arguments').getArgs
local p = {}
local keypageData = mw.loadData('Module:KeyPageData/Data')
function p.getData(frame)
if not frame then return '' end
local ID = frame.args[2]
local property = frame.args[1]
if not (keypageData[ID]) then ID = frame:preprocess ( '{{ID|' .. ID .. '}}' ) end
if not (keypageData[ID]) then return 'error: check arguments' end
if not (keypageData[ID][property]) then return '' end
if pcall(function() a=(keypageData[ID][property][1][1]) end) then
local s = '{{#tag: tabber|\n'
for k,v in pairs(keypageData[ID][property]) do
s = s .. v[2] .. ' = [[file:' .. v[1] .. ']] {{!}}-{{!}}\n'
end
s = s .. '}}'
return frame:preprocess(s) or ''
end
return frame:preprocess(keypageData[ID][property]) or ''
end
return p