0.15.2 • Published 6 years ago

fire-emblem-heroes-calculator v0.15.2

Weekly downloads
-
License
MIT
Repository
-
Last release
6 years ago

fire-emblem-heroes-calculator

Calculate the result of combat between one hero and another

Installation

You can load fire-emblem-heroes-calculator via npm, or with a script tag.

You can also try fire-emblem-heroes-calculator out without installing, using Runkit!

HTML (loaded via CDN)

<!-- Dev -->
<script src="https://proving-grounds-static.ajhyndman.com/<version>/fire-emblem-heroes-calculator.js"></script>
<!-- Production -->
<script src="https://proving-grounds-static.ajhyndman.com/<version>/fire-emblem-heroes-calculator.min.js"></script>

<script type="text/javascript">
  // A new variable will be available here, named `calculator`.
  alert(calculator.getDefaultInstance('Anna: Commander'));
</script>

Node (npm)

npm install --save fire-emblem-heroes-calculator
var calculator = require('fire-emblem-heroes-calculator');

Usage

var Anna = calculator.getDefaultInstance('Anna: Commander');
var Sharena = calculator.getDefaultInstance('Sharena: Princess of Askr');

calculator.calculateResult(Anna, Sharena);

// => {
//   combatInfo: {
//     "attackerDamage": 25,
//     "attackerNumAttacks": 1,
//     "attackerSpecialDamage": 0,
//     "attackerHp": 24,
//     "defenderSpecialDamage": 0,
//     "defenderNumAttacks": 1,
//     "defenderDamage": 17,
//     "defenderHp": 18
//   }
//   attackerState: {
//     hpMissing: 17
//     specialCharge: 2,
//   },
//   defenderState: {
//     hpMissing: 25
//     specialCharge: 0,
//   },
// }

calculator.getInheritableSkills('Anna: Commander', 'WEAPON');

// => [
//   'Brave Axe',
//   'Brave Axe+',
//   'Carrot Axe',
//   'Carrot Axe+',
//   'Emerald Axe',
//   'Emerald Axe+',
//   'Hammer',
//   'Hammer+',
//   'Iron Axe',
//   'Killer Axe',
//   'Killer Axe+',
//   'Nóatún',
//   'Silver Axe',
//   'Silver Axe+',
//   'Steel Axe'
// ]

calculator.getStat(
  Anna, // hero instance
  'atk', // stat key, one of: 'atk' | 'def' | 'hp' | 'res' | 'spd'
  40, // level, one of: 1 | 40
  {enemy: Sharena, isAttacker: true, allies: [], otherEnemies: []}, // Context (optional)
);

// => 45
0.15.2

6 years ago

0.15.1

6 years ago

0.15.0

6 years ago

0.14.5

6 years ago

0.14.4

6 years ago

0.14.3

6 years ago

0.14.2

6 years ago

0.14.1

6 years ago

0.13.1

6 years ago

0.13.0

6 years ago

0.12.6

6 years ago

0.12.5

6 years ago

0.12.4

6 years ago

0.12.3

6 years ago

0.12.2

6 years ago

0.12.1

6 years ago

0.12.0

6 years ago

0.11.2

6 years ago

0.11.1

6 years ago

0.11.0

6 years ago

0.10.2

6 years ago

0.10.1

7 years ago

0.10.0

7 years ago

0.9.14

7 years ago

0.9.13

7 years ago

0.9.12

7 years ago

0.9.11

7 years ago

0.9.10

7 years ago

0.9.9

7 years ago

0.9.8

7 years ago

0.9.7

7 years ago

0.9.6

7 years ago

0.9.5

7 years ago

0.9.4

7 years ago

0.9.3

7 years ago

0.9.2

7 years ago

0.9.1

7 years ago

0.9.0

7 years ago

0.8.3

7 years ago

0.8.2

7 years ago

0.8.1

7 years ago

0.8.0

7 years ago

0.7.22

7 years ago

0.7.21

7 years ago

0.7.20

7 years ago

0.7.19

7 years ago

0.7.18

7 years ago

0.7.17

7 years ago

0.7.16

7 years ago

0.7.15

7 years ago

0.7.14

7 years ago

0.7.13

7 years ago

0.7.12

7 years ago

0.7.11

7 years ago

0.7.10

7 years ago

0.7.9

7 years ago

0.7.8

7 years ago

0.7.7

7 years ago

0.7.6

7 years ago

0.7.5

7 years ago

0.7.4

7 years ago

0.7.3

7 years ago

0.7.2

7 years ago

0.7.1

7 years ago

0.7.0

7 years ago

0.6.6

7 years ago

0.6.5

7 years ago

0.6.4

7 years ago

0.6.3

7 years ago

0.6.2

7 years ago

0.6.1

7 years ago

0.6.0

7 years ago