Difference between revisions of "Widget:AdventurerPageStatsCalculatorTest"
Jump to navigation
Jump to search
imported>Elaeagnifolia |
imported>Elaeagnifolia |
||
| (15 intermediate revisions by the same user not shown) | |||
| Line 6: | Line 6: | ||
const MIN_HP = [<!--{$minHp3}-->,<!--{$minHp4}-->,<!--{$minHp5}-->]; | const MIN_HP = [<!--{$minHp3}-->,<!--{$minHp4}-->,<!--{$minHp5}-->]; | ||
const MAX_HP = <!--{$maxHp}-->; | const MAX_HP = <!--{$maxHp}-->; | ||
| − | const ADD_MAX_HP = <!--{$ | + | const ADD_MAX_HP = <!--{$addMaxHp1}-->; |
const MIN_STR = [<!--{$minStr3}-->,<!--{$minStr4}-->,<!--{$minStr5}-->]; | const MIN_STR = [<!--{$minStr3}-->,<!--{$minStr4}-->,<!--{$minStr5}-->]; | ||
const MAX_STR = <!--{$maxStr}-->; | const MAX_STR = <!--{$maxStr}-->; | ||
| − | const ADD_MAX_STR = <!--{$ | + | const ADD_MAX_STR = <!--{$addMaxAtk1}-->; |
const NAT_RARITY = <!--{$rarity}-->; | const NAT_RARITY = <!--{$rarity}-->; | ||
const HAS_SPIRAL_LIMIT_BREAK = <!--{$maxLimitBreakCount}--> == 5; | const HAS_SPIRAL_LIMIT_BREAK = <!--{$maxLimitBreakCount}--> == 5; | ||
| Line 76: | Line 76: | ||
if (HAS_SPIRAL_LIMIT_BREAK) { | if (HAS_SPIRAL_LIMIT_BREAK) { | ||
// Level 80+ after Mana Spiral is unlocked has a different calc | // Level 80+ after Mana Spiral is unlocked has a different calc | ||
| − | setHP(calculateSpiralHP(level, rarity), level) | + | setHP(calculateSpiralHP(level, rarity), level); |
| − | setStr(calculateSpiralStr(level, rarity), level) | + | setStr(calculateSpiralStr(level, rarity), level); |
} else { | } else { | ||
| − | setHP(calculateHP(level, rarity), level) | + | setHP(calculateHP(level, rarity), level); |
| − | setStr(calculateStr(level, rarity), level) | + | setStr(calculateStr(level, rarity), level); |
} | } | ||
} else { | } else { | ||
| Line 151: | Line 151: | ||
function calculateSpiralStr(level, rarity) { | function calculateSpiralStr(level, rarity) { | ||
let levelDiff = SPIRAL_MAX_LEVEL - MAX_LEVEL; | let levelDiff = SPIRAL_MAX_LEVEL - MAX_LEVEL; | ||
| − | let steps = (ADD_MAX_STR - | + | let steps = (ADD_MAX_STR - MAX_STR) / levelDiff; |
let statGain = (level-80) * steps; | let statGain = (level-80) * steps; | ||
| − | return Math.ceil( | + | return Math.ceil(MAX_STR + statGain); |
} | } | ||
</script> | </script> | ||