Skip to content

Commit

Permalink
Merge pull request #3342 from wowsims/ret_apl
Browse files Browse the repository at this point in the history
Add APL support for Retribution Paladin
  • Loading branch information
rosenrusinov authored Jul 18, 2023
2 parents 19cb50c + 92cb926 commit 028e751
Show file tree
Hide file tree
Showing 23 changed files with 61 additions and 18 deletions.
2 changes: 1 addition & 1 deletion sim/paladin/avengers_shield.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func (paladin *Paladin) registerAvengersShieldSpell() {
ActionID: core.ActionID{SpellID: 48827},
SpellSchool: core.SpellSchoolHoly,
ProcMask: core.ProcMaskMeleeMHSpecial,
Flags: core.SpellFlagMeleeMetrics,
Flags: core.SpellFlagMeleeMetrics | core.SpellFlagAPL,

ManaCost: core.ManaCostOptions{
BaseCost: 0.26,
Expand Down
2 changes: 1 addition & 1 deletion sim/paladin/avenging_wrath.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func (paladin *Paladin) RegisterAvengingWrathCD() {

paladin.AvengingWrath = paladin.RegisterSpell(core.SpellConfig{
ActionID: actionID,
Flags: core.SpellFlagNoOnCastComplete,
Flags: core.SpellFlagNoOnCastComplete | core.SpellFlagAPL,

ManaCost: core.ManaCostOptions{
BaseCost: 0.08,
Expand Down
2 changes: 1 addition & 1 deletion sim/paladin/consecration.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func (paladin *Paladin) registerConsecrationSpell() {
ActionID: core.ActionID{SpellID: 48819},
SpellSchool: core.SpellSchoolHoly,
ProcMask: core.ProcMaskEmpty,
Flags: core.SpellFlagMeleeMetrics,
Flags: core.SpellFlagMeleeMetrics | core.SpellFlagAPL,

ManaCost: core.ManaCostOptions{
BaseCost: 0.22,
Expand Down
2 changes: 1 addition & 1 deletion sim/paladin/crusader_strike.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func (paladin *Paladin) registerCrusaderStrikeSpell() {
ActionID: core.ActionID{SpellID: 35395},
SpellSchool: core.SpellSchoolPhysical,
ProcMask: core.ProcMaskMeleeMHSpecial,
Flags: core.SpellFlagMeleeMetrics | core.SpellFlagIncludeTargetBonusDamage,
Flags: core.SpellFlagMeleeMetrics | core.SpellFlagIncludeTargetBonusDamage | core.SpellFlagAPL,

ManaCost: core.ManaCostOptions{
BaseCost: 0.05,
Expand Down
1 change: 1 addition & 0 deletions sim/paladin/divine_plea.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ func (paladin *Paladin) registerDivinePleaSpell() {
paladin.DivinePlea = paladin.RegisterSpell(core.SpellConfig{
ActionID: actionID,
SpellSchool: core.SpellSchoolHoly,
Flags: core.SpellFlagAPL,

Cast: core.CastConfig{
DefaultCast: core.Cast{
Expand Down
1 change: 1 addition & 0 deletions sim/paladin/divine_protection.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ func (paladin *Paladin) registerDivineProtectionSpell() {

paladin.DivineProtection = paladin.RegisterSpell(core.SpellConfig{
ActionID: actionID,
Flags: core.SpellFlagAPL,

Cast: core.CastConfig{
CD: core.Cooldown{
Expand Down
2 changes: 1 addition & 1 deletion sim/paladin/divine_storm.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func (paladin *Paladin) registerDivineStormSpell() {
ActionID: core.ActionID{SpellID: 53385},
SpellSchool: core.SpellSchoolPhysical,
ProcMask: core.ProcMaskMeleeMHSpecial,
Flags: core.SpellFlagMeleeMetrics | core.SpellFlagIncludeTargetBonusDamage,
Flags: core.SpellFlagMeleeMetrics | core.SpellFlagIncludeTargetBonusDamage | core.SpellFlagAPL,

ManaCost: core.ManaCostOptions{
BaseCost: 0.12,
Expand Down
4 changes: 2 additions & 2 deletions sim/paladin/exorcism.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func (paladin *Paladin) registerExorcismSpell() {
ActionID: core.ActionID{SpellID: 48801},
SpellSchool: core.SpellSchoolHoly,
ProcMask: core.ProcMaskSpellDamage,
Flags: core.SpellFlagMeleeMetrics,
Flags: core.SpellFlagMeleeMetrics | core.SpellFlagAPL,

ManaCost: core.ManaCostOptions{
BaseCost: 0.08,
Expand All @@ -29,7 +29,7 @@ func (paladin *Paladin) registerExorcismSpell() {
},
ModifyCast: func(sim *core.Simulation, spell *core.Spell, cast *core.Cast) {
if paladin.CurrentMana() >= cast.Cost {
castTime := time.Duration(float64(cast.CastTime) * spell.CastTimeMultiplier)
castTime := paladin.ApplyCastSpeedForSpell(cast.CastTime, spell)
if castTime > 0 {
paladin.AutoAttacks.StopMeleeUntil(sim, sim.CurrentTime+castTime, false)
}
Expand Down
2 changes: 1 addition & 1 deletion sim/paladin/hammer_of_the_righteous.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func (paladin *Paladin) registerHammerOfTheRighteousSpell() {
ActionID: core.ActionID{SpellID: 53595},
SpellSchool: core.SpellSchoolHoly,
ProcMask: core.ProcMaskMeleeMHSpecial,
Flags: core.SpellFlagMeleeMetrics,
Flags: core.SpellFlagMeleeMetrics | core.SpellFlagAPL,

ManaCost: core.ManaCostOptions{
BaseCost: 0.06,
Expand Down
5 changes: 4 additions & 1 deletion sim/paladin/hammer_of_wrath.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func (paladin *Paladin) registerHammerOfWrathSpell() {
ActionID: core.ActionID{SpellID: 48806},
SpellSchool: core.SpellSchoolHoly,
ProcMask: core.ProcMaskMeleeMHSpecial,
Flags: core.SpellFlagMeleeMetrics,
Flags: core.SpellFlagMeleeMetrics | core.SpellFlagAPL,

ManaCost: core.ManaCostOptions{
BaseCost: 0.12 * core.TernaryFloat64(paladin.HasMajorGlyph(proto.PaladinMajorGlyph_GlyphOfHammerOfWrath), 0, 1),
Expand All @@ -28,6 +28,9 @@ func (paladin *Paladin) registerHammerOfWrathSpell() {
Duration: time.Second * 6,
},
},
ExtraCastCondition: func(sim *core.Simulation, target *core.Unit) bool {
return sim.IsExecutePhase20()
},

BonusCritRating: 25 * float64(paladin.Talents.SanctifiedWrath) * core.CritRatingPerCritChance,
DamageMultiplierAdditive: 1 +
Expand Down
2 changes: 1 addition & 1 deletion sim/paladin/hand_of_reckoning.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func (paladin *Paladin) registerHandOfReckoningSpell() {
ActionID: core.ActionID{SpellID: 67485}, // 62124 is the "taunt" part
SpellSchool: core.SpellSchoolHoly,
ProcMask: core.ProcMaskSpellDamage,
Flags: core.SpellFlagMeleeMetrics,
Flags: core.SpellFlagMeleeMetrics | core.SpellFlagAPL,

ManaCost: core.ManaCostOptions{
BaseCost: 0.03,
Expand Down
1 change: 1 addition & 0 deletions sim/paladin/holy_shield.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ func (paladin *Paladin) registerHolyShieldSpell() {
paladin.HolyShield = paladin.RegisterSpell(core.SpellConfig{
ActionID: actionID,
SpellSchool: core.SpellSchoolHoly,
Flags: core.SpellFlagAPL,

ManaCost: core.ManaCostOptions{
BaseCost: 0.10,
Expand Down
2 changes: 1 addition & 1 deletion sim/paladin/holy_wrath.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func (paladin *Paladin) registerHolyWrathSpell() {
ActionID: core.ActionID{SpellID: 48817},
SpellSchool: core.SpellSchoolHoly,
ProcMask: core.ProcMaskSpellDamage,
Flags: core.SpellFlagMeleeMetrics,
Flags: core.SpellFlagMeleeMetrics | core.SpellFlagAPL,

ManaCost: core.ManaCostOptions{
BaseCost: 0.20,
Expand Down
4 changes: 2 additions & 2 deletions sim/paladin/judgement.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func (paladin *Paladin) registerJudgementOfWisdomSpell(cdTimer *core.Timer) {
ActionID: core.ActionID{SpellID: 53408},
SpellSchool: core.SpellSchoolHoly,
ProcMask: core.ProcMaskEmpty,
Flags: SpellFlagPrimaryJudgement,
Flags: SpellFlagPrimaryJudgement | core.SpellFlagAPL,

ManaCost: core.ManaCostOptions{
BaseCost: 0.05,
Expand Down Expand Up @@ -58,7 +58,7 @@ func (paladin *Paladin) registerJudgementOfLightSpell(cdTimer *core.Timer) {
ActionID: core.ActionID{SpellID: 20271},
SpellSchool: core.SpellSchoolHoly,
ProcMask: core.ProcMaskEmpty,
Flags: SpellFlagPrimaryJudgement,
Flags: SpellFlagPrimaryJudgement | core.SpellFlagAPL,

ManaCost: core.ManaCostOptions{
BaseCost: 0.05,
Expand Down
4 changes: 4 additions & 0 deletions sim/paladin/protection/rotation.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ import (
)

func (prot *ProtectionPaladin) OnGCDReady(sim *core.Simulation) {
if prot.IsUsingAPL {
return
}

prot.SelectedRotation(sim)

if prot.GCD.IsReady(sim) {
Expand Down
7 changes: 5 additions & 2 deletions sim/paladin/retribution/rotation.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ func (ret *RetributionPaladin) OnAutoAttack(sim *core.Simulation, spell *core.Sp
}

func (ret *RetributionPaladin) OnGCDReady(sim *core.Simulation) {
if ret.IsUsingAPL {
return
}

ret.SelectedRotation(sim)
if ret.GCD.IsReady(sim) {
ret.DoNothing() // this means we had nothing to do and we are ok
Expand Down Expand Up @@ -303,8 +307,7 @@ func (ret *RetributionPaladin) mainRotation(sim *core.Simulation) {

func (ret *RetributionPaladin) checkConsecrationClipping(sim *core.Simulation) bool {
if ret.AvoidClippingConsecration {
// TODO: sim.Duration is the wrong value to check
return sim.CurrentTime+ret.Consecration.AOEDot().TickLength*4 <= sim.Duration
return ret.Consecration.AOEDot().TickLength*4 <= sim.GetRemainingDuration()
} else {
// If we're not configured to check, always return success.
return true
Expand Down
2 changes: 1 addition & 1 deletion sim/paladin/shield_of_righteousness.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func (paladin *Paladin) registerShieldOfRighteousnessSpell() {
ActionID: core.ActionID{SpellID: 61411},
SpellSchool: core.SpellSchoolHoly,
ProcMask: core.ProcMaskMeleeMHSpecial,
Flags: core.SpellFlagMeleeMetrics,
Flags: core.SpellFlagMeleeMetrics | core.SpellFlagAPL,

ManaCost: core.ManaCostOptions{
BaseCost: 0.06,
Expand Down
1 change: 1 addition & 0 deletions sim/paladin/soc.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ func (paladin *Paladin) registerSealOfCommandSpellAndAura() {
ActionID: auraActionID, // Seal of Command self buff.
SpellSchool: core.SpellSchoolHoly,
ProcMask: core.ProcMaskEmpty,
Flags: core.SpellFlagAPL,

ManaCost: core.ManaCostOptions{
BaseCost: 0.14,
Expand Down
1 change: 1 addition & 0 deletions sim/paladin/sor.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ func (paladin *Paladin) registerSealOfRighteousnessSpellAndAura() {
paladin.SealOfRighteousness = paladin.RegisterSpell(core.SpellConfig{
ActionID: auraActionID, // Seal of Righteousness self buff.
SpellSchool: core.SpellSchoolHoly,
Flags: core.SpellFlagAPL,

ManaCost: core.ManaCostOptions{
BaseCost: 0.14,
Expand Down
1 change: 1 addition & 0 deletions sim/paladin/sov.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ func (paladin *Paladin) registerSealOfVengeanceSpellAndAura() {
paladin.SealOfVengeance = paladin.RegisterSpell(core.SpellConfig{
ActionID: auraActionID, // Seal of Vengeance self buff.
SpellSchool: core.SpellSchoolHoly,
Flags: core.SpellFlagAPL,

ManaCost: core.ManaCostOptions{
BaseCost: 0.14,
Expand Down
2 changes: 1 addition & 1 deletion ui/core/launched_sims.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const aplLaunchStatuses: Record<Spec, LaunchStatus> = {
[Spec.SpecRogue]: LaunchStatus.Alpha,
[Spec.SpecHolyPaladin]: LaunchStatus.Unlaunched,
[Spec.SpecProtectionPaladin]: LaunchStatus.Unlaunched,
[Spec.SpecRetributionPaladin]: LaunchStatus.Unlaunched,
[Spec.SpecRetributionPaladin]: LaunchStatus.Alpha,
[Spec.SpecHealingPriest]: LaunchStatus.Unlaunched,
[Spec.SpecShadowPriest]: LaunchStatus.Alpha,
[Spec.SpecSmitePriest]: LaunchStatus.Unlaunched,
Expand Down
26 changes: 25 additions & 1 deletion ui/retribution_paladin/presets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ import { ItemSpec } from '../core/proto/common.js';
import { Potions } from '../core/proto/common.js';
import { Spec } from '../core/proto/common.js';
import { Faction } from '../core/proto/common.js';
import { SavedTalents } from '../core/proto/ui.js';
import { SavedRotation, SavedTalents } from '../core/proto/ui.js';
import { Player } from '../core/player.js';
import { APLRotation } from '../core/proto/apl.js';

import {
PaladinAura as PaladinAura,
Expand Down Expand Up @@ -265,3 +266,26 @@ export const P5_PRESET = {
{"id":50455}
]}`),
};

export const ROTATION_PRESET_BASIC_APL = {
name: 'Basic APL',
rotation: SavedRotation.create({
specRotationOptionsJson: RetributionPaladinRotation.toJsonString(DefaultRotation),
rotation: APLRotation.fromJsonString(`{
"enabled": true,
"prepullActions": [
{"action":{"castSpell":{"spellId":{"otherId":"OtherActionPotion"}}},"doAt":"-1s"}
],
"priorityList": [
{"action":{"autocastOtherCooldowns":{}}},
{"action":{"castSpell":{"spellId":{"spellId":67485}}}},
{"action":{"castSpell":{"spellId":{"spellId":48806}}}},
{"action":{"castSpell":{"spellId":{"spellId":53408}}}},
{"action":{"castSpell":{"spellId":{"spellId":35395}}}},
{"action":{"castSpell":{"spellId":{"spellId":53385}}}},
{"action":{"condition":{"auraIsActive":{"auraId":{"spellId":53488}}},"castSpell":{"spellId":{"spellId":48801}}}},
{"action":{"condition":{"cmp":{"op":"OpGt","lhs":{"remainingTime":{}},"rhs":{"const":{"val":"4s"}}}},"castSpell":{"spellId":{"spellId":48819}}}}
]
}`),
}),
};
3 changes: 3 additions & 0 deletions ui/retribution_paladin/sim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@ export class RetributionPaladinSimUI extends IndividualSimUI<Spec.SpecRetributio
},

presets: {
rotations: [
Presets.ROTATION_PRESET_BASIC_APL,
],
// Preset talents that the user can quickly select.
talents: [
Presets.AuraMasteryTalents,
Expand Down

0 comments on commit 028e751

Please sign in to comment.