From fc7c9c650679740e9504c5cadcb9dd87d5dfbbe8 Mon Sep 17 00:00:00 2001 From: Vollmer Date: Thu, 4 Apr 2024 23:49:20 +0200 Subject: [PATCH] move event ordering back to Deva needed for aplcheck, for analyzers castlinks should be enough --- .../evoker/devastation/CombatLogParser.ts | 4 +- .../normalizers/EssenceBurstNormalizer.ts | 47 ++++++++++++ src/analysis/retail/evoker/shared/index.ts | 1 - .../EssenceBurstEventOrderNormalizer.ts | 75 ------------------- 4 files changed, 49 insertions(+), 78 deletions(-) create mode 100644 src/analysis/retail/evoker/devastation/modules/normalizers/EssenceBurstNormalizer.ts delete mode 100644 src/analysis/retail/evoker/shared/modules/normalizers/EssenceBurstEventOrderNormalizer.ts diff --git a/src/analysis/retail/evoker/devastation/CombatLogParser.ts b/src/analysis/retail/evoker/devastation/CombatLogParser.ts index a61e81c582e..e4b036a1036 100644 --- a/src/analysis/retail/evoker/devastation/CombatLogParser.ts +++ b/src/analysis/retail/evoker/devastation/CombatLogParser.ts @@ -11,6 +11,7 @@ import EssenceBurst from './modules/abilities/EssenceBurst'; import Burnout from './modules/abilities/Burnout'; import DragonRage from './modules/abilities/DragonRage'; import CastLinkNormalizer from './modules/normalizers/CastLinkNormalizer'; +import EssenceBurstNormalizer from './modules/normalizers/EssenceBurstNormalizer'; import Snapfire from './modules/abilities/Snapfire'; import T30DevaTier4P from './modules/dragonflight/tier/T30DevaTier4P'; import CooldownThroughputTracker from './modules/features/CooldownThroughputTracker'; @@ -31,7 +32,6 @@ import T31DevaTier from './modules/dragonflight/tier/T31DevaTier'; // Shared import { - EssenceBurstEventOrderNormalizer, EssenceBurstCastLinkNormalizer, EBRefreshNormalizer, LeapingFlamesNormalizer, @@ -47,7 +47,6 @@ class CombatLogParser extends MainCombatLogParser { static specModules = { // Shared ebRefreshNormalizer: EBRefreshNormalizer, - essenceBurstEventOrderNormalizer: EssenceBurstEventOrderNormalizer, essenceBurstCastLinkNormalizer: EssenceBurstCastLinkNormalizer, leapingFlamesNormalizer: LeapingFlamesNormalizer, leapingFlames: LeapingFlames, @@ -63,6 +62,7 @@ class CombatLogParser extends MainCombatLogParser { // Normalizer castLinkNormalizer: CastLinkNormalizer, + essenceBurstNormalizer: EssenceBurstNormalizer, // features apls: AplCheck, diff --git a/src/analysis/retail/evoker/devastation/modules/normalizers/EssenceBurstNormalizer.ts b/src/analysis/retail/evoker/devastation/modules/normalizers/EssenceBurstNormalizer.ts new file mode 100644 index 00000000000..cdda1a06aa4 --- /dev/null +++ b/src/analysis/retail/evoker/devastation/modules/normalizers/EssenceBurstNormalizer.ts @@ -0,0 +1,47 @@ +import SPELLS from 'common/SPELLS/evoker'; +import EventOrderNormalizer, { EventOrder } from 'parser/core/EventOrderNormalizer'; +import { EventType } from 'parser/core/Events'; +import { Options } from 'parser/core/Module'; +import { EB_GENERATION_EVENT_TYPES } from '../../../shared/modules/normalizers/EssenceBurstCastLinkNormalizer'; + +const EVENT_ORDERS: EventOrder[] = [ + { + beforeEventId: SPELLS.SHATTERING_STAR.id, + beforeEventType: EventType.Cast, + afterEventId: SPELLS.ESSENCE_BURST_DEV_BUFF.id, + afterEventType: EB_GENERATION_EVENT_TYPES, + bufferMs: 50, + anyTarget: true, + updateTimestamp: true, + }, +]; + +/** + * The applybuff from Arcane Vigor is logged before the cast of Shattering Star + * This also happens to Living Flames cast with Burnout + * This normalizes events so that the Shattering Star cast always comes before the EB buff + * + * EventOrderNormalizer only normalizes 1 instance per entry in the EventOrder array + * which means that abilities that can generate multiple EB at once, eg. Living Flame cast with + * Leaping Flames, will only have one event normalized, which can be non ideal. Therefore we will build + * an array with all the different types to make sure we get them all normalized. + **/ +class EssenceBurstNormalizer extends EventOrderNormalizer { + constructor(options: Options) { + super(options, EVENT_ORDERS); + + EB_GENERATION_EVENT_TYPES.forEach((ebApplyEventType) => { + EVENT_ORDERS.push({ + beforeEventId: SPELLS.LIVING_FLAME_CAST.id, + beforeEventType: EventType.Cast, + afterEventId: SPELLS.ESSENCE_BURST_DEV_BUFF.id, + afterEventType: ebApplyEventType, + bufferMs: 50, + anyTarget: true, + updateTimestamp: true, + }); + }); + } +} + +export default EssenceBurstNormalizer; diff --git a/src/analysis/retail/evoker/shared/index.ts b/src/analysis/retail/evoker/shared/index.ts index cd1e6223286..93c9c253ce1 100644 --- a/src/analysis/retail/evoker/shared/index.ts +++ b/src/analysis/retail/evoker/shared/index.ts @@ -3,7 +3,6 @@ export { default as LivingFlameNormalizer, isFromLeapingFlames, } from './modules/normalizers/LeapingFlamesNormalizer'; -export { default as EssenceBurstEventOrderNormalizer } from './modules/normalizers/EssenceBurstEventOrderNormalizer'; export { default as EssenceBurstCastLinkNormalizer } from './modules/normalizers/EssenceBurstCastLinkNormalizer'; export { default as EBRefreshNormalizer } from './modules/normalizers/EBRefreshNormalizer'; export { default as LeapingFlames } from './modules/talents/LeapingFlames'; diff --git a/src/analysis/retail/evoker/shared/modules/normalizers/EssenceBurstEventOrderNormalizer.ts b/src/analysis/retail/evoker/shared/modules/normalizers/EssenceBurstEventOrderNormalizer.ts deleted file mode 100644 index ef62c4f6d6a..00000000000 --- a/src/analysis/retail/evoker/shared/modules/normalizers/EssenceBurstEventOrderNormalizer.ts +++ /dev/null @@ -1,75 +0,0 @@ -/* eslint-disable @typescript-eslint/no-unused-vars */ -import SPELLS from 'common/SPELLS/evoker'; -import EventOrderNormalizer, { EventOrder } from 'parser/core/EventOrderNormalizer'; -import { EventType } from 'parser/core/Events'; -import { Options } from 'parser/core/Module'; -import { EB_BUFF_IDS } from '../../constants'; -import EssenceBurstCastLinkNormalizer, { - EB_GENERATION_EVENT_TYPES, -} from './EssenceBurstCastLinkNormalizer'; -import TALENTS from 'common/TALENTS/evoker'; - -const CASTS_THAT_GENERATE = [SPELLS.LIVING_FLAME_CAST.id]; -const HEALS_THAT_GENERATE = [SPELLS.LIVING_FLAME_HEAL.id]; -const SPELLS_THAT_GENERATE = [ - { - beforeEventType: EventType.Cast, - beforeEventIds: CASTS_THAT_GENERATE, - }, - { - beforeEventType: EventType.Heal, - beforeEventIds: HEALS_THAT_GENERATE, - }, -]; - -/** EventOrderNormalizer only normalizes 1 instance per entry in the EventOrder array - * which means that abilities that can generate multiple EB at once, eg. Living Flame cast with - * Leaping Flames, will only have one event normalized, which can be non ideal. Therefore we will build - * an array with all the different types to make sure we get them all normalized. - * Ideally you would be able to swap the logic such that you could search based on - * what would be the afterEvent (eg. EB in this example) and link it to the beforeEvent - * That would remove the need for this. - * This solution technically doesn't catch all instance either since you can refresh twice - * on the same cast, but this is basically only going to happen to Devastation during Dragonrage, - * which is inconsequential. */ - -/** Applications of Essence Burst very often appear before of the event that generated it - * this normalizer fixes that issue. - * This is mainly something that becomes a problem when dealing with APLCheck, but - * could potentially cause issues with other analysis too. */ -class EssenceBurstEventOrderNormalizer extends EventOrderNormalizer { - /** We run it after we've made our cast links to avoid unwanted interactions */ - static dependencies = { - ...EventOrderNormalizer.dependencies, - essenceBurstCastLinkNormalizer: EssenceBurstCastLinkNormalizer, - }; - constructor(options: Options) { - const EVENT_ORDERS: EventOrder[] = []; - super(options, EVENT_ORDERS); - - /** Talent / Tier / Spec specific links */ - if (this.selectedCombatant.hasTalent(TALENTS.ARCANE_VIGOR_TALENT)) { - CASTS_THAT_GENERATE.unshift(SPELLS.SHATTERING_STAR.id); - } - if (this.selectedCombatant.hasTalent(TALENTS.ANACHRONISM_TALENT)) { - CASTS_THAT_GENERATE.unshift(TALENTS.PRESCIENCE_TALENT.id); - } - - /* Build our EVENT_ORDERS array */ - SPELLS_THAT_GENERATE.forEach((spells) => { - EB_GENERATION_EVENT_TYPES.forEach((ebApplyEventType) => { - EVENT_ORDERS.push({ - beforeEventId: spells.beforeEventIds, - beforeEventType: spells.beforeEventType, - afterEventId: EB_BUFF_IDS, - afterEventType: ebApplyEventType, - bufferMs: 50, - anyTarget: true, - updateTimestamp: true, - }); - }); - }); - } -} - -export default EssenceBurstEventOrderNormalizer;