Skip to content

Commit

Permalink
Move Pres EB consume links to shared EB normalizer
Browse files Browse the repository at this point in the history
  • Loading branch information
Krealle committed Jul 23, 2024
1 parent 73ef7d6 commit bf9876d
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import Events, {
} from 'parser/core/Events';
import {
didSparkProcEssenceBurst,
getEssenceBurstConsumeAbility,
isEbFromHardcast,
isEbFromReversion,
} from '../../normalizers/EventLinking/helpers';
import { getEssenceBurstConsumeAbility } from 'analysis/retail/evoker/shared/modules/normalizers/EssenceBurstCastLinkNormalizer';
import { TALENTS_EVOKER } from 'common/TALENTS';
import { SPELL_COLORS } from 'analysis/retail/evoker/preservation/constants';
import DonutChart from 'parser/ui/DonutChart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ import TalentSpellText from 'parser/ui/TalentSpellText';
import {
didEbConsumeSparkProc,
didSparkProcEssenceBurst,
getEssenceBurstConsumeAbility,
wasEbConsumed,
} from '../../normalizers/EventLinking/helpers';
import { getEssenceBurstConsumeAbility } from 'analysis/retail/evoker/shared/modules/normalizers/EssenceBurstCastLinkNormalizer';
import { ESSENCE_COSTS, MANA_COSTS } from './EssenceBurst';

class SparkOfInsight extends Analyzer {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ import {
getReversionHealing,
getEchoAplication,
getHealEvents,
isCastFromBurst,
} from '../../normalizers/EventLinking/helpers';
import { calculateEffectiveHealing } from 'parser/core/EventCalculateLib';
import { TITANS_GIFT_INC } from '../../normalizers/EventLinking/constants';
import { formatPercentage } from 'common/format';
import { isCastFromEB } from 'analysis/retail/evoker/shared/modules/normalizers/EssenceBurstCastLinkNormalizer';

class TitansGift extends Analyzer {
//Blossom
Expand Down Expand Up @@ -92,7 +92,7 @@ class TitansGift extends Analyzer {
//Track blossom healing added
emeraldBlossomHeal(event: HealEvent) {
const blossomCast = getBlossomCast(event);
if (blossomCast && isCastFromBurst(blossomCast)) {
if (blossomCast && isCastFromEB(blossomCast)) {
this.buffedBlossoms += 1;
const blossomHeals = getHealEvents(event);
for (const blossomHeal of blossomHeals) {
Expand All @@ -104,7 +104,7 @@ class TitansGift extends Analyzer {
//Track echo healing added
echoHeal(event: HealEvent | ApplyBuffEvent | RefreshBuffEvent) {
const echoApplication = getEchoAplication(event);
if (echoApplication && isCastFromBurst(echoApplication)) {
if (echoApplication && isCastFromEB(echoApplication)) {
this.buffedEchoes += 1;
if (event.type === EventType.Heal) {
this.healingAddedToEcho += calculateEffectiveHealing(event, TITANS_GIFT_INC);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import { TALENTS_EVOKER } from 'common/TALENTS';
import { EventLink } from 'parser/core/EventLinkNormalizer';
import { EventType, HasRelatedEvent } from 'parser/core/Events';
import {
ESSENCE_BURST_CONSUME,
CAST_BUFFER_MS,
ESSENCE_BURST_LINK,
MAX_ESSENCE_BURST_DURATION,
EB_REVERSION,
Expand All @@ -14,25 +12,6 @@ import {
} from './constants';

export const ESSENCE_BURST_EVENT_LINKS: EventLink[] = [
// link essence burst remove to a cast to track expirations vs consumptions
{
linkRelation: ESSENCE_BURST_CONSUME,
reverseLinkRelation: ESSENCE_BURST_CONSUME,
linkingEventId: SPELLS.ESSENCE_BURST_BUFF.id,
linkingEventType: [EventType.RemoveBuff, EventType.RemoveBuffStack],
referencedEventId: [
SPELLS.EMERALD_BLOSSOM_CAST.id,
SPELLS.DISINTEGRATE.id,
TALENTS_EVOKER.ECHO_TALENT.id,
],
referencedEventType: EventType.Cast,
anyTarget: true,
forwardBufferMs: CAST_BUFFER_MS,
backwardBufferMs: CAST_BUFFER_MS,
isActive(c) {
return c.hasTalent(TALENTS_EVOKER.ESSENCE_BURST_PRESERVATION_TALENT);
},
},
{
linkRelation: ESSENCE_BURST_LINK,
reverseLinkRelation: ESSENCE_BURST_LINK,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export const ECHO_TEMPORAL_ANOMALY = 'TemporalAnomaly'; // for linking BuffApply
export const ECHO = 'Echo'; // for linking BuffApply/Heal to echo removal
// END ECHO constants
export const ESSENCE_BURST_LINK = 'EssenceBurstLink'; // link eb removal to apply
export const ESSENCE_BURST_CONSUME = 'EssenceBurstConsumption'; // link essence cast to removing the essence burst buff
export const DREAM_BREATH_CALL_OF_YSERA = 'DreamBreathCallOfYsera'; // link DB hit to buff removal
export const DREAM_BREATH_CALL_OF_YSERA_HOT = 'DreamBreathCallOfYseraHoT'; // link DB hot to buff removal
export const FIELD_OF_DREAMS_PROC = 'FromFieldOfDreams'; // link EB heal to fluttering heal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import {
LIVING_FLAME_CALL_OF_YSERA,
DREAM_BREATH_CALL_OF_YSERA_HOT,
FIELD_OF_DREAMS_PROC,
ESSENCE_BURST_CONSUME,
LIFEBIND_HEAL,
ECHO_TYPE,
LIFEBIND,
Expand Down Expand Up @@ -79,12 +78,6 @@ export function didEchoExpire(event: RemoveBuffEvent) {
return !HasRelatedEvent(event, ECHO) && !HasRelatedEvent(event, ECHO_TEMPORAL_ANOMALY);
}

export function getEssenceBurstConsumeAbility(
event: RemoveBuffEvent | RemoveBuffStackEvent,
): null | CastEvent {
return GetRelatedEvent<CastEvent>(event, ESSENCE_BURST_CONSUME) ?? null;
}

export function getHealForLifebindHeal(event: HealEvent): HealEvent | null {
if (!HasRelatedEvent(event, LIFEBIND_HEAL)) {
event.__modified = false;
Expand Down Expand Up @@ -242,11 +235,6 @@ export function getBlossomCast(event: HealEvent) {
return GetRelatedEvent<CastEvent>(event, EMERALD_BLOSSOM_CAST);
}

//Find if a cast was from an essence burst
export function isCastFromBurst(event: CastEvent) {
return HasRelatedEvent(event, ESSENCE_BURST_CONSUME);
}

export function getEchoAplication(event: HealEvent | ApplyBuffEvent | RefreshBuffEvent) {
const EchoRemoval = GetRelatedEvent(event, ECHO);
if (EchoRemoval) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,19 @@ const EVENT_LINKS: EventLink[] = [
{
linkRelation: ESSENCE_BURST_CONSUME,
reverseLinkRelation: ESSENCE_BURST_CONSUME,
linkingEventId: [SPELLS.ESSENCE_BURST_AUGMENTATION_BUFF.id, SPELLS.ESSENCE_BURST_DEV_BUFF.id],
linkingEventId: [
SPELLS.ESSENCE_BURST_BUFF.id,
SPELLS.ESSENCE_BURST_AUGMENTATION_BUFF.id,
SPELLS.ESSENCE_BURST_DEV_BUFF.id,
],
linkingEventType: [EventType.RemoveBuff, EventType.RemoveBuffStack],
referencedEventId: [TALENTS.PYRE_TALENT.id, SPELLS.DISINTEGRATE.id, TALENTS.ERUPTION_TALENT.id],
referencedEventId: [
TALENTS.PYRE_TALENT.id,
SPELLS.DISINTEGRATE.id,
TALENTS.ERUPTION_TALENT.id,
TALENTS.ECHO_TALENT.id,
SPELLS.EMERALD_BLOSSOM_CAST.id,
],
referencedEventType: EventType.Cast,
anyTarget: true,
forwardBufferMs: ESSENCE_BURST_BUFFER,
Expand All @@ -204,6 +214,10 @@ class EssenceBurstCastLinkNormalizer extends EventLinkNormalizer {
};
constructor(options: Options) {
super(options, EVENT_LINKS);
this.active =
this.selectedCombatant.hasTalent(TALENTS.ESSENCE_BURST_PRESERVATION_TALENT) ||
this.selectedCombatant.hasTalent(TALENTS.ESSENCE_BURST_AUGMENTATION_TALENT) ||
this.selectedCombatant.hasTalent(TALENTS.RUBY_ESSENCE_BURST_TALENT);
}
}

Expand Down Expand Up @@ -324,4 +338,11 @@ export function isCastFromEB(event: CastEvent) {
return HasRelatedEvent(event, ESSENCE_BURST_CONSUME);
}

/** Get the event that consumed EB */
export function getEssenceBurstConsumeAbility(
event: RemoveBuffEvent | RemoveBuffStackEvent,
): null | CastEvent {
return GetRelatedEvent<CastEvent>(event, ESSENCE_BURST_CONSUME) ?? null;
}

export default EssenceBurstCastLinkNormalizer;

0 comments on commit bf9876d

Please sign in to comment.