Skip to content

Commit

Permalink
Merge pull request #4108 from wowsims/apl
Browse files Browse the repository at this point in the history
Add no-option simple rotation for prot paladin to make it easier to c…
  • Loading branch information
jimmyt857 authored Dec 24, 2023
2 parents 98783f3 + cc71d95 commit 7fdaa43
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 45 deletions.
44 changes: 0 additions & 44 deletions ui/protection_paladin/inputs.ts
Original file line number Diff line number Diff line change
@@ -1,61 +1,17 @@
import { Spec } from '../core/proto/common.js';
import { Player } from '../core/player.js';
import { EventID } from '../core/typed_event.js';
import { IndividualSimUI } from '../core/individual_sim_ui.js';
import { ActionId } from '../core/proto_utils/action_id.js';

import {
PaladinAura as PaladinAura,
PaladinSeal,
PaladinJudgement as PaladinJudgement,
ProtectionPaladin_Rotation_SpellOption as SpellOption,
ProtectionPaladin_Rotation as ProtectionPaladinRotation,
ProtectionPaladin_Options as ProtectionPaladinOptions,
} from '../core/proto/paladin.js';

import * as InputHelpers from '../core/components/input_helpers.js';

export const ProtectionPaladinRotationPriorityConfig = InputHelpers.makeCustomRotationInput<Spec.SpecProtectionPaladin, SpellOption>({
fieldName: 'customRotation',
numColumns: 2,
values: [
{ actionId: ActionId.fromSpellId(53408), value: SpellOption.JudgementOfWisdom },
{ actionId: ActionId.fromSpellId(48806), value: SpellOption.HammerOfWrath },
{ actionId: ActionId.fromSpellId(48819), value: SpellOption.Consecration },
{ actionId: ActionId.fromSpellId(48817), value: SpellOption.HolyWrath },
{ actionId: ActionId.fromSpellId(48801), value: SpellOption.Exorcism },
{ actionId: ActionId.fromSpellId(61411), value: SpellOption.ShieldOfRighteousness },
{ actionId: ActionId.fromSpellId(48827), value: SpellOption.AvengersShield },
{ actionId: ActionId.fromSpellId(53595), value: SpellOption.HammerOfTheRighteous },
{ actionId: ActionId.fromSpellId(48952), value: SpellOption.HolyShield },
],
});

// Configuration for spec-specific UI elements on the settings tab.
// These don't need to be in a separate file but it keeps things cleaner.
export const ProtectionPaladinRotationConfig = {
inputs: [
InputHelpers.makeRotationBooleanInput<Spec.SpecProtectionPaladin>({
fieldName: 'hammerFirst',
label: 'Open with HotR',
labelTooltip: 'Open with Hammer of the Righteous instead of Shield of Righteousness in the standard rotation. Recommended for AoE.',
}),
InputHelpers.makeRotationBooleanInput<Spec.SpecProtectionPaladin>({
fieldName: 'squeezeHolyWrath',
label: 'Squeeze Holy Wrath',
labelTooltip: 'Squeeze a Holy Wrath cast during sufficiently hasted GCDs (Bloodlust) in the standard rotation.',
}),
InputHelpers.makeRotationNumberInput<Spec.SpecProtectionPaladin>({
fieldName: 'waitSlack',
label: 'Max Wait Time (ms)',
labelTooltip: 'Maximum time in milliseconds to prioritize waiting for next Hammer/Shield to maintain 969. Affects standard and custom priority.',
}),
InputHelpers.makeRotationBooleanInput<Spec.SpecProtectionPaladin>({
fieldName: 'useCustomPrio',
label: 'Use custom priority',
labelTooltip: 'Deviates from the standard 96969 rotation, using the priority configured below. Will still attempt to keep a filler GCD between Hammer and Shield.',
}),
ProtectionPaladinRotationPriorityConfig
],
}

Expand Down
42 changes: 41 additions & 1 deletion ui/protection_paladin/sim.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {
Class,
Cooldowns,
Debuffs,
Faction,
IndividualBuffs,
Expand All @@ -11,6 +12,9 @@ import {
TristateEffect,
} from '../core/proto/common.js';
import {
APLAction,
APLListItem,
APLPrepullAction,
APLRotation,
} from '../core/proto/apl.js';
import { Stats } from '../core/proto_utils/stats.js';
Expand All @@ -22,8 +26,9 @@ import { TypedEvent } from '../core/typed_event.js';
import * as IconInputs from '../core/components/icon_inputs.js';
import * as OtherInputs from '../core/components/other_inputs.js';
import * as Mechanics from '../core/constants/mechanics.js';
import * as AplUtils from '../core/proto_utils/apl_utils.js';

import { PaladinMajorGlyph, PaladinSeal } from '../core/proto/paladin.js';
import { PaladinMajorGlyph, PaladinSeal, ProtectionPaladin_Rotation as ProtectionPaladinRotation } from '../core/proto/paladin.js';

import * as ProtectionPaladinInputs from './inputs.js';
import * as Presets from './presets.js';
Expand Down Expand Up @@ -240,6 +245,41 @@ const SPEC_CONFIG = registerSpecConfig(Spec.SpecProtectionPaladin, {
return Presets.ROTATION_DEFAULT.rotation.rotation!;
},

simpleRotation: (player: Player<Spec.SpecProtectionPaladin>, simple: ProtectionPaladinRotation, cooldowns: Cooldowns): APLRotation => {
let [prepullActions, actions] = AplUtils.standardCooldownDefaults(cooldowns);

const holyShieldPrepull = APLPrepullAction.fromJsonString(`{"action":{"castSpell":{"spellId":{"spellId":48952}}},"doAtValue":{"const":{"val":"-3s"}}}`);
const divinePlea = APLPrepullAction.fromJsonString(`{"action":{"castSpell":{"spellId":{"spellId":54428}}},"doAtValue":{"const":{"val":"-1500ms"}}}`);
prepullActions.push(holyShieldPrepull, divinePlea);

const shieldOfRighteousness = APLAction.fromJsonString(`{"condition":{"cmp":{"op":"OpLe","lhs":{"spellTimeToReady":{"spellId":{"spellId":53595}}},"rhs":{"const":{"val":"3s"}}}},"castSpell":{"spellId":{"spellId":61411}}}`);
const hammerOfRighteousness = APLAction.fromJsonString(`{"condition":{"cmp":{"op":"OpLe","lhs":{"spellTimeToReady":{"spellId":{"spellId":61411}}},"rhs":{"const":{"val":"3s"}}}},"castSpell":{"spellId":{"spellId":53595}}}`);
const hammerOfWrath = APLAction.fromJsonString(`{"castSpell":{"spellId":{"spellId":48806}}}`);
const waitPrimary = APLAction.fromJsonString(`{"condition":{"and":{"vals":[{"gcdIsReady":{}},{"not":{"val":{"spellIsReady":{"spellId":{"spellId":61411}}}}},{"not":{"val":{"spellIsReady":{"spellId":{"spellId":53595}}}}},{"cmp":{"op":"OpLe","lhs":{"min":{"vals":[{"spellTimeToReady":{"spellId":{"spellId":61411}}},{"spellTimeToReady":{"spellId":{"spellId":53595}}}]}},"rhs":{"const":{"val":"350ms"}}}}]}},"wait":{"duration":{"min":{"vals":[{"spellTimeToReady":{"spellId":{"spellId":61411}}},{"spellTimeToReady":{"spellId":{"spellId":53595}}}]}}}}`);
const consecration = APLAction.fromJsonString(`{"castSpell":{"spellId":{"spellId":48819}}}`);
const holyShield = APLAction.fromJsonString(`{"castSpell":{"spellId":{"spellId":48952}}}`);
const judgementOfWisdom = APLAction.fromJsonString(`{"castSpell":{"spellId":{"spellId":53408}}}`);
const waitSecondary = APLAction.fromJsonString(`{"condition":{"and":{"vals":[{"gcdIsReady":{}},{"not":{"val":{"spellIsReady":{"spellId":{"spellId":61411}}}}},{"not":{"val":{"spellIsReady":{"spellId":{"spellId":53595}}}}},{"not":{"val":{"spellIsReady":{"spellId":{"spellId":48819}}}}},{"not":{"val":{"spellIsReady":{"spellId":{"spellId":48952}}}}},{"not":{"val":{"spellIsReady":{"spellId":{"spellId":53408}}}}}]}},"wait":{"duration":{"min":{"vals":[{"spellTimeToReady":{"spellId":{"spellId":61411}}},{"spellTimeToReady":{"spellId":{"spellId":53595}}},{"spellTimeToReady":{"spellId":{"spellId":48819}}},{"spellTimeToReady":{"spellId":{"spellId":48952}}},{"spellTimeToReady":{"spellId":{"spellId":53408}}}]}}}}`);

actions.push(...[
shieldOfRighteousness,
hammerOfRighteousness,
hammerOfWrath,
waitPrimary,
consecration,
holyShield,
judgementOfWisdom,
waitSecondary,
].filter(a => a) as Array<APLAction>)

return APLRotation.create({
prepullActions: prepullActions,
priorityList: actions.map(action => APLListItem.create({
action: action,
}))
});
},

raidSimPresets: [
{
spec: Spec.SpecProtectionPaladin,
Expand Down

0 comments on commit 7fdaa43

Please sign in to comment.