Module:HeroDataArrays: Difference between revisions

Jump to navigation Jump to search
bullet damage
melee, updated max boon count
Line 2: Line 2:
local util_module = require('Module:Utilities')
local util_module = require('Module:Utilities')
local allHeroData = mw.loadJsonData("Data:HeroData.json")
local allHeroData = mw.loadJsonData("Data:HeroData.json")
local soul_unlock = require('Module:SoulUnlock')
local inGameHeroData = {}
local inGameHeroData = {}


Line 65: Line 66:
                 frame:expandTemplate{title="PageRef", args={a["Name"]}}..
                 frame:expandTemplate{title="PageRef", args={a["Name"]}}..
                 " || "..a["MaxHealth"].." || +"..a["LevelScaling>MaxHealth"].." || "..
                 " || "..a["MaxHealth"].." || +"..a["LevelScaling>MaxHealth"].." || "..
                 tostring(roundValue(tonumber(a["MaxHealth"])+tonumber(a["LevelScaling>MaxHealth"])*14)).." \n"
                 tostring(roundValue(tonumber(a["MaxHealth"])+tonumber(a["LevelScaling>MaxHealth"])*soul_unlock.get_max('PowerIncrease'))).." \n"
     end
     end
      
      
Line 219: Line 220:
                 frame:expandTemplate{title="PageRef", args={a["Name"]}}..
                 frame:expandTemplate{title="PageRef", args={a["Name"]}}..
                 " || "..a["BulletDamage"].." || +"..a["LevelScaling>BulletDamage"].." || "..
                 " || "..a["BulletDamage"].." || +"..a["LevelScaling>BulletDamage"].." || "..
                 tostring(roundValue(tonumber(a["BulletDamage"])+tonumber(a["LevelScaling>BulletDamage"])*14)).." \n"
                 tostring(roundValue(tonumber(a["BulletDamage"])+tonumber(a["LevelScaling>BulletDamage"])*soul_unlock.get_max('PowerIncrease'))).." \n"
    end
   
    -- Cap it off
    z = z.."|}"
   
    return z
end
 
p.heroLightMeleeTable = function(frame)
    -- Pull data
    heroLightMeleeData = heroDataArray({"Name", "LightMeleeDamage", "LevelScaling>LightMeleeDamage"})
 
    -- Input table will be called a, output wikitable will be called z
    -- From a to z, haha get it
    z = "{| class=\"wikitable sortable mw-collapsible\" style=\"text-align:center\" \n"..
        "|+ Hero Base Light Melee Stats \n"..
        "! Hero !! Starting !! Added per Boon !! At Max Boon \n"
 
    -- Iterate over heroes adding a new row to the wikitable for each
    for i,a in pairs(heroLightMeleeData) do
        z = z..
            "|- \n"..
            "| style=\"text-align:left;\" | "..
                frame:expandTemplate{title="PageRef", args={a["Name"]}}..
                " || "..a["LightMeleeDamage"].." || +"..a["LevelScaling>LightMeleeDamage"].." || "..
                tostring(roundValue(tonumber(a["LightMeleeDamage"])+tonumber(a["LevelScaling>LightMeleeDamage"])*soul_unlock.get_max('PowerIncrease'))).." \n"
    end
   
    -- Cap it off
    z = z.."|}"
   
    return z
end
 
p.heroHeavyMeleeTable = function(frame)
    -- Pull data
    heroHeavyMeleeData = heroDataArray({"Name", "HeavyMeleeDamage", "LevelScaling>HeavyMeleeDamage"})
 
    -- Input table will be called a, output wikitable will be called z
    -- From a to z, haha get it
    z = "{| class=\"wikitable sortable mw-collapsible\" style=\"text-align:center\" \n"..
        "|+ Hero Base Heavy Melee Stats \n"..
        "! Hero !! Starting !! Added per Boon !! At Max Boon \n"
 
    -- Iterate over heroes adding a new row to the wikitable for each
    for i,a in pairs(heroHeavyMeleeData) do
        z = z..
            "|- \n"..
            "| style=\"text-align:left;\" | "..
                frame:expandTemplate{title="PageRef", args={a["Name"]}}..
                " || "..a["HeavyMeleeDamage"].." || +"..a["LevelScaling>HeavyMeleeDamage"].." || "..
                tostring(roundValue(tonumber(a["HeavyMeleeDamage"])+tonumber(a["LevelScaling>HeavyMeleeDamage"])*soul_unlock.get_max('PowerIncrease'))).." \n"
     end
     end