Skip to content

Commit

Permalink
Merge pull request #3695 from wowsims/apl
Browse files Browse the repository at this point in the history
Add AOE case to hunter auto rotation, and only show Rune APL values f…
  • Loading branch information
jimmyt857 authored Sep 17, 2023
2 parents 0b70f8c + f685fff commit 76be36e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
10 changes: 10 additions & 0 deletions ui/core/components/individual_sim_ui/apl_values.ts
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,7 @@ const valueKindFactories: {[f in NonNullable<APLValueKind>]: ValueKindConfig<APL
submenu: ['Resources'],
shortDescription: 'Amount of currently available Runic Power.',
newValue: APLValueCurrentRunicPower.create,
includeIf: (player: Player<any>, isPrepull: boolean) => player.getClass() == Class.ClassDeathknight,
fields: [],
}),

Expand All @@ -607,6 +608,7 @@ const valueKindFactories: {[f in NonNullable<APLValueKind>]: ValueKindConfig<APL
submenu: ['Resources', 'Runes'],
shortDescription: 'Amount of currently available Runes of certain type including Death.',
newValue: APLValueCurrentRuneCount.create,
includeIf: (player: Player<any>, isPrepull: boolean) => player.getClass() == Class.ClassDeathknight,
fields: [
AplHelpers.runeTypeFieldConfig('runeType', true),
],
Expand All @@ -616,6 +618,7 @@ const valueKindFactories: {[f in NonNullable<APLValueKind>]: ValueKindConfig<APL
submenu: ['Resources', 'Runes'],
shortDescription: 'Amount of currently available Runes of certain type ignoring Death',
newValue: APLValueCurrentNonDeathRuneCount.create,
includeIf: (player: Player<any>, isPrepull: boolean) => player.getClass() == Class.ClassDeathknight,
fields: [
AplHelpers.runeTypeFieldConfig('runeType', false),
],
Expand All @@ -625,6 +628,7 @@ const valueKindFactories: {[f in NonNullable<APLValueKind>]: ValueKindConfig<APL
submenu: ['Resources', 'Runes'],
shortDescription: 'Is the rune of a certain slot currently available.',
newValue: APLValueCurrentRuneActive.create,
includeIf: (player: Player<any>, isPrepull: boolean) => player.getClass() == Class.ClassDeathknight,
fields: [
AplHelpers.runeSlotFieldConfig('runeSlot'),
],
Expand All @@ -634,6 +638,7 @@ const valueKindFactories: {[f in NonNullable<APLValueKind>]: ValueKindConfig<APL
submenu: ['Resources', 'Runes'],
shortDescription: 'Is the rune of a certain slot currently converted to Death.',
newValue: APLValueCurrentRuneDeath.create,
includeIf: (player: Player<any>, isPrepull: boolean) => player.getClass() == Class.ClassDeathknight,
fields: [
AplHelpers.runeSlotFieldConfig('runeSlot'),
],
Expand All @@ -643,6 +648,7 @@ const valueKindFactories: {[f in NonNullable<APLValueKind>]: ValueKindConfig<APL
submenu: ['Resources', 'Runes'],
shortDescription: 'Amount of time until a rune of certain type is ready to use.<br><b>NOTE:</b> Returns 0 if there is a rune available',
newValue: APLValueRuneCooldown.create,
includeIf: (player: Player<any>, isPrepull: boolean) => player.getClass() == Class.ClassDeathknight,
fields: [
AplHelpers.runeTypeFieldConfig('runeType', false),
],
Expand All @@ -652,6 +658,7 @@ const valueKindFactories: {[f in NonNullable<APLValueKind>]: ValueKindConfig<APL
submenu: ['Resources', 'Runes'],
shortDescription: 'Amount of time until a 2nd rune of certain type is ready to use.<br><b>NOTE:</b> Returns 0 if there are 2 runes available',
newValue: APLValueNextRuneCooldown.create,
includeIf: (player: Player<any>, isPrepull: boolean) => player.getClass() == Class.ClassDeathknight,
fields: [
AplHelpers.runeTypeFieldConfig('runeType', false),
],
Expand All @@ -661,6 +668,7 @@ const valueKindFactories: {[f in NonNullable<APLValueKind>]: ValueKindConfig<APL
submenu: ['Resources', 'Runes'],
shortDescription: 'Amount of time until a rune of certain slot is ready to use.<br><b>NOTE:</b> Returns 0 if rune is ready',
newValue: APLValueRuneSlotCooldown.create,
includeIf: (player: Player<any>, isPrepull: boolean) => player.getClass() == Class.ClassDeathknight,
fields: [
AplHelpers.runeSlotFieldConfig('runeSlot'),
],
Expand All @@ -670,6 +678,7 @@ const valueKindFactories: {[f in NonNullable<APLValueKind>]: ValueKindConfig<APL
submenu: ['Resources', 'Runes'],
shortDescription: 'Amount of rune grace period available for certain rune type.',
newValue: APLValueRuneGrace.create,
includeIf: (player: Player<any>, isPrepull: boolean) => player.getClass() == Class.ClassDeathknight,
fields: [
AplHelpers.runeTypeFieldConfig('runeType', false),
],
Expand All @@ -679,6 +688,7 @@ const valueKindFactories: {[f in NonNullable<APLValueKind>]: ValueKindConfig<APL
submenu: ['Resources', 'Runes'],
shortDescription: 'Amount of rune grace period available for certain rune slot.',
newValue: APLValueRuneSlotGrace.create,
includeIf: (player: Player<any>, isPrepull: boolean) => player.getClass() == Class.ClassDeathknight,
fields: [
AplHelpers.runeSlotFieldConfig('runeSlot'),
],
Expand Down
7 changes: 1 addition & 6 deletions ui/deathknight/sim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@ import { HandType, RaidBuffs } from '../core/proto/common.js';
import { PartyBuffs } from '../core/proto/common.js';
import { IndividualBuffs } from '../core/proto/common.js';
import { Debuffs } from '../core/proto/common.js';
import { Class } from '../core/proto/common.js';
import { Consumes } from '../core/proto/common.js';
import { Encounter } from '../core/proto/common.js';
import { ItemSlot } from '../core/proto/common.js';
import { MobType } from '../core/proto/common.js';
import { Spec } from '../core/proto/common.js';
import { Stat, PseudoStat } from '../core/proto/common.js';
import { TristateEffect } from '../core/proto/common.js'
Expand All @@ -23,7 +19,6 @@ import * as Tooltips from '../core/constants/tooltips.js';

import * as DeathKnightInputs from './inputs.js';
import * as Presets from './presets.js';
import { numberFieldConfig } from 'ui/core/components/individual_sim_ui/apl_helpers.js';

export class DeathknightSimUI extends IndividualSimUI<Spec.SpecDeathknight> {
constructor(parentElem: HTMLElement, player: Player<Spec.SpecDeathknight>) {
Expand Down Expand Up @@ -134,7 +129,7 @@ export class DeathknightSimUI extends IndividualSimUI<Spec.SpecDeathknight> {

autoRotation: (player: Player<Spec.SpecDeathknight>): APLRotation => {
const talentTree = player.getTalentTree();
const numTargets = player.getRaid()!.sim.encounter.targets.length;
const numTargets = player.sim.encounter.targets.length;
switch (talentTree) {
case 0:
if (player.getSpecOptions().drwPestiApply || numTargets > 1) {
Expand Down
5 changes: 4 additions & 1 deletion ui/hunter/sim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,10 @@ export class HunterSimUI extends IndividualSimUI<Spec.SpecHunter> {

autoRotation: (player: Player<Spec.SpecHunter>): APLRotation => {
const talentTree = player.getTalentTree();
if (talentTree == 0) {
const numTargets = player.sim.encounter.targets.length;
if (numTargets >= 4) {
return Presets.ROTATION_PRESET_AOE.rotation.rotation!;
} else if (talentTree == 0) {
return Presets.ROTATION_PRESET_BM.rotation.rotation!;
} else if (talentTree == 1) {
return Presets.ROTATION_PRESET_MM.rotation.rotation!;
Expand Down

0 comments on commit 76be36e

Please sign in to comment.