Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
trevorm4 committed Sep 23, 2024
1 parent d821dc6 commit 4bf617d
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ interface CastInfo {
targetsHit: number[];
}

const LESS_IMPORTANT_CDR_SPELLS: Set<number> = new Set<number>([
TALENTS_MONK.LIFE_COCOON_TALENT.id,
]);

class CelestialConduit extends Analyzer {
static dependencies = {
haste: Haste,
Expand Down Expand Up @@ -149,13 +153,18 @@ class CelestialConduit extends Analyzer {
}
// groupHits will be empty if the event passed is the only hit
const totalHits = groupHits.length || 1;
this.castInfoList.at(-1)!.targetsHit.push(totalHits);
const increase =
CELESTIAL_CONDUIT_INCREASE_PER_TARGET * Math.min(totalHits, CELESTIAL_CONDUIT_MAX_TARGETS);

if (event.type === EventType.Heal) {
this.healingIncreaseDataPoints.push(increase);
if (this.selectedCombatant.spec === SPECS.MISTWEAVER_MONK) {
this.castInfoList.at(-1)!.targetsHit.push(totalHits);
}
} else {
if (this.selectedCombatant.spec === SPECS.WINDWALKER_MONK) {
this.castInfoList.at(-1)!.targetsHit.push(totalHits);
}
this.damageIncreaseDataPoints.push(increase);
}
}
Expand Down Expand Up @@ -183,11 +192,17 @@ class CelestialConduit extends Analyzer {
<PerformanceMark perf={cancelPerf} />
</>
),
details: <>{castInfo.cancelled ? 'No' : 'Yes'}</>,
};
const cooldownPerfs: QualitativePerformance[] = [];
const cooldownItems: CooldownExpandableItem[] = [];
castInfo.cooldownMap!.forEach((cooldown, spellId) => {
const perf = cooldown === 0 ? QualitativePerformance.Fail : QualitativePerformance.Good;
const perf =
cooldown === 0
? LESS_IMPORTANT_CDR_SPELLS.has(spellId)
? QualitativePerformance.Ok
: QualitativePerformance.Fail
: QualitativePerformance.Good;
cooldownPerfs.push(perf);
cooldownItems.push({
label: (
Expand All @@ -201,20 +216,23 @@ class CelestialConduit extends Analyzer {
<PerformanceMark perf={perf} />
</>
),
details: <>{cooldown === 0 ? 'No' : 'Yes'}</>,
});
});
const avgTargetsHit =
castInfo.targetsHit.reduce((prev, cur) => {
return prev + cur;
}) / castInfo.targetsHit.length;

const targetHitPerf = this.getTargetsHitPerf(avgTargetsHit);
const targetsHitItem: CooldownExpandableItem = {
label: <>Average targets hit per pulse</>,
result: (
<>
{avgTargetsHit.toFixed(1)} <PerformanceMark perf={targetHitPerf} />
<PerformanceMark perf={targetHitPerf} />
</>
),
details: <>{avgTargetsHit.toFixed(1)} </>,
};
return {
perf: getAveragePerf([cancelPerf, ...cooldownPerfs, targetHitPerf]),
Expand All @@ -241,10 +259,15 @@ class CelestialConduit extends Analyzer {
const explanation = (
<p>
<strong>
<SpellLink spell={TALENTS_MONK.INVOKE_YULON_THE_JADE_SERPENT_TALENT} />
<SpellLink spell={TALENTS_MONK.CELESTIAL_CONDUIT_TALENT} />
</strong>
<br />
Before casting <SpellLink spell={TALENTS_MONK.CELESTIAL_CONDUIT_TALENT} />, make sure that.
Before casting <SpellLink spell={TALENTS_MONK.CELESTIAL_CONDUIT_TALENT} />, make sure that
all spells reduced by <SpellLink spell={TALENTS_MONK.HEART_OF_THE_JADE_SERPENT_TALENT} />{' '}
are on cooldown so that the extra CDR granted when casting{' '}
<SpellLink spell={TALENTS_MONK.UNITY_WITHIN_TALENT} /> is not wasted. Additionally, make
sure to never cancel the spell and to hit at least 5 targets in order to get the maximum
healing/damage buff (up to 30%).
</p>
);

Expand Down
4 changes: 4 additions & 0 deletions src/analysis/retail/monk/windwalker/CombatLogParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import {
FistsOfFuryLinkNormalizer,
FistsOfFuryNormalizer,
} from './normalizers/FistsOfFuryNormalizer';
import CelestialConduit from '../shared/hero/ConduitOfTheCelestials/talents/CelestialConduit';

class CombatLogParser extends CoreCombatLogParser {
static specModules = {
Expand Down Expand Up @@ -80,6 +81,9 @@ class CombatLogParser extends CoreCombatLogParser {
strikeoftheWindlord: StrikeoftheWindlord,
chiBurst: ChiBurst,

// Hero Talents:
celestialConduit: CelestialConduit,

// Guide helpers
hitComboTracker: HitComboTracker,
hitComboGraph: HitComboGraph,
Expand Down
6 changes: 5 additions & 1 deletion src/analysis/retail/monk/windwalker/Guide.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ export default function Guide({ modules, events, info }: GuideProps<typeof Comba
{modules.fistsofFury.guideSubsection}
{modules.strikeoftheWindlord.guideSubsection}
</Section>
<Section title="Major cooldowns">{modules.invokeXuen.guideSubsection}</Section>
<Section title="Major cooldowns">
{modules.invokeXuen.guideSubsection}
{info.combatant.hasTalent(TALENTS_MONK.CELESTIAL_CONDUIT_TALENT) &&
modules.celestialConduit.guideCastBreakdown}
</Section>
<Section title="Core Rotation">
<SubSection title="Overview">
The priority list provided here is a rough outline of actions taken, however as always you
Expand Down

0 comments on commit 4bf617d

Please sign in to comment.