genshin-damage-calculator
v1.0.0
Published
JavaScript library for calculating damage of Genshin Impact
Downloads
1
Readme
genshin-damage-calculator
JavaScript library for calculating damage of Genshin Impact
Usage
import {calculateDamage} from 'genshin-damage-calculator';
calculateDamage({
level: 70,
atk: 1500,
base_atk_ability: 6.19,
elemental_mastery: 150,
is_crit: true,
crit_dmg: 0.8,
damage_bonus: 0.4 + 0.52,
enemy_level: 75,
base_res: 0.1,
res_debuffs: 0.4,
def_reduction: 0.23,
vaporize: {
trigger_element: 'pyro',
},
}); //=> 52247
Concept
┌──────────────────────────┐
│* Character Name │
│* Character Level │
│* Weapon │
┌────┤* Artifacts │
│ │* Artifact Buffs │
│ │ (Always triggered) │
│ └──────────────────────────┘
▼
┌─────────────────────┐
│Base Character Status│
└───────┬─────────────┘
│
│ ┌──────────────────────────┐
│ │* Elemental Resonance │
│ │* Artifact Buffs triggered│
│◄───┤* Talent Buffs triggered │
│ │* Weapons Buffs triggered │
│ │* Lay Line Disorder etc. │
│ └──────────────────────────┘
│
▼
┌───────────────────────┐
│Buffed Character Status│
└───────┬───────────────┘
│
│ ┌──────────────────────────┐
│ │* Whether it's critical │
│ │* Elemental Reactions │
│ │* Attack-specific Buffs │
│◄───┤ triggered │
│ │* Damage Bonus │
│ │* Enemy Level │
│ │* Enemy's RES etc.│
│ └──────────────────────────┘
│
▼
┌─────────┐ ┌────────────┐
│Condition├──────►│Final Damage│
└─────────┘ └────────────┘
License
Licensed under the Apache License 2.0. See the LICENSE file for details.