Module:Sandbox/One Bar: Difference between revisions

One Bar (talk | contribs)
No edit summary
One Bar (talk | contribs)
alt fires
Line 18: Line 18:
LightMeleeDamage = "Light Melee Damage",
LightMeleeDamage = "Light Melee Damage",
HeavyMeleeDamage = "Heavy Melee Damage"
HeavyMeleeDamage = "Heavy Melee Damage"
}
-- Not in HeroData.json although Shiv is just (bullet damage * 12)
local alt_fires = {
Shiv = {base = 59.4, level = 2.64, suffix = "alt fire 12 pellets"},
Viscous = {base = 70, level = 0.9, suffix = "alt fire AOE"},
Yamato = {base = 70, level = 0.35, suffix = "alt fire AOE"}
}
}


Line 73: Line 80:
local burst = hero["BulletsPerBurst"]
local burst = hero["BulletsPerBurst"]
local bullet_mult = shots * burst
local bullet_mult = shots * burst
if (bullet_mult > 1) then
local hero_suffix = ""
if (property == "BulletDamage" and bullet_mult > 1) then
base = base * bullet_mult
base = base * bullet_mult
level = level * bullet_mult
level = level * bullet_mult
if (shots > 1) then hero_suffix = hero_suffix .. " (" .. shots .. " pellets)" end
if (burst > 1) then hero_suffix = hero_suffix .. " (" .. burst .. " bullets)" end
end
end
local tableData = mw.html.create("tr")
local tableData = mw.html.create("tr")
tableData
tableData
:tag("td"):wikitext(hero_icon(frame, hero["Name"])):done()
:tag("td"):wikitext(hero_icon(frame, hero["Name"]) .. hero_suffix):done()
:tag("td"):wikitext(base):done()
:tag("td"):wikitext(base):done()
:tag("td"):wikitext("+" .. level):done()
:tag("td"):wikitext("+" .. level):done()
Line 90: Line 100:
createTable:node(tableData)
createTable:node(tableData)
if (property == "BulletDamage" and alt_fires[hero["Name"]] ~= nil) then
local alt_fire = alt_fires[hero["Name"]]
local alt_base = alt_fire["base"]
local alt_level = alt_fire["level"]
local alt_suffix = " (" .. alt_fire["suffix"] .. ")"
local alt_fire_row = mw.html.create("tr")
alt_fire_row
:tag("td"):wikitext(hero_icon(frame, hero["Name"]) .. alt_suffix):done()
:tag("td"):wikitext(alt_base):done()
:tag("td"):wikitext("+" .. alt_level):done()
for i, v in ipairs(pi_souls_list) do
local total = alt_base + alt_level * i
alt_fire_row:tag("td"):wikitext(total):done()
end
createTable:node(alt_fire_row)
end
end
end