Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leaping #2

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,27 @@ import SPELLS from 'common/SPELLS/evoker';
import TALENTS from 'common/TALENTS/evoker';
import {
ApplyBuffEvent,
ApplyBuffStackEvent,
ApplyDebuffEvent,
CastEvent,
DamageEvent,
EmpowerEndEvent,
EventType,
GetRelatedEvent,
GetRelatedEvents,
HasRelatedEvent,
HasTarget,
RefreshBuffEvent,
RemoveDebuffEvent,
} from 'parser/core/Events';
import { Options } from 'parser/core/Module';
import EventLinkNormalizer, { EventLink } from 'parser/core/EventLinkNormalizer';
import { encodeEventTargetString } from 'parser/shared/modules/Enemies';

/** So sometimes when Ebon Might should be extended
* it just kinda doesn't? This messes with our analysis so
* let's check if it failed to extend where it should
* See example of this here (upheavel should have extended but didnt):
* See example of this here (upheaval should have extended but didn't):
* https://www.warcraftlogs.com/reports/1JqKrX2vLxb6Zyp9/#fight=8&source=3&pins=2%24Off%24%23244F4B%24expression%24type%20%3D%20%22empowerend%22%20or%20type%3D%22removebuff%22&view=events&start=1402475&end=1408776
*/
export const FAILED_EXTENSION_LINK = 'failedExtensionLink';
Expand All @@ -30,7 +34,7 @@ export const BREATH_EBON_APPLY_LINK = 'breathEbonApplyLink';
export const EBON_MIGHT_BUFF_LINKS = 'ebonMightBuffLinks';
export const EBON_MIGHT_APPLY_REMOVE_LINK = 'ebonMightApplyRemoveLink';

export const ESSENCE_BURST_GENERATED = 'EssenceBurstGenerated';
export const EB_FROM_PRESCIENCE = 'ebFromPrescience';

export const BREATH_OF_EONS_CAST_DEBUFF_APPLY_LINK = 'breathOfEonsCastDebuffApplyLink';
export const BREATH_OF_EONS_CAST_BUFF_LINK = 'breathOfEonsCastBuffLink';
Expand Down Expand Up @@ -163,8 +167,15 @@ const EVENT_LINKS: EventLink[] = [
referencedEventId: SPELLS.LIVING_FLAME_DAMAGE.id,
referencedEventType: EventType.Damage,
anyTarget: true,
maximumLinks: 2,
maximumLinks: 1,
forwardBufferMs: PUPIL_OF_ALEXSTRASZA_BUFFER,
additionalCondition(linkingEvent, referencedEvent) {
// No targets so we can't be sure which hit is the correct one, so we just claim it
if (!HasTarget(linkingEvent) && !HasTarget(referencedEvent)) {
return true;
}
return encodeEventTargetString(linkingEvent) !== encodeEventTargetString(referencedEvent);
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return encodeEventTargetString(linkingEvent) !== encodeEventTargetString(referencedEvent);
return test

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i wonder

},
},
{
linkRelation: ERUPTION_CAST_DAM_LINK,
Expand All @@ -177,15 +188,16 @@ const EVENT_LINKS: EventLink[] = [
forwardBufferMs: CAST_BUFFER_MS,
},
{
linkRelation: ESSENCE_BURST_GENERATED,
reverseLinkRelation: ESSENCE_BURST_GENERATED,
linkRelation: EB_FROM_PRESCIENCE,
reverseLinkRelation: EB_FROM_PRESCIENCE,
linkingEventId: TALENTS.PRESCIENCE_TALENT.id,
linkingEventType: EventType.Cast,
referencedEventId: SPELLS.ESSENCE_BURST_AUGMENTATION_BUFF.id,
referencedEventType: [EventType.ApplyBuff, EventType.ApplyBuffStack],
referencedEventType: [EventType.ApplyBuff, EventType.ApplyBuffStack, EventType.RefreshBuff],
anyTarget: true,
forwardBufferMs: CAST_BUFFER_MS,
backwardBufferMs: CAST_BUFFER_MS,
maximumLinks: 1,
},
{
linkRelation: FAILED_EXTENSION_LINK,
Expand Down Expand Up @@ -239,9 +251,9 @@ const EVENT_LINKS: EventLink[] = [

class CastLinkNormalizer extends EventLinkNormalizer {
// This is set to lower priority than default since
// to create proper links on events fabcricated using PrePullCooldownsNormalizer
// to create proper links on events fabricated using PrePullCooldownsNormalizer
// We need to ensure this runs after the PrePullCooldownsNormalizer
// This is neccessary if we want BreathOfEons module to function properly
// This is necessary if we want BreathOfEons module to function properly
// With pre-pull casts of Breath of Eons
priority = 100;
constructor(options: Options) {
Expand Down Expand Up @@ -297,8 +309,8 @@ export function getEruptionDamageEvents(event: CastEvent): DamageEvent[] {
);
}

export function getPupilDamageEvents(event: CastEvent): DamageEvent[] {
return GetRelatedEvents(
export function getPupilDamageEvent(event: CastEvent): DamageEvent | undefined {
return GetRelatedEvent(
event,
PUPIL_OF_ALEXSTRASZA_LINK,
(e): e is DamageEvent => e.type === EventType.Damage,
Expand All @@ -318,7 +330,13 @@ export function ebonIsFromBreath(event: ApplyBuffEvent | CastEvent) {
}

export function generatedEssenceBurst(event: CastEvent) {
return HasRelatedEvent(event, ESSENCE_BURST_GENERATED);
const maybeGenerate = GetRelatedEvent(
event,
EB_FROM_PRESCIENCE,
(e): e is ApplyBuffEvent | ApplyBuffStackEvent =>
e.type === EventType.ApplyBuff || e.type === EventType.ApplyBuffStack,
);
return Boolean(maybeGenerate);
}

export function failedEbonMightExtension(event: CastEvent | EmpowerEndEvent) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { formatNumber } from 'common/format';
import Analyzer, { Options, SELECTED_PLAYER } from 'parser/core/Analyzer';
import ItemDamageDone from 'parser/ui/ItemDamageDone';
import Events, { CastEvent } from 'parser/core/Events';
import { getPupilDamageEvents } from '../normalizers/CastLinkNormalizer';
import { getPupilDamageEvent } from '../normalizers/CastLinkNormalizer';

import Statistic from 'parser/ui/Statistic';
import STATISTIC_CATEGORY from 'parser/ui/STATISTIC_CATEGORY';
Expand All @@ -29,12 +29,12 @@ class PupilOfAlexstrasza extends Analyzer {
}

onCast(event: CastEvent) {
const damageEvents = getPupilDamageEvents(event);
if (damageEvents.length > 1) {
damageEvents.forEach((damEvent) => {
this.PupilOfAlexstraszaDamage += damEvent.amount + (damEvent.absorbed ?? 0);
});
const damageEvent = getPupilDamageEvent(event);
if (!damageEvent) {
return;
}

this.PupilOfAlexstraszaDamage += damageEvent.amount + (damageEvent.absorbed ?? 0);
}

statistic() {
Expand All @@ -45,12 +45,12 @@ class PupilOfAlexstrasza extends Analyzer {
category={STATISTIC_CATEGORY.TALENTS}
tooltip={
<>
<li>Damage: {formatNumber(this.PupilOfAlexstraszaDamage / 2)}</li>
<li>Damage: {formatNumber(this.PupilOfAlexstraszaDamage)}</li>
</>
}
>
<TalentSpellText talent={TALENTS.PUPIL_OF_ALEXSTRASZA_TALENT}>
<ItemDamageDone amount={this.PupilOfAlexstraszaDamage / 2} />
<ItemDamageDone amount={this.PupilOfAlexstraszaDamage} />
</TalentSpellText>
</Statistic>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export const SNAPFIRE_CONSUME = 'SnapfireConsumption';
export const IRIDESCENCE_RED_CONSUME = 'IridescentRedConsumption';
export const IRIDESCENCE_BLUE_CONSUME = 'IridescentBlueConsumption';
export const DISINTEGRATE_REMOVE_APPLY = 'DisintegrateRemoveApply';
export const EB_FROM_ARCANE_VIGOR = 'ebFromArcaneVigor';

const CAST_BUFFER_MS = 100;
const EVENT_LINKS: EventLink[] = [
Expand Down Expand Up @@ -114,6 +115,24 @@ const EVENT_LINKS: EventLink[] = [
referencedEventType: EventType.ApplyDebuff,
anyTarget: true,
},
{
linkRelation: EB_FROM_ARCANE_VIGOR,
reverseLinkRelation: EB_FROM_ARCANE_VIGOR,
linkingEventId: [SPELLS.SHATTERING_STAR.id],
linkingEventType: EventType.Cast,
referencedEventId: [
TALENTS_EVOKER.RUBY_ESSENCE_BURST_TALENT.id,
SPELLS.ESSENCE_BURST_DEV_BUFF.id,
],
referencedEventType: [EventType.ApplyBuff, EventType.ApplyBuffStack, EventType.RefreshBuff],
anyTarget: true,
forwardBufferMs: CAST_BUFFER_MS,
backwardBufferMs: CAST_BUFFER_MS,
maximumLinks: 1,
isActive(c) {
return c.hasTalent(TALENTS_EVOKER.ARCANE_VIGOR_TALENT);
},
},
];

class CastLinkNormalizer extends EventLinkNormalizer {
Expand Down
8 changes: 3 additions & 5 deletions src/analysis/retail/evoker/shared/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
export {
default as LeapingFlamesNormalizer,
getLeapingDamageEvents,
getLeapingHealEvents,
generatedEssenceBurst,
getCastedGeneratedEssenceBurst,
eventGeneratedEB,
getGeneratedEBEvents,
isFromLeapingFlames,
getWastedEssenceBurst,
getWastedEBEvents,
} from './modules/normalizers/LeapingFlamesNormalizer';
export { default as LivingFlameNormalizer } from './modules/normalizers/LivingFlameNormalizer';
export { default as LeapingFlames } from './modules/talents/LeapingFlames';
Expand Down
Loading
Loading