From cc71d9536aa490c6ebb42f2bec2f1795e3fb8ff5 Mon Sep 17 00:00:00 2001 From: James Tanner Date: Sun, 24 Dec 2023 16:35:16 +0900 Subject: [PATCH] Add no-option simple rotation for prot paladin to make it easier to configure cooldowns --- ui/protection_paladin/inputs.ts | 44 --------------------------------- ui/protection_paladin/sim.ts | 42 ++++++++++++++++++++++++++++++- 2 files changed, 41 insertions(+), 45 deletions(-) diff --git a/ui/protection_paladin/inputs.ts b/ui/protection_paladin/inputs.ts index db7e32f4d4..a7da711739 100644 --- a/ui/protection_paladin/inputs.ts +++ b/ui/protection_paladin/inputs.ts @@ -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({ - 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({ - 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({ - fieldName: 'squeezeHolyWrath', - label: 'Squeeze Holy Wrath', - labelTooltip: 'Squeeze a Holy Wrath cast during sufficiently hasted GCDs (Bloodlust) in the standard rotation.', - }), - InputHelpers.makeRotationNumberInput({ - 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({ - 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 ], } diff --git a/ui/protection_paladin/sim.ts b/ui/protection_paladin/sim.ts index b2a5d605c7..9ffd66c852 100644 --- a/ui/protection_paladin/sim.ts +++ b/ui/protection_paladin/sim.ts @@ -1,5 +1,6 @@ import { Class, + Cooldowns, Debuffs, Faction, IndividualBuffs, @@ -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'; @@ -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'; @@ -240,6 +245,41 @@ const SPEC_CONFIG = registerSpecConfig(Spec.SpecProtectionPaladin, { return Presets.ROTATION_DEFAULT.rotation.rotation!; }, + simpleRotation: (player: Player, 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) + + return APLRotation.create({ + prepullActions: prepullActions, + priorityList: actions.map(action => APLListItem.create({ + action: action, + })) + }); + }, + raidSimPresets: [ { spec: Spec.SpecProtectionPaladin,