forked from WoWAnalyzer/WoWAnalyzer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dragonflight' into bugfix/tertiary
- Loading branch information
Showing
10 changed files
with
266 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
src/parser/retail/modules/items/dragonflight/BelorrelosTheSuncaller.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import Analyzer, { Options } from 'parser/core/Analyzer'; | ||
import SPELLS from 'common/SPELLS/dragonflight/trinkets'; | ||
import Abilities from 'parser/core/modules/Abilities'; | ||
import SPELL_CATEGORY from 'parser/core/SPELL_CATEGORY'; | ||
import TRINKETS from 'common/ITEMS/dragonflight/trinkets'; | ||
|
||
const deps = { | ||
abilities: Abilities, | ||
}; | ||
|
||
export default class BelorrelosTheSuncaller extends Analyzer.withDependencies(deps) { | ||
constructor(options: Options) { | ||
super(options); | ||
|
||
this.active = this.selectedCombatant.hasTrinket(TRINKETS.BELORRELOS_THE_SUNCALLER.id); | ||
if (!this.active) { | ||
return; | ||
} | ||
|
||
this.deps.abilities.add({ | ||
spell: SPELLS.BELORRELOS_SOLAR_MAELSTROM.id, | ||
category: SPELL_CATEGORY.COOLDOWNS, | ||
cooldown: 120, | ||
castEfficiency: { | ||
suggestion: true, | ||
recommendedEfficiency: 0.9, | ||
}, | ||
damageSpellIds: [SPELLS.BELORRELOS_SOLAR_MAELSTROM.id], | ||
}); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
src/parser/retail/modules/items/dragonflight/Dreambinder.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import Analyzer, { Options } from 'parser/core/Analyzer'; | ||
import ITEMS from 'common/ITEMS/dragonflight/others'; | ||
import SPELLS from 'common/SPELLS/dragonflight/others'; | ||
import Abilities from 'parser/core/modules/Abilities'; | ||
import SPELL_CATEGORY from 'parser/core/SPELL_CATEGORY'; | ||
|
||
const deps = { | ||
abilities: Abilities, | ||
}; | ||
|
||
export default class Dreambinder extends Analyzer.withDependencies(deps) { | ||
constructor(options: Options) { | ||
super(options); | ||
|
||
this.active = this.selectedCombatant.hasMainHand(ITEMS.DREAMBINDER_LOOM_OF_THE_GREAT_CYCLE.id); | ||
if (!this.active) { | ||
return; | ||
} | ||
|
||
this.deps.abilities.add({ | ||
spell: SPELLS.DREAMBINDER_WEB_OF_DREAMS_DAMAGE.id, | ||
category: SPELL_CATEGORY.COOLDOWNS, | ||
cooldown: 120, | ||
castEfficiency: { | ||
suggestion: true, | ||
recommendedEfficiency: 0.9, | ||
}, | ||
damageSpellIds: [SPELLS.DREAMBINDER_WEB_OF_DREAMS_DAMAGE.id], | ||
}); | ||
} | ||
} |
121 changes: 121 additions & 0 deletions
121
src/parser/retail/modules/items/dragonflight/Iridal.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
import { Options, SELECTED_PLAYER } from 'parser/core/Analyzer'; | ||
import ITEMS from 'common/ITEMS/dragonflight/others'; | ||
// import SPELLS from 'common/SPELLS/dragonflight/others'; | ||
import SPELLS from 'common/SPELLS'; | ||
import Abilities from 'parser/core/modules/Abilities'; | ||
import SPELL_CATEGORY from 'parser/core/SPELL_CATEGORY'; | ||
import ExecuteHelper from 'parser/shared/modules/helpers/ExecuteHelper'; | ||
import Events, { CastEvent, DamageEvent, FightEndEvent } from 'parser/core/Events'; | ||
import SpellUsable from 'parser/shared/modules/SpellUsable'; | ||
|
||
const debug = false; | ||
|
||
const IRIDAL_EXECUTE_RANGE = 0.35; | ||
const IRIDAL_BASE_CD = 180000; | ||
const IRIDAL_INTERNAL_CD = 1000; | ||
const IRIDAL_CD_REDUCTION = 1000; | ||
|
||
const FILTERED_SPELL_IDS = [ | ||
SPELLS.IRIDAL_EXTINCTION_BLAST_DAMAGE.id, | ||
SPELLS.NYMUES_UNRAVELING_SPINDLE.id, | ||
// warlock spells | ||
388070, // inquisitor's gaze / fel barrage damage | ||
SPELLS.DOOM_BRAND_DAMAGE.id, | ||
]; | ||
|
||
// todo add cdr | ||
class Iridal extends ExecuteHelper { | ||
static executeSources = SELECTED_PLAYER; | ||
static lowerThreshold = IRIDAL_EXECUTE_RANGE; | ||
static countCooldownAsExecuteTime = true; | ||
|
||
static dependencies = { | ||
...ExecuteHelper.dependencies, | ||
abilities: Abilities, | ||
spellUsable: SpellUsable, | ||
}; | ||
protected abilities!: Abilities; | ||
|
||
protected maxCasts = 0; | ||
protected cdrApplied = 0; | ||
protected lastCDRApplied = -1000; | ||
protected iridalCasts = 0; | ||
|
||
constructor(options: Options) { | ||
super(options); | ||
|
||
this.active = this.selectedCombatant.hasMainHand(ITEMS.IRIDAL_THE_EARTHS_MASTER.id); | ||
if (!this.active) { | ||
return; | ||
} | ||
|
||
this.addEventListener(Events.fightend, this.adjustMaxCasts); | ||
|
||
const ctor = this.constructor as typeof ExecuteHelper; | ||
ctor.executeSpells.push(SPELLS.IRIDAL_EXTINCTION_BLAST_DAMAGE); | ||
|
||
(options.abilities as Abilities).add({ | ||
spell: SPELLS.IRIDAL_EXTINCTION_BLAST_DAMAGE.id, | ||
category: SPELL_CATEGORY.COOLDOWNS, | ||
cooldown: 180, | ||
castEfficiency: { | ||
suggestion: true, | ||
recommendedEfficiency: 0.9, | ||
maxCasts: () => this.maxCasts, | ||
}, | ||
damageSpellIds: [SPELLS.IRIDAL_EXTINCTION_BLAST_DAMAGE.id], | ||
}); | ||
|
||
this.addEventListener(Events.damage.by(SELECTED_PLAYER), this.onDamage); | ||
this.addEventListener( | ||
Events.cast.by(SELECTED_PLAYER).spell(SPELLS.IRIDAL_EXTINCTION_BLAST_DAMAGE), | ||
this.onIridalCast, | ||
); | ||
} | ||
|
||
adjustMaxCasts(event: FightEndEvent) { | ||
super.onFightEnd(event); | ||
this.maxCasts += Math.ceil( | ||
this.totalExecuteDuration / (IRIDAL_BASE_CD - this.cdrApplied / this.iridalCasts), | ||
); | ||
// this will underestimate the casts, fix statistic if too underestimated | ||
this.maxCasts = Math.max(this.maxCasts, this.iridalCasts); | ||
debug && this.debug('iridal cdr applied:', this.cdrApplied, 'max casts:', this.maxCasts); | ||
} | ||
|
||
onIridalCast(event: CastEvent) { | ||
this.iridalCasts += 1; | ||
} | ||
|
||
onDamage(event: DamageEvent) { | ||
if (this.spellUsable.isAvailable(SPELLS.IRIDAL_EXTINCTION_BLAST_DAMAGE.id)) { | ||
return; | ||
} | ||
if (event.timestamp < this.lastCDRApplied + IRIDAL_INTERNAL_CD) { | ||
return; | ||
} | ||
if (event.targetIsFriendly) { | ||
return; | ||
} | ||
if (FILTERED_SPELL_IDS.includes(event.ability?.guid)) { | ||
return; | ||
} | ||
if (IRIDAL_EXECUTE_RANGE < (event.hitPoints || 0) / (event.maxHitPoints || 1)) { | ||
return; | ||
} | ||
|
||
debug && | ||
this.debug( | ||
'iridal cd reduced by', | ||
event.ability.name, | ||
event.ability.guid, | ||
'hp%', | ||
(event.hitPoints || 0) / (event.maxHitPoints || 1), | ||
); | ||
this.spellUsable.reduceCooldown(SPELLS.IRIDAL_EXTINCTION_BLAST_DAMAGE.id, IRIDAL_CD_REDUCTION); | ||
this.cdrApplied += IRIDAL_CD_REDUCTION; | ||
this.lastCDRApplied = event.timestamp; | ||
} | ||
} | ||
|
||
export default Iridal; |
31 changes: 31 additions & 0 deletions
31
src/parser/retail/modules/items/dragonflight/NymuesUnravelingSpindle.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import Analyzer, { Options } from 'parser/core/Analyzer'; | ||
import SPELLS from 'common/SPELLS/dragonflight/trinkets'; | ||
import Abilities from 'parser/core/modules/Abilities'; | ||
import SPELL_CATEGORY from 'parser/core/SPELL_CATEGORY'; | ||
import TRINKETS from 'common/ITEMS/dragonflight/trinkets'; | ||
|
||
const deps = { | ||
abilities: Abilities, | ||
}; | ||
|
||
export default class NymuesUnravelingSpindle extends Analyzer.withDependencies(deps) { | ||
constructor(options: Options) { | ||
super(options); | ||
|
||
this.active = this.selectedCombatant.hasTrinket(TRINKETS.NYMUES_UNRAVELING_SPINDLE.id); | ||
if (!this.active) { | ||
return; | ||
} | ||
|
||
this.deps.abilities.add({ | ||
spell: SPELLS.NYMUES_UNRAVELING_SPINDLE.id, | ||
category: SPELL_CATEGORY.COOLDOWNS, | ||
cooldown: 120, | ||
castEfficiency: { | ||
suggestion: true, | ||
recommendedEfficiency: 0.9, | ||
}, | ||
damageSpellIds: [SPELLS.NYMUES_UNRAVELING_SPINDLE.id], | ||
}); | ||
} | ||
} |