diff --git a/sim/mage/combustion.go b/sim/mage/combustion.go index 12fc1ec2b..bcc85d9d0 100644 --- a/sim/mage/combustion.go +++ b/sim/mage/combustion.go @@ -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())) + } }, }) @@ -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, diff --git a/sim/mage/fire/TestFire.results b/sim/mage/fire/TestFire.results index 06d19f087..3d1137835 100644 --- a/sim/mage/fire/TestFire.results +++ b/sim/mage/fire/TestFire.results @@ -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: { diff --git a/sim/mage/items.go b/sim/mage/items.go index 2c016eb41..ed37fdc9c 100644 --- a/sim/mage/items.go +++ b/sim/mage/items.go @@ -4,6 +4,7 @@ import ( "time" "github.com/wowsims/cata/sim/core" + "github.com/wowsims/cata/sim/core/stats" ) // T11 @@ -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 }, }, }) diff --git a/sim/mage/mage.go b/sim/mage/mage.go index 749ec3c82..b72a32107 100644 --- a/sim/mage/mage.go +++ b/sim/mage/mage.go @@ -24,6 +24,7 @@ type Mage struct { frostfireOrb *FrostfireOrb t12MirrorImage *T12MirrorImage + t13ProcAura *core.Aura arcaneMissilesTickSpell *core.Spell Combustion *core.Spell diff --git a/sim/mage/talents_arcane.go b/sim/mage/talents_arcane.go index 536618dba..7f5ca4f81 100644 --- a/sim/mage/talents_arcane.go +++ b/sim/mage/talents_arcane.go @@ -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) + } }, }) @@ -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{ diff --git a/sim/mage/talents_frost.go b/sim/mage/talents_frost.go index cc86acba1..78d9fc7a2 100644 --- a/sim/mage/talents_frost.go +++ b/sim/mage/talents_frost.go @@ -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) + } }, }) @@ -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]), @@ -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())) + } }, })