ilivath

Untitled

Mar 3rd, 2019
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.00 KB | None | 0 0
  1. import React from 'react';
  2.  
  3. import Analyzer from 'parser/core/Analyzer';
  4. import AbilityTracker from 'parser/shared/modules/AbilityTracker';
  5.  
  6. import SPELLS from 'common/SPELLS';
  7. import SpellIcon from 'common/SpellIcon';
  8.  
  9. import StatisticBox, { STATISTIC_ORDER } from 'interface/others/StatisticBox';
  10.  
  11. // the application of the damage is instant after the cast, but seems to have a little bit of leeway across multiple enemies
  12. // this example log: /report/FaYGNxBzDVKAR8Lp/11-Mythic+Grong+-+Kill+(5:47)/Ilivath shows around +15ms, so setting 100ms buffer to account for lag
  13.  
  14. class WakeofAshes extends Analyzer {
  15. static dependencies = {
  16. abilityTracker: AbilityTracker,
  17. };
  18.  
  19. totalHits = 0;
  20. badCasts = 0;
  21. wakeCast = true;
  22.  
  23. constructor(...args) {
  24. super(...args);
  25. this.active = this.selectedCombatant.hasTalent(SPELLS.WAKE_OF_ASHES_TALENT.id);
  26. }
  27.  
  28. on_byPlayer_damage(event) {
  29. const spellId = event.ability.guid;
  30. if (spellId !== SPELLS.WAKE_OF_ASHES_TALENT.id) {
  31. return;
  32. }
  33. this.totalHits += 1;
  34. this.wakeCast = false;
  35. }
  36.  
  37. on_byPlayer_cast(event) {
  38. const spellId = event.ability.guid;
  39. if (spellId !== SPELLS.WAKE_OF_ASHES_TALENT.id) {
  40. return;
  41. }
  42. if (this.wakeCast) {
  43. this.badCasts += 1;
  44. }
  45. this.wakeCast = true;
  46. }
  47.  
  48. on_fightend() {
  49. if (this.wakeCast) {
  50. this.badCasts += 1;
  51. }
  52. }
  53.  
  54. get averageHitPerCast() {
  55. return this.totalHits / this.abilityTracker.getAbility(SPELLS.WAKE_OF_ASHES_TALENT.id).casts;
  56. }
  57.  
  58. statistic() {
  59. return (
  60. <StatisticBox
  61. position={STATISTIC_ORDER.UNIMPORTANT()}
  62. icon={<SpellIcon id={SPELLS.WAKE_OF_ASHES_TALENT.id} />}
  63. value={(
  64. <>
  65. {(this.averageHitPerCast.toFixed(2))} Average Targets Hit <br />
  66. {(this.badCasts)} Missed
  67. </>
  68. )}
  69. label="Stuff"
  70. tooltip={`Other Stuff`}
  71. />
  72. );
  73. }
  74. }
  75.  
  76. export default WakeofAshes;
Advertisement
Add Comment
Please, Sign In to add comment