Skip to content

Commit

Permalink
Merge pull request #1063 from wowsims/feature/mage-p4
Browse files Browse the repository at this point in the history
[MAGE] T13 set bonus
  • Loading branch information
1337LutZ committed Sep 30, 2024
2 parents 3784062 + aff43a7 commit 11c7fee
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 9 deletions.
8 changes: 8 additions & 0 deletions sim/mage/combustion.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ func (mage *Mage) registerCombustionSpell() {
spell.DealDamage(sim, result)
spell.RelatedDotSpell.Cast(sim, target)
}
if mage.t13ProcAura != nil {
spell.CD.Reduce(time.Second * time.Duration(5*mage.t13ProcAura.GetStacks()))
}
},
})

Expand All @@ -58,6 +61,11 @@ func (mage *Mage) registerCombustionSpell() {
Dot: core.DotConfig{
Aura: core.Aura{
Label: "Combustion Dot",
OnExpire: func(aura *core.Aura, sim *core.Simulation) {
if mage.t13ProcAura != nil {
mage.t13ProcAura.Deactivate(sim)
}
},
},
NumberOfTicks: 10,
TickLength: time.Second,
Expand Down
4 changes: 2 additions & 2 deletions sim/mage/fire/TestFire.results
Original file line number Diff line number Diff line change
Expand Up @@ -1259,8 +1259,8 @@ dps_results: {
dps_results: {
key: "TestFire-AllItems-TimeLord'sRegalia"
value: {
dps: 25696.78104
tps: 25273.4801
dps: 26698.06292
tps: 26232.03683
}
}
dps_results: {
Expand Down
41 changes: 39 additions & 2 deletions sim/mage/items.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"time"

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

// T11
Expand Down Expand Up @@ -83,11 +84,47 @@ var ItemSetTimeLordsRegalia = core.NewItemSet(core.ItemSet{
// Your Arcane Blast has a 100% chance and your Fireball, Pyroblast, Frostfire Bolt, and Frostbolt spells have a 50% chance to grant Stolen Time, increasing your haste rating by 50 for 30 sec and stacking up to 10 times.
// When Arcane Power, Combustion, or Icy Veins expires, all stacks of Stolen Time are lost.
2: func(agent core.Agent) {
// mage := agent.(MageAgent).GetMage()
character := agent.GetCharacter()
mage := agent.(MageAgent).GetMage()

// Stack reset handlers can be found in:
// combustion.go
// talents_arcane.go
// talents_frost.go
mage.t13ProcAura = core.MakeStackingAura(character, core.StackingStatAura{
Aura: core.Aura{
Label: "Stolen Time",
ActionID: core.ActionID{SpellID: 105785},
Duration: time.Second * 30,
MaxStacks: 10,
},
BonusPerStack: stats.Stats{stats.HasteRating: 50},
})

newStolenTimeTrigger := func(procChance float64, spellMask int64) {
core.MakeProcTriggerAura(&character.Unit, core.ProcTrigger{
Name: "Stolen Time Trigger",
ActionID: core.ActionID{ItemID: 105788},
Callback: core.CallbackOnSpellHitDealt,
ClassSpellMask: spellMask,
ProcChance: procChance,
Outcome: core.OutcomeLanded,
Handler: func(sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {
mage.t13ProcAura.Activate(sim)
mage.t13ProcAura.AddStack(sim)
},
})
}

newStolenTimeTrigger(1, MageSpellArcaneBlast)
newStolenTimeTrigger(0.5, MageSpellFireball|MageSpellPyroblast|MageSpellFrostfireBolt|MageSpellFrostbolt)
},
// Each stack of Stolen Time also reduces the cooldown of Arcane Power by 7 sec, Combustion by 5 sec, and Icy Veins by 15 sec.
4: func(agent core.Agent) {
// mage := agent.(MageAgent).GetMage()
// Cooldown reduction handlers can be found in:
// combustion.go
// talents_arcane.go
// talents_frost.go
},
},
})
1 change: 1 addition & 0 deletions sim/mage/mage.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ type Mage struct {
frostfireOrb *FrostfireOrb

t12MirrorImage *T12MirrorImage
t13ProcAura *core.Aura

arcaneMissilesTickSpell *core.Spell
Combustion *core.Spell
Expand Down
10 changes: 8 additions & 2 deletions sim/mage/talents_arcane.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,12 +305,15 @@ func (mage *Mage) registerArcanePowerCD() {
mage.arcanePowerCostMod.Activate()
arcanePowerDmgMod.Activate()
},
OnExpire: func(aura *core.Aura, sim *core.Simulation) {
OnExpire: func(_ *core.Aura, sim *core.Simulation) {
if mage.arcanePowerGCDmod != nil {
mage.arcanePowerGCDmod.Deactivate()
}
mage.arcanePowerCostMod.Deactivate()
arcanePowerDmgMod.Deactivate()
if mage.t13ProcAura != nil {
mage.t13ProcAura.Deactivate(sim)
}
},
})

Expand All @@ -323,8 +326,11 @@ func (mage *Mage) registerArcanePowerCD() {
Duration: time.Second * 120,
},
},
ApplyEffects: func(sim *core.Simulation, _ *core.Unit, _ *core.Spell) {
ApplyEffects: func(sim *core.Simulation, _ *core.Unit, spell *core.Spell) {
arcanePowerAura.Activate(sim)
if mage.t13ProcAura != nil {
spell.CD.Reduce(time.Second * time.Duration(7*mage.t13ProcAura.GetStacks()))
}
},
})
mage.AddMajorCooldown(core.MajorCooldown{
Expand Down
11 changes: 8 additions & 3 deletions sim/mage/talents_frost.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,11 @@ func (mage *Mage) registerIcyVeinsCD() {
OnGain: func(aura *core.Aura, sim *core.Simulation) {
icyVeinsMod.Activate()
},
OnExpire: func(aura *core.Aura, sim *core.Simulation) {
OnExpire: func(_ *core.Aura, sim *core.Simulation) {
icyVeinsMod.Deactivate()
if mage.t13ProcAura != nil {
mage.t13ProcAura.Deactivate(sim)
}
},
})

Expand All @@ -106,7 +109,6 @@ func (mage *Mage) registerIcyVeinsCD() {
},

Cast: core.CastConfig{

CD: core.Cooldown{
Timer: mage.NewTimer(),
Duration: time.Second * time.Duration(180*[]float64{1, .93, .86, .80}[mage.Talents.IceFloes]),
Expand All @@ -121,8 +123,11 @@ func (mage *Mage) registerIcyVeinsCD() {
return !icyVeinsAura.IsActive() && !mage.frostfireOrb.IsEnabled()
},

ApplyEffects: func(sim *core.Simulation, _ *core.Unit, _ *core.Spell) {
ApplyEffects: func(sim *core.Simulation, _ *core.Unit, spell *core.Spell) {
icyVeinsAura.Activate(sim)
if mage.t13ProcAura != nil {
spell.CD.Reduce(time.Second * time.Duration(15*mage.t13ProcAura.GetStacks()))
}
},
})

Expand Down

0 comments on commit 11c7fee

Please sign in to comment.