FANDOM


local p = {}
 
 --[[
 This function who origanly design for switching design on Characters's Template
 This function need two parameter:
    frame.args[1]: the text who need to be evaluate
    frame.args[2]: the size max of one line
 
The result is an value need to be tested in template
    true: all lines are small
    false: one or more lines are large
 --]]
function p.maxLen( frame ) 
    local maxSize = tonumber(frame.args[2]) or 80
    local tmpStr = string.gsub(frame.args[1], "%[%[[F|f]ile:.-%]%]", "123")
    tmpStr = string.gsub(tmpStr, "%[%[:[F|f]ile:.-%|", "")
    tmpStr = string.gsub(tmpStr, "[%[|%]]", "")
    local tmpArray = mw.text.split(tmpStr, "<br ?/?>")
    local textLines = {}
    local maxChars = 0;
 
    for key, value in pairs(tmpArray) do
        value = mw.text.split(value, "\n")
        for i = 1, #value do
            textLines[#textLines+1] = value[i]
        end
    end
 
    for key, value in pairs(textLines) do
        if #value > maxChars then
            maxChars = #value
        end
    end
 
    if maxChars > maxSize then
        return false
    else
        return true
    end
 
end
 
function p.replaceLinks( links )
    local results = links.args[1]
    local linksArray = {
        ["%[%[All in the Family]]"]="DEF +15%%",
        ["%[%[Android Assault]]"]="DEF +1000",
        ["%[%[Attack of the Clones]]"]="Ki +1",
        ["%[%[Auto Regeneration]]"]="Recover 3%% HP",
        ["%[%[Battlefield Diva]]"]="Ki +2",
        ["%[%[Berserker]]"]="ATK +20%% when HP is 50%% or below",
        ["%[%[Best Buddies]]"]="Ki +1",
        ["%[%[Big Bad Bosses]]"]="ATK & DEF +25%% when HP is 80%% or below",
        ["%[%[Blazing Battle]]"]="Disables enemy's Rampage, and ATK +15%%",
        ["%[%[Bombardment]]"]="ATK +15%%",
        ["%[%[Brainiacs]]"]="ATK & DEF +10%%",
        ["%[%[Brutal Beatdown]]"]="ATK +10%%",
        ["%[%[Budding Warrior]]"]="ATK +10%%",
        ["%[%[Cold Judgment]]"]="DEF +20%%",
        ["%[%[Connoisseur]]"]="Recover 5%% HP",
        ["%[%[Cooler's Armored Squad]]"]="ATK +25%%",
        ["%[%[Cooler's Underling]]"]="Ki +1",
        ["%[%[Courage]]"]="Ki +1",
        ["%[%[Coward]]"]="Ki +1",
        ["%[%[Crane School]]"]="ATK +500",
        ["%[%[Deficit Boost]]"]="ATK +15%%",
        ["%[%[Demon]]"]="Ki +1",
        ["%[%[Demon Duo]]"]="ATK +20%%",
        ["%[%[Destroyer of the Universe]]"]="ATK +25%%",
        ["%[%[Dismal Future]]"]="Ki +1",
        ["%[%[Dodon Ray]]"]="ATK +2000 when Super Attack is launched",
        ["%[%[Energy Absorption]]"]="Ki +2",
        ["%[%[Evil Autocrats]]"]="Ki +1",
        ["%[%[Experienced Fighters]]"]="ATK +10%%",
        ["%[%[Family Ties]]"]="Ki +2",
        ["%[%[Fear and Faith]]"]="Ki +2",
        ["%[%[Fierce Battle]]"]="ATK +15%%",
        ["%[%[Flee]]"]="Ki +1 when HP is 30%% or below",
        ["%[%[Formidable Enemy]]"]="ATK +10%%",
        ["%[%[Fortuneteller Baba’s Fighter]]"]="Ki +2",
        ["%[%[Frieza's Army]]"]="DEF +1000",
        ["%[%[Frieza's Minion]]"]="ATK +300",
        ["%[%[Fused Fighter]]"]="Ki +2",
        ["%[%[Fusion %(Link Skill%)%|Fusion]]"]="Ki +2",
        ["%[%[Fusion Failure]]"]="Recover 3%% HP",
        ["%[%[Galactic Visitor]]"]="Ki +1",
        ["%[%[Galactic Warriors]]"]="ATK +20%%",
        ["%[%[Gaze of Respect]]"]="Ki +2",
        ["%[%[Gentleman]]"]="Ki +2",
        ["%[%[Godly Power]]"]="ATK +15%%",
        ["%[%[Golden Warrior]]"]="Ki +1, enemy DEF -2000",
        ["%[%[Golden Z%-Fighter]]"]="Ki +2",
        ["%[%[GT]]"]="Ki +2",
        ["%[%[Guidance of the Dragon Balls]]"]="ATK +20%%",
        ["%[%[Hardened Grudge]]"]="Ki +1",
        ["%[%[Hatred of Saiyans]]"]="Ki +2",
        ["%[%[Hero]]"]="DEF +20%%",
        ["%[%[Hero of Justice]]"]="ATK +25%%",
        ["%[%[Infighter]]"]="ATK +10%%, Enemy DEF -10%%",
        ["%[%[Infinite Energy]]"]="Ki +2",
        ["%[%[Infinite Regeneration]]"]="Recover 3%% HP",
        ["%[%[Kamehameha]]"]="ATK +2500 when Super Attack is launched",
        ["%[%[Legendary Power]]"]="ATK +5000 when Super Attack is launched",
        ["%[%[Limit%-Breaking Form]]"]="ATK +2000 when Super Attack is launched",
        ["%[%[Loyalty]]"]="Ki +1",
        ["%[%[Majin]]"]="ATK & DEF +10%%",
        ["%[%[Majin Resurrection Plan]]"]="Ki +2",
        ["%[%[Master and Pupil]]"]="Ki +1",
        ["%[%[Master of Magic]]"]="ATK +15%%",
        ["%[%[Mechanical Menaces]]"]="Ki +1",
        ["%[%[Messenger from the Future]]"]="ATK +500",
        ["%[%[Metamorphosis]]"]="Recover 5%% HP",
        ["%[%[Money Money Money]]"]="Ki +1",
        ["%[%[More Than Meets the Eye]]"]="ATK +300",
        ["%[%[Namekians %(Link Skill%)%|Namekians]]"]="Recover 5%% HP",
        ["%[%[New]]"]="ATK +200",
        ["%[%[New Frieza Army]]"]="ATK & DEF +1000",
        ["%[%[Nightmare]]"]="ATK +10%%",
        ["%[%[Organic Upgrade]]"]="Ki +2",
        ["%[%[Otherworld Warriors %(Link Skill%)%|Otherworld Warriors]]"]="ATK +20%%",
        ["%[%[Over 9000]]"]="ATK +10%%",
        ["%[%[Over in a Flash]]"]="Ki +3",
        ["%[%[Patrol]]"]="Ki +2",
        ["%[%[Penguin Village Adventure]]"]="ATK +15%%",
        ["%[%[Power Bestowed by God]]"]="ATK +2500 when Super Attack is launched",
        ["%[%[Prepared for Battle]]"]="Ki +2",
        ["%[%[Prodigies]]"]="ATK +10%%",
        ["%[%[Respect]]"]="ATK +500",
        ["%[%[Resurrection 'F']]"]="ATK +700",
        ["%[%[Revival]]"]="Ki +2",
        ["%[%[Rival Duo]]"]="ATK +10%%, attacked enemy's DEF -15%%",
        ["%[%[Royal Lineage]]"]="Ki +1",
        ["%[%[RR Army]]"]="ATK +300",
        ["%[%[Saiyan Pride]]"]="ATK +15%%",
        ["%[%[Saiyan Roar]]"]="ATK +25%%",
        ["%[%[Saiyan Warrior Race]]"]="ATK +700",
        ["%[%[Scientist]]"]="Ki +2",
        ["%[%[Shadow Dragons]]"]="ATK +15%%",
        ["%[%[Shattering the Limit]]"]="Ki +2",
        ["%[%[Shocking Speed]]"]="Ki +2",
        ["%[%[Signature Pose]]"]="Ki +2",
        ["%[%[Soul vs Soul]]"]="Weakens Regeneration and Ki +1",
        ["%[%[Speedy Retribution]]"]="ATK +300",
        ["%[%[Strength in Unity]]"]="Ki +1",
        ["%[%[Strongest Clan in Space]]"]="Ki +2",
        ["%[%[Super Saiyan]]"]="ATK +10%%",
        ["%[%[Super Strike]]"]="ATK +20%%",
        ["%[%[Super%-God Combat]]"]="ATK +15%%",
        ["%[%[Supreme Power]]"]="Activate Penetration, ATK & DEF +1000",
        ["%[%[Supreme Warrior]]"]="Ki +1",
        ["%[%[Tag Team of Terror]]"]="ATK +500",
        ["%[%[Team Bardock %(Link Skill%)%|Team Bardock]]"]="Ki +1",
        ["%[%[Team Turles]]"]="Ki +1",
        ["%[%[Telekinesis]]"]="Enemy DEF -10%%",
        ["%[%[The First Awakened]]"]="ATK +25%%",
        ["%[%[The Ginyu Force]]"]="ATK +25%%",
        ["%[%[The Hera Clan]]"]="Ki +2",
        ["%[%[Champion's Strength]]"]="Ki +1",
        ["%[%[The Incredible Adventure]]"]="Ki +2",
        ["%[%[The Innocents]]"]="ATK +10%%",
        ["%[%[The Saiyan Lineage]]"]="Ki +1",
        ["%[%[The Students]]"]="DEF +1000",
        ["%[%[The Wall Standing Tall]]"]="Foils enemy's True Power and boosts ATK by 15%%",
        ["%[%[Thirst for Conquest]]"]="ATK +15%%",
        ["%[%[Tough as Nails]]"]="DEF +1500",
        ["%[%[Tournament of Power]]"]="Ki +3",
        ["%[%[Transform]]"]="Ki +2",
        ["%[%[Turtle School]]"]="ATK +500, DEF +500",
        ["%[%[Twin Terrors]]"]="Ki +2",
        ["%[%[Ultimate Lifeform]]"]="Ki +2",
        ["%[%[Unbreakable Bond]]"]="Ki +2",
        ["%[%[Universe's Most Malevolent]]"]="ATK +15%%",
        ["%[%[Warrior Gods]]"]="ATK +10%%",
        ["%[%[Warriors of Universe 6]]"]="Ki +2",
        ["%[%[World Tournament Champion]]"]="Ki +1",
        ["%[%[World Tournament Reborn]]"]="ATK +300",
        ["%[%[Xenoverse]]"]="ATK +20%%",
        ["%[%[Z Fighters]]"]="ATK +15%%",
        ["NamedLink"]="Descriptions",
    }
    for key, value in pairs( linksArray ) do
        results = string.gsub(results,key,"<span class=\"advanced-tooltip\">" .. key .. "<div class=\"tooltip-contents\"><div style=\"background: white; border: 2px solid; border-radius: 7px;-moz-border-radius: 7px;-webkit-border-radius: 7px; box-shadow:0 0 4px;\"> '''" .. value .. "''' </div> </div></span>")
    end
 
    return results
end
 
return p
*Disclosure: Some of the links above are affiliate links, meaning, at no additional cost to you, Fandom will earn a commission if you click through and make a purchase. Community content is available under CC-BY-SA unless otherwise noted.

Fandom may earn an affiliate commission on sales made from links on this page.

Stream the best stories.

Fandom may earn an affiliate commission on sales made from links on this page.

Get Disney+