Skip to content

Commit ff66d1a

Browse files
committed
Merge branch 'feature/warlock' of https://github.com/wowsims/mop into feature/warlock
2 parents 8043506 + 9072cce commit ff66d1a

68 files changed

Lines changed: 1981 additions & 986 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

sim/core/aura_helpers.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,22 @@ func (parentAura *Aura) AttachAdditivePseudoStatBuff(fieldPointer *float64, bonu
476476
return parentAura
477477
}
478478

479+
func (parentAura *Aura) AttachMultiplyCastSpeed(multiplier float64) *Aura {
480+
parentAura.ApplyOnGain(func(_ *Aura, _ *Simulation) {
481+
parentAura.Unit.MultiplyCastSpeed(multiplier)
482+
})
483+
484+
parentAura.ApplyOnExpire(func(_ *Aura, _ *Simulation) {
485+
parentAura.Unit.MultiplyCastSpeed(1 / multiplier)
486+
})
487+
488+
if parentAura.IsActive() {
489+
parentAura.Unit.MultiplyCastSpeed(multiplier)
490+
}
491+
492+
return parentAura
493+
}
494+
479495
type ShieldStrengthCalculator func(unit *Unit) float64
480496

481497
type DamageAbsorptionAura struct {

sim/core/buffs.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ func applyBuffEffects(agent Agent, raidBuffs *proto.RaidBuffs, _ *proto.PartyBuf
203203
if raidBuffs.Heroism {
204204
registerBloodlustCD(agent, 32182)
205205
}
206+
206207
if raidBuffs.TimeWarp {
207208
registerBloodlustCD(agent, 80353)
208209
}

sim/core/dot.go

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ type Dot struct {
4747

4848
BaseTickCount int32 // base tick count without haste applied
4949
remainingTicks int32
50+
tmpExtraTicks int32 // extra ticks that are added during the runtime of the dot
5051

5152
BonusCoefficient float64 // EffectBonusCoefficient in SpellEffect client DB table, "SP mod" on Wowhead (not necessarily shown there even if > 0)
5253

@@ -97,6 +98,7 @@ func (dot *Dot) recomputeAuraDuration(sim *Simulation) {
9798
nextTick := dot.TimeUntilNextTick(sim)
9899

99100
dot.remainingTicks = dot.BaseTickCount
101+
dot.tmpExtraTicks = 0
100102
if dot.affectedByCastSpeed {
101103
// round the tickPeriod to the nearest full ms, same as ingame. This can best be seen ingame in how haste caps
102104
// work. For example shadowflame should take 1009 haste rating with the 5%/3% haste buffs without rounding, but
@@ -159,7 +161,7 @@ func (dot *Dot) RemainingTicks() int32 {
159161
}
160162

161163
func (dot *Dot) TickCount() int32 {
162-
return dot.HastedTickCount() - dot.remainingTicks
164+
return dot.HastedTickCount() + dot.tmpExtraTicks - dot.remainingTicks
163165
}
164166

165167
func (dot *Dot) OutstandingDmg() float64 {
@@ -170,6 +172,17 @@ func (dot *Dot) BaseDuration() time.Duration {
170172
return time.Duration(dot.BaseTickCount) * dot.BaseTickLength
171173
}
172174

175+
// Adds a tick to the current active dot and extends it's duration
176+
func (dot *Dot) AddTick() {
177+
if !dot.active {
178+
return
179+
}
180+
181+
dot.tmpExtraTicks++
182+
dot.remainingTicks++
183+
dot.UpdateExpires(dot.expires + dot.TickPeriod())
184+
}
185+
173186
// Copy's the original DoT's period and duration to the current DoT.
174187
// This is only currently used for Mage's Impact DoT spreading and Enhancement's ImprovedLava Lash.
175188
func (dot *Dot) CopyDotAndApply(sim *Simulation, originaldot *Dot) {
@@ -178,6 +191,7 @@ func (dot *Dot) CopyDotAndApply(sim *Simulation, originaldot *Dot) {
178191

179192
dot.tickPeriod = originaldot.tickPeriod
180193
dot.remainingTicks = originaldot.remainingTicks
194+
dot.tmpExtraTicks = 0
181195

182196
// must be set before Activate
183197
dot.Duration = originaldot.ExpiresAt() - sim.CurrentTime // originaldot.Duration

sim/core/mana.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ func (unit *Unit) ManaRegenPerSecondWhileCombat() float64 {
161161
regenRate := unit.MP5ManaRegenPerSecond()
162162

163163
if unit.manaBar.hasteEffectsRegen {
164-
regenRate *= (1 + unit.stats[stats.HasteRating]/HasteRatingPerHastePercent/100)
164+
regenRate *= unit.TotalSpellHasteMultiplier()
165165
}
166166

167167
spiritRegenRate := 0.0

sim/core/pet.go

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ type PetConfig struct {
3232
IsGuardian bool
3333
HasDynamicMeleeSpeedInheritance bool
3434
HasDynamicCastSpeedInheritance bool
35+
HasResourceRegenInheritance bool
3536
}
3637

3738
// Pet is an extension of Character, for any entity created by a player that can
@@ -62,6 +63,8 @@ type Pet struct {
6263
hasDynamicMeleeSpeedInheritance bool
6364
// If true the pet will automatically inherit the owner's cast speed
6465
hasDynamicCastSpeedInheritance bool
66+
// If true the pet will automatically inherit the owner's regen speed multiplier
67+
hasResourceRegenInheritance bool
6568

6669
isReset bool
6770

@@ -102,6 +105,7 @@ func NewPet(config PetConfig) Pet {
102105
statInheritance: config.StatInheritance,
103106
hasDynamicMeleeSpeedInheritance: config.HasDynamicMeleeSpeedInheritance,
104107
hasDynamicCastSpeedInheritance: config.HasDynamicCastSpeedInheritance,
108+
hasResourceRegenInheritance: config.HasResourceRegenInheritance,
105109
enabledOnStart: config.EnabledOnStart,
106110
isGuardian: config.IsGuardian,
107111
}
@@ -112,10 +116,15 @@ func NewPet(config PetConfig) Pet {
112116
pet.AddStats(config.BaseStats)
113117
pet.addUniversalStatDependencies()
114118
pet.PseudoStats.InFrontOfTarget = config.Owner.PseudoStats.InFrontOfTarget
115-
116119
return pet
117120
}
118121

122+
func (pet *Pet) Initialize() {
123+
if pet.hasResourceRegenInheritance {
124+
pet.enableResourceRegenInheritance()
125+
}
126+
}
127+
119128
// Updates the stats for this pet in response to a stat change on the owner.
120129
// addedStats is the amount of stats added to the owner (will be negative if the
121130
// owner lost stats).
@@ -302,6 +311,12 @@ func (pet *Pet) enableDynamicCastSpeed(inheritance PetMeleeSpeedInheritance) {
302311
pet.dynamicCastSpeedInheritance = inheritance
303312
}
304313

314+
func (pet *Pet) enableResourceRegenInheritance() {
315+
if !slices.Contains(pet.Owner.RegenInheritancePets, pet) {
316+
pet.Owner.RegenInheritancePets = append(pet.Owner.RegenInheritancePets, pet)
317+
}
318+
}
319+
305320
// Some pets, i.E. Shadowfiend only inherit their owners stat after a brief period of time
306321
// Causing initial attacks and abilities to not be scaled
307322
func (pet *Pet) DelayInitialInheritance(time time.Duration) {

sim/core/unit.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ type Unit struct {
131131
DynamicStatsPets []*Pet
132132
DynamicMeleeSpeedPets []*Pet
133133
DynamicCastSpeedPets []*Pet
134+
RegenInheritancePets []*Pet
134135

135136
// AutoAttacks is the manager for auto attack swings.
136137
// Must be enabled to use, with "EnableAutoAttacks()".
@@ -489,6 +490,10 @@ func (unit *Unit) MultiplyResourceRegenSpeed(sim *Simulation, amount float64) {
489490
} else if unit.HasEnergyBar() {
490491
unit.MultiplyEnergyRegenSpeed(sim, amount)
491492
}
493+
494+
for _, pet := range unit.RegenInheritancePets {
495+
pet.MultiplyResourceRegenSpeed(sim, amount)
496+
}
492497
}
493498

494499
func (unit *Unit) AddBonusRangedHitPercent(percentage float64) {

sim/priest/_glyphs.go

Lines changed: 0 additions & 61 deletions
This file was deleted.

sim/priest/_power_infusion.go

Lines changed: 0 additions & 61 deletions
This file was deleted.

sim/priest/_talents.go

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -619,73 +619,6 @@ func (priest *Priest) applySinAndPunishment() {
619619
})
620620
}
621621

622-
func (priest *Priest) applyShadowyApparition() {
623-
if priest.Talents.ShadowyApparition == 0 {
624-
return
625-
}
626-
627-
const spellScaling = 0.515
628-
const levelScaling = 0.514
629-
630-
spell := priest.RegisterSpell(core.SpellConfig{
631-
ActionID: core.ActionID{SpellID: 87532},
632-
MissileSpeed: 3.5,
633-
ProcMask: core.ProcMaskEmpty, // summoned guardian, should not be able to proc stuff - verify
634-
ClassSpellMask: PriestSpellShadowyApparation,
635-
Flags: core.SpellFlagPassiveSpell,
636-
DamageMultiplier: 1,
637-
DamageMultiplierAdditive: 1,
638-
CritMultiplier: priest.DefaultCritMultiplier(),
639-
SpellSchool: core.SpellSchoolShadow,
640-
641-
BonusCoefficient: spellScaling,
642-
643-
ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
644-
baseDamage := priest.ClassSpellScaling * levelScaling
645-
646-
// snapshot values on spawn
647-
dmgMulti := spell.DamageMultiplier
648-
dmgMultiAdd := spell.DamageMultiplierAdditive
649-
650-
spell.WaitTravelTime(sim, func(sim *core.Simulation) {
651-
652-
oldMulti := spell.DamageMultiplier
653-
oldAdd := spell.DamageMultiplierAdditive
654-
655-
// calculate dmg on hit, as the apparations profit from the debuffs on the target
656-
// when they reach them
657-
// spell and other modifiers are snapshotted when the apparations spawn
658-
spell.DamageMultiplier = dmgMulti
659-
spell.DamageMultiplierAdditive = dmgMultiAdd
660-
661-
result := spell.CalcDamage(sim, target, baseDamage, spell.OutcomeMagicHitAndCrit)
662-
spell.DealDamage(sim, result)
663-
664-
// restore mods
665-
spell.DamageMultiplier = oldMulti
666-
spell.DamageMultiplierAdditive = oldAdd
667-
})
668-
},
669-
})
670-
671-
core.MakeProcTriggerAura(&priest.Unit, core.ProcTrigger{
672-
Name: "Shadowy Apparition Aura",
673-
Callback: core.CallbackOnPeriodicDamageDealt,
674-
Outcome: core.OutcomeLanded,
675-
ClassSpellMask: PriestSpellShadowWordPain,
676-
Handler: func(sim *core.Simulation, _ *core.Spell, result *core.SpellResult) {
677-
procChance := 0.04 * float64(priest.Talents.ShadowyApparition)
678-
if priest.Moving {
679-
procChance *= 5
680-
}
681-
682-
if sim.Proc(procChance, "Shadowy Apparition Aura") {
683-
spell.Cast(sim, result.Target)
684-
}
685-
},
686-
})
687-
}
688-
689622
// func (priest *Priest) applyDivineAegis() {
690623
// if priest.Talents.DivineAegis == 0 {
691624
// return

sim/priest/glyphs.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package priest
2+
3+
import (
4+
"github.com/wowsims/mop/sim/core"
5+
"github.com/wowsims/mop/sim/core/proto"
6+
)
7+
8+
func (priest *Priest) ApplyGlyphs() {
9+
// Glyph of Dispersion
10+
// Glyph of Mindspike
11+
// Glyph of Shadow Word Death
12+
if priest.HasMinorGlyph(proto.PriestMinorGlyph_GlyphOfTheSha) {
13+
priest.AddStaticMod(core.SpellModConfig{
14+
Kind: core.SpellMod_GlobalCooldown_Flat,
15+
TimeValue: -core.GCDDefault,
16+
ClassMask: PriestSpellMindBender | PriestSpellShadowFiend,
17+
})
18+
}
19+
}

0 commit comments

Comments
 (0)