Skip to content

Commit

Permalink
Implement prepull normalizer for living flame to handle specific scen…
Browse files Browse the repository at this point in the history
…ario
  • Loading branch information
Krealle committed Mar 17, 2024
1 parent 76be5c5 commit 9589720
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/analysis/retail/evoker/devastation/CombatLogParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import EngulfingBlaze from './modules/talents/EngulfingBlaze';
import LayWaste from './modules/talents/LayWaste';
import Iridescence from './modules/talents/Iridescence';
import T31DevaTier from './modules/dragonflight/tier/T31DevaTier';
import LivingFlamePrePullNormalizer from './modules/normalizers/LivingFlamePrePullNormalizer';

// Shared
import {
Expand Down Expand Up @@ -59,6 +60,7 @@ class CombatLogParser extends MainCombatLogParser {
// Normalizer
castLinkNormalizer: CastLinkNormalizer,
essenceBurstNormalizer: EssenceBurstNormalizer,
livingFlamePrePullNormalizer: LivingFlamePrePullNormalizer,

// features
apls: AplCheck,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import SPELLS from 'common/SPELLS/evoker';
import { AnyEvent, BeginCastEvent, EventType, HasRelatedEvent } from 'parser/core/Events';
import EventsNormalizer from 'parser/core/EventsNormalizer';
import { BURNOUT_CONSUME } from './CastLinkNormalizer';
import Haste from 'parser/shared/modules/Haste';

/**
* Living flame is the most commonly pre-pull casted spell for Devastation
* however it often occurs that you'll start channeling it pre-pull and only
* the cast success event (PrePullNormalizer doesn't account for this since we don't have a way to define instant cast spells)
* will trigger, this messes with how we handle GCDs and makes for a messy timeline.
*
* This normalizer aims to correct those situation
*/
class LivingFlamePrePullNormalizer extends EventsNormalizer {
static dependencies = {
...EventsNormalizer.dependencies,
haste: Haste,
};
protected haste!: Haste;
normalize(events: AnyEvent[]) {
const fixedEvents: AnyEvent[] = [];
let lastBeginCastEvent: BeginCastEvent | undefined;

events.forEach((event) => {
if (!lastBeginCastEvent) {
if (
event.type === EventType.BeginCast &&
event.ability.guid === SPELLS.LIVING_FLAME_CAST.id
) {
lastBeginCastEvent = event;
}

if (
event.type === EventType.Cast &&
event.ability.guid === SPELLS.LIVING_FLAME_CAST.id &&
!HasRelatedEvent(event, BURNOUT_CONSUME)
) {
fixedEvents.push({
...event,
// Try to get the proper GCD time
timestamp: event.timestamp - 1500 / (1 + this.haste.current),
__modified: true,
prepull: true,
});
return;
}
}
fixedEvents.push(event);
});
return fixedEvents;
}
}
export default LivingFlamePrePullNormalizer;

0 comments on commit 9589720

Please sign in to comment.