Skip to content

Commit f81bb0f

Browse files
authored
Merge pull request #59 from wowsims/feature/shadow
Initial implementation for the Shadow Spec
2 parents 63cd7f0 + 987b949 commit f81bb0f

46 files changed

Lines changed: 1575 additions & 867 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: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,6 @@ func (character *Character) EnableManaBar() {
3838
}
3939

4040
func (character *Character) EnableManaBarWithModifier(modifier float64) {
41-
// Assumes all units have >= 20 intellect.
42-
// See https://wowwiki-archive.fandom.com/wiki/Base_mana.
43-
// Subtract out the non-linear part of the formula separately, so that weird
44-
// mana values are not included when using the stat dependency manager.
45-
character.AddStat(stats.Mana, 20-15*20*modifier)
46-
character.AddStatDependency(stats.Intellect, stats.Mana, 15*modifier)
47-
4841
// Starting with cataclysm you get mp5 equal 5% of your base mana
4942
character.AddStat(stats.MP5, character.baseStats[stats.Mana]*0.05)
5043

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)