Skip to content

Commit

Permalink
Merge https://github.com/WoWAnalyzer/WoWAnalyzer into diverted-power
Browse files Browse the repository at this point in the history
  • Loading branch information
Krealle committed Aug 18, 2024
2 parents ce6fd4d + 20effda commit f000d06
Show file tree
Hide file tree
Showing 8 changed files with 128 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/analysis/retail/evoker/augmentation/CHANGELOG.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import TALENTS from 'common/TALENTS/evoker';

export default [
change(date(2024, 8, 14), <>Implement <SpellLink spell={TALENTS.DIVERTED_POWER_TALENT}/> module</>, Vollmer),
change(date(2024, 8, 14), <>Implement <SpellLink spell={TALENTS.UNRELENTING_SIEGE_TALENT}/> module</>, Vollmer),
change(date(2024, 8, 11), 'Bump compatibility to 11.0.2', Vollmer),
change(date(2024, 8, 11), <>Implement <SpellLink spell={TALENTS.MELT_ARMOR_TALENT}/> module</>, Vollmer),
change(date(2024, 8, 11), <>Implement <SpellLink spell={TALENTS.MIGHT_OF_THE_BLACK_DRAGONFLIGHT_TALENT}/> module</>, Vollmer),
Expand Down
2 changes: 2 additions & 0 deletions src/analysis/retail/evoker/augmentation/CombatLogParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ import {
MassDisintegrate,
MightOfTheBlackDragonflight,
DivertedPower,
UnrelentingSiege,
} from 'analysis/retail/evoker/shared';

class CombatLogParser extends MainCombatLogParser {
Expand Down Expand Up @@ -126,6 +127,7 @@ class CombatLogParser extends MainCombatLogParser {
mightOfTheBlackDragonflight: MightOfTheBlackDragonflight,
meltArmor: MeltArmor,
divertedPower: DivertedPower,
unrelentingSiege: UnrelentingSiege,

// Features
buffTrackerGraph: BuffTrackerGraph,
Expand Down
1 change: 1 addition & 0 deletions src/analysis/retail/evoker/devastation/CHANGELOG.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import SPELLS from 'common/SPELLS/evoker';

export default [
change(date(2024, 8, 14), <>Implement <SpellLink spell={TALENTS_EVOKER.DIVERTED_POWER_TALENT}/> module</>, Vollmer),
change(date(2024, 8, 14), <>Implement <SpellLink spell={TALENTS_EVOKER.UNRELENTING_SIEGE_TALENT}/> module</>, Vollmer),
change(date(2024, 8, 11), <>Update <SpellLink spell={TALENTS_EVOKER.TITANIC_WRATH_TALENT}/> multiplier</>, Vollmer),
change(date(2024, 8, 11), <>Implement <SpellLink spell={TALENTS_EVOKER.MELT_ARMOR_TALENT}/> module</>, Vollmer),
change(date(2024, 8, 11), <>Implement <SpellLink spell={TALENTS_EVOKER.MIGHT_OF_THE_BLACK_DRAGONFLIGHT_TALENT}/> module</>, Vollmer),
Expand Down
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 @@ -63,6 +63,7 @@ import {
MassDisintegrate,
MightOfTheBlackDragonflight,
DivertedPower,
UnrelentingSiege,
} from 'analysis/retail/evoker/shared';
import ExpandedLungs from '../shared/modules/talents/hero/flameshaper/ExpandedLungs';
import FanTheFlames from '../shared/modules/talents/hero/flameshaper/FanTheFlames';
Expand Down Expand Up @@ -136,6 +137,7 @@ class CombatLogParser extends MainCombatLogParser {
massDisintegrate: MassDisintegrate,
mightOfTheBlackDragonflight: MightOfTheBlackDragonflight,
divertedPower: DivertedPower,
unrelentingSiege: UnrelentingSiege,

// core abilities
disintegrate: Disintegrate,
Expand Down
1 change: 1 addition & 0 deletions src/analysis/retail/evoker/shared/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ export const IMMINENT_DESTRUCTION_MULTIPLIER = 0.1;
export const IMMINENT_DESTRUCTION_ESSENCE_REDUCTION = 1;
export const MELT_ARMOR_MULTIPLIER = 0.2;
export const MIGHT_OF_THE_BLACK_DRAGONFLIGHT_MULTIPLIER = 0.2;
export const UNRELENTING_SIEGE_MULTIPLIER_PER_STACK = 0.01;

export const MASS_DISINTEGRATE_MULTIPLIER_PER_MISSING_TARGET = 0.15;
export const MASS_ERUPTION_MULTIPLIER_PER_MISSING_TARGET =
Expand Down
1 change: 1 addition & 0 deletions src/analysis/retail/evoker/shared/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ export { default as MeltArmor } from './modules/talents/hero/scalecommander/Melt
export { default as MassDisintegrate } from './modules/talents/hero/scalecommander/MassDisintegrate';
export { default as MightOfTheBlackDragonflight } from './modules/talents/hero/scalecommander/MightOfTheBlackDragonflight';
export { default as DivertedPower } from './modules/talents/hero/scalecommander/DivertedPower';
export { default as UnrelentingSiege } from './modules/talents/hero/scalecommander/UnrelentingSiege';
export * from './constants';
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
import TALENTS from 'common/TALENTS/evoker';
import SPELLS from 'common/SPELLS/evoker';
import { formatNumber } from 'common/format';

import Analyzer, { Options, SELECTED_PLAYER } from 'parser/core/Analyzer';
import ItemDamageDone from 'parser/ui/ItemDamageDone';
import Events, { DamageEvent } from 'parser/core/Events';

import Statistic from 'parser/ui/Statistic';
import STATISTIC_CATEGORY from 'parser/ui/STATISTIC_CATEGORY';
import STATISTIC_ORDER from 'parser/ui/STATISTIC_ORDER';
import TalentSpellText from 'parser/ui/TalentSpellText';
import { UNRELENTING_SIEGE_MULTIPLIER_PER_STACK } from 'analysis/retail/evoker/shared/constants';
import { calculateEffectiveDamage } from 'parser/core/EventCalculateLib';
import Spell from 'common/SPELLS/Spell';
import DonutChart from 'parser/ui/DonutChart';

const AMPED_SPELLS = [
SPELLS.DISINTEGRATE,
SPELLS.LIVING_FLAME_DAMAGE,
SPELLS.AZURE_STRIKE,
TALENTS.ERUPTION_TALENT,
];
const COLORS = [
'rgb(41, 134, 204)', // Disintegrate
'rgb(216, 59, 59)', // Living Flame
'rgb(153, 102, 255)', // Azure Strike
'rgb(129, 52, 5)', // Eruption
];

/**
* For each second you are in combat, Azure Strike, Living Flame, and Disintegrate/Eruption
* deal 1% increased damage, up to 15%.
*/
class UnrelentingSiege extends Analyzer {
damageMap: Map<number, { spell: Spell; color: string; amount: number }> = new Map();

constructor(options: Options) {
super(options);
this.active = this.selectedCombatant.hasTalent(TALENTS.UNRELENTING_SIEGE_TALENT);

this.addEventListener(Events.damage.by(SELECTED_PLAYER).spell(AMPED_SPELLS), this.onDamage);

AMPED_SPELLS.forEach((spell) => {
this.damageMap.set(spell.id, {
spell,
color: COLORS[AMPED_SPELLS.indexOf(spell)],
amount: 0,
});
});
}

onDamage(event: DamageEvent) {
const stacks = this.selectedCombatant.getBuffStacks(SPELLS.UNRELENTING_SIEGE_BUFF.id);
if (!stacks) {
return;
}

const spell = this.damageMap.get(event.ability.guid);
if (!spell) {
// Essentially impossible to get here, but just in case
console.warn(
'UnrelentingSiege module could not find spell in damageMap',
event.ability.name +
`(${event.ability.guid}) @` +
this.owner.formatTimestamp(event.timestamp),
);
return;
}

spell.amount += calculateEffectiveDamage(
event,
stacks * UNRELENTING_SIEGE_MULTIPLIER_PER_STACK,
);
}

statistic() {
let totalDamage = 0;

const damageItems = Array.from(this.damageMap.values())
.filter((source) => source.amount > 0)
.sort((a, b) => b.amount - a.amount)
.map((source) => {
totalDamage += source.amount;

return {
color: source.color,
label: source.spell.name,
spellId: source.spell.id,
valueTooltip: formatNumber(source.amount),
value: source.amount,
};
});

return (
<Statistic
position={STATISTIC_ORDER.CORE(13)}
size="flexible"
category={STATISTIC_CATEGORY.HERO_TALENTS}
tooltip={<li>Damage: {formatNumber(totalDamage)}</li>}
>
<TalentSpellText talent={TALENTS.UNRELENTING_SIEGE_TALENT}>
<ItemDamageDone amount={totalDamage} />
</TalentSpellText>

<div className="pad">
<label>Damage sources</label>
<DonutChart items={damageItems} />
</div>
</Statistic>
);
}
}

export default UnrelentingSiege;
5 changes: 5 additions & 0 deletions src/common/SPELLS/evoker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,11 @@ const spells = {
name: 'Mass Eruption',
icon: 'ability_evoker_eruption',
},
UNRELENTING_SIEGE_BUFF: {
id: 441248,
name: 'Unrelenting Siege',
icon: 'ability_siege_engineer_superheated',
},
// endregion
} satisfies Record<string, Spell>;

Expand Down

0 comments on commit f000d06

Please sign in to comment.