Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React from 'react';
- import Analyzer from 'parser/core/Analyzer';
- import AbilityTracker from 'parser/shared/modules/AbilityTracker';
- import SPELLS from 'common/SPELLS';
- import SpellIcon from 'common/SpellIcon';
- import StatisticBox, { STATISTIC_ORDER } from 'interface/others/StatisticBox';
- // the application of the damage is instant after the cast, but seems to have a little bit of leeway across multiple enemies
- // this example log: /report/FaYGNxBzDVKAR8Lp/11-Mythic+Grong+-+Kill+(5:47)/Ilivath shows around +15ms, so setting 100ms buffer to account for lag
- class WakeofAshes extends Analyzer {
- static dependencies = {
- abilityTracker: AbilityTracker,
- };
- totalHits = 0;
- badCasts = 0;
- wakeCast = true;
- constructor(...args) {
- super(...args);
- this.active = this.selectedCombatant.hasTalent(SPELLS.WAKE_OF_ASHES_TALENT.id);
- }
- on_byPlayer_damage(event) {
- const spellId = event.ability.guid;
- if (spellId !== SPELLS.WAKE_OF_ASHES_TALENT.id) {
- return;
- }
- this.totalHits += 1;
- this.wakeCast = false;
- }
- on_byPlayer_cast(event) {
- const spellId = event.ability.guid;
- if (spellId !== SPELLS.WAKE_OF_ASHES_TALENT.id) {
- return;
- }
- if (this.wakeCast) {
- this.badCasts += 1;
- }
- this.wakeCast = true;
- }
- on_fightend() {
- if (this.wakeCast) {
- this.badCasts += 1;
- }
- }
- get averageHitPerCast() {
- return this.totalHits / this.abilityTracker.getAbility(SPELLS.WAKE_OF_ASHES_TALENT.id).casts;
- }
- statistic() {
- return (
- <StatisticBox
- position={STATISTIC_ORDER.UNIMPORTANT()}
- icon={<SpellIcon id={SPELLS.WAKE_OF_ASHES_TALENT.id} />}
- value={(
- <>
- {(this.averageHitPerCast.toFixed(2))} Average Targets Hit <br />
- {(this.badCasts)} Missed
- </>
- )}
- label="Stuff"
- tooltip={`Other Stuff`}
- />
- );
- }
- }
- export default WakeofAshes;
Advertisement
Add Comment
Please, Sign In to add comment