Skip to content

Commit

Permalink
Merge pull request #845 from hillerstorm/prot-pala
Browse files Browse the repository at this point in the history
  • Loading branch information
hillerstorm authored Jul 14, 2024
2 parents 8150142 + a9d5fc5 commit 58e69dc
Show file tree
Hide file tree
Showing 8 changed files with 245 additions and 270 deletions.
72 changes: 0 additions & 72 deletions sim/paladin/_divine_protection.go

This file was deleted.

42 changes: 0 additions & 42 deletions sim/paladin/_hand_of_reckoning.go

This file was deleted.

79 changes: 0 additions & 79 deletions sim/paladin/_holy_shield.go

This file was deleted.

36 changes: 0 additions & 36 deletions sim/paladin/_spiritual_attunement.go

This file was deleted.

76 changes: 76 additions & 0 deletions sim/paladin/divine_protection.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
package paladin

import (
"time"

"github.com/wowsims/cata/sim/core"
"github.com/wowsims/cata/sim/core/proto"
"github.com/wowsims/cata/sim/core/stats"
)

func (paladin *Paladin) registerDivineProtectionSpell() {
glyphOfDivineProtection := paladin.HasMajorGlyph(proto.PaladinMajorGlyph_GlyphOfDivineProtection)

actionID := core.ActionID{SpellID: 498}
paladin.DivineProtectionAura = paladin.RegisterAura(core.Aura{
Label: "Divine Protection",
ActionID: actionID,
Duration: time.Second * 10,

OnGain: func(aura *core.Aura, sim *core.Simulation) {
if glyphOfDivineProtection {
paladin.PseudoStats.SchoolDamageTakenMultiplier[stats.SchoolIndexArcane] *= 0.6
paladin.PseudoStats.SchoolDamageTakenMultiplier[stats.SchoolIndexFire] *= 0.6
paladin.PseudoStats.SchoolDamageTakenMultiplier[stats.SchoolIndexFrost] *= 0.6
paladin.PseudoStats.SchoolDamageTakenMultiplier[stats.SchoolIndexHoly] *= 0.6
paladin.PseudoStats.SchoolDamageTakenMultiplier[stats.SchoolIndexNature] *= 0.6
paladin.PseudoStats.SchoolDamageTakenMultiplier[stats.SchoolIndexShadow] *= 0.6
} else {
paladin.PseudoStats.DamageTakenMultiplier *= 0.8
}
},
OnExpire: func(aura *core.Aura, sim *core.Simulation) {
if glyphOfDivineProtection {
paladin.PseudoStats.SchoolDamageTakenMultiplier[stats.SchoolIndexArcane] /= 0.6
paladin.PseudoStats.SchoolDamageTakenMultiplier[stats.SchoolIndexFire] /= 0.6
paladin.PseudoStats.SchoolDamageTakenMultiplier[stats.SchoolIndexFrost] /= 0.6
paladin.PseudoStats.SchoolDamageTakenMultiplier[stats.SchoolIndexHoly] /= 0.6
paladin.PseudoStats.SchoolDamageTakenMultiplier[stats.SchoolIndexNature] /= 0.6
paladin.PseudoStats.SchoolDamageTakenMultiplier[stats.SchoolIndexShadow] /= 0.6
} else {
paladin.PseudoStats.DamageTakenMultiplier /= 0.8
}
},
})

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

ManaCost: core.ManaCostOptions{
BaseCost: 0.03,
},
Cast: core.CastConfig{
DefaultCast: core.Cast{
NonEmpty: true,
},
CD: core.Cooldown{
Timer: paladin.NewTimer(),
Duration: time.Minute * 1,
},
},

ApplyEffects: func(sim *core.Simulation, _ *core.Unit, spell *core.Spell) {
paladin.DivineProtectionAura.Activate(sim)
},
})

paladin.AddMajorCooldown(core.MajorCooldown{
Spell: paladin.DivineProtection,
Type: core.CooldownTypeSurvival,
ShouldActivate: func(sim *core.Simulation, character *core.Character) bool {
return character.Spec == proto.Spec_SpecProtectionPaladin
},
})
}
21 changes: 7 additions & 14 deletions sim/paladin/paladin.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ const (
SpellMaskAncientFury
SpellMaskSealsOfCommand
SpellMaskShieldOfTheRighteous
SpellMaskHolyShield
SpellMaskArdentDefender

SpellMaskHolyShock
SpellMaskWordOfGlory
Expand Down Expand Up @@ -155,15 +157,12 @@ type Paladin struct {
SealOfJusticeAura *core.Aura
AvengingWrathAura *core.Aura
DivineProtectionAura *core.Aura
ForbearanceAura *core.Aura
ZealotryAura *core.Aura
InquisitionAura *core.Aura
DivinePurposeAura *core.Aura
JudgementsOfThePureAura *core.Aura
GrandCrusaderAura *core.Aura
SacredDutyAura *core.Aura

SpiritualAttunementMetrics *core.ResourceMetrics
GrandCrusaderAura *core.Aura
SacredDutyAura *core.Aura
}

// Implemented by each Paladin spec.
Expand Down Expand Up @@ -231,6 +230,7 @@ func (paladin *Paladin) registerSpells() {
paladin.registerConsecrationSpell()
paladin.registerHolyWrath()
paladin.registerGuardianOfAncientKings()
paladin.registerDivineProtectionSpell()
}

func (paladin *Paladin) Reset(sim *core.Simulation) {
Expand Down Expand Up @@ -287,16 +287,9 @@ func NewPaladin(character *core.Character, talentsStr string, options *proto.Pal
paladin.AddStatDependency(stats.Agility, stats.MeleeCrit, core.CritPerAgiMaxLevel[character.Class]*core.CritRatingPerCritChance)
paladin.AddStat(stats.Parry, -paladin.GetBaseStats()[stats.Strength]*0.27) // Does not apply to base Strength
paladin.AddStatDependency(stats.Strength, stats.Parry, 0.27)

paladin.PseudoStats.BaseDodge += 0.034943
paladin.PseudoStats.BaseParry += 0.05
// TODO: figure out the exact tanking stat dependencies for prot pala
// // Paladins get 0.0167 dodge per agi. ~1% per 59.88
// paladin.AddStatDependency(stats.Agility, stats.Dodge, (1.0/59.88)*core.DodgeRatingPerDodgeChance)
// // Paladins get more melee haste from haste than other classes
// paladin.PseudoStats.MeleeHasteRatingPerHastePercent /= 1.3
// // Base dodge is unaffected by Diminishing Returns

paladin.PseudoStats.BaseDodge += 0.05
paladin.PseudoStats.BaseParry += 0.05

// Bonus Armor and Armor are treated identically for Paladins
paladin.AddStatDependency(stats.BonusArmor, stats.Armor, 1)
Expand Down
4 changes: 2 additions & 2 deletions sim/paladin/protection/protection.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ func NewProtectionPaladin(character *core.Character, options *proto.Player) *Pro
protOptions := options.GetProtectionPaladin()

prot := &ProtectionPaladin{
Paladin: paladin.NewPaladin(character, options.TalentsString, protOptions.Options.ClassOptions),
Options: protOptions.Options,
Paladin: paladin.NewPaladin(character, options.TalentsString, protOptions.Options.ClassOptions),
Options: protOptions.Options,
vengeance: &core.VengeanceTracker{},
}

Expand Down
Loading

0 comments on commit 58e69dc

Please sign in to comment.