mhwdmg
TypeScript icon, indicating that this package has built-in type declarations

0.4.4 • Public • Published

npm versionBuild Status

MHW DMG

TypeScript and JavaScript library for damage calcuration at MonsterHunterWorld: Iceborne.

Install

# use yarn
$ yarn add mhwdmg
# use npm
$ npm install --save mhwdmg

Examples

JavaScript

const { damage, damageDetail } = require('mhwdmg')

// basic
const weapon = {
  attack: 200,
  affinity: 0,
  element: 200,
  sharpness: 'purple'
}

const motion = {
  value: 20
}

const target = {
  physicalEffectiveness: 40,
  elementalEffectiveness: 20,
  anger: false,
  wounded: false
}

const condition = {
  weapon,
  motion,
  target
}

console.log(damage(condition)) // return 27


// with skills
const skill = {
  // attackBoost Lv.7
  attackBoost: 7,
  // criticalEye Lv.3
  criticalEye: 3
}

condition.skill = skill

console.log(damage(condition)) // return 31.2


// with buff
const buff = {
  demonDrug: true,
  canteen: 'L'
}

condition.buff = buff

console.log(damage(condition)) // return 32.4


// damageDetail returns detail of calcuration result
console.log(damageDetail(condition))
/*
{
  base: { elemental: 5, physical: 26 },
  critical: { elemental: 5, physical: 33 },
  expected: { elemental: 5, physical: 27.4 }
}
*/

Readme

Keywords

none

Package Sidebar

Install

npm i mhwdmg

Weekly Downloads

4

Version

0.4.4

License

MIT

Unpacked Size

14.1 kB

Total Files

17

Last publish

Collaborators

  • reireias