Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use related auras for remaining debuffs, and implement a few missing … #3413

Merged
merged 1 commit into from
Aug 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions sim/core/debuffs.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func applyDebuffEffects(target *Unit, targetIdx int, debuffs *proto.Debuffs, rai
MakePermanent(DemoralizingShoutAura(target, 0, GetTristateValueInt32(debuffs.DemoralizingShout, 0, 5)))
}
if debuffs.Vindication && targetIdx == 0 {
MakePermanent(VindicationAura(target))
MakePermanent(VindicationAura(target, 2))
}
if debuffs.DemoralizingScreech {
MakePermanent(DemoralizingScreechAura(target))
Expand All @@ -148,7 +148,7 @@ func applyDebuffEffects(target *Unit, targetIdx int, debuffs *proto.Debuffs, rai
MakePermanent(ThunderClapAura(target, GetTristateValueInt32(debuffs.ThunderClap, 0, 3)))
}
if debuffs.FrostFever != proto.TristateEffect_TristateEffectMissing {
MakePermanent(FrostFeverAura(target, GetTristateValueInt32(debuffs.FrostFever, 0, 3)))
MakePermanent(FrostFeverAura(target, GetTristateValueInt32(debuffs.FrostFever, 0, 3), 0))
}
if debuffs.InfectedWounds && targetIdx == 0 {
MakePermanent(InfectedWoundsAura(target, 3))
Expand Down Expand Up @@ -748,13 +748,13 @@ func DemoralizingShoutAura(target *Unit, boomingVoicePts int32, impDemoShoutPts
return aura
}

func VindicationAura(target *Unit) *Aura {
func VindicationAura(target *Unit, points int32) *Aura {
aura := target.GetOrRegisterAura(Aura{
Label: "Vindication",
ActionID: ActionID{SpellID: 26016},
Duration: time.Second * 10,
})
apReductionEffect(aura, 574)
apReductionEffect(aura, 287*float64(points))
return aura
}

Expand Down Expand Up @@ -813,11 +813,11 @@ func JudgementsOfTheJustAura(target *Unit, points int32) *Aura {
return aura
}

func FrostFeverAura(target *Unit, impIcyTouch int32) *Aura {
func FrostFeverAura(target *Unit, impIcyTouch int32, epidemic int32) *Aura {
aura := target.GetOrRegisterAura(Aura{
Label: "FrostFever",
ActionID: ActionID{SpellID: 55095},
Duration: time.Second * 15,
Duration: time.Second*15 + (time.Second * 3 * time.Duration(epidemic)),
})
AtkSpeedReductionEffect(aura, 1.14+0.02*float64(impIcyTouch))
return aura
Expand Down Expand Up @@ -927,12 +927,12 @@ func TotemOfWrathDebuff(target *Unit) *Aura {
return minorCritDebuffAura(target, "Totem of Wrath Debuff", ActionID{SpellID: 30708}, time.Minute*5, 3*CritRatingPerCritChance)
}

func MasterPoisonerDebuff(target *Unit, points float64) *Aura {
return minorCritDebuffAura(target, "Master Poisoner", ActionID{SpellID: 58410}, time.Second*20, points*CritRatingPerCritChance)
func MasterPoisonerDebuff(target *Unit, points int32) *Aura {
return minorCritDebuffAura(target, "Master Poisoner", ActionID{SpellID: 58410}, time.Second*20, float64(points)*CritRatingPerCritChance)
}

func HeartOfTheCrusaderDebuff(target *Unit, points float64) *Aura {
return minorCritDebuffAura(target, "Heart of the Crusader", ActionID{SpellID: 20337}, time.Second*20, points*CritRatingPerCritChance)
func HeartOfTheCrusaderDebuff(target *Unit, points int32) *Aura {
return minorCritDebuffAura(target, "Heart of the Crusader", ActionID{SpellID: 20337}, time.Second*20, float64(points)*CritRatingPerCritChance)
}

func minorCritDebuffAura(target *Unit, label string, actionID ActionID, duration time.Duration, critBonus float64) *Aura {
Expand Down
2 changes: 1 addition & 1 deletion sim/deathknight/deathknight.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ type Deathknight struct {
UnholyPresenceAura *core.Aura

// Debuffs
FrostFeverDebuffAura []*core.Aura
FrostFeverDebuffAura core.AuraArray
EbonPlagueOrCryptFeverAura core.AuraArray

RoRTSBonus func(*core.Unit) float64 // is either RoR or TS bonus function based on talents
Expand Down
7 changes: 7 additions & 0 deletions sim/deathknight/diseases.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ func (dk *Deathknight) registerDiseaseDots() {
}

func (dk *Deathknight) registerFrostFever() {
dk.FrostFeverDebuffAura = dk.NewEnemyAuraArray(func(target *core.Unit) *core.Aura {
return core.FrostFeverAura(target, dk.Talents.ImprovedIcyTouch, dk.Talents.Epidemic)
})

dk.FrostFeverSpell = dk.RegisterSpell(core.SpellConfig{
ActionID: core.ActionID{SpellID: 55095},
SpellSchool: core.SpellSchoolFrost,
Expand Down Expand Up @@ -109,7 +113,10 @@ func (dk *Deathknight) registerFrostFever() {
ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
dot := spell.Dot(target)
dot.Apply(sim)
dk.FrostFeverDebuffAura.Get(target).Activate(sim)
},

RelatedAuras: []core.AuraArray{dk.FrostFeverDebuffAura},
})
dk.FrostFeverExtended = make([]int, dk.Env.GetNumTargets())
}
Expand Down
9 changes: 0 additions & 9 deletions sim/deathknight/icy_touch.go
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
package deathknight

import (
"time"

"github.com/wowsims/wotlk/sim/core"
)

var IcyTouchActionID = core.ActionID{SpellID: 59131}

func (dk *Deathknight) registerIcyTouchSpell() {
dk.FrostFeverDebuffAura = make([]*core.Aura, len(dk.Env.Encounter.TargetUnits))
for i, target := range dk.Env.Encounter.TargetUnits {
ffAura := core.FrostFeverAura(target, dk.Talents.ImprovedIcyTouch)
ffAura.Duration = time.Second*15 + (time.Second * 3 * time.Duration(dk.Talents.Epidemic))
dk.FrostFeverDebuffAura[i] = ffAura
}

sigilBonus := dk.sigilOfTheFrozenConscienceBonus()

dk.IcyTouch = dk.RegisterSpell(core.SpellConfig{
Expand Down
2 changes: 1 addition & 1 deletion sim/deathknight/pestilence.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func (dk *Deathknight) registerPestilenceSpell() {
if dk.Talents.IcyTalons > 0 {
dk.IcyTalonsAura.Activate(sim)
}
dk.FrostFeverDebuffAura[aoeTarget.Index].Activate(sim)
dk.FrostFeverDebuffAura.Get(aoeTarget).Activate(sim)
}

if dk.BloodPlagueSpell.Dot(aoeTarget).IsActive() {
Expand Down
12 changes: 6 additions & 6 deletions sim/deathknight/tank/TestBloodTank.results
Original file line number Diff line number Diff line change
Expand Up @@ -904,9 +904,9 @@ dps_results: {
dps_results: {
key: "TestBloodTank-Average-Default"
value: {
dps: 1790.9397
tps: 6024.63062
dtps: 242.73323
dps: 1789.07382
tps: 6019.08785
dtps: 242.73879
}
}
dps_results: {
Expand Down Expand Up @@ -996,8 +996,8 @@ dps_results: {
dps_results: {
key: "TestBloodTank-SwitchInFrontOfTarget-Default"
value: {
dps: 1819.42574
tps: 6051.37454
dtps: 242.54547
dps: 1816.47681
tps: 6035.67207
dtps: 242.59397
}
}
2 changes: 2 additions & 0 deletions sim/druid/demoralizing_roar.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ func (druid *Druid) registerDemoralizingRoarSpell() {
}
}
},

RelatedAuras: []core.AuraArray{druid.DemoralizingRoarAuras},
})
}

Expand Down
2 changes: 2 additions & 0 deletions sim/druid/faerie_fire.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ func (druid *Druid) registerFaerieFireSpell() {
druid.FaerieFireAuras.Get(target).Activate(sim)
}
},

RelatedAuras: []core.AuraArray{druid.FaerieFireAuras},
})
}

Expand Down
4 changes: 4 additions & 0 deletions sim/druid/insect_swarm.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,8 @@ func (druid *Druid) registerInsectSwarmSpell() {
spell.DealOutcome(sim, result)
},
})

if !hasGlyph {
druid.InsectSwarm.RelatedAuras = append(druid.InsectSwarm.RelatedAuras, missAuras)
}
}
4 changes: 4 additions & 0 deletions sim/druid/mangle.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ func (druid *Druid) registerMangleBearSpell() {
spell.CD.Reset()
}
},

RelatedAuras: []core.AuraArray{mangleAuras},
})
}

Expand Down Expand Up @@ -110,6 +112,8 @@ func (druid *Druid) registerMangleCatSpell() {
spell.IssueRefund(sim)
}
},

RelatedAuras: []core.AuraArray{mangleAuras},
})
}

Expand Down
43 changes: 40 additions & 3 deletions sim/druid/talents.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ func (druid *Druid) ApplyTalents() {
druid.applyPredatoryInstincts()
druid.applyNaturalReaction()
druid.applyOwlkinFrenzy()
druid.applyInfectedWounds()
}

func (druid *Druid) setupNaturesGrace() {
Expand Down Expand Up @@ -216,10 +217,9 @@ func (druid *Druid) applyEarthAndMoon() {
aura.Activate(sim)
},
OnSpellHitDealt: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {
if !result.Landed() || (spell != druid.Starfire && spell != druid.Wrath) {
return
if result.Landed() && (spell == druid.Starfire || spell == druid.Wrath) {
eamAuras.Get(result.Target).Activate(sim)
}
eamAuras.Get(result.Target).Activate(sim)
},
})
}
Expand Down Expand Up @@ -650,3 +650,40 @@ func (druid *Druid) applyNaturalReaction() {
},
})
}

func (druid *Druid) applyInfectedWounds() {
if druid.Talents.InfectedWounds == 0 {
return
}

iwAuras := druid.NewEnemyAuraArray(func(target *core.Unit) *core.Aura {
return core.InfectedWoundsAura(target, druid.Talents.InfectedWounds)
})
druid.Env.RegisterPreFinalizeEffect(func() {
if druid.Shred != nil {
druid.Shred.RelatedAuras = append(druid.Shred.RelatedAuras, iwAuras)
}
if druid.MangleCat != nil {
druid.MangleCat.RelatedAuras = append(druid.MangleCat.RelatedAuras, iwAuras)
}
if druid.MangleBear != nil {
druid.MangleBear.RelatedAuras = append(druid.MangleBear.RelatedAuras, iwAuras)
}
if druid.Maul != nil {
druid.Maul.RelatedAuras = append(druid.Maul.RelatedAuras, iwAuras)
}
})

druid.RegisterAura(core.Aura{
Label: "Infected Wounds Talent",
Duration: core.NeverExpires,
OnReset: func(aura *core.Aura, sim *core.Simulation) {
aura.Activate(sim)
},
OnSpellHitDealt: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {
if result.Landed() && (spell == druid.Shred || spell == druid.Maul || spell == druid.MangleCat || spell == druid.MangleBear) {
iwAuras.Get(result.Target).Activate(sim)
}
},
})
}
9 changes: 3 additions & 6 deletions sim/hunter/pet_abilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,7 @@ func (hp *HunterPet) newAcidSpit() *core.Spell {
}

func (hp *HunterPet) newDemoralizingScreech() *core.Spell {
debuffs := make([]*core.Aura, len(hp.Env.Encounter.TargetUnits))
for i, target := range hp.Env.Encounter.TargetUnits {
debuffs[i] = core.DemoralizingScreechAura(target)
}
debuffs := hp.NewEnemyAuraArray(core.DemoralizingScreechAura)

return hp.newSpecialAbility(PetSpecialAbilityConfig{
Type: DemoralizingScreech,
Expand All @@ -268,8 +265,8 @@ func (hp *HunterPet) newDemoralizingScreech() *core.Spell {
APRatio: 0.07,
OnSpellHitDealt: func(sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {
if result.Landed() {
for _, debuff := range debuffs {
debuff.Activate(sim)
for _, aoeTarget := range sim.Encounter.TargetUnits {
debuffs.Get(aoeTarget).Activate(sim)
}
}
},
Expand Down
2 changes: 2 additions & 0 deletions sim/hunter/scorpid_sting.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,7 @@ func (hunter *Hunter) registerScorpidStingSpell() {
}
spell.DealOutcome(sim, result)
},

RelatedAuras: []core.AuraArray{hunter.ScorpidStingAuras},
})
}
4 changes: 2 additions & 2 deletions sim/paladin/protection/TestProtection.results
Original file line number Diff line number Diff line change
Expand Up @@ -1150,8 +1150,8 @@ dps_results: {
dps_results: {
key: "TestProtection-SwitchInFrontOfTarget-Default"
value: {
dps: 3796.10337
tps: 9106.41771
dps: 3796.1651
tps: 9106.57661
dtps: 4.75925
}
}
61 changes: 55 additions & 6 deletions sim/paladin/talents.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,10 @@ func (paladin *Paladin) ApplyTalents() {
paladin.applyWeaponSpecialization()
paladin.applyVengeance()
paladin.applyHeartOfTheCrusader()
paladin.applyVindication()
paladin.applyArtOfWar()
paladin.applyJudgmentsOfTheWise()
paladin.applyJudgementsOfTheJust()
paladin.applyJudgementsOfTheWise()
paladin.applyRighteousVengeance()
paladin.applyMinorGlyphOfSenseUndead()
paladin.applyGuardedByTheLight()
Expand Down Expand Up @@ -403,18 +405,43 @@ func (paladin *Paladin) applyHeartOfTheCrusader() {
return
}

hotcAuras := paladin.NewEnemyAuraArray(func(target *core.Unit) *core.Aura {
return core.HeartOfTheCrusaderDebuff(target, paladin.Talents.HeartOfTheCrusader)
})

paladin.RegisterAura(core.Aura{
Label: "Heart of the Crusader",
Duration: core.NeverExpires,
OnReset: func(aura *core.Aura, sim *core.Simulation) {
aura.Activate(sim)
},
OnSpellHitDealt: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {
if !spell.Flags.Matches(SpellFlagSecondaryJudgement) {
return
if spell.Flags.Matches(SpellFlagSecondaryJudgement) {
hotcAuras.Get(result.Target).Activate(sim)
}
},
})
}

func (paladin *Paladin) applyVindication() {
if paladin.Talents.Vindication == 0 {
return
}

vindicationAuras := paladin.NewEnemyAuraArray(func(target *core.Unit) *core.Aura {
return core.VindicationAura(target, paladin.Talents.Vindication)
})
paladin.RegisterAura(core.Aura{
Label: "Vindication Talent",
Duration: core.NeverExpires,
OnReset: func(aura *core.Aura, sim *core.Simulation) {
aura.Activate(sim)
},
OnSpellHitDealt: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {
// TODO: Replace with actual proc mask / proc chance
if result.Landed() && spell.ProcMask.Matches(core.ProcMaskMelee) {
vindicationAuras.Get(result.Target).Activate(sim)
}
debuffAura := core.HeartOfTheCrusaderDebuff(result.Target, float64(paladin.Talents.HeartOfTheCrusader))
debuffAura.Activate(sim)
},
})
}
Expand Down Expand Up @@ -462,7 +489,29 @@ func (paladin *Paladin) applyArtOfWar() {
})
}

func (paladin *Paladin) applyJudgmentsOfTheWise() {
func (paladin *Paladin) applyJudgementsOfTheJust() {
if paladin.Talents.JudgementsOfTheJust == 0 {
return
}

jojAuras := paladin.NewEnemyAuraArray(func(target *core.Unit) *core.Aura {
return core.JudgementsOfTheJustAura(target, paladin.Talents.JudgementsOfTheJust)
})
paladin.RegisterAura(core.Aura{
Label: "Judgements Of The Just Talent",
Duration: core.NeverExpires,
OnReset: func(aura *core.Aura, sim *core.Simulation) {
aura.Activate(sim)
},
OnSpellHitDealt: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {
if result.Landed() && spell.Flags.Matches(SpellFlagPrimaryJudgement|SpellFlagSecondaryJudgement) {
jojAuras.Get(result.Target).Activate(sim)
}
},
})
}

func (paladin *Paladin) applyJudgementsOfTheWise() {
if paladin.Talents.JudgementsOfTheWise == 0 {
return
}
Expand Down
1 change: 0 additions & 1 deletion sim/priest/priest.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ type Priest struct {
// cached cast stuff
// TODO: aoe multi-target situations will need multiple spells ticking for each target.
InnerFocusAura *core.Aura
MiseryAura *core.Aura
ShadowWeavingAura *core.Aura
ShadowyInsightAura *core.Aura
ImprovedSpiritTap *core.Aura
Expand Down
Loading
Loading