Site News
Warning: This wiki contains spoilers. Read at your own risk!

Social media: If you would like, please join our Discord server, and/or follow us on Twitter (X) or Tumblr!

Module:Heroes BoonBane: Difference between revisions

From Fire Emblem Wiki, your source on Fire Emblem information. By fans, for fans.
mNo edit summary
mNo edit summary
Line 26: Line 26:


Growth value details from:
Growth value details from:
https://feheroes.gamepedia.com/Stat_Growth
https://feheroes.gamepedia.com/index.php?title=Stat_growth&oldid=162275
]]
]]



Revision as of 22:36, 1 December 2019

For use on the stat templates of Fire Emblem Heroes playable characters.

level1

Outputs a hero's level 1 stats, adjusted for boon and bane.

{{#invoke:Heroes BoonBane|level1|<base stat>}}

Enter the hero's base stat in the first parameter.

Example: Tana's base Speed at 5★ is 10, so the entry is as follows:

{{#invoke:Heroes BoonBane|level1|10}}

This outputs: 9/10/11

level40

Outputs a hero's level 40 stats, adjusted for boon and bane.

{{#invoke:Heroes BoonBane|level40|<base stat>|<growth points>|<rarity>}}

Enter the hero's base stat in the first parameter. Enter their growth points in the second, and their rarity (as a number) in the third.

Example: Leon: True of Heart's base defense at 5★ is 8 and he has a 50% growth rate in defense, so the entry is as follows:

{{#invoke:Heroes BoonBane|level40|8|50|5}}

This outputs: Lua error at line 49: attempt to index field '?' (a nil value).


local p = {}

--[[
Level 1 stats. Input the neutral stat, and output the neutral, boon,
and bane (which are literally just the neutral stat +1 or -1).
Or output only neutral for heroes without boons/banes (e.g. GHBs).
]]

function p.level1(frame)
    boon = frame.args[1] + 1
    bane = frame.args[1] - 1
    if( frame.args[2] == "ghb" ) then
        return frame.args[1]
    else
        return string.format("%s/%s/%s", bane, frame.args[1], boon)
    end
end

--[[
Level 40 stats. Input as follows:
{{#invoke:Heroes BoonBane|level40|base|gp|star|ghb}}
base = Base stat
gp = Growth points in this stat
star = rarity
ghb = Only if this hero is a "special" hero with no boon/bane, e.g. GHBs, daily Hero Battles

Growth value details from:
https://feheroes.gamepedia.com/index.php?title=Stat_growth&oldid=162275
]]

function p.level40(frame)
    growth_values = {}
    growth_values[0] = {6,7,7,8,8}
    growth_values[1] = {8,8,9,10,10}
    growth_values[2] = {9,10,11,12,13}
    growth_values[3] = {11,12,13,14,15}
    growth_values[4] = {13,14,15,16,17}
    growth_values[5] = {14,15,17,18,19}
    growth_values[6] = {16,17,19,20,22}
    growth_values[7] = {18,19,21,22,24}
    growth_values[8] = {19,21,23,24,26}
    growth_values[9] = {21,23,25,26,28}
    growth_values[10] = {23,25,27,28,30}
    growth_values[11] = {24,26,29,31,33}
    growth_values[12] = {26,28,31,33,35}
    growth_values[13] = {28,30,33,35,37}

    -- For a bane, the growth value gets lowered by 1
    final_bane = (frame.args[1] - 1) + growth_values[tonumber(frame.args[2] - 1)][tonumber(frame.args[3])]

    final_neutral = frame.args[1] + growth_values[tonumber(frame.args[2])][tonumber(frame.args[3])]

    -- For a boon, the growth value gets increased by 1
    final_boon = (frame.args[1] + 1) + growth_values[tonumber(frame.args[2] + 1)][tonumber(frame.args[3])]

    if( frame.args[4] == "ghb" ) then
        return final_neutral
    else
        return string.format("%s/%s/%s", final_bane, final_neutral, final_boon)
    end
end

return p