Skip to content

Commit

Permalink
feral: add dps glyphs support
Browse files Browse the repository at this point in the history
Signed-off-by: jarves <[email protected]>
  • Loading branch information
jarveson committed Aug 21, 2022
1 parent d99575e commit c3d4940
Show file tree
Hide file tree
Showing 8 changed files with 68 additions and 22 deletions.
5 changes: 4 additions & 1 deletion sim/druid/berserk.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"time"

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

func (druid *Druid) registerBerserkCD() {
Expand All @@ -13,10 +14,12 @@ func (druid *Druid) registerBerserkCD() {

actionId := core.ActionID{SpellID: 50334}

glyphBonus := core.TernaryDuration(druid.HasMajorGlyph(proto.DruidMajorGlyph_GlyphOfBerserk), time.Second*5.0, 0.0)

druid.BerserkAura = druid.RegisterAura(core.Aura{
Label: "Berserk",
ActionID: actionId,
Duration: time.Second * 15,
Duration: (time.Second * 15) + glyphBonus,
OnGain: func(aura *core.Aura, sim *core.Simulation) {
if druid.InForm(Cat) {
druid.PseudoStats.CostMultiplier /= 2.0
Expand Down
7 changes: 7 additions & 0 deletions sim/druid/druid.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,13 @@ func (druid *Druid) MeleeCritMultiplier() float64 {
return druid.Character.MeleeCritMultiplier(primaryModifier, 0)
}

func (druid *Druid) HasMajorGlyph(glyph proto.DruidMajorGlyph) bool {
return druid.HasGlyph(int32(glyph))
}
func (druid *Druid) HasMinorGlyph(glyph proto.DruidMinorGlyph) bool {
return druid.HasGlyph(int32(glyph))
}

func (druid *Druid) Initialize() {
if druid.Talents.PrimalPrecision > 0 {
druid.PrimalPrecisionRecoveryMetrics = druid.NewEnergyMetrics(core.ActionID{SpellID: 48410})
Expand Down
7 changes: 5 additions & 2 deletions sim/druid/mangle.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"time"

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

Expand All @@ -17,6 +18,7 @@ func (druid *Druid) registerMangleBearSpell() {
cost := 20.0 - float64(druid.Talents.Ferocity)
refundAmount := cost * 0.8
durReduction := (0.5) * float64(druid.Talents.ImprovedMangle)
glyphBonus := core.TernaryFloat64(druid.HasMajorGlyph(proto.DruidMajorGlyph_GlyphOfBerserk), 0.1, 0.0)

druid.MangleBear = druid.RegisterSpell(core.SpellConfig{
ActionID: core.ActionID{SpellID: 48564},
Expand All @@ -42,7 +44,7 @@ func (druid *Druid) registerMangleBearSpell() {
ApplyEffects: core.ApplyEffectFuncDirectDamage(core.SpellEffect{
ProcMask: core.ProcMaskMeleeMHSpecial,

DamageMultiplier: 1 + 0.1*float64(druid.Talents.SavageFury),
DamageMultiplier: 1 + 0.1*float64(druid.Talents.SavageFury) + glyphBonus,
ThreatMultiplier: (1.5 / 1.15) *
core.TernaryFloat64(druid.InForm(Bear) && druid.HasSetBonus(ItemSetThunderheartHarness, 2), 1.15, 1),

Expand Down Expand Up @@ -73,6 +75,7 @@ func (druid *Druid) registerMangleCatSpell() {

cost := 45.0 - (2.0 * float64(druid.Talents.ImprovedMangle)) - float64(druid.Talents.Ferocity) - core.TernaryFloat64(druid.HasSetBonus(ItemSetThunderheartHarness, 2), 5.0, 0)
refundAmount := cost * 0.8
glyphBonus := core.TernaryFloat64(druid.HasMajorGlyph(proto.DruidMajorGlyph_GlyphOfBerserk), 0.1, 0.0)

druid.MangleCat = druid.RegisterSpell(core.SpellConfig{
ActionID: core.ActionID{SpellID: 48566},
Expand All @@ -94,7 +97,7 @@ func (druid *Druid) registerMangleCatSpell() {
ApplyEffects: core.ApplyEffectFuncDirectDamage(core.SpellEffect{
ProcMask: core.ProcMaskMeleeMHSpecial,

DamageMultiplier: 1 + 0.1*float64(druid.Talents.SavageFury),
DamageMultiplier: 1 + 0.1*float64(druid.Talents.SavageFury) + glyphBonus,
ThreatMultiplier: 1,

BaseDamage: core.BaseDamageConfigMeleeWeapon(core.MainHand, false, 566/2.0, 1.0, 2.0, true),
Expand Down
43 changes: 27 additions & 16 deletions sim/druid/maul.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package druid
import (
"github.com/wowsims/wotlk/sim/core"
"github.com/wowsims/wotlk/sim/core/items"
"github.com/wowsims/wotlk/sim/core/proto"
"github.com/wowsims/wotlk/sim/core/stats"
)

Expand All @@ -15,6 +16,31 @@ func (druid *Druid) registerMaulSpell(rageThreshold float64) {
baseDamage += 50
}

baseEffect := core.SpellEffect{
ProcMask: core.ProcMaskMeleeMHAuto | core.ProcMaskMeleeMHSpecial,

DamageMultiplier: 1 + 0.1*float64(druid.Talents.SavageFury),
ThreatMultiplier: 1,
FlatThreatBonus: 344,

BaseDamage: core.BaseDamageConfigMeleeWeapon(core.MainHand, false, baseDamage, 1, 1, true),
OutcomeApplier: druid.OutcomeFuncMeleeSpecialHitAndCrit(druid.MeleeCritMultiplier()),

OnSpellHitDealt: func(sim *core.Simulation, spell *core.Spell, spellEffect *core.SpellEffect) {
if !spellEffect.Landed() {
druid.AddRage(sim, refundAmount, druid.RageRefundMetrics)
}
},
}

maxTargets := core.TernaryInt(druid.HasMajorGlyph(proto.DruidMajorGlyph_GlyphOfMaul), 2, 1)
numHits := core.MinInt(maxTargets, int(druid.Env.GetNumTargets()))
effects := make([]core.SpellEffect, 0, numHits)
for i := 0; i < numHits; i++ {
effects = append(effects, baseEffect)
effects[i].Target = druid.Env.GetTargetUnit(int32(i))
}

druid.Maul = druid.RegisterSpell(core.SpellConfig{
ActionID: core.ActionID{SpellID: 26996},
SpellSchool: core.SpellSchoolPhysical,
Expand All @@ -30,22 +56,7 @@ func (druid *Druid) registerMaulSpell(rageThreshold float64) {
ModifyCast: druid.ApplyClearcasting,
},

ApplyEffects: core.ApplyEffectFuncDirectDamage(core.SpellEffect{
ProcMask: core.ProcMaskMeleeMHAuto | core.ProcMaskMeleeMHSpecial,

DamageMultiplier: 1 + 0.1*float64(druid.Talents.SavageFury),
ThreatMultiplier: 1,
FlatThreatBonus: 344,

BaseDamage: core.BaseDamageConfigMeleeWeapon(core.MainHand, false, baseDamage, 1, 1, true),
OutcomeApplier: druid.OutcomeFuncMeleeSpecialHitAndCrit(druid.MeleeCritMultiplier()),

OnSpellHitDealt: func(sim *core.Simulation, spell *core.Spell, spellEffect *core.SpellEffect) {
if !spellEffect.Landed() {
druid.AddRage(sim, refundAmount, druid.RageRefundMetrics)
}
},
}),
ApplyEffects: core.ApplyEffectFuncDamageMultiple(effects),
})

druid.MaulQueueAura = druid.RegisterAura(core.Aura{
Expand Down
13 changes: 12 additions & 1 deletion sim/druid/rip.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

"github.com/wowsims/wotlk/sim/core"
"github.com/wowsims/wotlk/sim/core/items"
"github.com/wowsims/wotlk/sim/core/proto"
"github.com/wowsims/wotlk/sim/core/stats"
)

Expand All @@ -14,6 +15,8 @@ func (druid *Druid) registerRipSpell() {
baseCost := 30.0
refundAmount := baseCost * (0.4 * float64(druid.Talents.PrimalPrecision))

glyphBonus := core.TernaryInt(druid.HasMajorGlyph(proto.DruidMajorGlyph_GlyphOfRip), 2, 0)

druid.Rip = druid.RegisterSpell(core.SpellConfig{
ActionID: actionID,
SpellSchool: core.SpellSchoolPhysical,
Expand Down Expand Up @@ -54,7 +57,7 @@ func (druid *Druid) registerRipSpell() {
Label: "Rip-" + strconv.Itoa(int(druid.Index)),
ActionID: actionID,
}),
NumberOfTicks: 6,
NumberOfTicks: 6 + glyphBonus,
TickLength: time.Second * 2,
TickEffects: core.TickFuncSnapshot(target, core.SpellEffect{
ProcMask: core.ProcMaskPeriodicDamage,
Expand All @@ -76,3 +79,11 @@ func (druid *Druid) registerRipSpell() {
}),
})
}

func (druid *Druid) maxRipTicks() int {
// TODO: This should handle sets as well
base := 6
ripGlyphBonus := core.TernaryInt(druid.HasMajorGlyph(proto.DruidMajorGlyph_GlyphOfRip), 2, 0)
shredGlyphBonus := core.TernaryInt(druid.HasMajorGlyph(proto.DruidMajorGlyph_GlyphOfShred), 3, 0)
return base + ripGlyphBonus + shredGlyphBonus
}
4 changes: 3 additions & 1 deletion sim/druid/savage_roar.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ import (
"time"

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

func (druid *Druid) getSavageRoarMultiplier() float64 {
return 1.3
glyphBonus := core.TernaryFloat64(druid.HasMajorGlyph(proto.DruidMajorGlyph_GlyphOfSavageRoar), 0.03, 0)
return 1.3 + glyphBonus
}

func (druid *Druid) registerSavageRoarSpell() {
Expand Down
10 changes: 10 additions & 0 deletions sim/druid/shred.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (

"github.com/wowsims/wotlk/sim/core"
"github.com/wowsims/wotlk/sim/core/items"
"github.com/wowsims/wotlk/sim/core/proto"
"github.com/wowsims/wotlk/sim/core/stats"
)

Expand Down Expand Up @@ -59,6 +60,15 @@ func (druid *Druid) registerShredSpell() {
OnSpellHitDealt: func(sim *core.Simulation, spell *core.Spell, spellEffect *core.SpellEffect) {
if spellEffect.Landed() {
druid.AddComboPoints(sim, 1, spell.ComboPointMetrics())

if druid.HasMajorGlyph(proto.DruidMajorGlyph_GlyphOfShred) && druid.RipDot.IsActive() {
maxRipTicks := druid.maxRipTicks()
if druid.RipDot.NumberOfTicks < maxRipTicks {
druid.RipDot.NumberOfTicks += 1
druid.RipDot.RecomputeAuraDuration()
}
}

} else {
druid.AddEnergy(sim, refundAmount, druid.EnergyRefundMetrics)
}
Expand Down
1 change: 0 additions & 1 deletion ui/feral_druid/sim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export class FeralDruidSimUI extends IndividualSimUI<Spec.SpecFeralDruid> {
cssClass: 'feral-druid-sim-ui',
// List any known bugs / issues here and they'll be shown on the site.
knownIssues: [
"Glyphs not implemented",
"Most Sets / new items aren't functional",
"Rotations need updating",
"Lacerate doesn't snapshot correctly",
Expand Down

0 comments on commit c3d4940

Please sign in to comment.