ElEditors, Interface administrators, Administrators
85,550
edits
m (Add i18n locale support) Tag: Reverted |
Tag: Rollback |
||
Line 1: | Line 1: | ||
-- pystart | -- pystart | ||
require('Module:CommonFunctions') | require('Module:CommonFunctions') | ||
local getArgs = require('Module:Arguments').getArgs | local getArgs = require('Module:Arguments').getArgs | ||
local p = {} | local p = {} | ||
-- Main process | -- Main process | ||
function p.main(frame) | function p.main(frame) | ||
local args = getArgs(frame) | local args = getArgs(frame); | ||
local is_rose = args[1] == 'Rose' and args.ecp == 'true'; | |||
local is_rose = args[1] == 'Rose' and args.ecp == 'true' | |||
-- Argument init | -- Argument init | ||
Line 29: | Line 22: | ||
-- Dictionary for headers | -- Dictionary for headers | ||
local prop = { | local prop = { 'MP Usage', 'Cooldown', 'Duration', 'MP Recovery', 'Max Hits', 'Effects' } | ||
if is_rose then | |||
for k, v in ipairs(prop) do | |||
prop[k] = v:gsub('MP', 'ECP') | |||
end | |||
end | |||
local prop_short = { 'mp', 'cd', 'duration', 'mp_recovery', 'hits', 'effects', 'chance' } | local prop_short = { 'mp', 'cd', 'duration', 'mp_recovery', 'hits', 'effects', 'chance' } | ||
local STR = { | local STR = { | ||
LIGHT = | LIGHT = 'Light', | ||
CRITICAL = | CRITICAL = 'Critical', | ||
REVERSED = | REVERSED = 'Reversed', | ||
HEAVY = | HEAVY = 'Heavy', | ||
HASTE = | HASTE = 'Haste', | ||
REGEN1 = | REGEN1 = 'Regenerating (1)', | ||
REGEN2 = | REGEN2 = 'Regenerating (2)', | ||
KB1 = | KB1 = 'Killing Blow (1)', | ||
KB2 = | KB2 = 'Killing Blow (2)', | ||
RUTHLESS = | RUTHLESS = 'Ruthless', | ||
POWERFUL = | POWERFUL = 'Powerful', | ||
USEFUL = | USEFUL = 'Useful', | ||
SEC = | SEC = ' Seconds', | ||
MP = | MP = ' MP', | ||
ECP = | ECP = ' ECP', | ||
PERSISTENT = | PERSISTENT = 'Persistent', | ||
PERSISTENT2 = | PERSISTENT2 = 'Persistent2' | ||
} | } | ||
Line 150: | Line 136: | ||
tr4 = new_row() | tr4 = new_row() | ||
-- Add indicator headers | -- Add indicator headers | ||
tr1:tag('th'):wikitext | tr1:tag('th'):wikitext('Mode'):attr('rowspan', 2) | ||
tr3:tag('td'):wikitext(frame:expandTemplate { | tr3:tag('td'):wikitext(frame:expandTemplate { | ||
title = | title = 'PvE' | ||
}) | }) | ||
tr4:tag('td'):wikitext(frame:expandTemplate { | tr4:tag('td'):wikitext(frame:expandTemplate { | ||
title = | title = 'PvP' | ||
}) | }) | ||
end | end | ||
Line 161: | Line 147: | ||
-- Loop through 2 input traits. | -- Loop through 2 input traits. | ||
for trait_count, trait_name in ipairs(traits) do | for trait_count, trait_name in ipairs(traits) do | ||
local th = tr1:tag('th'):wikitext(trait_name:gsub( | local th = tr1:tag('th'):wikitext(trait_name:gsub('Persistent2', 'Persistent') .. ' ' .. skill); | ||
local th_effect; | local th_effect; | ||
local th_skilltext; | local th_skilltext; | ||
Line 169: | Line 155: | ||
for detail_key, detail in ipairs(details) do | for detail_key, detail in ipairs(details) do | ||
if not th_effect then | if not th_effect then | ||
th_effect = tr2:tag('th'):wikitext | th_effect = tr2:tag('th'):wikitext('Attribute Effect'); | ||
end | end | ||
if indexOf(trait_name, detail) then | if indexOf(trait_name, detail) then | ||
Line 193: | Line 179: | ||
if not th_skilltext then | if not th_skilltext then | ||
th_skilltext = tr3:tag('td'):attr('rowspan', has_pvp_values and 2 or 1):wikitext(frame:expandTemplate { | th_skilltext = tr3:tag('td'):attr('rowspan', has_pvp_values and 2 or 1):wikitext(frame:expandTemplate { | ||
title = | title = 'SkillText', | ||
args = { | args = { | ||
trait_name, | trait_name, | ||
Line 256: | Line 242: | ||
title = 'Tt', | title = 'Tt', | ||
args = { calcEndValue(enhanced_detail) .. "'''", | args = { calcEndValue(enhanced_detail) .. "'''", | ||
"Final Enhanced Skill" } | |||
} | } | ||
end | end |