Skip to content

Commit

Permalink
Merge branch 'dragonflight' of https://github.com/WoWAnalyzer/WoWAnal…
Browse files Browse the repository at this point in the history
…yzer into dragonflight
  • Loading branch information
Krealle committed Mar 18, 2024
2 parents a7e3fbe + 19860e8 commit 54ab6de
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 12 deletions.
3 changes: 2 additions & 1 deletion src/CHANGELOG.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,15 @@ import {
Arlie,
LucasLevyOB,
dub,
Zyer,
Zyer, Earosselot,
} from 'CONTRIBUTORS';
import { ItemLink } from 'interface';
import SpellLink from 'interface/SpellLink';

// prettier-ignore
export default [
change(date(2024, 3, 17), <>Add <ItemLink id={ITEMS.NYMUES_UNRAVELING_SPINDLE.id}/> to channel list and implement buffSoonPresent APL condition.</>, Vollmer),
change(date(2024, 3, 14), 'Correct getBuffStacks method to return the stacks at the given timestamp', Earosselot),
change(date(2024, 3, 14), 'Fix overflow on cooldown bars while using the phase selector.', ToppleTheNun),
change(date(2024, 3, 14), 'Bump opacity on phase selector to 75% from 40%.', ToppleTheNun),
change(date(2024, 3, 13), 'Bump opacity on muted text to 75% from 47%.', ToppleTheNun),
Expand Down
1 change: 1 addition & 0 deletions src/analysis/retail/mage/frost/CHANGELOG.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Earosselot, Sharrq, Sref, ToppleTheNun } from 'CONTRIBUTORS';

// prettier-ignore
export default [
change(date(2024, 3, 14), <>Fixed <SpellLink spell={SPELLS.WINTERS_CHILL} /> module, to account correctly when flurry is casted at 4 <SpellLink spell={SPELLS.ICICLES_BUFF} /> </>, Earosselot),
change(date(2024, 2, 22), <>Html fixes and <SpellLink spell={TALENTS.SHIFTING_POWER_TALENT} /> cd reduction correction </>, Earosselot),
change(date(2024, 2, 2), <>Added <SpellLink spell={TALENTS.GLACIAL_SPIKE_TALENT} />, <SpellLink spell={TALENTS.BRAIN_FREEZE_TALENT} /> and <SpellLink spell={TALENTS.FINGERS_OF_FROST_TALENT} /> to Guide view</>, Earosselot),
change(date(2024, 1, 31), <>Added <SpellLink spell={TALENTS.FROZEN_ORB_TALENT} />, <SpellLink spell={TALENTS.SHIFTING_POWER_TALENT} />, <SpellLink spell={TALENTS.FLURRY_TALENT} /> and Preparation Section to Guide view</>, Earosselot),
Expand Down
9 changes: 5 additions & 4 deletions src/analysis/retail/mage/frost/core/WintersChill.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,11 @@ class WintersChill extends Analyzer {
const remove: RemoveDebuffEvent | undefined = GetRelatedEvent(event, 'DebuffRemove');
const flurry: CastEvent | undefined = GetRelatedEvent(event, 'SpellCast');
const precast: CastEvent | undefined = GetRelatedEvent(event, 'PreCast');
const precastIcicles =
(flurry &&
this.selectedCombatant.getBuff(SPELLS.ICICLES_BUFF.id, flurry.timestamp)?.stacks) ||
0;
const currentTimestamp = flurry !== undefined ? flurry.timestamp : this.owner.currentTimestamp;
const precastIcicles = this.selectedCombatant.getBuffStacks(
SPELLS.ICICLES_BUFF.id,
currentTimestamp - 100,
);
const wintersChillEvent = new WintersChillEvent(event, remove, precast, precastIcicles, flurry);
this.wintersChill.push(wintersChillEvent);
}
Expand Down
28 changes: 21 additions & 7 deletions src/parser/core/Entity.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import CombatLogParser from 'parser/core/CombatLogParser';
import { BuffEvent, HasSource } from 'parser/core/Events';

type StackHistory = Array<{ stacks: number; timestamp: number }>;
type StackHistoryElement = { stacks: number; timestamp: number };
export interface TrackedBuffEvent extends BuffEvent<any> {
start: number;
end: number | null;
stackHistory: StackHistory;
stackHistory: Array<StackHistoryElement>;
refreshHistory: number[];
stacks: number;
}
Expand Down Expand Up @@ -111,13 +111,27 @@ class Entity {
getBuffStacks(
spellId: number,
forTimestamp: number | null = null,
bufferTime = 0,
minimalActiveTime = 0,
bufferTime: number = 0,
minimalActiveTime: number = 0,
sourceID: number | null = null,
) {
return (
this.getBuff(spellId, forTimestamp, bufferTime, minimalActiveTime, sourceID)?.stacks || 0
): number {
const buff: TrackedBuffEvent | undefined = this.getBuff(
spellId,
forTimestamp,
bufferTime,
minimalActiveTime,
sourceID,
);
const currentTimestamp = forTimestamp !== null ? forTimestamp : this.owner.currentTimestamp;

let maxStackForTimestamp: StackHistoryElement = { timestamp: 0, stacks: 0 };
buff?.stackHistory.forEach((stack) => {
if (maxStackForTimestamp.timestamp < stack.timestamp && stack.timestamp < currentTimestamp) {
maxStackForTimestamp = stack;
}
});

return maxStackForTimestamp.stacks;
}

/**
Expand Down

0 comments on commit 54ab6de

Please sign in to comment.