From 8fd68a6f6eb1e3e5670c7dd3594e77cd1e483ff7 Mon Sep 17 00:00:00 2001 From: James Tanner Date: Tue, 10 Jan 2023 23:36:54 -0500 Subject: [PATCH 01/13] Start work on cost refactoring --- sim/core/cast.go | 23 ++++++++++++-- sim/core/spell.go | 8 +++++ sim/core/spell_cost.go | 69 ++++++++++++++++++++++++++++++++++++++++++ sim/druid/moonfire.go | 23 +++++++------- sim/druid/starfire.go | 27 +++++++---------- sim/druid/wrath.go | 12 +++----- 6 files changed, 125 insertions(+), 37 deletions(-) create mode 100644 sim/core/spell_cost.go diff --git a/sim/core/cast.go b/sim/core/cast.go index 3c7b0e8238..a9463f086b 100644 --- a/sim/core/cast.go +++ b/sim/core/cast.go @@ -120,6 +120,19 @@ func (spell *Spell) wrapCastFuncResources(config CastConfig, onCastComplete Cast } } + if spell.Cost != nil { + return func(sim *Simulation, target *Unit) bool { + if !spell.Cost.MeetsRequirement(spell) { + if sim.Log != nil && !spell.Flags.Matches(SpellFlagNoLogs) { + spell.Cost.LogCostFailure(sim, spell) + } + return false + } + onCastComplete(sim, target) + return true + } + } + switch spell.ResourceType { case stats.Mana: return func(sim *Simulation, target *Unit) bool { @@ -276,8 +289,8 @@ func (spell *Spell) wrapCastFuncSharedCooldown(config CastConfig, onCastComplete func (spell *Spell) makeCastFuncWait(config CastConfig, onCastComplete CastFunc) CastFunc { if !spell.Flags.Matches(SpellFlagNoOnCastComplete) { - configOnCastComplete := config.OnCastComplete oldOnCastComplete1 := onCastComplete + configOnCastComplete := config.OnCastComplete onCastComplete = func(sim *Simulation, target *Unit) { oldOnCastComplete1(sim, target) if configOnCastComplete != nil { @@ -287,7 +300,13 @@ func (spell *Spell) makeCastFuncWait(config CastConfig, onCastComplete CastFunc) } } - if spell.ResourceType == stats.Mana && config.DefaultCast.Cost != 0 { + if spell.Cost != nil { + oldOnCastComplete2 := onCastComplete + onCastComplete = func(sim *Simulation, target *Unit) { + spell.Cost.SpendCost(sim, spell) + oldOnCastComplete2(sim, target) + } + } else if spell.ResourceType == stats.Mana && config.DefaultCast.Cost != 0 { oldOnCastComplete2 := onCastComplete onCastComplete = func(sim *Simulation, target *Unit) { if spell.CurCast.Cost > 0 { diff --git a/sim/core/spell.go b/sim/core/spell.go index 6ad1493ca0..8de4883e42 100644 --- a/sim/core/spell.go +++ b/sim/core/spell.go @@ -20,6 +20,7 @@ type SpellConfig struct { ResourceType stats.Stat BaseCost float64 + Cost SpellCost Cast CastConfig BonusHitRating float64 @@ -79,6 +80,9 @@ type Spell struct { // are calculated using the base cost. BaseCost float64 + // Cost for the spell. + Cost SpellCost + // Default cast parameters with all static effects applied. DefaultCast Cast @@ -158,6 +162,7 @@ func (unit *Unit) RegisterSpell(config SpellConfig) *Spell { MissileSpeed: config.MissileSpeed, ResourceType: config.ResourceType, BaseCost: config.BaseCost, + Cost: config.Cost, DefaultCast: config.Cast.DefaultCast, CD: config.Cast.CD, @@ -207,6 +212,9 @@ func (unit *Unit) RegisterSpell(config SpellConfig) *Spell { spell.SchoolIndex = stats.SchoolIndexShadow } + if spell.Cost != nil { + spell.Cost.Init(spell) + } switch spell.ResourceType { case stats.Mana: spell.ResourceMetrics = spell.Unit.NewManaMetrics(spell.ActionID) diff --git a/sim/core/spell_cost.go b/sim/core/spell_cost.go new file mode 100644 index 0000000000..49ecd525c0 --- /dev/null +++ b/sim/core/spell_cost.go @@ -0,0 +1,69 @@ +package core + +import ( + "time" + + "github.com/wowsims/wotlk/sim/core/stats" +) + +// Handles computing the cost of spells and checking whether the Unit +// meets them. +type SpellCost interface { + // For initialization logic that requires a reference to the spell + // to which this cost will apply. + Init(*Spell) + + // Whether the Unit associated with the spell meets the resource cost + // requirements to cast the spell. + MeetsRequirement(*Spell) bool + + // Logs a message for when the cast fails due to lack of resources. + LogCostFailure(*Simulation, *Spell) + + // Subtracts the resources used from a cast from the Unit. + SpendCost(*Simulation, *Spell) +} + +type ManaCostOptions struct { + BaseCost float64 + Multiplier float64 // It's OK to leave this at 0, will default to 1. +} +type ManaCost struct { + BaseCost float64 + Multiplier float64 + + ResourceMetrics *ResourceMetrics +} + +func NewManaCost(options ManaCostOptions) *ManaCost { + if options.Multiplier == 0 { + options.Multiplier = 1 + } + return &ManaCost{ + BaseCost: options.BaseCost, + Multiplier: options.Multiplier, + } +} + +func (mc *ManaCost) Init(spell *Spell) { + mc.BaseCost = mc.BaseCost * spell.Unit.BaseMana + spell.ResourceType = stats.Mana + spell.BaseCost = mc.BaseCost + spell.DefaultCast.Cost = mc.BaseCost * mc.Multiplier + mc.ResourceMetrics = spell.Unit.NewManaMetrics(spell.ActionID) +} +func (mc *ManaCost) MeetsRequirement(spell *Spell) bool { + spell.CurCast.Cost = spell.ApplyCostModifiers(spell.CurCast.Cost) + return spell.Unit.CurrentMana() < spell.CurCast.Cost +} +func (mc *ManaCost) LogCostFailure(sim *Simulation, spell *Spell) { + spell.Unit.Log(sim, + "Failed casting %s, not enough mana. (Current Mana = %0.03f, Mana Cost = %0.03f)", + spell.ActionID, spell.Unit.CurrentMana(), spell.CurCast.Cost) +} +func (mc *ManaCost) SpendCost(sim *Simulation, spell *Spell) { + if spell.CurCast.Cost > 0 { + spell.Unit.SpendMana(sim, spell.CurCast.Cost, mc.ResourceMetrics) + spell.Unit.PseudoStats.FiveSecondRuleRefreshTime = sim.CurrentTime + time.Second*5 + } +} diff --git a/sim/druid/moonfire.go b/sim/druid/moonfire.go index f8dc0fe020..0d19a4466e 100644 --- a/sim/druid/moonfire.go +++ b/sim/druid/moonfire.go @@ -12,22 +12,21 @@ import ( func (druid *Druid) registerMoonfireSpell() { actionID := core.ActionID{SpellID: 48463} - baseCost := 0.21 * druid.BaseMana - numTicks := druid.moonfireTicks() druid.Moonfire = druid.RegisterSpell(core.SpellConfig{ - ActionID: core.ActionID{SpellID: 48463}, - SpellSchool: core.SpellSchoolArcane, - ProcMask: core.ProcMaskSpellDamage, - Flags: SpellFlagNaturesGrace | SpellFlagOmenTrigger, - ResourceType: stats.Mana, - BaseCost: baseCost, - + ActionID: actionID, + SpellSchool: core.SpellSchoolArcane, + ProcMask: core.ProcMaskSpellDamage, + Flags: SpellFlagNaturesGrace | SpellFlagOmenTrigger, + + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.21, + Multiplier: 1 - 0.03*float64(druid.Talents.Moonglow), + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * (1 - 0.03*float64(druid.Talents.Moonglow)), - GCD: core.GCDDefault, + GCD: core.GCDDefault, }, }, @@ -72,7 +71,7 @@ func (druid *Druid) registerMoonfireSpell() { druid.MoonfireDot = core.NewDot(core.Dot{ Spell: druid.RegisterSpell(core.SpellConfig{ - ActionID: core.ActionID{SpellID: 48463}, + ActionID: actionID, SpellSchool: core.SpellSchoolArcane, ProcMask: core.ProcMaskSpellDamage, diff --git a/sim/druid/starfire.go b/sim/druid/starfire.go index 794a7c4828..ec5cc9e07d 100644 --- a/sim/druid/starfire.go +++ b/sim/druid/starfire.go @@ -5,36 +5,31 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) -// Idol IDs -const IvoryMoongoddess int32 = 27518 -const ShootingStar int32 = 40321 - func (druid *Druid) registerStarfireSpell() { - actionID := core.ActionID{SpellID: 48465} - baseCost := 0.16 * druid.BaseMana spellCoeff := 1.0 bonusCoeff := 0.04 * float64(druid.Talents.WrathOfCenarius) - idolSpellPower := core.TernaryFloat64(druid.Equip[core.ItemSlotRanged].ID == IvoryMoongoddess, 55, 0) + - core.TernaryFloat64(druid.Equip[core.ItemSlotRanged].ID == ShootingStar, 165, 0) + idolSpellPower := 0 + + core.TernaryFloat64(druid.Equip[core.ItemSlotRanged].ID == 27518, 55, 0) + // Ivory Moongoddess + core.TernaryFloat64(druid.Equip[core.ItemSlotRanged].ID == 40321, 165, 0) // Shooting Star hasGlyph := druid.HasMajorGlyph(proto.DruidMajorGlyph_GlyphOfStarfire) maxMoonfireTicks := druid.moonfireTicks() + core.TernaryInt32(hasGlyph, 3, 0) druid.Starfire = druid.RegisterSpell(core.SpellConfig{ - ActionID: actionID, - SpellSchool: core.SpellSchoolArcane, - ProcMask: core.ProcMaskSpellDamage, - Flags: SpellFlagNaturesGrace | SpellFlagOmenTrigger, - ResourceType: stats.Mana, - BaseCost: baseCost, + ActionID: core.ActionID{SpellID: 48465}, + SpellSchool: core.SpellSchoolArcane, + ProcMask: core.ProcMaskSpellDamage, + Flags: SpellFlagNaturesGrace | SpellFlagOmenTrigger, + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.16, + Multiplier: 1 - 0.03*float64(druid.Talents.Moonglow), + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * (1 - 0.03*float64(druid.Talents.Moonglow)), GCD: core.GCDDefault, CastTime: druid.starfireCastTime(), }, diff --git a/sim/druid/wrath.go b/sim/druid/wrath.go index 3178fddd7f..6f78af1275 100644 --- a/sim/druid/wrath.go +++ b/sim/druid/wrath.go @@ -4,31 +4,29 @@ import ( "time" "github.com/wowsims/wotlk/sim/core" - "github.com/wowsims/wotlk/sim/core/stats" ) const IdolAvenger int32 = 31025 const IdolSteadfastRenewal int32 = 40712 func (druid *Druid) registerWrathSpell() { - actionID := core.ActionID{SpellID: 48461} - baseCost := 0.11 * druid.BaseMana spellCoeff := 0.571 + (0.02 * float64(druid.Talents.WrathOfCenarius)) bonusFlatDamage := core.TernaryFloat64(druid.Equip[core.ItemSlotRanged].ID == IdolAvenger, 25, 0) + core.TernaryFloat64(druid.Equip[core.ItemSlotRanged].ID == IdolSteadfastRenewal, 70, 0) druid.Wrath = druid.RegisterSpell(core.SpellConfig{ - ActionID: actionID, + ActionID: core.ActionID{SpellID: 48461}, SpellSchool: core.SpellSchoolNature, ProcMask: core.ProcMaskSpellDamage, Flags: SpellFlagNaturesGrace | SpellFlagOmenTrigger, - ResourceType: stats.Mana, - BaseCost: baseCost, MissileSpeed: 20, + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.11, + Multiplier: 1 - 0.03*float64(druid.Talents.Moonglow), + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * (1 - 0.03*float64(druid.Talents.Moonglow)), GCD: core.GCDDefault, CastTime: time.Second*2 - time.Millisecond*100*time.Duration(druid.Talents.StarlightWrath), }, From 107bdf356ce9a8a9e6ad31225ee88137db9bd7b6 Mon Sep 17 00:00:00 2001 From: James Tanner Date: Tue, 10 Jan 2023 23:55:06 -0500 Subject: [PATCH 02/13] Small fixes --- sim/core/spell.go | 37 +++++++++++++++++++------------------ sim/core/spell_cost.go | 2 +- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/sim/core/spell.go b/sim/core/spell.go index 8de4883e42..d69fb10d1a 100644 --- a/sim/core/spell.go +++ b/sim/core/spell.go @@ -214,24 +214,25 @@ func (unit *Unit) RegisterSpell(config SpellConfig) *Spell { if spell.Cost != nil { spell.Cost.Init(spell) - } - switch spell.ResourceType { - case stats.Mana: - spell.ResourceMetrics = spell.Unit.NewManaMetrics(spell.ActionID) - case stats.Rage: - spell.ResourceMetrics = spell.Unit.NewRageMetrics(spell.ActionID) - case stats.Energy: - spell.ResourceMetrics = spell.Unit.NewEnergyMetrics(spell.ActionID) - case stats.RunicPower: - spell.ResourceMetrics = spell.Unit.NewRunicPowerMetrics(spell.ActionID) - case stats.BloodRune: - spell.ResourceMetrics = spell.Unit.NewBloodRuneMetrics(spell.ActionID) - case stats.FrostRune: - spell.ResourceMetrics = spell.Unit.NewFrostRuneMetrics(spell.ActionID) - case stats.UnholyRune: - spell.ResourceMetrics = spell.Unit.NewUnholyRuneMetrics(spell.ActionID) - case stats.DeathRune: - spell.ResourceMetrics = spell.Unit.NewDeathRuneMetrics(spell.ActionID) + } else { + switch spell.ResourceType { + case stats.Mana: + spell.ResourceMetrics = spell.Unit.NewManaMetrics(spell.ActionID) + case stats.Rage: + spell.ResourceMetrics = spell.Unit.NewRageMetrics(spell.ActionID) + case stats.Energy: + spell.ResourceMetrics = spell.Unit.NewEnergyMetrics(spell.ActionID) + case stats.RunicPower: + spell.ResourceMetrics = spell.Unit.NewRunicPowerMetrics(spell.ActionID) + case stats.BloodRune: + spell.ResourceMetrics = spell.Unit.NewBloodRuneMetrics(spell.ActionID) + case stats.FrostRune: + spell.ResourceMetrics = spell.Unit.NewFrostRuneMetrics(spell.ActionID) + case stats.UnholyRune: + spell.ResourceMetrics = spell.Unit.NewUnholyRuneMetrics(spell.ActionID) + case stats.DeathRune: + spell.ResourceMetrics = spell.Unit.NewDeathRuneMetrics(spell.ActionID) + } } if spell.ResourceType == 0 && spell.DefaultCast.Cost != 0 { diff --git a/sim/core/spell_cost.go b/sim/core/spell_cost.go index 49ecd525c0..f0bcd6b9ee 100644 --- a/sim/core/spell_cost.go +++ b/sim/core/spell_cost.go @@ -54,7 +54,7 @@ func (mc *ManaCost) Init(spell *Spell) { } func (mc *ManaCost) MeetsRequirement(spell *Spell) bool { spell.CurCast.Cost = spell.ApplyCostModifiers(spell.CurCast.Cost) - return spell.Unit.CurrentMana() < spell.CurCast.Cost + return spell.Unit.CurrentMana() >= spell.CurCast.Cost } func (mc *ManaCost) LogCostFailure(sim *Simulation, spell *Spell) { spell.Unit.Log(sim, From f88ffeb967c12d0866f9e496c4d0afdac1239d23 Mon Sep 17 00:00:00 2001 From: James Tanner Date: Wed, 11 Jan 2023 00:37:59 -0500 Subject: [PATCH 03/13] Update druid spells --- sim/core/cast.go | 16 ++++++++-------- sim/druid/fake_gotw.go | 16 +++++++--------- sim/druid/force_of_nature.go | 12 +++++------- sim/druid/forms.go | 22 ++++++++++------------ sim/druid/hurricane.go | 10 ++++------ sim/druid/innervate.go | 21 ++++++++++----------- sim/druid/insect_swarm.go | 22 ++++++++++------------ sim/druid/rebirth.go | 15 +++++++-------- sim/druid/starfall.go | 19 +++++++++---------- sim/druid/typhoon.go | 26 +++++++++++--------------- 10 files changed, 81 insertions(+), 98 deletions(-) diff --git a/sim/core/cast.go b/sim/core/cast.go index a9463f086b..4b8b795800 100644 --- a/sim/core/cast.go +++ b/sim/core/cast.go @@ -93,7 +93,7 @@ func (spell *Spell) ApplyCostModifiers(cost float64) float64 { } func (spell *Spell) wrapCastFuncInit(config CastConfig, onCastComplete CastSuccessFunc) CastSuccessFunc { - if config.DefaultCast == emptyCast { + if spell.DefaultCast == emptyCast { return onCastComplete } @@ -113,7 +113,7 @@ func (spell *Spell) wrapCastFuncInit(config CastConfig, onCastComplete CastSucce } func (spell *Spell) wrapCastFuncResources(config CastConfig, onCastComplete CastFunc) CastSuccessFunc { - if spell.ResourceType == 0 || config.DefaultCast.Cost == 0 { + if spell.ResourceType == 0 || spell.DefaultCast.Cost == 0 { return func(sim *Simulation, target *Unit) bool { onCastComplete(sim, target) return true @@ -198,7 +198,7 @@ func (spell *Spell) wrapCastFuncResources(config CastConfig, onCastComplete Cast } func (spell *Spell) wrapCastFuncHaste(config CastConfig, onCastComplete CastFunc) CastFunc { - if config.IgnoreHaste || (config.DefaultCast.GCD == 0 && config.DefaultCast.CastTime == 0 && config.DefaultCast.ChannelTime == 0) { + if config.IgnoreHaste || (spell.DefaultCast.GCD == 0 && spell.DefaultCast.CastTime == 0 && spell.DefaultCast.ChannelTime == 0) { return onCastComplete } @@ -212,11 +212,11 @@ func (spell *Spell) wrapCastFuncHaste(config CastConfig, onCastComplete CastFunc } func (spell *Spell) wrapCastFuncGCD(config CastConfig, onCastComplete CastFunc) CastFunc { - if config.DefaultCast == emptyCast { // spells that are not actually cast (e.g. auto attacks, procs) + if spell.DefaultCast == emptyCast { // spells that are not actually cast (e.g. auto attacks, procs) return onCastComplete } - if config.DefaultCast.GCD == 0 { // mostly cooldowns (e.g. nature's swiftness, presence of mind) + if spell.DefaultCast.GCD == 0 { // mostly cooldowns (e.g. nature's swiftness, presence of mind) return func(sim *Simulation, target *Unit) { if hc := spell.Unit.Hardcast; hc.Expires > sim.CurrentTime { panic(fmt.Sprintf("Trying to cast %s but casting/channeling %v for %s, curTime = %s", spell.ActionID, hc.ActionID, hc.Expires-sim.CurrentTime, sim.CurrentTime)) @@ -306,7 +306,7 @@ func (spell *Spell) makeCastFuncWait(config CastConfig, onCastComplete CastFunc) spell.Cost.SpendCost(sim, spell) oldOnCastComplete2(sim, target) } - } else if spell.ResourceType == stats.Mana && config.DefaultCast.Cost != 0 { + } else if spell.ResourceType == stats.Mana && spell.DefaultCast.Cost != 0 { oldOnCastComplete2 := onCastComplete onCastComplete = func(sim *Simulation, target *Unit) { if spell.CurCast.Cost > 0 { @@ -317,7 +317,7 @@ func (spell *Spell) makeCastFuncWait(config CastConfig, onCastComplete CastFunc) } } - if config.DefaultCast.ChannelTime > 0 { + if spell.DefaultCast.ChannelTime > 0 { return func(sim *Simulation, target *Unit) { spell.Unit.Hardcast = Hardcast{Expires: sim.CurrentTime + spell.CurCast.ChannelTime, ActionID: spell.ActionID} if sim.Log != nil && !spell.Flags.Matches(SpellFlagNoLogs) { @@ -329,7 +329,7 @@ func (spell *Spell) makeCastFuncWait(config CastConfig, onCastComplete CastFunc) } } - if config.DefaultCast.CastTime == 0 { + if spell.DefaultCast.CastTime == 0 { if spell.Flags.Matches(SpellFlagNoLogs) { return onCastComplete } else { diff --git a/sim/druid/fake_gotw.go b/sim/druid/fake_gotw.go index 3ac9adb04e..161a364c82 100644 --- a/sim/druid/fake_gotw.go +++ b/sim/druid/fake_gotw.go @@ -3,26 +3,24 @@ package druid import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) // This is 'fake' because it doesnt actually account for any actual buff updating // this is only used as a 'clearcast fisher' spell func (druid *Druid) registerFakeGotw() { - - baseCost := druid.BaseMana * core.TernaryFloat64(druid.HasMinorGlyph(proto.DruidMinorGlyph_GlyphOfTheWild), 0.32, 0.64) + baseCost := core.TernaryFloat64(druid.HasMinorGlyph(proto.DruidMinorGlyph_GlyphOfTheWild), 0.32, 0.64) druid.GiftOfTheWild = druid.RegisterSpell(core.SpellConfig{ ActionID: core.ActionID{SpellID: 48470}, + Flags: SpellFlagOmenTrigger | core.SpellFlagHelpful, - ResourceType: stats.Mana, - BaseCost: baseCost, - Flags: SpellFlagOmenTrigger | core.SpellFlagHelpful, - + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: baseCost, + Multiplier: 1, + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - GCD: core.GCDDefault, - Cost: baseCost, + GCD: core.GCDDefault, }, }, }) diff --git a/sim/druid/force_of_nature.go b/sim/druid/force_of_nature.go index 7ef0351103..be36d72f8e 100644 --- a/sim/druid/force_of_nature.go +++ b/sim/druid/force_of_nature.go @@ -17,17 +17,16 @@ func (druid *Druid) registerForceOfNatureCD() { ActionID: core.ActionID{SpellID: 65861}, Duration: time.Second * 30, }) - baseCost := druid.BaseMana * 0.12 druid.ForceOfNature = druid.RegisterSpell(core.SpellConfig{ ActionID: core.ActionID{SpellID: 65861}, - ResourceType: stats.Mana, - BaseCost: baseCost, - + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.12, + Multiplier: 1, + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - GCD: core.GCDDefault, - Cost: baseCost, + GCD: core.GCDDefault, }, CD: core.Cooldown{ Timer: druid.NewTimer(), @@ -36,7 +35,6 @@ func (druid *Druid) registerForceOfNatureCD() { }, ApplyEffects: func(sim *core.Simulation, _ *core.Unit, _ *core.Spell) { - druid.Treant1.EnableWithTimeout(sim, druid.Treant1, time.Second*30) druid.Treant2.EnableWithTimeout(sim, druid.Treant2, time.Second*30) druid.Treant3.EnableWithTimeout(sim, druid.Treant3, time.Second*30) diff --git a/sim/druid/forms.go b/sim/druid/forms.go index 1eb9518fc2..a03e8fd595 100644 --- a/sim/druid/forms.go +++ b/sim/druid/forms.go @@ -90,7 +90,6 @@ func (druid *Druid) GetFormShiftStats() stats.Stats { func (druid *Druid) registerCatFormSpell() { actionID := core.ActionID{SpellID: 768} - baseCost := druid.BaseMana * 0.35 srm := druid.getSavageRoarMultiplier() @@ -186,13 +185,13 @@ func (druid *Druid) registerCatFormSpell() { ActionID: actionID, Flags: core.SpellFlagNoOnCastComplete, - ResourceType: stats.Mana, - BaseCost: baseCost, - + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.35, + Multiplier: (1 - 0.2*float64(druid.Talents.KingOfTheJungle)) * (1 - 0.1*float64(druid.Talents.NaturalShapeshifter)), + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * (1 - 0.2*float64(druid.Talents.KingOfTheJungle)) * (1 - 0.1*float64(druid.Talents.NaturalShapeshifter)), - GCD: core.GCDDefault, + GCD: core.GCDDefault, }, IgnoreHaste: true, }, @@ -220,7 +219,6 @@ func (druid *Druid) calcArmorBonus() float64 { func (druid *Druid) registerBearFormSpell() { actionID := core.ActionID{SpellID: 9634} - baseCost := druid.BaseMana * 0.35 healthMetrics := druid.NewHealthMetrics(actionID) statBonus := druid.GetFormShiftStats().Add(stats.Stats{ @@ -324,13 +322,13 @@ func (druid *Druid) registerBearFormSpell() { ActionID: actionID, Flags: core.SpellFlagNoOnCastComplete, - ResourceType: stats.Mana, - BaseCost: baseCost, - + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.35, + Multiplier: (1 - 0.2*float64(druid.Talents.KingOfTheJungle)) * (1 - 0.1*float64(druid.Talents.NaturalShapeshifter)), + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * (1 - 0.2*float64(druid.Talents.KingOfTheJungle)) * (1 - 0.1*float64(druid.Talents.NaturalShapeshifter)), - GCD: core.GCDDefault, + GCD: core.GCDDefault, }, IgnoreHaste: true, }, diff --git a/sim/druid/hurricane.go b/sim/druid/hurricane.go index 6b738bdbba..784fc765a3 100644 --- a/sim/druid/hurricane.go +++ b/sim/druid/hurricane.go @@ -4,12 +4,10 @@ import ( "time" "github.com/wowsims/wotlk/sim/core" - "github.com/wowsims/wotlk/sim/core/stats" ) func (druid *Druid) registerHurricaneSpell() { actionID := core.ActionID{SpellID: 48467} - baseCost := 0.81 * druid.BaseMana hurricaneDot := core.NewDot(core.Dot{ Aura: druid.RegisterAura(core.Aura{ @@ -41,12 +39,12 @@ func (druid *Druid) registerHurricaneSpell() { ProcMask: core.ProcMaskSpellDamage, Flags: core.SpellFlagChanneled | SpellFlagOmenTrigger, - ResourceType: stats.Mana, - BaseCost: baseCost, - + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.81, + Multiplier: 1, + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost, GCD: core.GCDDefault, ChannelTime: time.Second * 10, }, diff --git a/sim/druid/innervate.go b/sim/druid/innervate.go index c9258741c9..4b4984e375 100644 --- a/sim/druid/innervate.go +++ b/sim/druid/innervate.go @@ -2,7 +2,6 @@ package druid import ( "github.com/wowsims/wotlk/sim/core" - "github.com/wowsims/wotlk/sim/core/stats" ) // Returns the time to wait before the next action, or 0 if innervate is on CD @@ -15,8 +14,8 @@ func (druid *Druid) registerInnervateCD() { innervateTarget := innervateTargetAgent.GetCharacter() actionID := core.ActionID{SpellID: 29166, Tag: druid.Index} + var innervateSpell *core.Spell - baseCost := druid.BaseMana * 0.04 innervateCD := core.InnervateCD var innervateAura *core.Aura @@ -29,7 +28,7 @@ func (druid *Druid) registerInnervateCD() { if druid.StartingForm.Matches(Cat) { // double shift + innervate cost. // Prevents not having enough mana to shift back into form if more powershift are executed - innervateManaThreshold = druid.CatForm.DefaultCast.Cost*2 + baseCost + innervateManaThreshold = druid.CatForm.DefaultCast.Cost*2 + innervateSpell.DefaultCast.Cost } else { // Threshold can be lower when casting on self because its never mid-cast. innervateManaThreshold = 500 @@ -43,17 +42,17 @@ func (druid *Druid) registerInnervateCD() { innervateTarget.ExpectedBonusMana += expectedManaPerInnervate * float64(remainingInnervateUsages) }) - innervateSpell := druid.RegisterSpell(core.SpellConfig{ + innervateSpell = druid.RegisterSpell(core.SpellConfig{ ActionID: actionID, + Flags: SpellFlagOmenTrigger, - ResourceType: stats.Mana, - BaseCost: baseCost, - Flags: SpellFlagOmenTrigger, - + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.04, + Multiplier: 1, + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost, - GCD: core.GCDDefault, + GCD: core.GCDDefault, }, CD: core.Cooldown{ Timer: druid.NewTimer(), @@ -75,7 +74,7 @@ func (druid *Druid) registerInnervateCD() { Spell: innervateSpell, Type: core.CooldownTypeMana, CanActivate: func(sim *core.Simulation, character *core.Character) bool { - if character.CurrentMana() < baseCost { + if character.CurrentMana() < innervateSpell.DefaultCast.Cost { return false } // Technically this shouldn't be allowed in bear form either, but bear diff --git a/sim/druid/insect_swarm.go b/sim/druid/insect_swarm.go index b8842e81d2..f12a63e630 100644 --- a/sim/druid/insect_swarm.go +++ b/sim/druid/insect_swarm.go @@ -4,17 +4,14 @@ import ( "strconv" "time" - "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core" - "github.com/wowsims/wotlk/sim/core/stats" + "github.com/wowsims/wotlk/sim/core/proto" ) const CryingWind int32 = 45270 func (druid *Druid) registerInsectSwarmSpell() { actionID := core.ActionID{SpellID: 48468} - baseCost := 0.08 * druid.BaseMana target := druid.CurrentTarget missAura := core.InsectSwarmAura(target) @@ -22,17 +19,18 @@ func (druid *Druid) registerInsectSwarmSpell() { idolSpellPower := core.TernaryFloat64(druid.Equip[core.ItemSlotRanged].ID == CryingWind, 396, 0) druid.InsectSwarm = druid.RegisterSpell(core.SpellConfig{ - ActionID: actionID, - SpellSchool: core.SpellSchoolNature, - ProcMask: core.ProcMaskSpellDamage, - ResourceType: stats.Mana, - Flags: SpellFlagOmenTrigger, - BaseCost: baseCost, + ActionID: actionID, + SpellSchool: core.SpellSchoolNature, + ProcMask: core.ProcMaskSpellDamage, + Flags: SpellFlagOmenTrigger, + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.08, + Multiplier: 1 - 0.03*float64(druid.Talents.Moonglow), + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost, - GCD: core.GCDDefault, + GCD: core.GCDDefault, }, }, diff --git a/sim/druid/rebirth.go b/sim/druid/rebirth.go index 27eea0cd6c..f8304d87eb 100644 --- a/sim/druid/rebirth.go +++ b/sim/druid/rebirth.go @@ -4,28 +4,27 @@ import ( "time" "github.com/wowsims/wotlk/sim/core" - "github.com/wowsims/wotlk/sim/core/stats" ) // Right now, add the additional GCD + mana cost for shifting back to Moonkin form as a hack // Consider adding moonkin shapeshift spell / form tracking to balance rotation instead // Then we can properly incur Rebirth cost through additional Moonkin form spell cast func (druid *Druid) registerRebirthSpell() { - baseCost := druid.BaseMana * 0.68 + baseCost := 0.68 if druid.InForm(Moonkin) { - baseCost += ((druid.BaseMana * 0.13) * (1 - (float64(druid.Talents.NaturalShapeshifter) * 0.1))) + baseCost += 0.13 } druid.Rebirth = druid.RegisterSpell(core.SpellConfig{ ActionID: core.ActionID{SpellID: 48477}, + Flags: SpellFlagOmenTrigger, - ResourceType: stats.Mana, - BaseCost: baseCost, - Flags: SpellFlagOmenTrigger, - + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: baseCost, + Multiplier: 1 - 0.1*float64(druid.Talents.NaturalShapeshifter), + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost, GCD: core.GCDDefault, CastTime: time.Second*3 + time.Millisecond*500, }, diff --git a/sim/druid/starfall.go b/sim/druid/starfall.go index a18d087ea6..c3f60e7ee6 100644 --- a/sim/druid/starfall.go +++ b/sim/druid/starfall.go @@ -6,7 +6,6 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) // We register two spells to apply two different dot effects and get two entries in Damage/Detailed results @@ -15,23 +14,23 @@ func (druid *Druid) registerStarfallSpell() { return } - baseCost := druid.BaseMana * 0.35 target := druid.CurrentTarget numberOfTicks := core.TernaryInt32(druid.Env.GetNumTargets() > 1, 20, 10) tickLength := core.TernaryDuration(druid.Env.GetNumTargets() > 1, time.Millisecond*500, time.Millisecond*1000) druid.Starfall = druid.RegisterSpell(core.SpellConfig{ - ActionID: core.ActionID{SpellID: 53201}, - SpellSchool: core.SpellSchoolArcane, - ProcMask: core.ProcMaskSpellDamage, - Flags: SpellFlagNaturesGrace | SpellFlagOmenTrigger, - ResourceType: stats.Mana, - BaseCost: baseCost, + ActionID: core.ActionID{SpellID: 53201}, + SpellSchool: core.SpellSchoolArcane, + ProcMask: core.ProcMaskSpellDamage, + Flags: SpellFlagNaturesGrace | SpellFlagOmenTrigger, + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.35, + Multiplier: 1 - 0.03*float64(druid.Talents.Moonglow), + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * (1 - 0.03*float64(druid.Talents.Moonglow)), - GCD: core.GCDDefault, + GCD: core.GCDDefault, }, CD: core.Cooldown{ Timer: druid.NewTimer(), diff --git a/sim/druid/typhoon.go b/sim/druid/typhoon.go index 37e2595563..d352ce6dd4 100644 --- a/sim/druid/typhoon.go +++ b/sim/druid/typhoon.go @@ -5,7 +5,6 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (druid *Druid) registerTyphoonSpell() { @@ -13,22 +12,19 @@ func (druid *Druid) registerTyphoonSpell() { return } - actionID := core.ActionID{SpellID: 61384} - baseCost := 0.25 * druid.BaseMana - spellCoeff := 0.193 - druid.Typhoon = druid.RegisterSpell(core.SpellConfig{ - ActionID: actionID, - SpellSchool: core.SpellSchoolNature, - ProcMask: core.ProcMaskSpellDamage, - ResourceType: stats.Mana, - BaseCost: baseCost, - Flags: SpellFlagOmenTrigger, - + ActionID: core.ActionID{SpellID: 61384}, + SpellSchool: core.SpellSchoolNature, + ProcMask: core.ProcMaskSpellDamage, + Flags: SpellFlagOmenTrigger, + + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.25, + Multiplier: 1, + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost, - GCD: core.GCDDefault, + GCD: core.GCDDefault, }, CD: core.Cooldown{ Timer: druid.NewTimer(), @@ -43,7 +39,7 @@ func (druid *Druid) registerTyphoonSpell() { ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) { spell.WaitTravelTime(sim, func(sim *core.Simulation) { - baseDamage := 1190 + (spellCoeff * spell.SpellPower()) + baseDamage := 1190 + 0.193*spell.SpellPower() baseDamage *= sim.Encounter.AOECapMultiplier() for _, aoeTarget := range sim.Encounter.Targets { spell.CalcAndDealDamage(sim, &aoeTarget.Unit, baseDamage, spell.OutcomeMagicHitAndCrit) From 44ecaf6ed47fc457c2262327d2aca92d2559d472 Mon Sep 17 00:00:00 2001 From: James Tanner Date: Wed, 11 Jan 2023 00:40:20 -0500 Subject: [PATCH 04/13] Fix insect swarm mistake --- sim/druid/insect_swarm.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sim/druid/insect_swarm.go b/sim/druid/insect_swarm.go index f12a63e630..5c56919ab9 100644 --- a/sim/druid/insect_swarm.go +++ b/sim/druid/insect_swarm.go @@ -26,7 +26,7 @@ func (druid *Druid) registerInsectSwarmSpell() { Cost: core.NewManaCost(core.ManaCostOptions{ BaseCost: 0.08, - Multiplier: 1 - 0.03*float64(druid.Talents.Moonglow), + Multiplier: 1, }), Cast: core.CastConfig{ DefaultCast: core.Cast{ From c22c6b6d642dc657a53e6865dc31f28ae3fad8d0 Mon Sep 17 00:00:00 2001 From: James Tanner Date: Wed, 11 Jan 2023 01:00:33 -0500 Subject: [PATCH 05/13] Update hunter spells --- sim/core/cast.go | 18 ++++++++++ sim/core/mana.go | 44 +++++++++++++++++++++++ sim/core/spell_cost.go | 69 ------------------------------------ sim/hunter/aimed_shot.go | 21 ++++++----- sim/hunter/arcane_shot.go | 22 ++++++------ sim/hunter/black_arrow.go | 18 +++++----- sim/hunter/chimera_shot.go | 21 ++++++----- sim/hunter/explosive_shot.go | 20 +++++------ sim/hunter/explosive_trap.go | 17 ++++----- sim/hunter/kill_command.go | 12 ++----- sim/hunter/kill_shot.go | 20 +++++------ sim/hunter/multi_shot.go | 19 +++++----- sim/hunter/rapid_fire.go | 11 ++---- sim/hunter/raptor_strike.go | 24 ++++++------- sim/hunter/scorpid_sting.go | 18 +++++----- sim/hunter/serpent_sting.go | 17 +++++---- sim/hunter/silencing_shot.go | 22 +++++------- sim/hunter/steady_shot.go | 22 ++++++------ sim/hunter/talents.go | 13 +++---- sim/hunter/volley.go | 17 +++++---- 20 files changed, 197 insertions(+), 248 deletions(-) delete mode 100644 sim/core/spell_cost.go diff --git a/sim/core/cast.go b/sim/core/cast.go index 4b8b795800..1470f07a8b 100644 --- a/sim/core/cast.go +++ b/sim/core/cast.go @@ -381,3 +381,21 @@ func (spell *Spell) makeCastFuncWait(config CastConfig, onCastComplete CastFunc) } } } + +// Handles computing the cost of spells and checking whether the Unit +// meets them. +type SpellCost interface { + // For initialization logic that requires a reference to the spell + // to which this cost will apply. + Init(*Spell) + + // Whether the Unit associated with the spell meets the resource cost + // requirements to cast the spell. + MeetsRequirement(*Spell) bool + + // Logs a message for when the cast fails due to lack of resources. + LogCostFailure(*Simulation, *Spell) + + // Subtracts the resources used from a cast from the Unit. + SpendCost(*Simulation, *Spell) +} diff --git a/sim/core/mana.go b/sim/core/mana.go index fe6e28b3d1..1a9ec2d8c3 100644 --- a/sim/core/mana.go +++ b/sim/core/mana.go @@ -293,3 +293,47 @@ func (mb *manaBar) reset() { mb.currentMana = mb.unit.MaxMana() } + +type ManaCostOptions struct { + BaseCost float64 + Multiplier float64 // It's OK to leave this at 0, will default to 1. +} +type ManaCost struct { + BaseCost float64 + Multiplier float64 + + ResourceMetrics *ResourceMetrics +} + +func NewManaCost(options ManaCostOptions) *ManaCost { + if options.Multiplier == 0 { + options.Multiplier = 1 + } + return &ManaCost{ + BaseCost: options.BaseCost, + Multiplier: options.Multiplier, + } +} + +func (mc *ManaCost) Init(spell *Spell) { + mc.BaseCost = mc.BaseCost * spell.Unit.BaseMana + spell.ResourceType = stats.Mana + spell.BaseCost = mc.BaseCost + spell.DefaultCast.Cost = mc.BaseCost * mc.Multiplier + mc.ResourceMetrics = spell.Unit.NewManaMetrics(spell.ActionID) +} +func (mc *ManaCost) MeetsRequirement(spell *Spell) bool { + spell.CurCast.Cost = spell.ApplyCostModifiers(spell.CurCast.Cost) + return spell.Unit.CurrentMana() >= spell.CurCast.Cost +} +func (mc *ManaCost) LogCostFailure(sim *Simulation, spell *Spell) { + spell.Unit.Log(sim, + "Failed casting %s, not enough mana. (Current Mana = %0.03f, Mana Cost = %0.03f)", + spell.ActionID, spell.Unit.CurrentMana(), spell.CurCast.Cost) +} +func (mc *ManaCost) SpendCost(sim *Simulation, spell *Spell) { + if spell.CurCast.Cost > 0 { + spell.Unit.SpendMana(sim, spell.CurCast.Cost, mc.ResourceMetrics) + spell.Unit.PseudoStats.FiveSecondRuleRefreshTime = sim.CurrentTime + time.Second*5 + } +} diff --git a/sim/core/spell_cost.go b/sim/core/spell_cost.go deleted file mode 100644 index f0bcd6b9ee..0000000000 --- a/sim/core/spell_cost.go +++ /dev/null @@ -1,69 +0,0 @@ -package core - -import ( - "time" - - "github.com/wowsims/wotlk/sim/core/stats" -) - -// Handles computing the cost of spells and checking whether the Unit -// meets them. -type SpellCost interface { - // For initialization logic that requires a reference to the spell - // to which this cost will apply. - Init(*Spell) - - // Whether the Unit associated with the spell meets the resource cost - // requirements to cast the spell. - MeetsRequirement(*Spell) bool - - // Logs a message for when the cast fails due to lack of resources. - LogCostFailure(*Simulation, *Spell) - - // Subtracts the resources used from a cast from the Unit. - SpendCost(*Simulation, *Spell) -} - -type ManaCostOptions struct { - BaseCost float64 - Multiplier float64 // It's OK to leave this at 0, will default to 1. -} -type ManaCost struct { - BaseCost float64 - Multiplier float64 - - ResourceMetrics *ResourceMetrics -} - -func NewManaCost(options ManaCostOptions) *ManaCost { - if options.Multiplier == 0 { - options.Multiplier = 1 - } - return &ManaCost{ - BaseCost: options.BaseCost, - Multiplier: options.Multiplier, - } -} - -func (mc *ManaCost) Init(spell *Spell) { - mc.BaseCost = mc.BaseCost * spell.Unit.BaseMana - spell.ResourceType = stats.Mana - spell.BaseCost = mc.BaseCost - spell.DefaultCast.Cost = mc.BaseCost * mc.Multiplier - mc.ResourceMetrics = spell.Unit.NewManaMetrics(spell.ActionID) -} -func (mc *ManaCost) MeetsRequirement(spell *Spell) bool { - spell.CurCast.Cost = spell.ApplyCostModifiers(spell.CurCast.Cost) - return spell.Unit.CurrentMana() >= spell.CurCast.Cost -} -func (mc *ManaCost) LogCostFailure(sim *Simulation, spell *Spell) { - spell.Unit.Log(sim, - "Failed casting %s, not enough mana. (Current Mana = %0.03f, Mana Cost = %0.03f)", - spell.ActionID, spell.Unit.CurrentMana(), spell.CurCast.Cost) -} -func (mc *ManaCost) SpendCost(sim *Simulation, spell *Spell) { - if spell.CurCast.Cost > 0 { - spell.Unit.SpendMana(sim, spell.CurCast.Cost, mc.ResourceMetrics) - spell.Unit.PseudoStats.FiveSecondRuleRefreshTime = sim.CurrentTime + time.Second*5 - } -} diff --git a/sim/hunter/aimed_shot.go b/sim/hunter/aimed_shot.go index ed345cd942..56e58a9f92 100644 --- a/sim/hunter/aimed_shot.go +++ b/sim/hunter/aimed_shot.go @@ -5,28 +5,27 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (hunter *Hunter) registerAimedShotSpell(timer *core.Timer) { if !hunter.Talents.AimedShot { return } - baseCost := 0.08 * hunter.BaseMana hunter.AimedShot = hunter.RegisterSpell(core.SpellConfig{ - ActionID: core.ActionID{SpellID: 49050}, - SpellSchool: core.SpellSchoolPhysical, - ProcMask: core.ProcMaskRangedSpecial, - Flags: core.SpellFlagMeleeMetrics | core.SpellFlagIncludeTargetBonusDamage, - ResourceType: stats.Mana, - BaseCost: baseCost, + ActionID: core.ActionID{SpellID: 49050}, + SpellSchool: core.SpellSchoolPhysical, + ProcMask: core.ProcMaskRangedSpecial, + Flags: core.SpellFlagMeleeMetrics | core.SpellFlagIncludeTargetBonusDamage, + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.08, + Multiplier: 1 * + (1 - 0.03*float64(hunter.Talents.Efficiency)) * + (1 - 0.05*float64(hunter.Talents.MasterMarksman)), + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * - (1 - 0.03*float64(hunter.Talents.Efficiency)) * - (1 - 0.05*float64(hunter.Talents.MasterMarksman)), GCD: core.GCDDefault, }, IgnoreHaste: true, diff --git a/sim/hunter/arcane_shot.go b/sim/hunter/arcane_shot.go index 8e07778343..0a06a35dba 100644 --- a/sim/hunter/arcane_shot.go +++ b/sim/hunter/arcane_shot.go @@ -5,12 +5,9 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (hunter *Hunter) registerArcaneShotSpell(timer *core.Timer) { - baseCost := 0.05 * hunter.BaseMana - hasGlyph := hunter.HasMajorGlyph(proto.HunterMajorGlyph_GlyphOfArcaneShot) var manaMetrics *core.ResourceMetrics if hasGlyph { @@ -18,17 +15,18 @@ func (hunter *Hunter) registerArcaneShotSpell(timer *core.Timer) { } hunter.ArcaneShot = hunter.RegisterSpell(core.SpellConfig{ - ActionID: core.ActionID{SpellID: 49045}, - SpellSchool: core.SpellSchoolArcane, - ProcMask: core.ProcMaskRangedSpecial, - Flags: core.SpellFlagMeleeMetrics, - ResourceType: stats.Mana, - BaseCost: baseCost, - + ActionID: core.ActionID{SpellID: 49045}, + SpellSchool: core.SpellSchoolArcane, + ProcMask: core.ProcMaskRangedSpecial, + Flags: core.SpellFlagMeleeMetrics, + + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.05, + Multiplier: 1 - 0.03*float64(hunter.Talents.Efficiency), + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * (1 - 0.03*float64(hunter.Talents.Efficiency)), - GCD: core.GCDDefault, + GCD: core.GCDDefault, }, IgnoreHaste: true, CD: core.Cooldown{ diff --git a/sim/hunter/black_arrow.go b/sim/hunter/black_arrow.go index 0b2f76b98c..5475686758 100644 --- a/sim/hunter/black_arrow.go +++ b/sim/hunter/black_arrow.go @@ -14,20 +14,20 @@ func (hunter *Hunter) registerBlackArrowSpell(timer *core.Timer) { } actionID := core.ActionID{SpellID: 63672} - baseCost := 0.06 * hunter.BaseMana hunter.BlackArrow = hunter.RegisterSpell(core.SpellConfig{ - ActionID: actionID, - SpellSchool: core.SpellSchoolShadow, - ProcMask: core.ProcMaskRangedSpecial, - ResourceType: stats.Mana, - BaseCost: baseCost, + ActionID: actionID, + SpellSchool: core.SpellSchoolShadow, + ProcMask: core.ProcMaskRangedSpecial, + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.06, + Multiplier: 1 * + (1 - 0.03*float64(hunter.Talents.Efficiency)) * + (1 - 0.2*float64(hunter.Talents.Resourcefulness)), + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * - (1 - 0.03*float64(hunter.Talents.Efficiency)) * - (1 - 0.2*float64(hunter.Talents.Resourcefulness)), GCD: core.GCDDefault, }, IgnoreHaste: true, // Hunter GCD is locked at 1.5s diff --git a/sim/hunter/chimera_shot.go b/sim/hunter/chimera_shot.go index 528e5ca969..e60eb0496c 100644 --- a/sim/hunter/chimera_shot.go +++ b/sim/hunter/chimera_shot.go @@ -5,30 +5,29 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (hunter *Hunter) registerChimeraShotSpell() { if !hunter.Talents.ChimeraShot { return } - baseCost := 0.12 * hunter.BaseMana ssProcSpell := hunter.chimeraShotSerpentStingSpell() hunter.ChimeraShot = hunter.RegisterSpell(core.SpellConfig{ - ActionID: core.ActionID{SpellID: 53209}, - SpellSchool: core.SpellSchoolNature, - ProcMask: core.ProcMaskRangedSpecial, - Flags: core.SpellFlagMeleeMetrics, - ResourceType: stats.Mana, - BaseCost: baseCost, + ActionID: core.ActionID{SpellID: 53209}, + SpellSchool: core.SpellSchoolNature, + ProcMask: core.ProcMaskRangedSpecial, + Flags: core.SpellFlagMeleeMetrics, + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.12, + Multiplier: 1 * + (1 - 0.03*float64(hunter.Talents.Efficiency)) * + (1 - 0.05*float64(hunter.Talents.MasterMarksman)), + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * - (1 - 0.03*float64(hunter.Talents.Efficiency)) * - (1 - 0.05*float64(hunter.Talents.MasterMarksman)), GCD: core.GCDDefault, }, IgnoreHaste: true, // Hunter GCD is locked at 1.5s diff --git a/sim/hunter/explosive_shot.go b/sim/hunter/explosive_shot.go index 9f5b6d0465..68f9bd174f 100644 --- a/sim/hunter/explosive_shot.go +++ b/sim/hunter/explosive_shot.go @@ -6,7 +6,6 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (hunter *Hunter) registerExplosiveShotSpell(timer *core.Timer) { @@ -19,8 +18,6 @@ func (hunter *Hunter) registerExplosiveShotSpell(timer *core.Timer) { } func (hunter *Hunter) makeExplosiveShotSpell(timer *core.Timer, downrank bool) (*core.Spell, *core.Dot) { - baseCost := 0.07 * hunter.BaseMana - actionID := core.ActionID{SpellID: 60053} minFlatDamage := 386.0 maxFlatDamage := 464.0 @@ -32,17 +29,18 @@ func (hunter *Hunter) makeExplosiveShotSpell(timer *core.Timer, downrank bool) ( var esDot *core.Dot esSpell := hunter.RegisterSpell(core.SpellConfig{ - ActionID: actionID, - SpellSchool: core.SpellSchoolFire, - ProcMask: core.ProcMaskRangedSpecial, - Flags: core.SpellFlagMeleeMetrics, - ResourceType: stats.Mana, - BaseCost: baseCost, + ActionID: actionID, + SpellSchool: core.SpellSchoolFire, + ProcMask: core.ProcMaskRangedSpecial, + Flags: core.SpellFlagMeleeMetrics, + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.07, + Multiplier: 1 - 0.03*float64(hunter.Talents.Efficiency), + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * (1 - 0.03*float64(hunter.Talents.Efficiency)), - GCD: core.GCDDefault, + GCD: core.GCDDefault, }, IgnoreHaste: true, CD: core.Cooldown{ diff --git a/sim/hunter/explosive_trap.go b/sim/hunter/explosive_trap.go index 1c36b27b68..c88b4c26d4 100644 --- a/sim/hunter/explosive_trap.go +++ b/sim/hunter/explosive_trap.go @@ -5,26 +5,23 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (hunter *Hunter) registerExplosiveTrapSpell(timer *core.Timer) { actionID := core.ActionID{SpellID: 49067} - baseCost := 0.19 * hunter.BaseMana hasGlyph := hunter.HasMajorGlyph(proto.HunterMajorGlyph_GlyphOfExplosiveTrap) hunter.ExplosiveTrap = hunter.RegisterSpell(core.SpellConfig{ - ActionID: actionID, - SpellSchool: core.SpellSchoolFire, - ProcMask: core.ProcMaskSpellDamage, - ResourceType: stats.Mana, - BaseCost: baseCost, + ActionID: actionID, + SpellSchool: core.SpellSchoolFire, + ProcMask: core.ProcMaskSpellDamage, + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.19, + Multiplier: 1 - 0.2*float64(hunter.Talents.Resourcefulness), + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * - (1 - 0.2*float64(hunter.Talents.Resourcefulness)), - GCD: core.GCDDefault, }, CD: core.Cooldown{ diff --git a/sim/hunter/kill_command.go b/sim/hunter/kill_command.go index 63b82ba8e8..2c5385ce8f 100644 --- a/sim/hunter/kill_command.go +++ b/sim/hunter/kill_command.go @@ -4,7 +4,6 @@ import ( "time" "github.com/wowsims/wotlk/sim/core" - "github.com/wowsims/wotlk/sim/core/stats" ) func (hunter *Hunter) registerKillCommandCD() { @@ -39,20 +38,15 @@ func (hunter *Hunter) registerKillCommandCD() { }, }) - baseCost := 0.03 * hunter.BaseMana - hunter.KillCommand = hunter.RegisterSpell(core.SpellConfig{ ActionID: actionID, SpellSchool: core.SpellSchoolPhysical, Flags: core.SpellFlagNoOnCastComplete, - ResourceType: stats.Mana, - BaseCost: baseCost, - + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.03, + }), Cast: core.CastConfig{ - DefaultCast: core.Cast{ - Cost: baseCost, - }, CD: core.Cooldown{ Timer: hunter.NewTimer(), Duration: time.Minute - time.Second*10*time.Duration(hunter.Talents.CatlikeReflexes), diff --git a/sim/hunter/kill_shot.go b/sim/hunter/kill_shot.go index 4621f136b4..1aa3bc95f8 100644 --- a/sim/hunter/kill_shot.go +++ b/sim/hunter/kill_shot.go @@ -5,24 +5,22 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (hunter *Hunter) registerKillShotSpell() { - baseCost := 0.07 * hunter.BaseMana - hunter.KillShot = hunter.RegisterSpell(core.SpellConfig{ - ActionID: core.ActionID{SpellID: 61006}, - SpellSchool: core.SpellSchoolPhysical, - ProcMask: core.ProcMaskRangedSpecial, - Flags: core.SpellFlagMeleeMetrics | core.SpellFlagIncludeTargetBonusDamage, - ResourceType: stats.Mana, - BaseCost: baseCost, + ActionID: core.ActionID{SpellID: 61006}, + SpellSchool: core.SpellSchoolPhysical, + ProcMask: core.ProcMaskRangedSpecial, + Flags: core.SpellFlagMeleeMetrics | core.SpellFlagIncludeTargetBonusDamage, + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.07, + Multiplier: 1 - 0.03*float64(hunter.Talents.Efficiency), + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * (1 - 0.03*float64(hunter.Talents.Efficiency)), - GCD: core.GCDDefault, + GCD: core.GCDDefault, }, IgnoreHaste: true, CD: core.Cooldown{ diff --git a/sim/hunter/multi_shot.go b/sim/hunter/multi_shot.go index a212b56836..86e2167cda 100644 --- a/sim/hunter/multi_shot.go +++ b/sim/hunter/multi_shot.go @@ -5,26 +5,23 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (hunter *Hunter) registerMultiShotSpell(timer *core.Timer) { - baseCost := 0.09 * hunter.BaseMana numHits := core.MinInt32(3, hunter.Env.GetNumTargets()) hunter.MultiShot = hunter.RegisterSpell(core.SpellConfig{ - ActionID: core.ActionID{SpellID: 49048}, - SpellSchool: core.SpellSchoolPhysical, - ProcMask: core.ProcMaskRangedSpecial, - Flags: core.SpellFlagMeleeMetrics | core.SpellFlagIncludeTargetBonusDamage, - ResourceType: stats.Mana, - BaseCost: baseCost, + ActionID: core.ActionID{SpellID: 49048}, + SpellSchool: core.SpellSchoolPhysical, + ProcMask: core.ProcMaskRangedSpecial, + Flags: core.SpellFlagMeleeMetrics | core.SpellFlagIncludeTargetBonusDamage, + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.09, + Multiplier: 1 - 0.03*float64(hunter.Talents.Efficiency), + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * - (1 - 0.03*float64(hunter.Talents.Efficiency)), - GCD: core.GCDDefault, CastTime: 1, // Dummy value so core doesn't optimize the cast away }, diff --git a/sim/hunter/rapid_fire.go b/sim/hunter/rapid_fire.go index e9104d0cd2..85a637b80f 100644 --- a/sim/hunter/rapid_fire.go +++ b/sim/hunter/rapid_fire.go @@ -5,7 +5,6 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (hunter *Hunter) registerRapidFireCD() { @@ -41,17 +40,13 @@ func (hunter *Hunter) registerRapidFireCD() { }, }) - baseCost := 0.03 * hunter.BaseMana hunter.RapidFire = hunter.RegisterSpell(core.SpellConfig{ ActionID: actionID, - ResourceType: stats.Mana, - BaseCost: baseCost, - + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.03, + }), Cast: core.CastConfig{ - DefaultCast: core.Cast{ - Cost: baseCost, - }, CD: core.Cooldown{ Timer: hunter.NewTimer(), Duration: time.Minute*5 - time.Minute*time.Duration(hunter.Talents.RapidKilling), diff --git a/sim/hunter/raptor_strike.go b/sim/hunter/raptor_strike.go index 682fb371b0..945f007e3b 100644 --- a/sim/hunter/raptor_strike.go +++ b/sim/hunter/raptor_strike.go @@ -4,25 +4,21 @@ import ( "time" "github.com/wowsims/wotlk/sim/core" - //"github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (hunter *Hunter) registerRaptorStrikeSpell() { - baseCost := 0.04 * hunter.BaseMana - hunter.RaptorStrike = hunter.RegisterSpell(core.SpellConfig{ - ActionID: core.ActionID{SpellID: 48996}, - SpellSchool: core.SpellSchoolPhysical, - ProcMask: core.ProcMaskMeleeMHAuto | core.ProcMaskMeleeMHSpecial, - Flags: core.SpellFlagMeleeMetrics | core.SpellFlagIncludeTargetBonusDamage, - ResourceType: stats.Mana, - BaseCost: baseCost, - + ActionID: core.ActionID{SpellID: 48996}, + SpellSchool: core.SpellSchoolPhysical, + ProcMask: core.ProcMaskMeleeMHAuto | core.ProcMaskMeleeMHSpecial, + Flags: core.SpellFlagMeleeMetrics | core.SpellFlagIncludeTargetBonusDamage, + + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.04, + Multiplier: 1 - 0.2*float64(hunter.Talents.Resourcefulness), + }), Cast: core.CastConfig{ - DefaultCast: core.Cast{ - Cost: baseCost * (1 - 0.2*float64(hunter.Talents.Resourcefulness)), - }, + DefaultCast: core.Cast{}, CD: core.Cooldown{ Timer: hunter.NewTimer(), Duration: time.Second * 6, diff --git a/sim/hunter/scorpid_sting.go b/sim/hunter/scorpid_sting.go index 1c33d2f0b0..78efa53e24 100644 --- a/sim/hunter/scorpid_sting.go +++ b/sim/hunter/scorpid_sting.go @@ -2,25 +2,23 @@ package hunter import ( "github.com/wowsims/wotlk/sim/core" - "github.com/wowsims/wotlk/sim/core/stats" ) func (hunter *Hunter) registerScorpidStingSpell() { hunter.ScorpidStingAura = core.ScorpidStingAura(hunter.CurrentTarget) - baseCost := 0.09 * hunter.BaseMana - hunter.ScorpidSting = hunter.RegisterSpell(core.SpellConfig{ - ActionID: core.ActionID{SpellID: 3043}, - SpellSchool: core.SpellSchoolNature, - ProcMask: core.ProcMaskRangedSpecial, - ResourceType: stats.Mana, - BaseCost: baseCost, + ActionID: core.ActionID{SpellID: 3043}, + SpellSchool: core.SpellSchoolNature, + ProcMask: core.ProcMaskRangedSpecial, + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.09, + Multiplier: 1 - 0.03*float64(hunter.Talents.Efficiency), + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * (1 - 0.03*float64(hunter.Talents.Efficiency)), - GCD: core.GCDDefault, + GCD: core.GCDDefault, }, IgnoreHaste: true, // Hunter GCD is locked at 1.5s }, diff --git a/sim/hunter/serpent_sting.go b/sim/hunter/serpent_sting.go index 6ddb3faa7e..23c095282e 100644 --- a/sim/hunter/serpent_sting.go +++ b/sim/hunter/serpent_sting.go @@ -6,24 +6,23 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (hunter *Hunter) registerSerpentStingSpell() { actionID := core.ActionID{SpellID: 49001} - baseCost := 0.09 * hunter.BaseMana hunter.SerpentSting = hunter.RegisterSpell(core.SpellConfig{ - ActionID: actionID, - SpellSchool: core.SpellSchoolNature, - ProcMask: core.ProcMaskEmpty, - ResourceType: stats.Mana, - BaseCost: baseCost, + ActionID: actionID, + SpellSchool: core.SpellSchoolNature, + ProcMask: core.ProcMaskEmpty, + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.09, + Multiplier: 1 - 0.03*float64(hunter.Talents.Efficiency), + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * (1 - 0.03*float64(hunter.Talents.Efficiency)), - GCD: core.GCDDefault, + GCD: core.GCDDefault, }, IgnoreHaste: true, // Hunter GCD is locked at 1.5s }, diff --git a/sim/hunter/silencing_shot.go b/sim/hunter/silencing_shot.go index cec33b6708..698d38928c 100644 --- a/sim/hunter/silencing_shot.go +++ b/sim/hunter/silencing_shot.go @@ -4,28 +4,24 @@ import ( "time" "github.com/wowsims/wotlk/sim/core" - "github.com/wowsims/wotlk/sim/core/stats" ) func (hunter *Hunter) registerSilencingShotSpell() { if !hunter.Talents.SilencingShot { return } - baseCost := 0.06 * hunter.BaseMana hunter.SilencingShot = hunter.RegisterSpell(core.SpellConfig{ - ActionID: core.ActionID{SpellID: 34490}, - SpellSchool: core.SpellSchoolPhysical, - ProcMask: core.ProcMaskRangedSpecial, - Flags: core.SpellFlagMeleeMetrics | core.SpellFlagIncludeTargetBonusDamage, - ResourceType: stats.Mana, - BaseCost: baseCost, - + ActionID: core.ActionID{SpellID: 34490}, + SpellSchool: core.SpellSchoolPhysical, + ProcMask: core.ProcMaskRangedSpecial, + Flags: core.SpellFlagMeleeMetrics | core.SpellFlagIncludeTargetBonusDamage, + + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.06, + Multiplier: 1 - 0.03*float64(hunter.Talents.Efficiency), + }), Cast: core.CastConfig{ - DefaultCast: core.Cast{ - Cost: baseCost * - (1 - 0.03*float64(hunter.Talents.Efficiency)), - }, CD: core.Cooldown{ Timer: hunter.NewTimer(), Duration: time.Second * 20, diff --git a/sim/hunter/steady_shot.go b/sim/hunter/steady_shot.go index 94232e9ddf..0859a1bc58 100644 --- a/sim/hunter/steady_shot.go +++ b/sim/hunter/steady_shot.go @@ -4,12 +4,9 @@ import ( "time" "github.com/wowsims/wotlk/sim/core" - "github.com/wowsims/wotlk/sim/core/stats" ) func (hunter *Hunter) registerSteadyShotSpell() { - baseCost := 0.05 * hunter.BaseMana - impSSProcChance := 0.05 * float64(hunter.Talents.ImprovedSteadyShot) if hunter.Talents.ImprovedSteadyShot > 0 { hunter.ImprovedSteadyShotAura = hunter.RegisterAura(core.Aura{ @@ -49,18 +46,19 @@ func (hunter *Hunter) registerSteadyShotSpell() { } hunter.SteadyShot = hunter.RegisterSpell(core.SpellConfig{ - ActionID: core.ActionID{SpellID: 49052}, - SpellSchool: core.SpellSchoolPhysical, - ProcMask: core.ProcMaskRangedSpecial, - Flags: core.SpellFlagMeleeMetrics | core.SpellFlagIncludeTargetBonusDamage, - ResourceType: stats.Mana, - BaseCost: baseCost, + ActionID: core.ActionID{SpellID: 49052}, + SpellSchool: core.SpellSchoolPhysical, + ProcMask: core.ProcMaskRangedSpecial, + Flags: core.SpellFlagMeleeMetrics | core.SpellFlagIncludeTargetBonusDamage, + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.05, + Multiplier: 1 * + (1 - 0.03*float64(hunter.Talents.Efficiency)) * + (1 - 0.05*float64(hunter.Talents.MasterMarksman)), + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * - (1 - 0.03*float64(hunter.Talents.Efficiency)) * - (1 - 0.05*float64(hunter.Talents.MasterMarksman)), GCD: core.GCDDefault, CastTime: 1, // Dummy value so core doesn't optimize the cast away }, diff --git a/sim/hunter/talents.go b/sim/hunter/talents.go index cf2c26085e..455c8bd9ef 100644 --- a/sim/hunter/talents.go +++ b/sim/hunter/talents.go @@ -443,18 +443,13 @@ func (hunter *Hunter) registerBestialWrathCD() { }, }) - manaCost := hunter.BaseMana * 0.1 - bwSpell := hunter.RegisterSpell(core.SpellConfig{ ActionID: actionID, - ResourceType: stats.Mana, - BaseCost: manaCost, - + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.1, + }), Cast: core.CastConfig{ - DefaultCast: core.Cast{ - Cost: manaCost, - }, CD: core.Cooldown{ Timer: hunter.NewTimer(), Duration: hunter.applyLongevity(time.Minute*2 - core.TernaryDuration(hunter.HasMajorGlyph(proto.HunterMajorGlyph_GlyphOfBestialWrath), time.Second*20, 0)), @@ -474,7 +469,7 @@ func (hunter *Hunter) registerBestialWrathCD() { Spell: bwSpell, Type: core.CooldownTypeDPS, CanActivate: func(sim *core.Simulation, character *core.Character) bool { - return hunter.CurrentMana() >= manaCost + return hunter.CurrentMana() >= bwSpell.DefaultCast.Cost }, }) } diff --git a/sim/hunter/volley.go b/sim/hunter/volley.go index 1ff59b0022..6c0b354451 100644 --- a/sim/hunter/volley.go +++ b/sim/hunter/volley.go @@ -5,12 +5,10 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (hunter *Hunter) registerVolleySpell() { actionID := core.ActionID{SpellID: 58434} - baseCost := 0.17 * hunter.BaseMana volleyDot := core.NewDot(core.Dot{ Aura: hunter.RegisterAura(core.Aura{ @@ -38,16 +36,17 @@ func (hunter *Hunter) registerVolleySpell() { }) hunter.Volley = hunter.RegisterSpell(core.SpellConfig{ - ActionID: actionID, - SpellSchool: core.SpellSchoolArcane, - ProcMask: core.ProcMaskRangedSpecial, - Flags: core.SpellFlagChanneled, - ResourceType: stats.Mana, - BaseCost: baseCost, + ActionID: actionID, + SpellSchool: core.SpellSchoolArcane, + ProcMask: core.ProcMaskRangedSpecial, + Flags: core.SpellFlagChanneled, + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.17, + Multiplier: core.TernaryFloat64(hunter.HasMajorGlyph(proto.HunterMajorGlyph_GlyphOfVolley), 0.8, 1), + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * core.TernaryFloat64(hunter.HasMajorGlyph(proto.HunterMajorGlyph_GlyphOfVolley), 0.8, 1), GCD: core.GCDDefault, ChannelTime: time.Second * 6, }, From 14b2fe7edbcd1d6ceb23c7e5c6db23b029fe0945 Mon Sep 17 00:00:00 2001 From: James Tanner Date: Wed, 11 Jan 2023 10:33:33 -0500 Subject: [PATCH 06/13] Update mage spells --- sim/mage/TestFire.results | 20 ++++++++++---------- sim/mage/arcane_barrage.go | 14 ++++++-------- sim/mage/arcane_blast.go | 17 ++++++++--------- sim/mage/arcane_explosion.go | 19 ++++++++----------- sim/mage/arcane_missiles.go | 10 ++++------ sim/mage/blizzard.go | 17 +++++++---------- sim/mage/deep_freeze.go | 21 +++++++++------------ sim/mage/fire_blast.go | 19 ++++++++----------- sim/mage/fireball.go | 10 ++++------ sim/mage/flamestrike.go | 18 +++++++----------- sim/mage/frostbolt.go | 9 +++------ sim/mage/frostfire_bolt.go | 8 +++----- sim/mage/ice_lance.go | 11 ++++------- sim/mage/living_bomb.go | 19 ++++++++----------- sim/mage/mirror_image.go | 33 +++++++++++++++------------------ sim/mage/pyroblast.go | 9 +++------ sim/mage/scorch.go | 19 ++++++++----------- sim/mage/talents.go | 19 +++++-------------- sim/mage/water_elemental.go | 24 ++++++++++-------------- 19 files changed, 130 insertions(+), 186 deletions(-) diff --git a/sim/mage/TestFire.results b/sim/mage/TestFire.results index 92daff9025..95fff70a15 100644 --- a/sim/mage/TestFire.results +++ b/sim/mage/TestFire.results @@ -748,42 +748,42 @@ dps_results: { key: "TestFire-Settings-Troll-P1Fire-AOE-FullBuffs-LongMultiTarget" value: { dps: 16406.86037 - tps: 16251.25769 + tps: 16301.13589 } } dps_results: { key: "TestFire-Settings-Troll-P1Fire-AOE-FullBuffs-LongSingleTarget" value: { - dps: 1907.49242 - tps: 1683.61172 + dps: 1846.98472 + tps: 1629.25784 } } dps_results: { key: "TestFire-Settings-Troll-P1Fire-AOE-FullBuffs-ShortSingleTarget" value: { - dps: 2530.40926 - tps: 2140.47538 + dps: 2530.77637 + tps: 2140.72982 } } dps_results: { key: "TestFire-Settings-Troll-P1Fire-AOE-NoBuffs-LongMultiTarget" value: { dps: 13092.77802 - tps: 12967.15457 + tps: 13006.80055 } } dps_results: { key: "TestFire-Settings-Troll-P1Fire-AOE-NoBuffs-LongSingleTarget" value: { - dps: 890.50483 - tps: 777.75897 + dps: 876.06802 + tps: 764.89906 } } dps_results: { key: "TestFire-Settings-Troll-P1Fire-AOE-NoBuffs-ShortSingleTarget" value: { - dps: 1439.37405 - tps: 1163.97443 + dps: 1439.01784 + tps: 1163.70814 } } dps_results: { diff --git a/sim/mage/arcane_barrage.go b/sim/mage/arcane_barrage.go index 7d4f82afc0..04b1d1f037 100644 --- a/sim/mage/arcane_barrage.go +++ b/sim/mage/arcane_barrage.go @@ -5,7 +5,6 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (mage *Mage) registerArcaneBarrageSpell() { @@ -13,22 +12,21 @@ func (mage *Mage) registerArcaneBarrageSpell() { return } - baseCost := .18 * mage.BaseMana - mage.ArcaneBarrage = mage.RegisterSpell(core.SpellConfig{ ActionID: core.ActionID{SpellID: 44781}, SpellSchool: core.SpellSchoolFrost, ProcMask: core.ProcMaskSpellDamage, Flags: SpellFlagMage | BarrageSpells, MissileSpeed: 24, - ResourceType: stats.Mana, - BaseCost: baseCost, + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.18, + Multiplier: 1 * + (1 - .01*float64(mage.Talents.ArcaneFocus)) * + core.TernaryFloat64(mage.HasMajorGlyph(proto.MageMajorGlyph_GlyphOfArcaneBarrage), .8, 1), + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * - (1 - .01*float64(mage.Talents.ArcaneFocus)) * - core.TernaryFloat64(mage.HasMajorGlyph(proto.MageMajorGlyph_GlyphOfArcaneBarrage), .8, 1), GCD: core.GCDDefault, }, CD: core.Cooldown{ diff --git a/sim/mage/arcane_blast.go b/sim/mage/arcane_blast.go index b8bdd702ba..5130dea77c 100644 --- a/sim/mage/arcane_blast.go +++ b/sim/mage/arcane_blast.go @@ -11,8 +11,6 @@ import ( const ArcaneBlastBaseCastTime = time.Millisecond * 2500 func (mage *Mage) registerArcaneBlastSpell() { - ArcaneBlastBaseManaCost := .07 * mage.BaseMana - abAuraMultiplierPerStack := core.TernaryFloat64(mage.HasMajorGlyph(proto.MageMajorGlyph_GlyphOfArcaneBlast), .18, .15) mage.ArcaneBlastAura = mage.GetOrRegisterAura(core.Aura{ Label: "Arcane Blast", @@ -34,16 +32,17 @@ func (mage *Mage) registerArcaneBlastSpell() { spellCoeff := 2.5/3.5 + .03*float64(mage.Talents.ArcaneEmpowerment) mage.ArcaneBlast = mage.RegisterSpell(core.SpellConfig{ - ActionID: actionID, - SpellSchool: core.SpellSchoolArcane, - ProcMask: core.ProcMaskSpellDamage, - Flags: SpellFlagMage | BarrageSpells, - ResourceType: stats.Mana, - BaseCost: ArcaneBlastBaseManaCost, + ActionID: actionID, + SpellSchool: core.SpellSchoolArcane, + ProcMask: core.ProcMaskSpellDamage, + Flags: SpellFlagMage | BarrageSpells, + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.07, + Multiplier: 1 - .01*float64(mage.Talents.ArcaneFocus), + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: ArcaneBlastBaseManaCost * (1 - .01*float64(mage.Talents.ArcaneFocus)), GCD: core.GCDDefault, CastTime: ArcaneBlastBaseCastTime, }, diff --git a/sim/mage/arcane_explosion.go b/sim/mage/arcane_explosion.go index 603d388dbd..73b8bf5cde 100644 --- a/sim/mage/arcane_explosion.go +++ b/sim/mage/arcane_explosion.go @@ -3,24 +3,21 @@ package mage import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (mage *Mage) registerArcaneExplosionSpell() { - baseCost := .22 * mage.BaseMana - mage.ArcaneExplosion = mage.RegisterSpell(core.SpellConfig{ - ActionID: core.ActionID{SpellID: 42921}, - SpellSchool: core.SpellSchoolArcane, - ProcMask: core.ProcMaskSpellDamage, - Flags: SpellFlagMage, - ResourceType: stats.Mana, - BaseCost: baseCost, + ActionID: core.ActionID{SpellID: 42921}, + SpellSchool: core.SpellSchoolArcane, + ProcMask: core.ProcMaskSpellDamage, + Flags: SpellFlagMage, + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.22, + Multiplier: core.TernaryFloat64(mage.HasMajorGlyph(proto.MageMajorGlyph_GlyphOfArcaneExplosion), .9, 1), + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * - core.TernaryFloat64(mage.HasMajorGlyph(proto.MageMajorGlyph_GlyphOfArcaneExplosion), .9, 1), GCD: core.GCDDefault, }, }, diff --git a/sim/mage/arcane_missiles.go b/sim/mage/arcane_missiles.go index b0cd5a67a6..4d61008b4c 100644 --- a/sim/mage/arcane_missiles.go +++ b/sim/mage/arcane_missiles.go @@ -6,12 +6,10 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (mage *Mage) registerArcaneMissilesSpell() { actionID := core.ActionID{SpellID: 42846} - baseCost := .31 * mage.BaseMana spellCoeff := 1/3.5 + 0.03*float64(mage.Talents.ArcaneEmpowerment) t10ProcAura := mage.BloodmagesRegalia2pcAura() @@ -22,13 +20,13 @@ func (mage *Mage) registerArcaneMissilesSpell() { ProcMask: core.ProcMaskSpellDamage, Flags: SpellFlagMage | core.SpellFlagChanneled, MissileSpeed: 20, - ResourceType: stats.Mana, - BaseCost: baseCost, + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.31, + Multiplier: 1 - .01*float64(mage.Talents.ArcaneFocus), + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * (1 - .01*float64(mage.Talents.ArcaneFocus)), - GCD: core.GCDDefault, ChannelTime: time.Second * 5, }, diff --git a/sim/mage/blizzard.go b/sim/mage/blizzard.go index c2b8e32ae2..a661dd3300 100644 --- a/sim/mage/blizzard.go +++ b/sim/mage/blizzard.go @@ -4,12 +4,10 @@ import ( "time" "github.com/wowsims/wotlk/sim/core" - "github.com/wowsims/wotlk/sim/core/stats" ) func (mage *Mage) registerBlizzardSpell() { actionID := core.ActionID{SpellID: 42939} - baseCost := .74 * mage.BaseMana results := make([]*core.SpellResult, len(mage.Env.Encounter.Targets)) blizzardDot := core.NewDot(core.Dot{ @@ -37,17 +35,16 @@ func (mage *Mage) registerBlizzardSpell() { }) mage.Blizzard = mage.RegisterSpell(core.SpellConfig{ - ActionID: actionID, - SpellSchool: core.SpellSchoolFrost, - ProcMask: core.ProcMaskSpellDamage, - Flags: SpellFlagMage | core.SpellFlagChanneled, - ResourceType: stats.Mana, - BaseCost: baseCost, + ActionID: actionID, + SpellSchool: core.SpellSchoolFrost, + ProcMask: core.ProcMaskSpellDamage, + Flags: SpellFlagMage | core.SpellFlagChanneled, + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.74, + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost, - GCD: core.GCDDefault, ChannelTime: time.Second * 8, }, diff --git a/sim/mage/deep_freeze.go b/sim/mage/deep_freeze.go index 9722d0534e..6c3a51be4a 100644 --- a/sim/mage/deep_freeze.go +++ b/sim/mage/deep_freeze.go @@ -4,7 +4,6 @@ import ( "time" "github.com/wowsims/wotlk/sim/core" - "github.com/wowsims/wotlk/sim/core/stats" ) func (mage *Mage) registerDeepFreezeSpell() { @@ -12,20 +11,18 @@ func (mage *Mage) registerDeepFreezeSpell() { return } - baseCost := .09 * mage.BaseMana - mage.DeepFreeze = mage.RegisterSpell(core.SpellConfig{ - ActionID: core.ActionID{SpellID: 44572}, - SpellSchool: core.SpellSchoolFrost, - ProcMask: core.ProcMaskSpellDamage, - Flags: SpellFlagMage, - ResourceType: stats.Mana, - BaseCost: baseCost, - + ActionID: core.ActionID{SpellID: 44572}, + SpellSchool: core.SpellSchoolFrost, + ProcMask: core.ProcMaskSpellDamage, + Flags: SpellFlagMage, + + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.09, + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost, - GCD: core.GCDDefault, + GCD: core.GCDDefault, }, CD: core.Cooldown{ Timer: mage.NewTimer(), diff --git a/sim/mage/fire_blast.go b/sim/mage/fire_blast.go index 7f8bcaf36e..939b9283f5 100644 --- a/sim/mage/fire_blast.go +++ b/sim/mage/fire_blast.go @@ -4,24 +4,21 @@ import ( "time" "github.com/wowsims/wotlk/sim/core" - "github.com/wowsims/wotlk/sim/core/stats" ) func (mage *Mage) registerFireBlastSpell() { - baseCost := 0.21 * mage.BaseMana - mage.FireBlast = mage.RegisterSpell(core.SpellConfig{ - ActionID: core.ActionID{SpellID: 42873}, - SpellSchool: core.SpellSchoolFire, - ProcMask: core.ProcMaskSpellDamage, - Flags: SpellFlagMage | HotStreakSpells, - ResourceType: stats.Mana, - BaseCost: baseCost, + ActionID: core.ActionID{SpellID: 42873}, + SpellSchool: core.SpellSchoolFire, + ProcMask: core.ProcMaskSpellDamage, + Flags: SpellFlagMage | HotStreakSpells, + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.21, + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost, - GCD: core.GCDDefault, + GCD: core.GCDDefault, }, CD: core.Cooldown{ Timer: mage.NewTimer(), diff --git a/sim/mage/fireball.go b/sim/mage/fireball.go index f02b72e5a1..55e07c80b3 100644 --- a/sim/mage/fireball.go +++ b/sim/mage/fireball.go @@ -6,12 +6,10 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (mage *Mage) registerFireballSpell() { actionID := core.ActionID{SpellID: 42833} - baseCost := .19 * mage.BaseMana spellCoeff := 1 + 0.05*float64(mage.Talents.EmpoweredFire) hasGlyph := mage.HasMajorGlyph(proto.MageMajorGlyph_GlyphOfFireball) @@ -22,13 +20,13 @@ func (mage *Mage) registerFireballSpell() { ProcMask: core.ProcMaskSpellDamage, Flags: SpellFlagMage | BarrageSpells | HotStreakSpells, MissileSpeed: 24, - ResourceType: stats.Mana, - BaseCost: baseCost, + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.19, + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost, - GCD: core.GCDDefault, + GCD: core.GCDDefault, CastTime: time.Millisecond*3500 - time.Millisecond*100*time.Duration(mage.Talents.ImprovedFireball) - core.TernaryDuration(hasGlyph, time.Millisecond*150, 0), diff --git a/sim/mage/flamestrike.go b/sim/mage/flamestrike.go index d0446a3adf..1482759c65 100644 --- a/sim/mage/flamestrike.go +++ b/sim/mage/flamestrike.go @@ -4,26 +4,22 @@ import ( "time" "github.com/wowsims/wotlk/sim/core" - "github.com/wowsims/wotlk/sim/core/stats" ) func (mage *Mage) registerFlamestrikeSpell() { actionID := core.ActionID{SpellID: 42926} - baseCost := .30 * mage.BaseMana mage.Flamestrike = mage.RegisterSpell(core.SpellConfig{ - ActionID: actionID, - SpellSchool: core.SpellSchoolFire, - ProcMask: core.ProcMaskSpellDamage, - Flags: SpellFlagMage, - ResourceType: stats.Mana, - BaseCost: baseCost, + ActionID: actionID, + SpellSchool: core.SpellSchoolFire, + ProcMask: core.ProcMaskSpellDamage, + Flags: SpellFlagMage, + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.30, + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * - (1 - 0.01*float64(mage.Talents.Pyromaniac)), - GCD: core.GCDDefault, CastTime: time.Second * 3, }, diff --git a/sim/mage/frostbolt.go b/sim/mage/frostbolt.go index 54f71e2c76..2bc1c93ca3 100644 --- a/sim/mage/frostbolt.go +++ b/sim/mage/frostbolt.go @@ -5,11 +5,9 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (mage *Mage) registerFrostboltSpell() { - baseCost := .11 * mage.BaseMana spellCoeff := (3.0 / 3.5) + 0.05*float64(mage.Talents.EmpoweredFrostbolt) replProcChance := float64(mage.Talents.EnduringWinter) / 3 @@ -24,13 +22,12 @@ func (mage *Mage) registerFrostboltSpell() { ProcMask: core.ProcMaskSpellDamage, Flags: SpellFlagMage | BarrageSpells, MissileSpeed: 28, - ResourceType: stats.Mana, - BaseCost: baseCost, + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.11, + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost, - GCD: core.GCDDefault, CastTime: time.Second*3 - time.Millisecond*100*time.Duration(mage.Talents.ImprovedFrostbolt+mage.Talents.EmpoweredFrostbolt), }, diff --git a/sim/mage/frostfire_bolt.go b/sim/mage/frostfire_bolt.go index 9cc37d5822..f4e1fbc455 100644 --- a/sim/mage/frostfire_bolt.go +++ b/sim/mage/frostfire_bolt.go @@ -6,12 +6,10 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (mage *Mage) registerFrostfireBoltSpell() { actionID := core.ActionID{SpellID: 47610} - baseCost := .14 * mage.BaseMana spellCoeff := 3.0/3.5 + .05*float64(mage.Talents.EmpoweredFire) mage.FrostfireBolt = mage.RegisterSpell(core.SpellConfig{ @@ -20,12 +18,12 @@ func (mage *Mage) registerFrostfireBoltSpell() { ProcMask: core.ProcMaskSpellDamage, Flags: SpellFlagMage | BarrageSpells | HotStreakSpells, MissileSpeed: 28, - ResourceType: stats.Mana, - BaseCost: baseCost, + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.14, + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost, GCD: core.GCDDefault, CastTime: time.Second * 3, }, diff --git a/sim/mage/ice_lance.go b/sim/mage/ice_lance.go index 7b8e1aebec..f7bd649689 100644 --- a/sim/mage/ice_lance.go +++ b/sim/mage/ice_lance.go @@ -2,25 +2,22 @@ package mage import ( "github.com/wowsims/wotlk/sim/core" - "github.com/wowsims/wotlk/sim/core/stats" ) func (mage *Mage) registerIceLanceSpell() { - baseCost := .06 * mage.BaseMana - mage.IceLance = mage.RegisterSpell(core.SpellConfig{ ActionID: core.ActionID{SpellID: 42914}, SpellSchool: core.SpellSchoolFrost, ProcMask: core.ProcMaskSpellDamage, Flags: SpellFlagMage, MissileSpeed: 38, - ResourceType: stats.Mana, - BaseCost: baseCost, + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.06, + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost, - GCD: core.GCDDefault, + GCD: core.GCDDefault, }, }, diff --git a/sim/mage/living_bomb.go b/sim/mage/living_bomb.go index af2b8f38d9..1eeb667820 100644 --- a/sim/mage/living_bomb.go +++ b/sim/mage/living_bomb.go @@ -6,7 +6,6 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (mage *Mage) registerLivingBombSpell() { @@ -14,8 +13,6 @@ func (mage *Mage) registerLivingBombSpell() { return } - baseCost := .22 * mage.BaseMana - livingBombExplosionSpell := mage.RegisterSpell(core.SpellConfig{ ActionID: core.ActionID{SpellID: 55362}, SpellSchool: core.SpellSchoolFire, @@ -40,17 +37,17 @@ func (mage *Mage) registerLivingBombSpell() { }) mage.LivingBomb = mage.RegisterSpell(core.SpellConfig{ - ActionID: core.ActionID{SpellID: 55360}, - SpellSchool: core.SpellSchoolFire, - ProcMask: core.ProcMaskSpellDamage, - Flags: SpellFlagMage, - ResourceType: stats.Mana, - BaseCost: baseCost, + ActionID: core.ActionID{SpellID: 55360}, + SpellSchool: core.SpellSchoolFire, + ProcMask: core.ProcMaskSpellDamage, + Flags: SpellFlagMage, + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.22, + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost, - GCD: core.GCDDefault, + GCD: core.GCDDefault, }, }, diff --git a/sim/mage/mirror_image.go b/sim/mage/mirror_image.go index 5624d89789..43673ff167 100644 --- a/sim/mage/mirror_image.go +++ b/sim/mage/mirror_image.go @@ -11,7 +11,6 @@ import ( // The numbers in this file are VERY rough approximations based on logs. func (mage *Mage) registerMirrorImageCD() { - baseCost := mage.BaseMana * 0.1 summonDuration := time.Second * 30 var t10Aura *core.Aura @@ -30,14 +29,14 @@ func (mage *Mage) registerMirrorImageCD() { } mage.MirrorImage = mage.RegisterSpell(core.SpellConfig{ - ActionID: core.ActionID{SpellID: 55342}, - ResourceType: stats.Mana, - BaseCost: baseCost, + ActionID: core.ActionID{SpellID: 55342}, + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.1, + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost, - GCD: core.GCDDefault, + GCD: core.GCDDefault, }, CD: core.Cooldown{ Timer: mage.NewTimer(), @@ -135,7 +134,6 @@ var mirrorImageInheritance = func(ownerStats stats.Stats) stats.Stats { } func (mi *MirrorImage) registerFrostboltSpell() { - baseCost := 90.0 numImages := core.TernaryFloat64(mi.mageOwner.HasMajorGlyph(proto.MageMajorGlyph_GlyphOfMirrorImage), 4, 3) mi.Frostbolt = mi.RegisterSpell(core.SpellConfig{ @@ -143,12 +141,12 @@ func (mi *MirrorImage) registerFrostboltSpell() { SpellSchool: core.SpellSchoolFrost, ProcMask: core.ProcMaskSpellDamage, MissileSpeed: 24, - ResourceType: stats.Mana, - BaseCost: baseCost, + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.01, + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost, GCD: core.GCDDefault, CastTime: time.Second * 3, }, @@ -170,20 +168,19 @@ func (mi *MirrorImage) registerFrostboltSpell() { } func (mi *MirrorImage) registerFireblastSpell() { - baseCost := 120.0 numImages := core.TernaryFloat64(mi.mageOwner.HasMajorGlyph(proto.MageMajorGlyph_GlyphOfMirrorImage), 4, 3) mi.Fireblast = mi.RegisterSpell(core.SpellConfig{ - ActionID: core.ActionID{SpellID: 59637}, - SpellSchool: core.SpellSchoolFrost, - ProcMask: core.ProcMaskSpellDamage, - ResourceType: stats.Mana, - BaseCost: baseCost, + ActionID: core.ActionID{SpellID: 59637}, + SpellSchool: core.SpellSchoolFrost, + ProcMask: core.ProcMaskSpellDamage, + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.01, + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost, - GCD: core.GCDMin, + GCD: core.GCDMin, }, CD: core.Cooldown{ Timer: mi.NewTimer(), diff --git a/sim/mage/pyroblast.go b/sim/mage/pyroblast.go index 839ceac8a3..c6fe8a952f 100644 --- a/sim/mage/pyroblast.go +++ b/sim/mage/pyroblast.go @@ -5,7 +5,6 @@ import ( "time" "github.com/wowsims/wotlk/sim/core" - "github.com/wowsims/wotlk/sim/core/stats" ) func (mage *Mage) registerPyroblastSpell() { @@ -14,7 +13,6 @@ func (mage *Mage) registerPyroblastSpell() { } actionID := core.ActionID{SpellID: 42891} - baseCost := .22 * mage.BaseMana spellCoeff := 1.15 + 0.05*float64(mage.Talents.EmpoweredFire) tickCoeff := 0.05 + 0.05*float64(mage.Talents.EmpoweredFire) @@ -27,13 +25,12 @@ func (mage *Mage) registerPyroblastSpell() { ProcMask: core.ProcMaskSpellDamage, Flags: SpellFlagMage, MissileSpeed: 24, - ResourceType: stats.Mana, - BaseCost: baseCost, + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.22, + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost, - GCD: core.GCDDefault, CastTime: time.Second * 5, }, diff --git a/sim/mage/scorch.go b/sim/mage/scorch.go index f0d6ba430f..b44d06be7f 100644 --- a/sim/mage/scorch.go +++ b/sim/mage/scorch.go @@ -5,12 +5,9 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (mage *Mage) registerScorchSpell() { - baseCost := .08 * mage.BaseMana - hasImpScorch := mage.Talents.ImprovedScorch > 0 procChance := float64(mage.Talents.ImprovedScorch) / 3.0 if hasImpScorch { @@ -18,16 +15,16 @@ func (mage *Mage) registerScorchSpell() { } mage.Scorch = mage.RegisterSpell(core.SpellConfig{ - ActionID: core.ActionID{SpellID: 42859}, - SpellSchool: core.SpellSchoolFire, - ProcMask: core.ProcMaskSpellDamage, - Flags: SpellFlagMage | HotStreakSpells, - ResourceType: stats.Mana, - BaseCost: baseCost, - + ActionID: core.ActionID{SpellID: 42859}, + SpellSchool: core.SpellSchoolFire, + ProcMask: core.ProcMaskSpellDamage, + Flags: SpellFlagMage | HotStreakSpells, + + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.08, + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost, GCD: core.GCDDefault, CastTime: time.Millisecond * 1500, }, diff --git a/sim/mage/talents.go b/sim/mage/talents.go index 78f989dc56..b660d3da7e 100644 --- a/sim/mage/talents.go +++ b/sim/mage/talents.go @@ -487,12 +487,6 @@ func (mage *Mage) registerIcyVeinsCD() { } actionID := core.ActionID{SpellID: 12472} - manaCost := mage.BaseMana * 0.03 - - cooldown := 180.0 - if mage.Talents.IceFloes > 0 { - cooldown *= 1 - []float64{0, .7, .14, .20}[mage.Talents.IceFloes] - } icyVeinsAura := mage.RegisterAura(core.Aura{ Label: "Icy Veins", @@ -510,16 +504,13 @@ func (mage *Mage) registerIcyVeinsCD() { ActionID: actionID, Flags: core.SpellFlagNoOnCastComplete, - ResourceType: stats.Mana, - BaseCost: manaCost, - + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.03, + }), Cast: core.CastConfig{ - DefaultCast: core.Cast{ - Cost: manaCost, - }, CD: core.Cooldown{ Timer: mage.NewTimer(), - Duration: time.Duration(cooldown) * time.Second, + Duration: time.Second * time.Duration(180*[]float64{1, .93, .86, .80}[mage.Talents.IceFloes]), }, }, ApplyEffects: func(sim *core.Simulation, _ *core.Unit, _ *core.Spell) { @@ -536,7 +527,7 @@ func (mage *Mage) registerIcyVeinsCD() { return false } - if character.CurrentMana() < manaCost { + if character.CurrentMana() < mage.IcyVeins.DefaultCast.Cost { return false } diff --git a/sim/mage/water_elemental.go b/sim/mage/water_elemental.go index 85e0fa2f0a..53a41f11ad 100644 --- a/sim/mage/water_elemental.go +++ b/sim/mage/water_elemental.go @@ -20,18 +20,16 @@ func (mage *Mage) registerSummonWaterElementalCD() { return } - baseCost := mage.BaseMana * 0.16 summonDuration := time.Second*45 + time.Second*5*time.Duration(mage.Talents.EnduringWinter) mage.SummonWaterElemental = mage.RegisterSpell(core.SpellConfig{ ActionID: core.ActionID{SpellID: 31687}, - ResourceType: stats.Mana, - BaseCost: baseCost, - + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.16, + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost, - GCD: core.GCDDefault, + GCD: core.GCDDefault, }, CD: core.Cooldown{ Timer: mage.NewTimer(), @@ -132,18 +130,16 @@ var waterElementalStatInheritance = func(ownerStats stats.Stats) stats.Stats { } func (we *WaterElemental) registerWaterboltSpell() { - baseCost := we.BaseMana * 0.01 - we.Waterbolt = we.RegisterSpell(core.SpellConfig{ - ActionID: core.ActionID{SpellID: 31707}, - SpellSchool: core.SpellSchoolFrost, - ProcMask: core.ProcMaskSpellDamage, - ResourceType: stats.Mana, - BaseCost: baseCost, + ActionID: core.ActionID{SpellID: 31707}, + SpellSchool: core.SpellSchoolFrost, + ProcMask: core.ProcMaskSpellDamage, + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.01, + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost, GCD: core.GCDDefault, CastTime: time.Millisecond * 2500, }, From f8197ba1c7c1e5d3ed7b7eb86809c99d06480910 Mon Sep 17 00:00:00 2001 From: James Tanner Date: Wed, 11 Jan 2023 10:47:21 -0500 Subject: [PATCH 07/13] Update paladin spells --- sim/core/mana.go | 3 ++ sim/paladin/avengers_shield.go | 22 ++++++------ sim/paladin/avenging_wrath.go | 12 ++----- sim/paladin/consecration.go | 12 +++---- sim/paladin/crusader_strike.go | 21 ++++++------ sim/paladin/divine_plea.go | 1 - sim/paladin/divine_storm.go | 19 +++++------ sim/paladin/exorcism.go | 12 +++---- sim/paladin/hammer_of_the_righteous.go | 22 ++++++------ sim/paladin/hammer_of_wrath.go | 24 +++++-------- sim/paladin/holy_shield.go | 11 +++--- sim/paladin/holy_wrath.go | 13 +++---- sim/paladin/judgement.go | 47 +++++++++++--------------- sim/paladin/shield_of_righteousness.go | 19 +++++------ sim/paladin/soc.go | 12 +++---- sim/paladin/sor.go | 12 +++---- sim/paladin/sov.go | 11 +++--- 17 files changed, 116 insertions(+), 157 deletions(-) diff --git a/sim/core/mana.go b/sim/core/mana.go index 1a9ec2d8c3..324a2aebb9 100644 --- a/sim/core/mana.go +++ b/sim/core/mana.go @@ -306,6 +306,9 @@ type ManaCost struct { } func NewManaCost(options ManaCostOptions) *ManaCost { + if options.BaseCost == 0 { + return nil + } if options.Multiplier == 0 { options.Multiplier = 1 } diff --git a/sim/paladin/avengers_shield.go b/sim/paladin/avengers_shield.go index 95f7c8b0f2..f5343a2598 100644 --- a/sim/paladin/avengers_shield.go +++ b/sim/paladin/avengers_shield.go @@ -5,29 +5,27 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (paladin *Paladin) registerAvengersShieldSpell() { - baseCost := paladin.BaseMana * 0.26 - glyphedSingleTargetAS := paladin.HasMajorGlyph(proto.PaladinMajorGlyph_GlyphOfAvengerSShield) // Glyph to single target, OR apply to up to 3 targets numHits := core.TernaryInt32(glyphedSingleTargetAS, 1, core.MinInt32(3, paladin.Env.GetNumTargets())) results := make([]*core.SpellResult, numHits) paladin.AvengersShield = paladin.RegisterSpell(core.SpellConfig{ - ActionID: core.ActionID{SpellID: 48827}, - SpellSchool: core.SpellSchoolHoly, - ProcMask: core.ProcMaskMeleeMHSpecial, - Flags: core.SpellFlagMeleeMetrics, - ResourceType: stats.Mana, - BaseCost: baseCost, - + ActionID: core.ActionID{SpellID: 48827}, + SpellSchool: core.SpellSchoolHoly, + ProcMask: core.ProcMaskMeleeMHSpecial, + Flags: core.SpellFlagMeleeMetrics, + + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.26, + Multiplier: 1 - 0.02*float64(paladin.Talents.Benediction), + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * (1 - 0.02*float64(paladin.Talents.Benediction)), - GCD: core.GCDDefault, + GCD: core.GCDDefault, }, IgnoreHaste: true, CD: core.Cooldown{ diff --git a/sim/paladin/avenging_wrath.go b/sim/paladin/avenging_wrath.go index 3d2a4cb340..23850a6b56 100644 --- a/sim/paladin/avenging_wrath.go +++ b/sim/paladin/avenging_wrath.go @@ -6,7 +6,6 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (paladin *Paladin) RegisterAvengingWrathCD() { @@ -30,19 +29,14 @@ func (paladin *Paladin) RegisterAvengingWrathCD() { }, }) - baseCost := paladin.BaseMana * 0.08 - paladin.AvengingWrath = paladin.RegisterSpell(core.SpellConfig{ ActionID: actionID, Flags: core.SpellFlagNoOnCastComplete, - ResourceType: stats.Mana, - BaseCost: baseCost, - + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.08, + }), Cast: core.CastConfig{ - DefaultCast: core.Cast{ - Cost: baseCost, - }, CD: core.Cooldown{ Timer: paladin.NewTimer(), Duration: time.Minute*3 - (time.Second * time.Duration(30*paladin.Talents.SanctifiedWrath)), diff --git a/sim/paladin/consecration.go b/sim/paladin/consecration.go index 04ff7bc080..8b077f7ed5 100644 --- a/sim/paladin/consecration.go +++ b/sim/paladin/consecration.go @@ -5,7 +5,6 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) // Maybe could switch "rank" parameter type to some proto thing. Would require updates to proto files. @@ -13,7 +12,6 @@ import ( func (paladin *Paladin) registerConsecrationSpell() { // TODO: Properly implement max rank consecration. - baseCost := 0.22 * paladin.BaseMana actionID := core.ActionID{SpellID: 48819} bonusSpellPower := 0 + core.TernaryFloat64(paladin.Equip[proto.ItemSlot_ItemSlotRanged].ID == 27917, 47*0.8, 0) + @@ -50,13 +48,13 @@ func (paladin *Paladin) registerConsecrationSpell() { ProcMask: core.ProcMaskEmpty, Flags: core.SpellFlagMeleeMetrics, - ResourceType: stats.Mana, - BaseCost: baseCost, - + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.22, + Multiplier: 1 - 0.02*float64(paladin.Talents.Benediction), + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * (1 - 0.02*float64(paladin.Talents.Benediction)), - GCD: core.GCDDefault, + GCD: core.GCDDefault, }, CD: core.Cooldown{ Timer: paladin.NewTimer(), diff --git a/sim/paladin/crusader_strike.go b/sim/paladin/crusader_strike.go index 98a6d52097..8d7f37b3e7 100644 --- a/sim/paladin/crusader_strike.go +++ b/sim/paladin/crusader_strike.go @@ -5,27 +5,26 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (paladin *Paladin) registerCrusaderStrikeSpell() { - baseCost := paladin.BaseMana * 0.05 bonusDmg := core.TernaryFloat64(paladin.Equip[proto.ItemSlot_ItemSlotRanged].ID == 31033, 36, 0) + // Libram of Righteous Power core.TernaryFloat64(paladin.Equip[proto.ItemSlot_ItemSlotRanged].ID == 40191, 79, 0) // Libram of Radiance paladin.CrusaderStrike = paladin.RegisterSpell(core.SpellConfig{ - ActionID: core.ActionID{SpellID: 35395}, - SpellSchool: core.SpellSchoolPhysical, - ProcMask: core.ProcMaskMeleeMHSpecial, - Flags: core.SpellFlagMeleeMetrics | core.SpellFlagIncludeTargetBonusDamage, - ResourceType: stats.Mana, - BaseCost: baseCost, + ActionID: core.ActionID{SpellID: 35395}, + SpellSchool: core.SpellSchoolPhysical, + ProcMask: core.ProcMaskMeleeMHSpecial, + Flags: core.SpellFlagMeleeMetrics | core.SpellFlagIncludeTargetBonusDamage, + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.05, + Multiplier: 1 * + (1 - 0.02*float64(paladin.Talents.Benediction)) * + core.TernaryFloat64(paladin.HasMajorGlyph(proto.PaladinMajorGlyph_GlyphOfCrusaderStrike), 0.8, 1), + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * - (1 - 0.02*float64(paladin.Talents.Benediction)) * - core.TernaryFloat64(paladin.HasMajorGlyph(proto.PaladinMajorGlyph_GlyphOfCrusaderStrike), 0.8, 1), GCD: core.GCDDefault, }, IgnoreHaste: true, // cs is on phys gcd, which cannot be hasted diff --git a/sim/paladin/divine_plea.go b/sim/paladin/divine_plea.go index ebb09c5713..0dbd643ffd 100644 --- a/sim/paladin/divine_plea.go +++ b/sim/paladin/divine_plea.go @@ -13,7 +13,6 @@ func (paladin *Paladin) registerDivinePleaSpell() { // In future maybe expose aura for buff asserting (For prot paladins.) actionID := core.ActionID{SpellID: 54428} // Divine plea - hasGlyph := paladin.HasMajorGlyph(proto.PaladinMajorGlyph_GlyphOfDivinePlea) plea := core.NewDot(core.Dot{ diff --git a/sim/paladin/divine_storm.go b/sim/paladin/divine_storm.go index 44fc19659e..416d372293 100644 --- a/sim/paladin/divine_storm.go +++ b/sim/paladin/divine_storm.go @@ -5,28 +5,27 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (paladin *Paladin) registerDivineStormSpell() { - baseCost := paladin.BaseMana * 0.12 bonusDmg := core.TernaryFloat64(paladin.Equip[proto.ItemSlot_ItemSlotRanged].ID == 45510, 235, 0) + // Libram of Discord core.TernaryFloat64(paladin.Equip[proto.ItemSlot_ItemSlotRanged].ID == 38362, 81, 0) // Venture Co. Libram of Retribution numHits := core.MinInt32(4, paladin.Env.GetNumTargets()) results := make([]*core.SpellResult, numHits) paladin.DivineStorm = paladin.RegisterSpell(core.SpellConfig{ - ActionID: core.ActionID{SpellID: 53385}, - SpellSchool: core.SpellSchoolPhysical, - ProcMask: core.ProcMaskMeleeMHSpecial, - Flags: core.SpellFlagMeleeMetrics | core.SpellFlagIncludeTargetBonusDamage, - ResourceType: stats.Mana, - BaseCost: baseCost, + ActionID: core.ActionID{SpellID: 53385}, + SpellSchool: core.SpellSchoolPhysical, + ProcMask: core.ProcMaskMeleeMHSpecial, + Flags: core.SpellFlagMeleeMetrics | core.SpellFlagIncludeTargetBonusDamage, + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.12, + Multiplier: 1 - 0.02*float64(paladin.Talents.Benediction), + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * (1 - 0.02*float64(paladin.Talents.Benediction)), - GCD: core.GCDDefault, + GCD: core.GCDDefault, }, IgnoreHaste: true, // ds is on phys gcd, which cannot be hasted CD: core.Cooldown{ diff --git a/sim/paladin/exorcism.go b/sim/paladin/exorcism.go index 080b9bb48c..dba641544c 100644 --- a/sim/paladin/exorcism.go +++ b/sim/paladin/exorcism.go @@ -5,25 +5,21 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (paladin *Paladin) registerExorcismSpell() { - // From the perspective of max rank. - baseCost := paladin.BaseMana * 0.08 * (1 - 0.02*float64(paladin.Talents.Benediction)) - paladin.Exorcism = paladin.RegisterSpell(core.SpellConfig{ ActionID: core.ActionID{SpellID: 48801}, SpellSchool: core.SpellSchoolHoly, ProcMask: core.ProcMaskSpellDamage, Flags: core.SpellFlagMeleeMetrics, - ResourceType: stats.Mana, - BaseCost: baseCost, - + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.08, + Multiplier: 1 - 0.02*float64(paladin.Talents.Benediction), + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost, GCD: core.GCDDefault, CastTime: time.Millisecond * 1500, }, diff --git a/sim/paladin/hammer_of_the_righteous.go b/sim/paladin/hammer_of_the_righteous.go index b97771cdda..a530067845 100644 --- a/sim/paladin/hammer_of_the_righteous.go +++ b/sim/paladin/hammer_of_the_righteous.go @@ -5,27 +5,25 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (paladin *Paladin) registerHammerOfTheRighteousSpell() { - baseCost := paladin.BaseMana * 0.06 - numHits := core.MinInt32(core.TernaryInt32(paladin.HasMajorGlyph(proto.PaladinMajorGlyph_GlyphOfHammerOfTheRighteous), 4, 3), paladin.Env.GetNumTargets()) results := make([]*core.SpellResult, numHits) paladin.HammerOfTheRighteous = paladin.RegisterSpell(core.SpellConfig{ - ActionID: core.ActionID{SpellID: 53595}, - SpellSchool: core.SpellSchoolHoly, - ProcMask: core.ProcMaskMeleeMHSpecial, - Flags: core.SpellFlagMeleeMetrics, - ResourceType: stats.Mana, - BaseCost: baseCost, - + ActionID: core.ActionID{SpellID: 53595}, + SpellSchool: core.SpellSchoolHoly, + ProcMask: core.ProcMaskMeleeMHSpecial, + Flags: core.SpellFlagMeleeMetrics, + + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.06, + Multiplier: 1 - 0.02*float64(paladin.Talents.Benediction), + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * (1 - 0.02*float64(paladin.Talents.Benediction)), - GCD: core.GCDDefault, + GCD: core.GCDDefault, }, IgnoreHaste: true, CD: core.Cooldown{ diff --git a/sim/paladin/hammer_of_wrath.go b/sim/paladin/hammer_of_wrath.go index c2eb58ecd9..76d3d61744 100644 --- a/sim/paladin/hammer_of_wrath.go +++ b/sim/paladin/hammer_of_wrath.go @@ -5,27 +5,21 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (paladin *Paladin) registerHammerOfWrathSpell() { - // From the perspective of max rank. - baseCost := paladin.BaseMana * 0.12 - paladin.HammerOfWrath = paladin.RegisterSpell(core.SpellConfig{ - ActionID: core.ActionID{SpellID: 48806}, - SpellSchool: core.SpellSchoolHoly, - ProcMask: core.ProcMaskMeleeMHSpecial, - Flags: core.SpellFlagMeleeMetrics, - ResourceType: stats.Mana, - BaseCost: baseCost, - + ActionID: core.ActionID{SpellID: 48806}, + SpellSchool: core.SpellSchoolHoly, + ProcMask: core.ProcMaskMeleeMHSpecial, + Flags: core.SpellFlagMeleeMetrics, + + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.12 * core.TernaryFloat64(paladin.HasMajorGlyph(proto.PaladinMajorGlyph_GlyphOfHammerOfWrath), 0, 1), + Multiplier: 1 - 0.02*float64(paladin.Talents.Benediction), + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * - (1 - 0.02*float64(paladin.Talents.Benediction)) * - core.TernaryFloat64(paladin.HasMajorGlyph(proto.PaladinMajorGlyph_GlyphOfHammerOfWrath), 0, 1), - GCD: core.GCDDefault, }, IgnoreHaste: true, diff --git a/sim/paladin/holy_shield.go b/sim/paladin/holy_shield.go index 3d668bc202..3d4e39cc5a 100644 --- a/sim/paladin/holy_shield.go +++ b/sim/paladin/holy_shield.go @@ -53,19 +53,16 @@ func (paladin *Paladin) registerHolyShieldSpell() { }, }) - baseCost := paladin.BaseMana * 0.10 - paladin.HolyShield = paladin.RegisterSpell(core.SpellConfig{ ActionID: actionID, SpellSchool: core.SpellSchoolHoly, - ResourceType: stats.Mana, - BaseCost: baseCost, - + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.10, + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost, - GCD: core.GCDDefault, + GCD: core.GCDDefault, }, CD: core.Cooldown{ Timer: paladin.NewTimer(), diff --git a/sim/paladin/holy_wrath.go b/sim/paladin/holy_wrath.go index 657c0d13e5..f26b0674eb 100644 --- a/sim/paladin/holy_wrath.go +++ b/sim/paladin/holy_wrath.go @@ -5,12 +5,9 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (paladin *Paladin) registerHolyWrathSpell() { - // From the perspective of max rank. - baseCost := paladin.BaseMana * 0.20 results := make([]*core.SpellResult, len(paladin.Env.Encounter.Targets)) paladin.HolyWrath = paladin.RegisterSpell(core.SpellConfig{ @@ -19,13 +16,13 @@ func (paladin *Paladin) registerHolyWrathSpell() { ProcMask: core.ProcMaskSpellDamage, Flags: core.SpellFlagMeleeMetrics, - ResourceType: stats.Mana, - BaseCost: baseCost, - + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.20, + Multiplier: 1 - 0.02*float64(paladin.Talents.Benediction), + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * (1 - 0.02*float64(paladin.Talents.Benediction)), - GCD: core.GCDDefault, + GCD: core.GCDDefault, }, CD: core.Cooldown{ Timer: paladin.NewTimer(), diff --git a/sim/paladin/judgement.go b/sim/paladin/judgement.go index 58e78d7338..89a0f457b7 100644 --- a/sim/paladin/judgement.go +++ b/sim/paladin/judgement.go @@ -4,7 +4,6 @@ import ( "time" "github.com/wowsims/wotlk/sim/core" - "github.com/wowsims/wotlk/sim/core/stats" ) // const JudgementDuration = time.Second * 20 @@ -17,22 +16,19 @@ func (paladin *Paladin) canJudgement(sim *core.Simulation) bool { } func (paladin *Paladin) registerJudgementOfWisdomSpell(cdTimer *core.Timer) { - // paladin.JudgementOfLightAura = core.JudgementOfLightAura(paladin.CurrentTarget) - - baseCost := paladin.BaseMana * 0.05 - paladin.JudgementOfWisdom = paladin.RegisterSpell(core.SpellConfig{ - ActionID: core.ActionID{SpellID: 53408}, - SpellSchool: core.SpellSchoolHoly, - ProcMask: core.ProcMaskEmpty, - Flags: SpellFlagPrimaryJudgement, - ResourceType: stats.Mana, - BaseCost: baseCost, - + ActionID: core.ActionID{SpellID: 53408}, + SpellSchool: core.SpellSchoolHoly, + ProcMask: core.ProcMaskEmpty, + Flags: SpellFlagPrimaryJudgement, + + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.05, + Multiplier: 1 - 0.02*float64(paladin.Talents.Benediction), + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * (1 - 0.02*float64(paladin.Talents.Benediction)), - GCD: core.GCDDefault, + GCD: core.GCDDefault, }, IgnoreHaste: true, CD: core.Cooldown{ @@ -58,22 +54,19 @@ func (paladin *Paladin) registerJudgementOfWisdomSpell(cdTimer *core.Timer) { } func (paladin *Paladin) registerJudgementOfLightSpell(cdTimer *core.Timer) { - // paladin.JudgementOfLightAura = core.JudgementOfLightAura(paladin.CurrentTarget) - - baseCost := paladin.BaseMana * 0.05 - paladin.JudgementOfLight = paladin.RegisterSpell(core.SpellConfig{ - ActionID: core.ActionID{SpellID: 20271}, - SpellSchool: core.SpellSchoolHoly, - ProcMask: core.ProcMaskEmpty, - Flags: SpellFlagPrimaryJudgement, - ResourceType: stats.Mana, - BaseCost: baseCost, - + ActionID: core.ActionID{SpellID: 20271}, + SpellSchool: core.SpellSchoolHoly, + ProcMask: core.ProcMaskEmpty, + Flags: SpellFlagPrimaryJudgement, + + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.05, + Multiplier: 1 - 0.02*float64(paladin.Talents.Benediction), + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * (1 - 0.02*float64(paladin.Talents.Benediction)), - GCD: core.GCDDefault, + GCD: core.GCDDefault, }, IgnoreHaste: true, CD: core.Cooldown{ diff --git a/sim/paladin/shield_of_righteousness.go b/sim/paladin/shield_of_righteousness.go index 4d07b967a3..b21267b6fa 100644 --- a/sim/paladin/shield_of_righteousness.go +++ b/sim/paladin/shield_of_righteousness.go @@ -8,24 +8,23 @@ import ( ) func (paladin *Paladin) registerShieldOfRighteousnessSpell() { - baseCost := paladin.BaseMana * 0.06 var aegisPlateProcAura *core.Aura if paladin.HasSetBonus(ItemSetAegisPlate, 4) { aegisPlateProcAura = paladin.NewTemporaryStatsAura("Aegis", core.ActionID{SpellID: 64883}, stats.Stats{stats.BlockValue: 225}, time.Second*6) } paladin.ShieldOfRighteousness = paladin.RegisterSpell(core.SpellConfig{ - ActionID: core.ActionID{SpellID: 61411}, - SpellSchool: core.SpellSchoolHoly, - ProcMask: core.ProcMaskMeleeMHSpecial, - Flags: core.SpellFlagMeleeMetrics, - ResourceType: stats.Mana, - BaseCost: baseCost, - + ActionID: core.ActionID{SpellID: 61411}, + SpellSchool: core.SpellSchoolHoly, + ProcMask: core.ProcMaskMeleeMHSpecial, + Flags: core.SpellFlagMeleeMetrics, + + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.06, + Multiplier: 1 - 0.02*float64(paladin.Talents.Benediction), + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * - (1 - 0.02*float64(paladin.Talents.Benediction)), GCD: core.GCDDefault, }, IgnoreHaste: true, diff --git a/sim/paladin/soc.go b/sim/paladin/soc.go index 05f7bda604..90d6d3e363 100644 --- a/sim/paladin/soc.go +++ b/sim/paladin/soc.go @@ -3,7 +3,6 @@ package paladin import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (paladin *Paladin) registerSealOfCommandSpellAndAura() { @@ -156,19 +155,18 @@ func (paladin *Paladin) registerSealOfCommandSpellAndAura() { }) aura := paladin.SealOfCommandAura - baseCost := paladin.BaseMana * 0.14 paladin.SealOfCommand = paladin.RegisterSpell(core.SpellConfig{ ActionID: auraActionID, // Seal of Command self buff. SpellSchool: core.SpellSchoolHoly, ProcMask: core.ProcMaskEmpty, - ResourceType: stats.Mana, - BaseCost: baseCost, - + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.14, + Multiplier: 1 - 0.02*float64(paladin.Talents.Benediction), + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * (1 - 0.02*float64(paladin.Talents.Benediction)), - GCD: core.GCDDefault, + GCD: core.GCDDefault, }, }, diff --git a/sim/paladin/sor.go b/sim/paladin/sor.go index 008f92de33..f0ed23b3a6 100644 --- a/sim/paladin/sor.go +++ b/sim/paladin/sor.go @@ -2,7 +2,6 @@ package paladin import ( "github.com/wowsims/wotlk/sim/core" - "github.com/wowsims/wotlk/sim/core/stats" ) func (paladin *Paladin) registerSealOfRighteousnessSpellAndAura() { @@ -104,18 +103,17 @@ func (paladin *Paladin) registerSealOfRighteousnessSpellAndAura() { }) aura := paladin.SealOfRighteousnessAura - baseCost := paladin.BaseMana * 0.14 paladin.SealOfRighteousness = paladin.RegisterSpell(core.SpellConfig{ ActionID: auraActionID, // Seal of Righteousness self buff. SpellSchool: core.SpellSchoolHoly, - ResourceType: stats.Mana, - BaseCost: baseCost, - + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.14, + Multiplier: 1 - 0.02*float64(paladin.Talents.Benediction), + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * (1 - 0.02*float64(paladin.Talents.Benediction)), - GCD: core.GCDDefault, + GCD: core.GCDDefault, }, }, diff --git a/sim/paladin/sov.go b/sim/paladin/sov.go index 755dc66705..b068303eda 100644 --- a/sim/paladin/sov.go +++ b/sim/paladin/sov.go @@ -170,18 +170,17 @@ func (paladin *Paladin) registerSealOfVengeanceSpellAndAura() { }) aura := paladin.SealOfVengeanceAura - baseCost := paladin.BaseMana * 0.14 paladin.SealOfVengeance = paladin.RegisterSpell(core.SpellConfig{ ActionID: auraActionID, // Seal of Vengeance self buff. SpellSchool: core.SpellSchoolHoly, - ResourceType: stats.Mana, - BaseCost: baseCost, - + Cost: core.NewManaCost(core.ManaCostOptions{ + BaseCost: 0.14, + Multiplier: 1 - 0.02*float64(paladin.Talents.Benediction), + }), Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * (1 - 0.02*float64(paladin.Talents.Benediction)), - GCD: core.GCDDefault, + GCD: core.GCDDefault, }, }, From e12bbc39a64146ebacd0636d206e4f7179047d5d Mon Sep 17 00:00:00 2001 From: James Tanner Date: Wed, 11 Jan 2023 20:41:20 -0500 Subject: [PATCH 08/13] Simplify mana cost interface --- sim/core/cast.go | 4 ---- sim/core/mana.go | 25 ++++++------------------- sim/core/spell.go | 13 +++++++------ sim/druid/fake_gotw.go | 4 ++-- sim/druid/force_of_nature.go | 4 ++-- sim/druid/forms.go | 8 ++++---- sim/druid/hurricane.go | 4 ++-- sim/druid/innervate.go | 4 ++-- sim/druid/insect_swarm.go | 4 ++-- sim/druid/moonfire.go | 4 ++-- sim/druid/rebirth.go | 4 ++-- sim/druid/starfall.go | 4 ++-- sim/druid/starfire.go | 4 ++-- sim/druid/typhoon.go | 4 ++-- sim/druid/wrath.go | 4 ++-- sim/hunter/aimed_shot.go | 4 ++-- sim/hunter/arcane_shot.go | 4 ++-- sim/hunter/black_arrow.go | 4 ++-- sim/hunter/chimera_shot.go | 4 ++-- sim/hunter/explosive_shot.go | 4 ++-- sim/hunter/explosive_trap.go | 4 ++-- sim/hunter/kill_command.go | 4 ++-- sim/hunter/kill_shot.go | 4 ++-- sim/hunter/multi_shot.go | 4 ++-- sim/hunter/rapid_fire.go | 4 ++-- sim/hunter/raptor_strike.go | 4 ++-- sim/hunter/scorpid_sting.go | 4 ++-- sim/hunter/serpent_sting.go | 4 ++-- sim/hunter/silencing_shot.go | 4 ++-- sim/hunter/steady_shot.go | 4 ++-- sim/hunter/talents.go | 4 ++-- sim/hunter/volley.go | 4 ++-- sim/mage/arcane_barrage.go | 4 ++-- sim/mage/arcane_blast.go | 4 ++-- sim/mage/arcane_explosion.go | 4 ++-- sim/mage/arcane_missiles.go | 4 ++-- sim/mage/blizzard.go | 4 ++-- sim/mage/deep_freeze.go | 4 ++-- sim/mage/fire_blast.go | 4 ++-- sim/mage/fireball.go | 4 ++-- sim/mage/flamestrike.go | 4 ++-- sim/mage/frostbolt.go | 4 ++-- sim/mage/frostfire_bolt.go | 4 ++-- sim/mage/ice_lance.go | 4 ++-- sim/mage/living_bomb.go | 4 ++-- sim/mage/mirror_image.go | 12 ++++++------ sim/mage/pyroblast.go | 4 ++-- sim/mage/scorch.go | 4 ++-- sim/mage/talents.go | 4 ++-- sim/mage/water_elemental.go | 8 ++++---- sim/paladin/avengers_shield.go | 4 ++-- sim/paladin/avenging_wrath.go | 4 ++-- sim/paladin/consecration.go | 4 ++-- sim/paladin/crusader_strike.go | 4 ++-- sim/paladin/divine_storm.go | 4 ++-- sim/paladin/exorcism.go | 4 ++-- sim/paladin/hammer_of_the_righteous.go | 4 ++-- sim/paladin/hammer_of_wrath.go | 4 ++-- sim/paladin/holy_shield.go | 4 ++-- sim/paladin/holy_wrath.go | 4 ++-- sim/paladin/judgement.go | 8 ++++---- sim/paladin/shield_of_righteousness.go | 4 ++-- sim/paladin/soc.go | 4 ++-- sim/paladin/sor.go | 4 ++-- sim/paladin/sov.go | 4 ++-- 65 files changed, 147 insertions(+), 163 deletions(-) diff --git a/sim/core/cast.go b/sim/core/cast.go index 1470f07a8b..ed53b4e5c4 100644 --- a/sim/core/cast.go +++ b/sim/core/cast.go @@ -385,10 +385,6 @@ func (spell *Spell) makeCastFuncWait(config CastConfig, onCastComplete CastFunc) // Handles computing the cost of spells and checking whether the Unit // meets them. type SpellCost interface { - // For initialization logic that requires a reference to the spell - // to which this cost will apply. - Init(*Spell) - // Whether the Unit associated with the spell meets the resource cost // requirements to cast the spell. MeetsRequirement(*Spell) bool diff --git a/sim/core/mana.go b/sim/core/mana.go index 324a2aebb9..0323607a96 100644 --- a/sim/core/mana.go +++ b/sim/core/mana.go @@ -299,32 +299,19 @@ type ManaCostOptions struct { Multiplier float64 // It's OK to leave this at 0, will default to 1. } type ManaCost struct { - BaseCost float64 - Multiplier float64 - ResourceMetrics *ResourceMetrics } -func NewManaCost(options ManaCostOptions) *ManaCost { - if options.BaseCost == 0 { - return nil - } - if options.Multiplier == 0 { - options.Multiplier = 1 - } +func newManaCost(spell *Spell, options ManaCostOptions) *ManaCost { + spell.ResourceType = stats.Mana + spell.BaseCost = options.BaseCost * spell.Unit.BaseMana + spell.DefaultCast.Cost = spell.BaseCost * TernaryFloat64(options.Multiplier == 0, 1, options.Multiplier) + return &ManaCost{ - BaseCost: options.BaseCost, - Multiplier: options.Multiplier, + ResourceMetrics: spell.Unit.NewManaMetrics(spell.ActionID), } } -func (mc *ManaCost) Init(spell *Spell) { - mc.BaseCost = mc.BaseCost * spell.Unit.BaseMana - spell.ResourceType = stats.Mana - spell.BaseCost = mc.BaseCost - spell.DefaultCast.Cost = mc.BaseCost * mc.Multiplier - mc.ResourceMetrics = spell.Unit.NewManaMetrics(spell.ActionID) -} func (mc *ManaCost) MeetsRequirement(spell *Spell) bool { spell.CurCast.Cost = spell.ApplyCostModifiers(spell.CurCast.Cost) return spell.Unit.CurrentMana() >= spell.CurCast.Cost diff --git a/sim/core/spell.go b/sim/core/spell.go index d69fb10d1a..6efffe9af3 100644 --- a/sim/core/spell.go +++ b/sim/core/spell.go @@ -20,8 +20,8 @@ type SpellConfig struct { ResourceType stats.Stat BaseCost float64 - Cost SpellCost - Cast CastConfig + ManaCost ManaCostOptions + Cast CastConfig BonusHitRating float64 BonusCritRating float64 @@ -162,7 +162,6 @@ func (unit *Unit) RegisterSpell(config SpellConfig) *Spell { MissileSpeed: config.MissileSpeed, ResourceType: config.ResourceType, BaseCost: config.BaseCost, - Cost: config.Cost, DefaultCast: config.Cast.DefaultCast, CD: config.Cast.CD, @@ -212,9 +211,11 @@ func (unit *Unit) RegisterSpell(config SpellConfig) *Spell { spell.SchoolIndex = stats.SchoolIndexShadow } - if spell.Cost != nil { - spell.Cost.Init(spell) - } else { + if config.ManaCost.BaseCost != 0 { + spell.Cost = newManaCost(spell, config.ManaCost) + } + + if spell.Cost == nil { switch spell.ResourceType { case stats.Mana: spell.ResourceMetrics = spell.Unit.NewManaMetrics(spell.ActionID) diff --git a/sim/druid/fake_gotw.go b/sim/druid/fake_gotw.go index 161a364c82..42837cc4ea 100644 --- a/sim/druid/fake_gotw.go +++ b/sim/druid/fake_gotw.go @@ -14,10 +14,10 @@ func (druid *Druid) registerFakeGotw() { ActionID: core.ActionID{SpellID: 48470}, Flags: SpellFlagOmenTrigger | core.SpellFlagHelpful, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: baseCost, Multiplier: 1, - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, diff --git a/sim/druid/force_of_nature.go b/sim/druid/force_of_nature.go index be36d72f8e..24815af5bd 100644 --- a/sim/druid/force_of_nature.go +++ b/sim/druid/force_of_nature.go @@ -20,10 +20,10 @@ func (druid *Druid) registerForceOfNatureCD() { druid.ForceOfNature = druid.RegisterSpell(core.SpellConfig{ ActionID: core.ActionID{SpellID: 65861}, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.12, Multiplier: 1, - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, diff --git a/sim/druid/forms.go b/sim/druid/forms.go index a03e8fd595..d9cd68e063 100644 --- a/sim/druid/forms.go +++ b/sim/druid/forms.go @@ -185,10 +185,10 @@ func (druid *Druid) registerCatFormSpell() { ActionID: actionID, Flags: core.SpellFlagNoOnCastComplete, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.35, Multiplier: (1 - 0.2*float64(druid.Talents.KingOfTheJungle)) * (1 - 0.1*float64(druid.Talents.NaturalShapeshifter)), - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, @@ -322,10 +322,10 @@ func (druid *Druid) registerBearFormSpell() { ActionID: actionID, Flags: core.SpellFlagNoOnCastComplete, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.35, Multiplier: (1 - 0.2*float64(druid.Talents.KingOfTheJungle)) * (1 - 0.1*float64(druid.Talents.NaturalShapeshifter)), - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, diff --git a/sim/druid/hurricane.go b/sim/druid/hurricane.go index 784fc765a3..89e26a962f 100644 --- a/sim/druid/hurricane.go +++ b/sim/druid/hurricane.go @@ -39,10 +39,10 @@ func (druid *Druid) registerHurricaneSpell() { ProcMask: core.ProcMaskSpellDamage, Flags: core.SpellFlagChanneled | SpellFlagOmenTrigger, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.81, Multiplier: 1, - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, diff --git a/sim/druid/innervate.go b/sim/druid/innervate.go index 4b4984e375..af3c8f9e04 100644 --- a/sim/druid/innervate.go +++ b/sim/druid/innervate.go @@ -46,10 +46,10 @@ func (druid *Druid) registerInnervateCD() { ActionID: actionID, Flags: SpellFlagOmenTrigger, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.04, Multiplier: 1, - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, diff --git a/sim/druid/insect_swarm.go b/sim/druid/insect_swarm.go index 5c56919ab9..e3083619d3 100644 --- a/sim/druid/insect_swarm.go +++ b/sim/druid/insect_swarm.go @@ -24,10 +24,10 @@ func (druid *Druid) registerInsectSwarmSpell() { ProcMask: core.ProcMaskSpellDamage, Flags: SpellFlagOmenTrigger, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.08, Multiplier: 1, - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, diff --git a/sim/druid/moonfire.go b/sim/druid/moonfire.go index 0d19a4466e..fb65971fc9 100644 --- a/sim/druid/moonfire.go +++ b/sim/druid/moonfire.go @@ -20,10 +20,10 @@ func (druid *Druid) registerMoonfireSpell() { ProcMask: core.ProcMaskSpellDamage, Flags: SpellFlagNaturesGrace | SpellFlagOmenTrigger, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.21, Multiplier: 1 - 0.03*float64(druid.Talents.Moonglow), - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, diff --git a/sim/druid/rebirth.go b/sim/druid/rebirth.go index f8304d87eb..c87f02d540 100644 --- a/sim/druid/rebirth.go +++ b/sim/druid/rebirth.go @@ -19,10 +19,10 @@ func (druid *Druid) registerRebirthSpell() { ActionID: core.ActionID{SpellID: 48477}, Flags: SpellFlagOmenTrigger, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: baseCost, Multiplier: 1 - 0.1*float64(druid.Talents.NaturalShapeshifter), - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, diff --git a/sim/druid/starfall.go b/sim/druid/starfall.go index c3f60e7ee6..1b073bc1f7 100644 --- a/sim/druid/starfall.go +++ b/sim/druid/starfall.go @@ -24,10 +24,10 @@ func (druid *Druid) registerStarfallSpell() { ProcMask: core.ProcMaskSpellDamage, Flags: SpellFlagNaturesGrace | SpellFlagOmenTrigger, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.35, Multiplier: 1 - 0.03*float64(druid.Talents.Moonglow), - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, diff --git a/sim/druid/starfire.go b/sim/druid/starfire.go index ec5cc9e07d..131d78320f 100644 --- a/sim/druid/starfire.go +++ b/sim/druid/starfire.go @@ -24,10 +24,10 @@ func (druid *Druid) registerStarfireSpell() { ProcMask: core.ProcMaskSpellDamage, Flags: SpellFlagNaturesGrace | SpellFlagOmenTrigger, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.16, Multiplier: 1 - 0.03*float64(druid.Talents.Moonglow), - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, diff --git a/sim/druid/typhoon.go b/sim/druid/typhoon.go index d352ce6dd4..07d4001c0e 100644 --- a/sim/druid/typhoon.go +++ b/sim/druid/typhoon.go @@ -18,10 +18,10 @@ func (druid *Druid) registerTyphoonSpell() { ProcMask: core.ProcMaskSpellDamage, Flags: SpellFlagOmenTrigger, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.25, Multiplier: 1, - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, diff --git a/sim/druid/wrath.go b/sim/druid/wrath.go index 6f78af1275..aa89e01493 100644 --- a/sim/druid/wrath.go +++ b/sim/druid/wrath.go @@ -21,10 +21,10 @@ func (druid *Druid) registerWrathSpell() { Flags: SpellFlagNaturesGrace | SpellFlagOmenTrigger, MissileSpeed: 20, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.11, Multiplier: 1 - 0.03*float64(druid.Talents.Moonglow), - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, diff --git a/sim/hunter/aimed_shot.go b/sim/hunter/aimed_shot.go index 56e58a9f92..a4898d8bcd 100644 --- a/sim/hunter/aimed_shot.go +++ b/sim/hunter/aimed_shot.go @@ -18,12 +18,12 @@ func (hunter *Hunter) registerAimedShotSpell(timer *core.Timer) { ProcMask: core.ProcMaskRangedSpecial, Flags: core.SpellFlagMeleeMetrics | core.SpellFlagIncludeTargetBonusDamage, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.08, Multiplier: 1 * (1 - 0.03*float64(hunter.Talents.Efficiency)) * (1 - 0.05*float64(hunter.Talents.MasterMarksman)), - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, diff --git a/sim/hunter/arcane_shot.go b/sim/hunter/arcane_shot.go index 0a06a35dba..b429445478 100644 --- a/sim/hunter/arcane_shot.go +++ b/sim/hunter/arcane_shot.go @@ -20,10 +20,10 @@ func (hunter *Hunter) registerArcaneShotSpell(timer *core.Timer) { ProcMask: core.ProcMaskRangedSpecial, Flags: core.SpellFlagMeleeMetrics, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.05, Multiplier: 1 - 0.03*float64(hunter.Talents.Efficiency), - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, diff --git a/sim/hunter/black_arrow.go b/sim/hunter/black_arrow.go index 5475686758..1eb51c2d56 100644 --- a/sim/hunter/black_arrow.go +++ b/sim/hunter/black_arrow.go @@ -20,12 +20,12 @@ func (hunter *Hunter) registerBlackArrowSpell(timer *core.Timer) { SpellSchool: core.SpellSchoolShadow, ProcMask: core.ProcMaskRangedSpecial, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.06, Multiplier: 1 * (1 - 0.03*float64(hunter.Talents.Efficiency)) * (1 - 0.2*float64(hunter.Talents.Resourcefulness)), - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, diff --git a/sim/hunter/chimera_shot.go b/sim/hunter/chimera_shot.go index e60eb0496c..434401573f 100644 --- a/sim/hunter/chimera_shot.go +++ b/sim/hunter/chimera_shot.go @@ -20,12 +20,12 @@ func (hunter *Hunter) registerChimeraShotSpell() { ProcMask: core.ProcMaskRangedSpecial, Flags: core.SpellFlagMeleeMetrics, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.12, Multiplier: 1 * (1 - 0.03*float64(hunter.Talents.Efficiency)) * (1 - 0.05*float64(hunter.Talents.MasterMarksman)), - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, diff --git a/sim/hunter/explosive_shot.go b/sim/hunter/explosive_shot.go index 68f9bd174f..1310793aea 100644 --- a/sim/hunter/explosive_shot.go +++ b/sim/hunter/explosive_shot.go @@ -34,10 +34,10 @@ func (hunter *Hunter) makeExplosiveShotSpell(timer *core.Timer, downrank bool) ( ProcMask: core.ProcMaskRangedSpecial, Flags: core.SpellFlagMeleeMetrics, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.07, Multiplier: 1 - 0.03*float64(hunter.Talents.Efficiency), - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, diff --git a/sim/hunter/explosive_trap.go b/sim/hunter/explosive_trap.go index c88b4c26d4..a343a4ad86 100644 --- a/sim/hunter/explosive_trap.go +++ b/sim/hunter/explosive_trap.go @@ -16,10 +16,10 @@ func (hunter *Hunter) registerExplosiveTrapSpell(timer *core.Timer) { SpellSchool: core.SpellSchoolFire, ProcMask: core.ProcMaskSpellDamage, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.19, Multiplier: 1 - 0.2*float64(hunter.Talents.Resourcefulness), - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, diff --git a/sim/hunter/kill_command.go b/sim/hunter/kill_command.go index 2c5385ce8f..a4a92400c0 100644 --- a/sim/hunter/kill_command.go +++ b/sim/hunter/kill_command.go @@ -43,9 +43,9 @@ func (hunter *Hunter) registerKillCommandCD() { SpellSchool: core.SpellSchoolPhysical, Flags: core.SpellFlagNoOnCastComplete, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.03, - }), + }, Cast: core.CastConfig{ CD: core.Cooldown{ Timer: hunter.NewTimer(), diff --git a/sim/hunter/kill_shot.go b/sim/hunter/kill_shot.go index 1aa3bc95f8..e2d7450283 100644 --- a/sim/hunter/kill_shot.go +++ b/sim/hunter/kill_shot.go @@ -14,10 +14,10 @@ func (hunter *Hunter) registerKillShotSpell() { ProcMask: core.ProcMaskRangedSpecial, Flags: core.SpellFlagMeleeMetrics | core.SpellFlagIncludeTargetBonusDamage, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.07, Multiplier: 1 - 0.03*float64(hunter.Talents.Efficiency), - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, diff --git a/sim/hunter/multi_shot.go b/sim/hunter/multi_shot.go index 86e2167cda..738784a6b9 100644 --- a/sim/hunter/multi_shot.go +++ b/sim/hunter/multi_shot.go @@ -16,10 +16,10 @@ func (hunter *Hunter) registerMultiShotSpell(timer *core.Timer) { ProcMask: core.ProcMaskRangedSpecial, Flags: core.SpellFlagMeleeMetrics | core.SpellFlagIncludeTargetBonusDamage, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.09, Multiplier: 1 - 0.03*float64(hunter.Talents.Efficiency), - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, diff --git a/sim/hunter/rapid_fire.go b/sim/hunter/rapid_fire.go index 85a637b80f..73dc9bdb98 100644 --- a/sim/hunter/rapid_fire.go +++ b/sim/hunter/rapid_fire.go @@ -43,9 +43,9 @@ func (hunter *Hunter) registerRapidFireCD() { hunter.RapidFire = hunter.RegisterSpell(core.SpellConfig{ ActionID: actionID, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.03, - }), + }, Cast: core.CastConfig{ CD: core.Cooldown{ Timer: hunter.NewTimer(), diff --git a/sim/hunter/raptor_strike.go b/sim/hunter/raptor_strike.go index 945f007e3b..127f83fe97 100644 --- a/sim/hunter/raptor_strike.go +++ b/sim/hunter/raptor_strike.go @@ -13,10 +13,10 @@ func (hunter *Hunter) registerRaptorStrikeSpell() { ProcMask: core.ProcMaskMeleeMHAuto | core.ProcMaskMeleeMHSpecial, Flags: core.SpellFlagMeleeMetrics | core.SpellFlagIncludeTargetBonusDamage, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.04, Multiplier: 1 - 0.2*float64(hunter.Talents.Resourcefulness), - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{}, CD: core.Cooldown{ diff --git a/sim/hunter/scorpid_sting.go b/sim/hunter/scorpid_sting.go index 78efa53e24..59831d0a76 100644 --- a/sim/hunter/scorpid_sting.go +++ b/sim/hunter/scorpid_sting.go @@ -12,10 +12,10 @@ func (hunter *Hunter) registerScorpidStingSpell() { SpellSchool: core.SpellSchoolNature, ProcMask: core.ProcMaskRangedSpecial, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.09, Multiplier: 1 - 0.03*float64(hunter.Talents.Efficiency), - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, diff --git a/sim/hunter/serpent_sting.go b/sim/hunter/serpent_sting.go index 23c095282e..63726d5de9 100644 --- a/sim/hunter/serpent_sting.go +++ b/sim/hunter/serpent_sting.go @@ -16,10 +16,10 @@ func (hunter *Hunter) registerSerpentStingSpell() { SpellSchool: core.SpellSchoolNature, ProcMask: core.ProcMaskEmpty, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.09, Multiplier: 1 - 0.03*float64(hunter.Talents.Efficiency), - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, diff --git a/sim/hunter/silencing_shot.go b/sim/hunter/silencing_shot.go index 698d38928c..18e58820cd 100644 --- a/sim/hunter/silencing_shot.go +++ b/sim/hunter/silencing_shot.go @@ -17,10 +17,10 @@ func (hunter *Hunter) registerSilencingShotSpell() { ProcMask: core.ProcMaskRangedSpecial, Flags: core.SpellFlagMeleeMetrics | core.SpellFlagIncludeTargetBonusDamage, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.06, Multiplier: 1 - 0.03*float64(hunter.Talents.Efficiency), - }), + }, Cast: core.CastConfig{ CD: core.Cooldown{ Timer: hunter.NewTimer(), diff --git a/sim/hunter/steady_shot.go b/sim/hunter/steady_shot.go index 0859a1bc58..7cec80077d 100644 --- a/sim/hunter/steady_shot.go +++ b/sim/hunter/steady_shot.go @@ -51,12 +51,12 @@ func (hunter *Hunter) registerSteadyShotSpell() { ProcMask: core.ProcMaskRangedSpecial, Flags: core.SpellFlagMeleeMetrics | core.SpellFlagIncludeTargetBonusDamage, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.05, Multiplier: 1 * (1 - 0.03*float64(hunter.Talents.Efficiency)) * (1 - 0.05*float64(hunter.Talents.MasterMarksman)), - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, diff --git a/sim/hunter/talents.go b/sim/hunter/talents.go index 455c8bd9ef..c0fa810a05 100644 --- a/sim/hunter/talents.go +++ b/sim/hunter/talents.go @@ -446,9 +446,9 @@ func (hunter *Hunter) registerBestialWrathCD() { bwSpell := hunter.RegisterSpell(core.SpellConfig{ ActionID: actionID, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.1, - }), + }, Cast: core.CastConfig{ CD: core.Cooldown{ Timer: hunter.NewTimer(), diff --git a/sim/hunter/volley.go b/sim/hunter/volley.go index 6c0b354451..a85a177fab 100644 --- a/sim/hunter/volley.go +++ b/sim/hunter/volley.go @@ -41,10 +41,10 @@ func (hunter *Hunter) registerVolleySpell() { ProcMask: core.ProcMaskRangedSpecial, Flags: core.SpellFlagChanneled, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.17, Multiplier: core.TernaryFloat64(hunter.HasMajorGlyph(proto.HunterMajorGlyph_GlyphOfVolley), 0.8, 1), - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, diff --git a/sim/mage/arcane_barrage.go b/sim/mage/arcane_barrage.go index 04b1d1f037..01b66f28cc 100644 --- a/sim/mage/arcane_barrage.go +++ b/sim/mage/arcane_barrage.go @@ -19,12 +19,12 @@ func (mage *Mage) registerArcaneBarrageSpell() { Flags: SpellFlagMage | BarrageSpells, MissileSpeed: 24, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.18, Multiplier: 1 * (1 - .01*float64(mage.Talents.ArcaneFocus)) * core.TernaryFloat64(mage.HasMajorGlyph(proto.MageMajorGlyph_GlyphOfArcaneBarrage), .8, 1), - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, diff --git a/sim/mage/arcane_blast.go b/sim/mage/arcane_blast.go index 5130dea77c..799eaad628 100644 --- a/sim/mage/arcane_blast.go +++ b/sim/mage/arcane_blast.go @@ -37,10 +37,10 @@ func (mage *Mage) registerArcaneBlastSpell() { ProcMask: core.ProcMaskSpellDamage, Flags: SpellFlagMage | BarrageSpells, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.07, Multiplier: 1 - .01*float64(mage.Talents.ArcaneFocus), - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, diff --git a/sim/mage/arcane_explosion.go b/sim/mage/arcane_explosion.go index 73b8bf5cde..692369fe03 100644 --- a/sim/mage/arcane_explosion.go +++ b/sim/mage/arcane_explosion.go @@ -12,10 +12,10 @@ func (mage *Mage) registerArcaneExplosionSpell() { ProcMask: core.ProcMaskSpellDamage, Flags: SpellFlagMage, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.22, Multiplier: core.TernaryFloat64(mage.HasMajorGlyph(proto.MageMajorGlyph_GlyphOfArcaneExplosion), .9, 1), - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, diff --git a/sim/mage/arcane_missiles.go b/sim/mage/arcane_missiles.go index 4d61008b4c..8710495e08 100644 --- a/sim/mage/arcane_missiles.go +++ b/sim/mage/arcane_missiles.go @@ -21,10 +21,10 @@ func (mage *Mage) registerArcaneMissilesSpell() { Flags: SpellFlagMage | core.SpellFlagChanneled, MissileSpeed: 20, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.31, Multiplier: 1 - .01*float64(mage.Talents.ArcaneFocus), - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, diff --git a/sim/mage/blizzard.go b/sim/mage/blizzard.go index a661dd3300..19c8da6f76 100644 --- a/sim/mage/blizzard.go +++ b/sim/mage/blizzard.go @@ -40,9 +40,9 @@ func (mage *Mage) registerBlizzardSpell() { ProcMask: core.ProcMaskSpellDamage, Flags: SpellFlagMage | core.SpellFlagChanneled, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.74, - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, diff --git a/sim/mage/deep_freeze.go b/sim/mage/deep_freeze.go index 6c3a51be4a..19c7f6e12b 100644 --- a/sim/mage/deep_freeze.go +++ b/sim/mage/deep_freeze.go @@ -17,9 +17,9 @@ func (mage *Mage) registerDeepFreezeSpell() { ProcMask: core.ProcMaskSpellDamage, Flags: SpellFlagMage, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.09, - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, diff --git a/sim/mage/fire_blast.go b/sim/mage/fire_blast.go index 939b9283f5..6d61e7379d 100644 --- a/sim/mage/fire_blast.go +++ b/sim/mage/fire_blast.go @@ -13,9 +13,9 @@ func (mage *Mage) registerFireBlastSpell() { ProcMask: core.ProcMaskSpellDamage, Flags: SpellFlagMage | HotStreakSpells, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.21, - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, diff --git a/sim/mage/fireball.go b/sim/mage/fireball.go index 55e07c80b3..438a93fee8 100644 --- a/sim/mage/fireball.go +++ b/sim/mage/fireball.go @@ -21,9 +21,9 @@ func (mage *Mage) registerFireballSpell() { Flags: SpellFlagMage | BarrageSpells | HotStreakSpells, MissileSpeed: 24, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.19, - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, diff --git a/sim/mage/flamestrike.go b/sim/mage/flamestrike.go index 1482759c65..804443c520 100644 --- a/sim/mage/flamestrike.go +++ b/sim/mage/flamestrike.go @@ -15,9 +15,9 @@ func (mage *Mage) registerFlamestrikeSpell() { ProcMask: core.ProcMaskSpellDamage, Flags: SpellFlagMage, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.30, - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, diff --git a/sim/mage/frostbolt.go b/sim/mage/frostbolt.go index 2bc1c93ca3..0499e90a37 100644 --- a/sim/mage/frostbolt.go +++ b/sim/mage/frostbolt.go @@ -23,9 +23,9 @@ func (mage *Mage) registerFrostboltSpell() { Flags: SpellFlagMage | BarrageSpells, MissileSpeed: 28, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.11, - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, diff --git a/sim/mage/frostfire_bolt.go b/sim/mage/frostfire_bolt.go index f4e1fbc455..d0cc2001f0 100644 --- a/sim/mage/frostfire_bolt.go +++ b/sim/mage/frostfire_bolt.go @@ -19,9 +19,9 @@ func (mage *Mage) registerFrostfireBoltSpell() { Flags: SpellFlagMage | BarrageSpells | HotStreakSpells, MissileSpeed: 28, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.14, - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, diff --git a/sim/mage/ice_lance.go b/sim/mage/ice_lance.go index f7bd649689..2f010bc035 100644 --- a/sim/mage/ice_lance.go +++ b/sim/mage/ice_lance.go @@ -12,9 +12,9 @@ func (mage *Mage) registerIceLanceSpell() { Flags: SpellFlagMage, MissileSpeed: 38, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.06, - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, diff --git a/sim/mage/living_bomb.go b/sim/mage/living_bomb.go index 1eeb667820..c4fdb1edf9 100644 --- a/sim/mage/living_bomb.go +++ b/sim/mage/living_bomb.go @@ -42,9 +42,9 @@ func (mage *Mage) registerLivingBombSpell() { ProcMask: core.ProcMaskSpellDamage, Flags: SpellFlagMage, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.22, - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, diff --git a/sim/mage/mirror_image.go b/sim/mage/mirror_image.go index 43673ff167..09d8294c5b 100644 --- a/sim/mage/mirror_image.go +++ b/sim/mage/mirror_image.go @@ -31,9 +31,9 @@ func (mage *Mage) registerMirrorImageCD() { mage.MirrorImage = mage.RegisterSpell(core.SpellConfig{ ActionID: core.ActionID{SpellID: 55342}, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.1, - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, @@ -142,9 +142,9 @@ func (mi *MirrorImage) registerFrostboltSpell() { ProcMask: core.ProcMaskSpellDamage, MissileSpeed: 24, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.01, - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, @@ -175,9 +175,9 @@ func (mi *MirrorImage) registerFireblastSpell() { SpellSchool: core.SpellSchoolFrost, ProcMask: core.ProcMaskSpellDamage, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.01, - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDMin, diff --git a/sim/mage/pyroblast.go b/sim/mage/pyroblast.go index c6fe8a952f..25f25da763 100644 --- a/sim/mage/pyroblast.go +++ b/sim/mage/pyroblast.go @@ -26,9 +26,9 @@ func (mage *Mage) registerPyroblastSpell() { Flags: SpellFlagMage, MissileSpeed: 24, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.22, - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, diff --git a/sim/mage/scorch.go b/sim/mage/scorch.go index b44d06be7f..8660fb7d3c 100644 --- a/sim/mage/scorch.go +++ b/sim/mage/scorch.go @@ -20,9 +20,9 @@ func (mage *Mage) registerScorchSpell() { ProcMask: core.ProcMaskSpellDamage, Flags: SpellFlagMage | HotStreakSpells, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.08, - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, diff --git a/sim/mage/talents.go b/sim/mage/talents.go index b660d3da7e..a6247f3e86 100644 --- a/sim/mage/talents.go +++ b/sim/mage/talents.go @@ -504,9 +504,9 @@ func (mage *Mage) registerIcyVeinsCD() { ActionID: actionID, Flags: core.SpellFlagNoOnCastComplete, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.03, - }), + }, Cast: core.CastConfig{ CD: core.Cooldown{ Timer: mage.NewTimer(), diff --git a/sim/mage/water_elemental.go b/sim/mage/water_elemental.go index 53a41f11ad..0f2ec32842 100644 --- a/sim/mage/water_elemental.go +++ b/sim/mage/water_elemental.go @@ -24,9 +24,9 @@ func (mage *Mage) registerSummonWaterElementalCD() { mage.SummonWaterElemental = mage.RegisterSpell(core.SpellConfig{ ActionID: core.ActionID{SpellID: 31687}, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.16, - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, @@ -135,9 +135,9 @@ func (we *WaterElemental) registerWaterboltSpell() { SpellSchool: core.SpellSchoolFrost, ProcMask: core.ProcMaskSpellDamage, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.01, - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, diff --git a/sim/paladin/avengers_shield.go b/sim/paladin/avengers_shield.go index f5343a2598..548afc757a 100644 --- a/sim/paladin/avengers_shield.go +++ b/sim/paladin/avengers_shield.go @@ -19,10 +19,10 @@ func (paladin *Paladin) registerAvengersShieldSpell() { ProcMask: core.ProcMaskMeleeMHSpecial, Flags: core.SpellFlagMeleeMetrics, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.26, Multiplier: 1 - 0.02*float64(paladin.Talents.Benediction), - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, diff --git a/sim/paladin/avenging_wrath.go b/sim/paladin/avenging_wrath.go index 23850a6b56..c7007866c0 100644 --- a/sim/paladin/avenging_wrath.go +++ b/sim/paladin/avenging_wrath.go @@ -33,9 +33,9 @@ func (paladin *Paladin) RegisterAvengingWrathCD() { ActionID: actionID, Flags: core.SpellFlagNoOnCastComplete, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.08, - }), + }, Cast: core.CastConfig{ CD: core.Cooldown{ Timer: paladin.NewTimer(), diff --git a/sim/paladin/consecration.go b/sim/paladin/consecration.go index 8b077f7ed5..62f86beab9 100644 --- a/sim/paladin/consecration.go +++ b/sim/paladin/consecration.go @@ -48,10 +48,10 @@ func (paladin *Paladin) registerConsecrationSpell() { ProcMask: core.ProcMaskEmpty, Flags: core.SpellFlagMeleeMetrics, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.22, Multiplier: 1 - 0.02*float64(paladin.Talents.Benediction), - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, diff --git a/sim/paladin/crusader_strike.go b/sim/paladin/crusader_strike.go index 8d7f37b3e7..b00bbcfea9 100644 --- a/sim/paladin/crusader_strike.go +++ b/sim/paladin/crusader_strike.go @@ -17,12 +17,12 @@ func (paladin *Paladin) registerCrusaderStrikeSpell() { ProcMask: core.ProcMaskMeleeMHSpecial, Flags: core.SpellFlagMeleeMetrics | core.SpellFlagIncludeTargetBonusDamage, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.05, Multiplier: 1 * (1 - 0.02*float64(paladin.Talents.Benediction)) * core.TernaryFloat64(paladin.HasMajorGlyph(proto.PaladinMajorGlyph_GlyphOfCrusaderStrike), 0.8, 1), - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, diff --git a/sim/paladin/divine_storm.go b/sim/paladin/divine_storm.go index 416d372293..13be4ead4a 100644 --- a/sim/paladin/divine_storm.go +++ b/sim/paladin/divine_storm.go @@ -19,10 +19,10 @@ func (paladin *Paladin) registerDivineStormSpell() { ProcMask: core.ProcMaskMeleeMHSpecial, Flags: core.SpellFlagMeleeMetrics | core.SpellFlagIncludeTargetBonusDamage, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.12, Multiplier: 1 - 0.02*float64(paladin.Talents.Benediction), - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, diff --git a/sim/paladin/exorcism.go b/sim/paladin/exorcism.go index dba641544c..b368d8ef41 100644 --- a/sim/paladin/exorcism.go +++ b/sim/paladin/exorcism.go @@ -14,10 +14,10 @@ func (paladin *Paladin) registerExorcismSpell() { ProcMask: core.ProcMaskSpellDamage, Flags: core.SpellFlagMeleeMetrics, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.08, Multiplier: 1 - 0.02*float64(paladin.Talents.Benediction), - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, diff --git a/sim/paladin/hammer_of_the_righteous.go b/sim/paladin/hammer_of_the_righteous.go index a530067845..e8d8fe3ab1 100644 --- a/sim/paladin/hammer_of_the_righteous.go +++ b/sim/paladin/hammer_of_the_righteous.go @@ -17,10 +17,10 @@ func (paladin *Paladin) registerHammerOfTheRighteousSpell() { ProcMask: core.ProcMaskMeleeMHSpecial, Flags: core.SpellFlagMeleeMetrics, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.06, Multiplier: 1 - 0.02*float64(paladin.Talents.Benediction), - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, diff --git a/sim/paladin/hammer_of_wrath.go b/sim/paladin/hammer_of_wrath.go index 76d3d61744..aabf92e464 100644 --- a/sim/paladin/hammer_of_wrath.go +++ b/sim/paladin/hammer_of_wrath.go @@ -14,10 +14,10 @@ func (paladin *Paladin) registerHammerOfWrathSpell() { ProcMask: core.ProcMaskMeleeMHSpecial, Flags: core.SpellFlagMeleeMetrics, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.12 * core.TernaryFloat64(paladin.HasMajorGlyph(proto.PaladinMajorGlyph_GlyphOfHammerOfWrath), 0, 1), Multiplier: 1 - 0.02*float64(paladin.Talents.Benediction), - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, diff --git a/sim/paladin/holy_shield.go b/sim/paladin/holy_shield.go index 3d4e39cc5a..f203d0a15b 100644 --- a/sim/paladin/holy_shield.go +++ b/sim/paladin/holy_shield.go @@ -57,9 +57,9 @@ func (paladin *Paladin) registerHolyShieldSpell() { ActionID: actionID, SpellSchool: core.SpellSchoolHoly, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.10, - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, diff --git a/sim/paladin/holy_wrath.go b/sim/paladin/holy_wrath.go index f26b0674eb..efe154eb04 100644 --- a/sim/paladin/holy_wrath.go +++ b/sim/paladin/holy_wrath.go @@ -16,10 +16,10 @@ func (paladin *Paladin) registerHolyWrathSpell() { ProcMask: core.ProcMaskSpellDamage, Flags: core.SpellFlagMeleeMetrics, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.20, Multiplier: 1 - 0.02*float64(paladin.Talents.Benediction), - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, diff --git a/sim/paladin/judgement.go b/sim/paladin/judgement.go index 89a0f457b7..464bd7a66d 100644 --- a/sim/paladin/judgement.go +++ b/sim/paladin/judgement.go @@ -22,10 +22,10 @@ func (paladin *Paladin) registerJudgementOfWisdomSpell(cdTimer *core.Timer) { ProcMask: core.ProcMaskEmpty, Flags: SpellFlagPrimaryJudgement, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.05, Multiplier: 1 - 0.02*float64(paladin.Talents.Benediction), - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, @@ -60,10 +60,10 @@ func (paladin *Paladin) registerJudgementOfLightSpell(cdTimer *core.Timer) { ProcMask: core.ProcMaskEmpty, Flags: SpellFlagPrimaryJudgement, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.05, Multiplier: 1 - 0.02*float64(paladin.Talents.Benediction), - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, diff --git a/sim/paladin/shield_of_righteousness.go b/sim/paladin/shield_of_righteousness.go index b21267b6fa..f074673de3 100644 --- a/sim/paladin/shield_of_righteousness.go +++ b/sim/paladin/shield_of_righteousness.go @@ -19,10 +19,10 @@ func (paladin *Paladin) registerShieldOfRighteousnessSpell() { ProcMask: core.ProcMaskMeleeMHSpecial, Flags: core.SpellFlagMeleeMetrics, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.06, Multiplier: 1 - 0.02*float64(paladin.Talents.Benediction), - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, diff --git a/sim/paladin/soc.go b/sim/paladin/soc.go index 90d6d3e363..afe5c8cbe0 100644 --- a/sim/paladin/soc.go +++ b/sim/paladin/soc.go @@ -160,10 +160,10 @@ func (paladin *Paladin) registerSealOfCommandSpellAndAura() { SpellSchool: core.SpellSchoolHoly, ProcMask: core.ProcMaskEmpty, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.14, Multiplier: 1 - 0.02*float64(paladin.Talents.Benediction), - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, diff --git a/sim/paladin/sor.go b/sim/paladin/sor.go index f0ed23b3a6..5b2a1ad87b 100644 --- a/sim/paladin/sor.go +++ b/sim/paladin/sor.go @@ -107,10 +107,10 @@ func (paladin *Paladin) registerSealOfRighteousnessSpellAndAura() { ActionID: auraActionID, // Seal of Righteousness self buff. SpellSchool: core.SpellSchoolHoly, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.14, Multiplier: 1 - 0.02*float64(paladin.Talents.Benediction), - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, diff --git a/sim/paladin/sov.go b/sim/paladin/sov.go index b068303eda..a0170e5120 100644 --- a/sim/paladin/sov.go +++ b/sim/paladin/sov.go @@ -174,10 +174,10 @@ func (paladin *Paladin) registerSealOfVengeanceSpellAndAura() { ActionID: auraActionID, // Seal of Vengeance self buff. SpellSchool: core.SpellSchoolHoly, - Cost: core.NewManaCost(core.ManaCostOptions{ + ManaCost: core.ManaCostOptions{ BaseCost: 0.14, Multiplier: 1 - 0.02*float64(paladin.Talents.Benediction), - }), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ GCD: core.GCDDefault, From ab636f1e87f7860c1a3972315f4e2b68b0a3d586 Mon Sep 17 00:00:00 2001 From: James Tanner Date: Wed, 11 Jan 2023 20:59:09 -0500 Subject: [PATCH 09/13] Update priest spells --- sim/priest/binding_heal.go | 17 +++++++---------- sim/priest/circle_of_healing.go | 21 ++++++++++----------- sim/priest/devouring_plague.go | 19 +++++++++---------- sim/priest/flash_heal.go | 24 +++++++++++------------- sim/priest/greater_heal.go | 24 +++++++++++------------- sim/priest/holy_fire.go | 14 ++++++-------- sim/priest/mind_blast.go | 20 ++++++++++---------- sim/priest/mind_flay.go | 20 +++++++++----------- sim/priest/mind_sear.go | 17 ++++++++--------- sim/priest/penance.go | 24 +++++++++++------------- sim/priest/power_infusion.go | 13 ++++--------- sim/priest/power_word_shield.go | 23 +++++++++++------------ sim/priest/prayer_of_healing.go | 22 ++++++++++------------ sim/priest/prayer_of_mending.go | 23 +++++++++++------------ sim/priest/renew.go | 12 +++++------- sim/priest/shadow/rotation.go | 3 ++- sim/priest/shadow_word_death.go | 18 ++++++++---------- sim/priest/shadow_word_pain.go | 12 +++++------- sim/priest/smite.go | 15 ++++++--------- sim/priest/vampiric_touch.go | 14 ++++++-------- 20 files changed, 160 insertions(+), 195 deletions(-) diff --git a/sim/priest/binding_heal.go b/sim/priest/binding_heal.go index a09eacba7c..2cd379d7c5 100644 --- a/sim/priest/binding_heal.go +++ b/sim/priest/binding_heal.go @@ -4,25 +4,22 @@ import ( "time" "github.com/wowsims/wotlk/sim/core" - "github.com/wowsims/wotlk/sim/core/stats" ) func (priest *Priest) registerBindingHealSpell() { - baseCost := .27 * priest.BaseMana spellCoeff := 0.8057 + 0.04*float64(priest.Talents.EmpoweredHealing) priest.BindingHeal = priest.RegisterSpell(core.SpellConfig{ - ActionID: core.ActionID{SpellID: 48120}, - SpellSchool: core.SpellSchoolHoly, - ProcMask: core.ProcMaskSpellHealing, - Flags: core.SpellFlagHelpful, - ResourceType: stats.Mana, - BaseCost: baseCost, + ActionID: core.ActionID{SpellID: 48120}, + SpellSchool: core.SpellSchoolHoly, + ProcMask: core.ProcMaskSpellHealing, + Flags: core.SpellFlagHelpful, + ManaCost: core.ManaCostOptions{ + BaseCost: 0.27, + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost, - GCD: core.GCDDefault, CastTime: time.Millisecond * 1500, }, diff --git a/sim/priest/circle_of_healing.go b/sim/priest/circle_of_healing.go index aa3c8ad695..376fcde25f 100644 --- a/sim/priest/circle_of_healing.go +++ b/sim/priest/circle_of_healing.go @@ -5,7 +5,6 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (priest *Priest) registerCircleOfHealingSpell() { @@ -13,22 +12,22 @@ func (priest *Priest) registerCircleOfHealingSpell() { return } - baseCost := .21 * priest.BaseMana numTargets := 5 + core.TernaryInt32(priest.HasMajorGlyph(proto.PriestMajorGlyph_GlyphOfCircleOfHealing), 1, 0) targets := priest.Env.Raid.GetFirstNPlayersOrPets(numTargets) priest.CircleOfHealing = priest.RegisterSpell(core.SpellConfig{ - ActionID: core.ActionID{SpellID: 48089}, - SpellSchool: core.SpellSchoolHoly, - ProcMask: core.ProcMaskSpellHealing, - Flags: core.SpellFlagHelpful, - ResourceType: stats.Mana, - BaseCost: baseCost, - + ActionID: core.ActionID{SpellID: 48089}, + SpellSchool: core.SpellSchoolHoly, + ProcMask: core.ProcMaskSpellHealing, + Flags: core.SpellFlagHelpful, + + ManaCost: core.ManaCostOptions{ + BaseCost: 0.21, + Multiplier: 1 - []float64{0, .04, .07, .10}[priest.Talents.MentalAgility], + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * (1 - []float64{0, .04, .07, .10}[priest.Talents.MentalAgility]), - GCD: core.GCDDefault, + GCD: core.GCDDefault, }, CD: core.Cooldown{ Timer: priest.NewTimer(), diff --git a/sim/priest/devouring_plague.go b/sim/priest/devouring_plague.go index 75da16756b..d3db7a4c54 100644 --- a/sim/priest/devouring_plague.go +++ b/sim/priest/devouring_plague.go @@ -5,27 +5,26 @@ import ( "time" "github.com/wowsims/wotlk/sim/core" - "github.com/wowsims/wotlk/sim/core/stats" ) func (priest *Priest) registerDevouringPlagueSpell() { actionID := core.ActionID{SpellID: 48300} - baseCost := priest.BaseMana * 0.25 target := priest.CurrentTarget priest.DpInitMultiplier = 8 * 0.1 * float64(priest.Talents.ImprovedDevouringPlague) priest.DevouringPlague = priest.RegisterSpell(core.SpellConfig{ - ActionID: actionID, - SpellSchool: core.SpellSchoolShadow, - ProcMask: core.ProcMaskSpellDamage, - Flags: core.SpellFlagDisease, - ResourceType: stats.Mana, - BaseCost: baseCost, + ActionID: actionID, + SpellSchool: core.SpellSchoolShadow, + ProcMask: core.ProcMaskSpellDamage, + Flags: core.SpellFlagDisease, + ManaCost: core.ManaCostOptions{ + BaseCost: 0.25, + Multiplier: 1 - []float64{0, .04, .07, .10}[priest.Talents.MentalAgility], + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * (1 - []float64{0, .04, .07, .10}[priest.Talents.MentalAgility]), - GCD: core.GCDDefault, + GCD: core.GCDDefault, }, }, diff --git a/sim/priest/flash_heal.go b/sim/priest/flash_heal.go index 216f5e65fe..98dad77f4d 100644 --- a/sim/priest/flash_heal.go +++ b/sim/priest/flash_heal.go @@ -5,27 +5,25 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (priest *Priest) registerFlashHealSpell() { - baseCost := .18 * priest.BaseMana spellCoeff := 0.8057 + 0.04*float64(priest.Talents.EmpoweredHealing) priest.FlashHeal = priest.RegisterSpell(core.SpellConfig{ - ActionID: core.ActionID{SpellID: 48071}, - SpellSchool: core.SpellSchoolHoly, - ProcMask: core.ProcMaskSpellHealing, - Flags: core.SpellFlagHelpful, - ResourceType: stats.Mana, - BaseCost: baseCost, - + ActionID: core.ActionID{SpellID: 48071}, + SpellSchool: core.SpellSchoolHoly, + ProcMask: core.ProcMaskSpellHealing, + Flags: core.SpellFlagHelpful, + + ManaCost: core.ManaCostOptions{ + BaseCost: 0.18, + Multiplier: 1 - + .05*float64(priest.Talents.ImprovedFlashHeal) - + core.TernaryFloat64(priest.HasMajorGlyph(proto.PriestMajorGlyph_GlyphOfFlashHeal), .1, 0), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * (1 - - .05*float64(priest.Talents.ImprovedFlashHeal) - - core.TernaryFloat64(priest.HasMajorGlyph(proto.PriestMajorGlyph_GlyphOfFlashHeal), .1, 0)), - GCD: core.GCDDefault, CastTime: time.Millisecond * 1500, }, diff --git a/sim/priest/greater_heal.go b/sim/priest/greater_heal.go index 71f5ad3751..bb6e3b3c8a 100644 --- a/sim/priest/greater_heal.go +++ b/sim/priest/greater_heal.go @@ -4,27 +4,25 @@ import ( "time" "github.com/wowsims/wotlk/sim/core" - "github.com/wowsims/wotlk/sim/core/stats" ) func (priest *Priest) registerGreaterHealSpell() { - baseCost := .32 * priest.BaseMana spellCoeff := 1.6114 + 0.08*float64(priest.Talents.EmpoweredHealing) priest.GreaterHeal = priest.RegisterSpell(core.SpellConfig{ - ActionID: core.ActionID{SpellID: 48063}, - SpellSchool: core.SpellSchoolHoly, - ProcMask: core.ProcMaskSpellHealing, - Flags: core.SpellFlagHelpful, - ResourceType: stats.Mana, - BaseCost: baseCost, - + ActionID: core.ActionID{SpellID: 48063}, + SpellSchool: core.SpellSchoolHoly, + ProcMask: core.ProcMaskSpellHealing, + Flags: core.SpellFlagHelpful, + + ManaCost: core.ManaCostOptions{ + BaseCost: 0.32, + Multiplier: 1 * + (1 - .05*float64(priest.Talents.ImprovedHealing)) * + core.TernaryFloat64(priest.HasSetBonus(ItemSetRegaliaOfFaith, 4), .95, 1), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * - (1 - .05*float64(priest.Talents.ImprovedHealing)) * - core.TernaryFloat64(priest.HasSetBonus(ItemSetRegaliaOfFaith, 4), .95, 1), - GCD: core.GCDDefault, CastTime: time.Second*3 - time.Millisecond*100*time.Duration(priest.Talents.DivineFury), }, diff --git a/sim/priest/holy_fire.go b/sim/priest/holy_fire.go index 8f17695b84..c5aa955741 100644 --- a/sim/priest/holy_fire.go +++ b/sim/priest/holy_fire.go @@ -6,23 +6,21 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (priest *Priest) RegisterHolyFireSpell(memeDream bool) { actionID := core.ActionID{SpellID: 48135} - baseCost := .11 * priest.BaseMana priest.HolyFire = priest.RegisterSpell(core.SpellConfig{ - ActionID: actionID, - SpellSchool: core.SpellSchoolHoly, - ProcMask: core.ProcMaskSpellDamage, - ResourceType: stats.Mana, - BaseCost: baseCost, + ActionID: actionID, + SpellSchool: core.SpellSchoolHoly, + ProcMask: core.ProcMaskSpellDamage, + ManaCost: core.ManaCostOptions{ + BaseCost: 0.11, + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost, GCD: core.GCDDefault, CastTime: time.Millisecond*2000 - time.Millisecond*100*time.Duration(priest.Talents.DivineFury), }, diff --git a/sim/priest/mind_blast.go b/sim/priest/mind_blast.go index 21e906aa4c..1f4ed620d3 100644 --- a/sim/priest/mind_blast.go +++ b/sim/priest/mind_blast.go @@ -5,30 +5,30 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (priest *Priest) registerMindBlastSpell() { - baseCost := priest.BaseMana * 0.17 * core.TernaryFloat64(priest.HasSetBonus(ItemSetValorous, 2), 0.9, 1) spellCoeff := 0.429 * (1 + 0.05*float64(priest.Talents.Misery)) + hasGlyphOfShadow := priest.HasGlyph(int32(proto.PriestMajorGlyph_GlyphOfShadow)) var replSrc core.ReplenishmentSource if priest.Talents.VampiricTouch { replSrc = priest.Env.Raid.NewReplenishmentSource(core.ActionID{SpellID: 48160}) } - hasGlyphOfShadow := priest.HasGlyph(int32(proto.PriestMajorGlyph_GlyphOfShadow)) - priest.MindBlast = priest.RegisterSpell(core.SpellConfig{ - ActionID: core.ActionID{SpellID: 48127}, - SpellSchool: core.SpellSchoolShadow, - ProcMask: core.ProcMaskSpellDamage, - ResourceType: stats.Mana, - BaseCost: baseCost, + ActionID: core.ActionID{SpellID: 48127}, + SpellSchool: core.SpellSchoolShadow, + ProcMask: core.ProcMaskSpellDamage, + ManaCost: core.ManaCostOptions{ + BaseCost: 0.17, + Multiplier: 1 * + (1 - 0.05*float64(priest.Talents.FocusedMind)) * + core.TernaryFloat64(priest.HasSetBonus(ItemSetValorous, 2), 0.9, 1), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * (1 - 0.05*float64(priest.Talents.FocusedMind)), GCD: core.GCDDefault, CastTime: time.Millisecond * 1500, }, diff --git a/sim/priest/mind_flay.go b/sim/priest/mind_flay.go index a8a33c02c8..adbf920f39 100644 --- a/sim/priest/mind_flay.go +++ b/sim/priest/mind_flay.go @@ -6,7 +6,6 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) // TODO Mind Flay (48156) now "periodically triggers" Mind Flay (58381), probably to allow haste to work. @@ -17,8 +16,6 @@ func (priest *Priest) MindFlayActionID(numTicks int32) core.ActionID { } func (priest *Priest) newMindFlaySpell(numTicks int32) *core.Spell { - baseCost := priest.BaseMana * 0.09 - channelTime := time.Second * time.Duration(numTicks) if priest.HasSetBonus(ItemSetCrimsonAcolyte, 4) { channelTime -= time.Duration(numTicks) * (time.Millisecond * 170) @@ -28,16 +25,17 @@ func (priest *Priest) newMindFlaySpell(numTicks int32) *core.Spell { miseryCoeff := 0.257 * (1 + 0.05*float64(priest.Talents.Misery)) return priest.RegisterSpell(core.SpellConfig{ - ActionID: priest.MindFlayActionID(numTicks), - SpellSchool: core.SpellSchoolShadow, - ProcMask: core.ProcMaskSpellDamage, - Flags: core.SpellFlagChanneled, - ResourceType: stats.Mana, - BaseCost: baseCost, - + ActionID: priest.MindFlayActionID(numTicks), + SpellSchool: core.SpellSchoolShadow, + ProcMask: core.ProcMaskSpellDamage, + Flags: core.SpellFlagChanneled, + + ManaCost: core.ManaCostOptions{ + BaseCost: 0.09, + Multiplier: 1 - 0.05*float64(priest.Talents.FocusedMind), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * (1 - 0.05*float64(priest.Talents.FocusedMind)), GCD: core.GCDDefault, ChannelTime: channelTime, }, diff --git a/sim/priest/mind_sear.go b/sim/priest/mind_sear.go index 100ca4654a..d7a0e301a5 100644 --- a/sim/priest/mind_sear.go +++ b/sim/priest/mind_sear.go @@ -6,7 +6,6 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) // TODO see Mind Flay: Mind Sear (53023) now "periodically triggers" Mind Sear (53022). @@ -17,20 +16,20 @@ func (priest *Priest) MindSearActionID(numTicks int32) core.ActionID { } func (priest *Priest) newMindSearSpell(numTicks int32) *core.Spell { - baseCost := priest.BaseMana * 0.28 channelTime := time.Second * time.Duration(numTicks) return priest.RegisterSpell(core.SpellConfig{ - ActionID: priest.MindSearActionID(numTicks), - SpellSchool: core.SpellSchoolShadow, - ProcMask: core.ProcMaskEmpty, - Flags: core.SpellFlagChanneled, - ResourceType: stats.Mana, - BaseCost: baseCost, + ActionID: priest.MindSearActionID(numTicks), + SpellSchool: core.SpellSchoolShadow, + ProcMask: core.ProcMaskEmpty, + Flags: core.SpellFlagChanneled, + ManaCost: core.ManaCostOptions{ + BaseCost: 0.28, + Multiplier: 1 - 0.05*float64(priest.Talents.FocusedMind), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * (1 - 0.05*float64(priest.Talents.FocusedMind)), GCD: core.GCDDefault, ChannelTime: channelTime, }, diff --git a/sim/priest/penance.go b/sim/priest/penance.go index 1509bd5a26..3bd39102a1 100644 --- a/sim/priest/penance.go +++ b/sim/priest/penance.go @@ -6,7 +6,6 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (priest *Priest) registerPenanceHealSpell() { @@ -23,8 +22,6 @@ func (priest *Priest) makePenanceSpell(isHeal bool) *core.Spell { } actionID := core.ActionID{SpellID: 53007} - baseCost := priest.BaseMana * 0.16 - penanceDots := make([]*core.Dot, len(priest.Env.AllUnits)) var procMask core.ProcMask @@ -37,18 +34,19 @@ func (priest *Priest) makePenanceSpell(isHeal bool) *core.Spell { } spell := priest.RegisterSpell(core.SpellConfig{ - ActionID: actionID, - SpellSchool: core.SpellSchoolHoly, - ProcMask: procMask, - Flags: flags, - ResourceType: stats.Mana, - BaseCost: baseCost, - + ActionID: actionID, + SpellSchool: core.SpellSchoolHoly, + ProcMask: procMask, + Flags: flags, + + ManaCost: core.ManaCostOptions{ + BaseCost: 0.16, + Multiplier: 1 * + (1 - 0.05*float64(priest.Talents.ImprovedHealing)) * + (1 - []float64{0, .04, .07, .10}[priest.Talents.MentalAgility]), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * - (1 - 0.05*float64(priest.Talents.ImprovedHealing)) * - (1 - []float64{0, .04, .07, .10}[priest.Talents.MentalAgility]), GCD: core.GCDDefault, ChannelTime: time.Second * 2, }, diff --git a/sim/priest/power_infusion.go b/sim/priest/power_infusion.go index 349d205ae2..49c3583d5b 100644 --- a/sim/priest/power_infusion.go +++ b/sim/priest/power_infusion.go @@ -4,7 +4,6 @@ import ( "time" "github.com/wowsims/wotlk/sim/core" - "github.com/wowsims/wotlk/sim/core/stats" ) func (priest *Priest) registerPowerInfusionCD() { @@ -13,7 +12,6 @@ func (priest *Priest) registerPowerInfusionCD() { } actionID := core.ActionID{SpellID: 10060, Tag: priest.Index} - baseCost := priest.BaseMana * 0.16 powerInfusionTargetAgent := priest.Party.Raid.GetPlayerFromRaidTarget(priest.SelfBuffs.PowerInfusionTarget) if powerInfusionTargetAgent == nil { @@ -26,13 +24,10 @@ func (priest *Priest) registerPowerInfusionCD() { ActionID: actionID, Flags: core.SpellFlagHelpful, - ResourceType: stats.Mana, - BaseCost: baseCost, - + ManaCost: core.ManaCostOptions{ + BaseCost: 0.16, + }, Cast: core.CastConfig{ - DefaultCast: core.Cast{ - Cost: baseCost, - }, CD: core.Cooldown{ Timer: priest.NewTimer(), Duration: time.Duration(float64(core.PowerInfusionCD) * (1 - .1*float64(priest.Talents.Aspiration))), @@ -49,7 +44,7 @@ func (priest *Priest) registerPowerInfusionCD() { Priority: core.CooldownPriorityBloodlust, Type: core.CooldownTypeMana, CanActivate: func(sim *core.Simulation, character *core.Character) bool { - return character.CurrentMana() >= baseCost + return character.CurrentMana() >= piSpell.DefaultCast.Cost }, ShouldActivate: func(sim *core.Simulation, character *core.Character) bool { // How can we determine the target will be able to continue casting diff --git a/sim/priest/power_word_shield.go b/sim/priest/power_word_shield.go index e41031336e..c36da93078 100644 --- a/sim/priest/power_word_shield.go +++ b/sim/priest/power_word_shield.go @@ -5,12 +5,10 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (priest *Priest) registerPowerWordShieldSpell() { actionID := core.ActionID{SpellID: 48066} - baseCost := 0.23 * priest.BaseMana coeff := 0.8057 + 0.08*float64(priest.Talents.BorrowedTime) wsDuration := time.Second*15 - @@ -28,18 +26,19 @@ func (priest *Priest) registerPowerWordShieldSpell() { var glyphHeal *core.Spell priest.PowerWordShield = priest.RegisterSpell(core.SpellConfig{ - ActionID: actionID, - SpellSchool: core.SpellSchoolHoly, - ProcMask: core.ProcMaskSpellHealing, - Flags: core.SpellFlagHelpful, - ResourceType: stats.Mana, - BaseCost: baseCost, - + ActionID: actionID, + SpellSchool: core.SpellSchoolHoly, + ProcMask: core.ProcMaskSpellHealing, + Flags: core.SpellFlagHelpful, + + ManaCost: core.ManaCostOptions{ + BaseCost: 0.23, + Multiplier: 1 - + []float64{0, .04, .07, .10}[priest.Talents.MentalAgility] - + core.TernaryFloat64(priest.Talents.SoulWarding, .15, 0), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * (1 - - []float64{0, .04, .07, .10}[priest.Talents.MentalAgility] - - core.TernaryFloat64(priest.Talents.SoulWarding, .15, 0)), GCD: core.GCDDefault, }, CD: cd, diff --git a/sim/priest/prayer_of_healing.go b/sim/priest/prayer_of_healing.go index 9905770dd6..cb39c05de8 100644 --- a/sim/priest/prayer_of_healing.go +++ b/sim/priest/prayer_of_healing.go @@ -6,27 +6,25 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (priest *Priest) registerPrayerOfHealingSpell() { - baseCost := .48 * priest.BaseMana - var glyphHots []*core.Dot priest.PrayerOfHealing = priest.RegisterSpell(core.SpellConfig{ - ActionID: core.ActionID{SpellID: 48072}, - SpellSchool: core.SpellSchoolHoly, - ProcMask: core.ProcMaskSpellHealing, - Flags: core.SpellFlagHelpful, - ResourceType: stats.Mana, - BaseCost: baseCost, + ActionID: core.ActionID{SpellID: 48072}, + SpellSchool: core.SpellSchoolHoly, + ProcMask: core.ProcMaskSpellHealing, + Flags: core.SpellFlagHelpful, + ManaCost: core.ManaCostOptions{ + BaseCost: 0.48, + Multiplier: 1 - + .1*float64(priest.Talents.HealingPrayers) - + core.TernaryFloat64(priest.HasSetBonus(ItemSetVestmentsOfAbsolution, 2), 0.1, 0), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * (1 - - .1*float64(priest.Talents.HealingPrayers) - - core.TernaryFloat64(priest.HasSetBonus(ItemSetVestmentsOfAbsolution, 2), 0.1, 0)), GCD: core.GCDDefault, CastTime: time.Second * 3, }, diff --git a/sim/priest/prayer_of_mending.go b/sim/priest/prayer_of_mending.go index e4eb2b07e9..9beaa8cb41 100644 --- a/sim/priest/prayer_of_mending.go +++ b/sim/priest/prayer_of_mending.go @@ -5,12 +5,10 @@ import ( "time" "github.com/wowsims/wotlk/sim/core" - "github.com/wowsims/wotlk/sim/core/stats" ) func (priest *Priest) registerPrayerOfMendingSpell() { actionID := core.ActionID{SpellID: 48113} - baseCost := 0.15 * priest.BaseMana pomAuras := make([]*core.Aura, len(priest.Env.AllUnits)) for _, unit := range priest.Env.AllUnits { @@ -55,18 +53,19 @@ func (priest *Priest) registerPrayerOfMendingSpell() { } priest.PrayerOfMending = priest.RegisterSpell(core.SpellConfig{ - ActionID: actionID, - SpellSchool: core.SpellSchoolHoly, - ProcMask: core.ProcMaskSpellHealing, - Flags: core.SpellFlagHelpful, - ResourceType: stats.Mana, - BaseCost: baseCost, - + ActionID: actionID, + SpellSchool: core.SpellSchoolHoly, + ProcMask: core.ProcMaskSpellHealing, + Flags: core.SpellFlagHelpful, + + ManaCost: core.ManaCostOptions{ + BaseCost: 0.15, + Multiplier: 1 * + (1 - .1*float64(priest.Talents.HealingPrayers)) * + (1 - []float64{0, .04, .07, .10}[priest.Talents.MentalAgility]), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * - (1 - .1*float64(priest.Talents.HealingPrayers)) * - (1 - []float64{0, .04, .07, .10}[priest.Talents.MentalAgility]), GCD: core.GCDDefault, }, CD: core.Cooldown{ diff --git a/sim/priest/renew.go b/sim/priest/renew.go index 98ea469e33..8ae9445a0b 100644 --- a/sim/priest/renew.go +++ b/sim/priest/renew.go @@ -6,12 +6,10 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (priest *Priest) registerRenewSpell() { actionID := core.ActionID{SpellID: 48068} - baseCost := 0.17 * priest.BaseMana spellCoeff := (1.88 + .05*float64(priest.Talents.EmpoweredRenew)) / 5 if priest.Talents.EmpoweredRenew > 0 { @@ -43,13 +41,13 @@ func (priest *Priest) registerRenewSpell() { ProcMask: core.ProcMaskSpellHealing, Flags: core.SpellFlagHelpful, - ResourceType: stats.Mana, - BaseCost: baseCost, - + ManaCost: core.ManaCostOptions{ + BaseCost: 0.17, + Multiplier: 1 - []float64{0, .04, .07, .10}[priest.Talents.MentalAgility], + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * (1 - []float64{0, .04, .07, .10}[priest.Talents.MentalAgility]), - GCD: core.GCDDefault, + GCD: core.GCDDefault, }, }, diff --git a/sim/priest/shadow/rotation.go b/sim/priest/shadow/rotation.go index cc40405006..63cfd660ee 100644 --- a/sim/priest/shadow/rotation.go +++ b/sim/priest/shadow/rotation.go @@ -157,7 +157,8 @@ func (spriest *ShadowPriest) chooseSpellIdeal(sim *core.Simulation) (*core.Spell spriest.MindBlast.SkipCastAndApplyEffects(sim, spriest.CurrentTarget) spriest.MindBlast.CD.UsePrePull(sim, sim.CurrentTime) } else { - spriest.SpendMana(sim, spriest.VampiricTouch.DefaultCast.Cost, spriest.VampiricTouch.ResourceMetrics) + spriest.VampiricTouch.Cost.MeetsRequirement(spriest.VampiricTouch) + spriest.VampiricTouch.Cost.SpendCost(sim, spriest.VampiricTouch) spriest.VampiricTouch.SkipCastAndApplyEffects(sim, spriest.CurrentTarget) } } diff --git a/sim/priest/shadow_word_death.go b/sim/priest/shadow_word_death.go index 4452dc3bcb..9dc0c8cb77 100644 --- a/sim/priest/shadow_word_death.go +++ b/sim/priest/shadow_word_death.go @@ -5,12 +5,9 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (priest *Priest) registerShadowWordDeathSpell() { - baseCost := priest.BaseMana * 0.12 - if priest.HasMajorGlyph(proto.PriestMajorGlyph_GlyphOfShadowWordDeath) { priest.RegisterResetEffect(func(sim *core.Simulation) { sim.RegisterExecutePhaseCallback(func(sim *core.Simulation, isExecute int) { @@ -24,16 +21,17 @@ func (priest *Priest) registerShadowWordDeathSpell() { hasGlyphOfShadow := priest.HasGlyph(int32(proto.PriestMajorGlyph_GlyphOfShadow)) priest.ShadowWordDeath = priest.RegisterSpell(core.SpellConfig{ - ActionID: core.ActionID{SpellID: 48158}, - SpellSchool: core.SpellSchoolShadow, - ProcMask: core.ProcMaskSpellDamage, - ResourceType: stats.Mana, - BaseCost: baseCost, + ActionID: core.ActionID{SpellID: 48158}, + SpellSchool: core.SpellSchoolShadow, + ProcMask: core.ProcMaskSpellDamage, + ManaCost: core.ManaCostOptions{ + BaseCost: 0.12, + Multiplier: 1 - []float64{0, .04, .07, .10}[priest.Talents.MentalAgility], + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * (1 - []float64{0, .04, .07, .10}[priest.Talents.MentalAgility]), - GCD: core.GCDDefault, + GCD: core.GCDDefault, }, CD: core.Cooldown{ Timer: priest.NewTimer(), diff --git a/sim/priest/shadow_word_pain.go b/sim/priest/shadow_word_pain.go index cfd99c0786..0a85c0b4cc 100644 --- a/sim/priest/shadow_word_pain.go +++ b/sim/priest/shadow_word_pain.go @@ -6,12 +6,10 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (priest *Priest) registerShadowWordPainSpell() { actionID := core.ActionID{SpellID: 48125} - baseCost := priest.BaseMana * 0.22 var glyphManaMetrics *core.ResourceMetrics if priest.HasGlyph(int32(proto.PriestMajorGlyph_GlyphOfShadowWordPain)) { @@ -23,13 +21,13 @@ func (priest *Priest) registerShadowWordPainSpell() { SpellSchool: core.SpellSchoolShadow, ProcMask: core.ProcMaskSpellDamage, - ResourceType: stats.Mana, - BaseCost: baseCost, - + ManaCost: core.ManaCostOptions{ + BaseCost: 0.22, + Multiplier: 1 - []float64{0, .04, .07, .10}[priest.Talents.MentalAgility], + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * (1 - []float64{0, .04, .07, .10}[priest.Talents.MentalAgility]), - GCD: core.GCDDefault, + GCD: core.GCDDefault, }, }, diff --git a/sim/priest/smite.go b/sim/priest/smite.go index 669469fbfb..bbc9895943 100644 --- a/sim/priest/smite.go +++ b/sim/priest/smite.go @@ -4,22 +4,19 @@ import ( "time" "github.com/wowsims/wotlk/sim/core" - "github.com/wowsims/wotlk/sim/core/stats" ) func (priest *Priest) RegisterSmiteSpell(memeDream bool) { - baseCost := .15 * priest.BaseMana - priest.Smite = priest.RegisterSpell(core.SpellConfig{ - ActionID: core.ActionID{SpellID: 48123}, - SpellSchool: core.SpellSchoolHoly, - ProcMask: core.ProcMaskSpellDamage, - ResourceType: stats.Mana, - BaseCost: baseCost, + ActionID: core.ActionID{SpellID: 48123}, + SpellSchool: core.SpellSchoolHoly, + ProcMask: core.ProcMaskSpellDamage, + ManaCost: core.ManaCostOptions{ + BaseCost: 0.15, + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost, GCD: core.GCDDefault, CastTime: time.Millisecond*2500 - time.Millisecond*100*time.Duration(priest.Talents.DivineFury), }, diff --git a/sim/priest/vampiric_touch.go b/sim/priest/vampiric_touch.go index 43e0aeef30..53c7d2913a 100644 --- a/sim/priest/vampiric_touch.go +++ b/sim/priest/vampiric_touch.go @@ -5,23 +5,21 @@ import ( "time" "github.com/wowsims/wotlk/sim/core" - "github.com/wowsims/wotlk/sim/core/stats" ) func (priest *Priest) registerVampiricTouchSpell() { actionID := core.ActionID{SpellID: 48160} - baseCost := priest.BaseMana * 0.16 priest.VampiricTouch = priest.RegisterSpell(core.SpellConfig{ - ActionID: actionID, - SpellSchool: core.SpellSchoolShadow, - ProcMask: core.ProcMaskSpellDamage, - ResourceType: stats.Mana, - BaseCost: baseCost, + ActionID: actionID, + SpellSchool: core.SpellSchoolShadow, + ProcMask: core.ProcMaskSpellDamage, + ManaCost: core.ManaCostOptions{ + BaseCost: 0.16, + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost, GCD: core.GCDDefault, CastTime: time.Millisecond * 1500, }, From ba30f8b7a934ea9ce07c7783c48f262e4b0c8a60 Mon Sep 17 00:00:00 2001 From: James Tanner Date: Wed, 11 Jan 2023 21:02:29 -0500 Subject: [PATCH 10/13] Fix spriest diff --- sim/priest/shadow/rotation.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sim/priest/shadow/rotation.go b/sim/priest/shadow/rotation.go index 63cfd660ee..1705300ef5 100644 --- a/sim/priest/shadow/rotation.go +++ b/sim/priest/shadow/rotation.go @@ -157,8 +157,7 @@ func (spriest *ShadowPriest) chooseSpellIdeal(sim *core.Simulation) (*core.Spell spriest.MindBlast.SkipCastAndApplyEffects(sim, spriest.CurrentTarget) spriest.MindBlast.CD.UsePrePull(sim, sim.CurrentTime) } else { - spriest.VampiricTouch.Cost.MeetsRequirement(spriest.VampiricTouch) - spriest.VampiricTouch.Cost.SpendCost(sim, spriest.VampiricTouch) + spriest.SpendMana(sim, spriest.VampiricTouch.DefaultCast.Cost, spriest.VampiricTouch.Cost.(*core.ManaCost).ResourceMetrics) spriest.VampiricTouch.SkipCastAndApplyEffects(sim, spriest.CurrentTarget) } } From 483eea42c60c0bca415ba11e43cccb3d685dc7f5 Mon Sep 17 00:00:00 2001 From: James Tanner Date: Wed, 11 Jan 2023 21:22:06 -0500 Subject: [PATCH 11/13] Update shaman spells --- sim/core/mana.go | 3 +- sim/core/spell.go | 2 +- sim/shaman/bloodlust.go | 12 ++++---- sim/shaman/chain_lightning.go | 2 +- sim/shaman/electric_spell.go | 31 ++++++-------------- sim/shaman/feral_spirit.go | 12 +++----- sim/shaman/fire_elemental_spells.go | 33 +++++++++------------ sim/shaman/fire_elemental_totem.go | 11 +++---- sim/shaman/fire_totems.go | 45 ++++++++++++++--------------- sim/shaman/firenova.go | 19 +++++------- sim/shaman/lavaburst.go | 17 +++++------ sim/shaman/lavalash.go | 18 +++++------- sim/shaman/lightning_bolt.go | 7 +---- sim/shaman/shocks.go | 33 ++++++++++----------- sim/shaman/stormstrike.go | 21 +++++--------- sim/shaman/totems.go | 29 +++++++++---------- 16 files changed, 124 insertions(+), 171 deletions(-) diff --git a/sim/core/mana.go b/sim/core/mana.go index 0323607a96..5d5d84d650 100644 --- a/sim/core/mana.go +++ b/sim/core/mana.go @@ -296,6 +296,7 @@ func (mb *manaBar) reset() { type ManaCostOptions struct { BaseCost float64 + FlatCost float64 // Alternative to BaseCost for giving a flat value. Multiplier float64 // It's OK to leave this at 0, will default to 1. } type ManaCost struct { @@ -304,7 +305,7 @@ type ManaCost struct { func newManaCost(spell *Spell, options ManaCostOptions) *ManaCost { spell.ResourceType = stats.Mana - spell.BaseCost = options.BaseCost * spell.Unit.BaseMana + spell.BaseCost = TernaryFloat64(options.FlatCost > 0, options.FlatCost, options.BaseCost*spell.Unit.BaseMana) spell.DefaultCast.Cost = spell.BaseCost * TernaryFloat64(options.Multiplier == 0, 1, options.Multiplier) return &ManaCost{ diff --git a/sim/core/spell.go b/sim/core/spell.go index 6efffe9af3..e2ca3f01f9 100644 --- a/sim/core/spell.go +++ b/sim/core/spell.go @@ -211,7 +211,7 @@ func (unit *Unit) RegisterSpell(config SpellConfig) *Spell { spell.SchoolIndex = stats.SchoolIndexShadow } - if config.ManaCost.BaseCost != 0 { + if config.ManaCost.BaseCost != 0 || config.ManaCost.FlatCost != 0 { spell.Cost = newManaCost(spell, config.ManaCost) } diff --git a/sim/shaman/bloodlust.go b/sim/shaman/bloodlust.go index 8539d7aacb..fc193c86c1 100644 --- a/sim/shaman/bloodlust.go +++ b/sim/shaman/bloodlust.go @@ -2,7 +2,6 @@ package shaman import ( "github.com/wowsims/wotlk/sim/core" - "github.com/wowsims/wotlk/sim/core/stats" ) func (shaman *Shaman) BloodlustActionID() core.ActionID { @@ -25,17 +24,16 @@ func (shaman *Shaman) registerBloodlustCD() { } } - baseCost := shaman.BaseMana * 0.26 bloodlustSpell := shaman.RegisterSpell(core.SpellConfig{ ActionID: actionID, - ResourceType: stats.Mana, - BaseCost: baseCost, - + ManaCost: core.ManaCostOptions{ + BaseCost: 0.26, + Multiplier: 1 - 0.02*float64(shaman.Talents.MentalQuickness), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * (1 - 0.02*float64(shaman.Talents.MentalQuickness)), - GCD: core.GCDDefault, + GCD: core.GCDDefault, }, CD: core.Cooldown{ Timer: shaman.NewTimer(), diff --git a/sim/shaman/chain_lightning.go b/sim/shaman/chain_lightning.go index 7b75968bb9..05302f0343 100644 --- a/sim/shaman/chain_lightning.go +++ b/sim/shaman/chain_lightning.go @@ -19,7 +19,7 @@ func (shaman *Shaman) registerChainLightningSpell() { func (shaman *Shaman) newChainLightningSpell(isLightningOverload bool) *core.Spell { spellConfig := shaman.newElectricSpellConfig( core.ActionID{SpellID: 49271}, - 0.26*shaman.BaseMana, + 0.26, time.Millisecond*2000, isLightningOverload) diff --git a/sim/shaman/electric_spell.go b/sim/shaman/electric_spell.go index a4ee6c1e16..c29452aab6 100644 --- a/sim/shaman/electric_spell.go +++ b/sim/shaman/electric_spell.go @@ -4,7 +4,6 @@ import ( "time" "github.com/wowsims/wotlk/sim/core" - "github.com/wowsims/wotlk/sim/core/stats" ) // Totem Item IDs @@ -24,28 +23,21 @@ const ( CastTagLightningOverload int32 = 6 ) -// Mana cost numbers based on in-game testing: -// -// With 5/5 convection: -// Normal: 270, w/ EF: 150 -// -// With 5/5 convection and TotPE equipped: -// Normal: 246, w/ EF: 136 - // Shared precomputation logic for LB and CL. func (shaman *Shaman) newElectricSpellConfig(actionID core.ActionID, baseCost float64, baseCastTime time.Duration, isLightningOverload bool) core.SpellConfig { spell := core.SpellConfig{ - ActionID: actionID, - SpellSchool: core.SpellSchoolNature, - ProcMask: core.ProcMaskSpellDamage, - Flags: SpellFlagElectric | SpellFlagFocusable, - ResourceType: stats.Mana, - BaseCost: baseCost, + ActionID: actionID, + SpellSchool: core.SpellSchoolNature, + ProcMask: core.ProcMaskSpellDamage, + Flags: SpellFlagElectric | SpellFlagFocusable, + ManaCost: core.ManaCostOptions{ + BaseCost: core.TernaryFloat64(isLightningOverload, 0, baseCost), + Multiplier: 1 - 0.02*float64(shaman.Talents.Convection), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost, - CastTime: baseCastTime, + CastTime: baseCastTime - time.Millisecond*100*time.Duration(shaman.Talents.LightningMastery), GCD: core.GCDDefault, }, }, @@ -61,16 +53,11 @@ func (shaman *Shaman) newElectricSpellConfig(actionID core.ActionID, baseCost fl if isLightningOverload { spell.ActionID.Tag = CastTagLightningOverload - spell.ResourceType = 0 spell.Cast.DefaultCast.CastTime = 0 spell.Cast.DefaultCast.GCD = 0 spell.Cast.DefaultCast.Cost = 0 spell.DamageMultiplier *= 0.5 spell.ThreatMultiplier = 0 - } else if shaman.Talents.LightningMastery > 0 { - // Convection applies against the base cost of the spell. - spell.Cast.DefaultCast.Cost -= baseCost * float64(shaman.Talents.Convection) * 0.02 - spell.Cast.DefaultCast.CastTime -= time.Millisecond * 100 * time.Duration(shaman.Talents.LightningMastery) } return spell diff --git a/sim/shaman/feral_spirit.go b/sim/shaman/feral_spirit.go index 62442cce08..f8c49f35ca 100644 --- a/sim/shaman/feral_spirit.go +++ b/sim/shaman/feral_spirit.go @@ -4,7 +4,6 @@ import ( "time" "github.com/wowsims/wotlk/sim/core" - "github.com/wowsims/wotlk/sim/core/stats" ) func (shaman *Shaman) registerFeralSpirit() { @@ -12,8 +11,6 @@ func (shaman *Shaman) registerFeralSpirit() { return } - manaCost := 0.12 * shaman.BaseMana - spiritWolvesActiveAura := shaman.RegisterAura(core.Aura{ Label: "Feral Spirit", ActionID: core.ActionID{SpellID: 51533}, @@ -23,13 +20,12 @@ func (shaman *Shaman) registerFeralSpirit() { shaman.FeralSpirit = shaman.RegisterSpell(core.SpellConfig{ ActionID: core.ActionID{SpellID: 51533}, - ResourceType: stats.Mana, - BaseCost: manaCost, - + ManaCost: core.ManaCostOptions{ + BaseCost: 0.12, + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: manaCost, - GCD: core.GCDDefault, + GCD: core.GCDDefault, }, IgnoreHaste: true, CD: core.Cooldown{ diff --git a/sim/shaman/fire_elemental_spells.go b/sim/shaman/fire_elemental_spells.go index 10139fc95e..139269392b 100644 --- a/sim/shaman/fire_elemental_spells.go +++ b/sim/shaman/fire_elemental_spells.go @@ -5,23 +5,20 @@ import ( "time" "github.com/wowsims/wotlk/sim/core" - "github.com/wowsims/wotlk/sim/core/stats" ) func (fireElemental *FireElemental) registerFireBlast() { - var manaCost float64 = 276 - fireElemental.FireBlast = fireElemental.RegisterSpell(core.SpellConfig{ - ActionID: core.ActionID{SpellID: 13339}, - SpellSchool: core.SpellSchoolFire, - ProcMask: core.ProcMaskSpellDamage, - ResourceType: stats.Mana, - BaseCost: manaCost, + ActionID: core.ActionID{SpellID: 13339}, + SpellSchool: core.SpellSchoolFire, + ProcMask: core.ProcMaskSpellDamage, + ManaCost: core.ManaCostOptions{ + FlatCost: 276, + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: manaCost, - GCD: core.GCDDefault, + GCD: core.GCDDefault, }, IgnoreHaste: true, CD: core.Cooldown{ @@ -40,22 +37,19 @@ func (fireElemental *FireElemental) registerFireBlast() { spell.CalcAndDealDamage(sim, target, baseDamage, spell.OutcomeMagicHitAndCrit) }, }) - } func (fireElemental *FireElemental) registerFireNova() { - var manaCost float64 = 207 - fireElemental.FireNova = fireElemental.RegisterSpell(core.SpellConfig{ - ActionID: core.ActionID{SpellID: 12470}, - SpellSchool: core.SpellSchoolFire, - ProcMask: core.ProcMaskSpellDamage, - ResourceType: stats.Mana, - BaseCost: manaCost, + ActionID: core.ActionID{SpellID: 12470}, + SpellSchool: core.SpellSchoolFire, + ProcMask: core.ProcMaskSpellDamage, + ManaCost: core.ManaCostOptions{ + FlatCost: 207, + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: manaCost, GCD: core.GCDDefault, CastTime: time.Second * 2, }, @@ -81,7 +75,6 @@ func (fireElemental *FireElemental) registerFireNova() { } }, }) - } func (fireElemental *FireElemental) registerFireShieldAura() { diff --git a/sim/shaman/fire_elemental_totem.go b/sim/shaman/fire_elemental_totem.go index 44b88d5f9e..0f1b4046fe 100644 --- a/sim/shaman/fire_elemental_totem.go +++ b/sim/shaman/fire_elemental_totem.go @@ -5,7 +5,6 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) const fireTotemDuration time.Duration = time.Second * 120 @@ -16,7 +15,6 @@ func (shaman *Shaman) registerFireElementalTotem() { } actionID := core.ActionID{SpellID: 2894} - manaCost := 0.23 * shaman.BaseMana fireElementalAura := shaman.RegisterAura(core.Aura{ Label: "Fire Elemental Totem", @@ -27,13 +25,12 @@ func (shaman *Shaman) registerFireElementalTotem() { shaman.FireElementalTotem = shaman.RegisterSpell(core.SpellConfig{ ActionID: actionID, - ResourceType: stats.Mana, - BaseCost: manaCost, - + ManaCost: core.ManaCostOptions{ + BaseCost: 0.23, + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: manaCost, - GCD: core.GCDDefault, + GCD: core.GCDDefault, }, CD: core.Cooldown{ Timer: shaman.NewTimer(), diff --git a/sim/shaman/fire_totems.go b/sim/shaman/fire_totems.go index ea0eeb2a9d..ad8836054f 100644 --- a/sim/shaman/fire_totems.go +++ b/sim/shaman/fire_totems.go @@ -6,26 +6,25 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (shaman *Shaman) registerSearingTotemSpell() { actionID := core.ActionID{SpellID: 58704} - baseCost := 0.07 * shaman.BaseMana shaman.SearingTotem = shaman.RegisterSpell(core.SpellConfig{ - ActionID: actionID, - SpellSchool: core.SpellSchoolFire, - ProcMask: core.ProcMaskEmpty, - Flags: SpellFlagTotem, - ResourceType: stats.Mana, - BaseCost: baseCost, - + ActionID: actionID, + SpellSchool: core.SpellSchoolFire, + ProcMask: core.ProcMaskEmpty, + Flags: SpellFlagTotem, + + ManaCost: core.ManaCostOptions{ + BaseCost: 0.07, + Multiplier: 1 - + 0.05*float64(shaman.Talents.TotemicFocus) - + 0.02*float64(shaman.Talents.MentalQuickness), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost - - baseCost*float64(shaman.Talents.TotemicFocus)*0.05 - - baseCost*float64(shaman.Talents.MentalQuickness)*0.02, GCD: time.Second, }, }, @@ -87,21 +86,21 @@ func (shaman *Shaman) registerSearingTotemSpell() { func (shaman *Shaman) registerMagmaTotemSpell() { actionID := core.ActionID{SpellID: 58734} - baseCost := 0.27 * shaman.BaseMana shaman.MagmaTotem = shaman.RegisterSpell(core.SpellConfig{ - ActionID: actionID, - SpellSchool: core.SpellSchoolFire, - ProcMask: core.ProcMaskEmpty, - Flags: SpellFlagTotem, - ResourceType: stats.Mana, - BaseCost: baseCost, - + ActionID: actionID, + SpellSchool: core.SpellSchoolFire, + ProcMask: core.ProcMaskEmpty, + Flags: SpellFlagTotem, + + ManaCost: core.ManaCostOptions{ + BaseCost: 0.27, + Multiplier: 1 - + 0.05*float64(shaman.Talents.TotemicFocus) - + 0.02*float64(shaman.Talents.MentalQuickness), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost - - baseCost*float64(shaman.Talents.TotemicFocus)*0.05 - - baseCost*float64(shaman.Talents.MentalQuickness)*0.02, GCD: time.Second, }, }, diff --git a/sim/shaman/firenova.go b/sim/shaman/firenova.go index f8dc20dcc6..b3772a89b8 100644 --- a/sim/shaman/firenova.go +++ b/sim/shaman/firenova.go @@ -5,28 +5,25 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (shaman *Shaman) registerFireNovaSpell() { - manaCost := 0.22 * shaman.BaseMana - fireNovaGlyphCDReduction := core.TernaryInt32(shaman.HasMajorGlyph(proto.ShamanMajorGlyph_GlyphOfFireNova), 3, 0) impFireNovaCDReduction := shaman.Talents.ImprovedFireNova * 2 fireNovaCooldown := 10 - fireNovaGlyphCDReduction - impFireNovaCDReduction shaman.FireNova = shaman.RegisterSpell(core.SpellConfig{ - ActionID: core.ActionID{SpellID: 61657}, - SpellSchool: core.SpellSchoolFire, - ProcMask: core.ProcMaskSpellDamage, - Flags: SpellFlagFocusable, - ResourceType: stats.Mana, - BaseCost: manaCost, + ActionID: core.ActionID{SpellID: 61657}, + SpellSchool: core.SpellSchoolFire, + ProcMask: core.ProcMaskSpellDamage, + Flags: SpellFlagFocusable, + ManaCost: core.ManaCostOptions{ + BaseCost: 0.22, + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: manaCost, - GCD: core.GCDDefault, + GCD: core.GCDDefault, }, CD: core.Cooldown{ Timer: shaman.NewTimer(), diff --git a/sim/shaman/lavaburst.go b/sim/shaman/lavaburst.go index fbd9afb82b..c75c3110f1 100644 --- a/sim/shaman/lavaburst.go +++ b/sim/shaman/lavaburst.go @@ -6,12 +6,10 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (shaman *Shaman) registerLavaBurstSpell() { actionID := core.ActionID{SpellID: 60043} - baseCost := 0.1 * shaman.BaseMana dmgBonus := core.TernaryFloat64(shaman.Equip[core.ItemSlotRanged].ID == VentureCoLightningRod, 121, 0) + core.TernaryFloat64(shaman.Equip[core.ItemSlotRanged].ID == ThunderfallTotem, 215, 0) spellCoeff := 0.5714 + @@ -52,16 +50,17 @@ func (shaman *Shaman) registerLavaBurstSpell() { } shaman.LavaBurst = shaman.RegisterSpell(core.SpellConfig{ - ActionID: actionID, - SpellSchool: core.SpellSchoolFire, - ProcMask: core.ProcMaskSpellDamage, - Flags: SpellFlagFocusable, - ResourceType: stats.Mana, - BaseCost: baseCost, + ActionID: actionID, + SpellSchool: core.SpellSchoolFire, + ProcMask: core.ProcMaskSpellDamage, + Flags: SpellFlagFocusable, + ManaCost: core.ManaCostOptions{ + BaseCost: 0.1, + Multiplier: 1 - 0.02*float64(shaman.Talents.Convection), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * (1 - float64(shaman.Talents.Convection)*0.02), CastTime: time.Second*2 - time.Millisecond*100*time.Duration(shaman.Talents.LightningMastery), GCD: core.GCDDefault, }, diff --git a/sim/shaman/lavalash.go b/sim/shaman/lavalash.go index 42bde82076..1cf2d644e7 100644 --- a/sim/shaman/lavalash.go +++ b/sim/shaman/lavalash.go @@ -22,8 +22,6 @@ func (shaman *Shaman) registerLavaLashSpell() { return } - manaCost := 0.04 * shaman.BaseMana - flatDamageBonus := core.TernaryFloat64(shaman.Equip[core.ItemSlotRanged].ID == VentureCoFlameSlicer, 25, 0) imbueMultiplier := 1.0 @@ -47,17 +45,17 @@ func (shaman *Shaman) registerLavaLashSpell() { } shaman.LavaLash = shaman.RegisterSpell(core.SpellConfig{ - ActionID: core.ActionID{SpellID: 60103}, - SpellSchool: core.SpellSchoolFire, - ProcMask: core.ProcMaskMeleeOHSpecial, - Flags: core.SpellFlagMeleeMetrics, - ResourceType: stats.Mana, - BaseCost: manaCost, + ActionID: core.ActionID{SpellID: 60103}, + SpellSchool: core.SpellSchoolFire, + ProcMask: core.ProcMaskMeleeOHSpecial, + Flags: core.SpellFlagMeleeMetrics, + ManaCost: core.ManaCostOptions{ + BaseCost: 0.04, + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: manaCost, - GCD: core.GCDDefault, + GCD: core.GCDDefault, }, IgnoreHaste: true, CD: core.Cooldown{ diff --git a/sim/shaman/lightning_bolt.go b/sim/shaman/lightning_bolt.go index f24b5b2e40..1fecc9e331 100644 --- a/sim/shaman/lightning_bolt.go +++ b/sim/shaman/lightning_bolt.go @@ -28,14 +28,9 @@ func (shaman *Shaman) RegisterMaelstromLightningBoltSpells(minStacks int32) []*c } func (shaman *Shaman) newLightningBoltSpellConfig(isLightningOverload bool) core.SpellConfig { - baseCost := 0.1 * shaman.BaseMana - if shaman.HasSetBonus(ItemSetEarthShatterGarb, 2) { - baseCost -= baseCost * 0.05 - } - spellConfig := shaman.newElectricSpellConfig( core.ActionID{SpellID: 49238}, - baseCost, + 0.1*core.TernaryFloat64(shaman.HasSetBonus(ItemSetEarthShatterGarb, 2), 0.95, 1), time.Millisecond*2500, isLightningOverload) diff --git a/sim/shaman/shocks.go b/sim/shaman/shocks.go index d06d031355..0cd0965277 100644 --- a/sim/shaman/shocks.go +++ b/sim/shaman/shocks.go @@ -6,7 +6,6 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (shaman *Shaman) ShockCD() time.Duration { @@ -16,23 +15,23 @@ func (shaman *Shaman) ShockCD() time.Duration { // Shared logic for all shocks. func (shaman *Shaman) newShockSpellConfig(spellID int32, spellSchool core.SpellSchool, baseCost float64, shockTimer *core.Timer) core.SpellConfig { actionID := core.ActionID{SpellID: spellID} - cost := baseCost return core.SpellConfig{ - ActionID: actionID, - SpellSchool: spellSchool, - ProcMask: core.ProcMaskSpellDamage, - Flags: SpellFlagShock, - ResourceType: stats.Mana, - BaseCost: cost, - + ActionID: actionID, + SpellSchool: spellSchool, + ProcMask: core.ProcMaskSpellDamage, + Flags: SpellFlagShock, + + ManaCost: core.ManaCostOptions{ + BaseCost: baseCost, + Multiplier: 1 - + core.TernaryFloat64(shaman.Talents.ShamanisticFocus, 0.45, 0) - + 0.02*float64(shaman.Talents.Convection) - + 0.02*float64(shaman.Talents.MentalQuickness) - + core.TernaryFloat64(shaman.HasSetBonus(ItemSetSkyshatterHarness, 2), 0.1, 0), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: cost - - baseCost*(core.TernaryFloat64(shaman.Talents.ShamanisticFocus, 0.45, 0)+ - float64(shaman.Talents.Convection)*0.02+ - float64(shaman.Talents.MentalQuickness)*0.02+ - core.TernaryFloat64(shaman.HasSetBonus(ItemSetSkyshatterHarness, 2), 0.1, 0)), GCD: core.GCDDefault, }, ModifyCast: func(_ *core.Simulation, spell *core.Spell, cast *core.Cast) { @@ -54,7 +53,7 @@ func (shaman *Shaman) newShockSpellConfig(spellID int32, spellSchool core.SpellS } func (shaman *Shaman) registerEarthShockSpell(shockTimer *core.Timer) { - config := shaman.newShockSpellConfig(49231, core.SpellSchoolNature, 0.18*shaman.BaseMana, shockTimer) + config := shaman.newShockSpellConfig(49231, core.SpellSchoolNature, 0.18, shockTimer) config.ApplyEffects = func(sim *core.Simulation, target *core.Unit, spell *core.Spell) { baseDamage := sim.Roll(854, 900) + 0.386*spell.SpellPower() spell.CalcAndDealDamage(sim, target, baseDamage, spell.OutcomeMagicHitAndCrit) @@ -67,7 +66,7 @@ const FlameshockID = 49233 func (shaman *Shaman) registerFlameShockSpell(shockTimer *core.Timer) { actionID := core.ActionID{SpellID: FlameshockID} - config := shaman.newShockSpellConfig(FlameshockID, core.SpellSchoolFire, 0.17*shaman.BaseMana, shockTimer) + config := shaman.newShockSpellConfig(FlameshockID, core.SpellSchoolFire, 0.17, shockTimer) config.Cast.CD.Duration -= time.Duration(shaman.Talents.BoomingEchoes) * time.Second config.CritMultiplier = shaman.ElementalCritMultiplier(core.TernaryFloat64(shaman.HasMajorGlyph(proto.ShamanMajorGlyph_GlyphOfFlameShock), 0.6, 0)) @@ -124,7 +123,7 @@ func (shaman *Shaman) registerFlameShockSpell(shockTimer *core.Timer) { } func (shaman *Shaman) registerFrostShockSpell(shockTimer *core.Timer) { - config := shaman.newShockSpellConfig(49236, core.SpellSchoolFrost, 0.18*shaman.BaseMana, shockTimer) + config := shaman.newShockSpellConfig(49236, core.SpellSchoolFrost, 0.18, shockTimer) config.Cast.CD.Duration -= time.Duration(shaman.Talents.BoomingEchoes) * time.Second config.DamageMultiplier += 0.1 * float64(shaman.Talents.BoomingEchoes) config.ThreatMultiplier *= 2 diff --git a/sim/shaman/stormstrike.go b/sim/shaman/stormstrike.go index 00713f1bd1..4a3a0cda5b 100644 --- a/sim/shaman/stormstrike.go +++ b/sim/shaman/stormstrike.go @@ -84,11 +84,6 @@ func (shaman *Shaman) registerStormstrikeSpell() { mhHit := shaman.newStormstrikeHitSpell(true) ohHit := shaman.newStormstrikeHitSpell(false) - baseCost := 0.08 * shaman.BaseMana - if shaman.Equip[core.ItemSlotRanged].ID == StormfuryTotem { - baseCost -= 22 - } - ssDebuffAura := shaman.StormstrikeDebuffAura(shaman.CurrentTarget) var skyshatterAura *core.Aura @@ -107,17 +102,17 @@ func (shaman *Shaman) registerStormstrikeSpell() { impSSChance := 0.5 * float64(shaman.Talents.ImprovedStormstrike) shaman.Stormstrike = shaman.RegisterSpell(core.SpellConfig{ - ActionID: StormstrikeActionID, - SpellSchool: core.SpellSchoolPhysical, - ProcMask: core.ProcMaskMeleeMHSpecial, - Flags: core.SpellFlagMeleeMetrics, - ResourceType: stats.Mana, - BaseCost: baseCost, + ActionID: StormstrikeActionID, + SpellSchool: core.SpellSchoolPhysical, + ProcMask: core.ProcMaskMeleeMHSpecial, + Flags: core.SpellFlagMeleeMetrics, + ManaCost: core.ManaCostOptions{ + BaseCost: 0.08, + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost, - GCD: core.GCDDefault, + GCD: core.GCDDefault, }, IgnoreHaste: true, CD: core.Cooldown{ diff --git a/sim/shaman/totems.go b/sim/shaman/totems.go index 1ec97fe7f0..95ac098269 100644 --- a/sim/shaman/totems.go +++ b/sim/shaman/totems.go @@ -5,7 +5,6 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (shaman *Shaman) newTotemSpellConfig(baseCost float64, spellID int32) core.SpellConfig { @@ -13,14 +12,14 @@ func (shaman *Shaman) newTotemSpellConfig(baseCost float64, spellID int32) core. ActionID: core.ActionID{SpellID: spellID}, Flags: SpellFlagTotem, - ResourceType: stats.Mana, - BaseCost: baseCost, - + ManaCost: core.ManaCostOptions{ + BaseCost: baseCost, + Multiplier: 1 - + 0.05*float64(shaman.Talents.TotemicFocus) - + 0.02*float64(shaman.Talents.MentalQuickness), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost - - (baseCost * float64(shaman.Talents.TotemicFocus) * 0.05) - - (baseCost * float64(shaman.Talents.MentalQuickness) * 0.02), GCD: time.Second, }, IgnoreHaste: true, @@ -29,7 +28,7 @@ func (shaman *Shaman) newTotemSpellConfig(baseCost float64, spellID int32) core. } func (shaman *Shaman) registerWrathOfAirTotemSpell() { - config := shaman.newTotemSpellConfig(0.11*shaman.BaseMana, 3738) + config := shaman.newTotemSpellConfig(0.11, 3738) config.ApplyEffects = func(sim *core.Simulation, _ *core.Unit, _ *core.Spell) { shaman.NextTotemDrops[AirTotem] = sim.CurrentTime + time.Second*300 } @@ -37,7 +36,7 @@ func (shaman *Shaman) registerWrathOfAirTotemSpell() { } func (shaman *Shaman) registerWindfuryTotemSpell() { - config := shaman.newTotemSpellConfig(shaman.BaseMana*0.11, 8512) + config := shaman.newTotemSpellConfig(0.11, 8512) config.ApplyEffects = func(sim *core.Simulation, _ *core.Unit, _ *core.Spell) { shaman.NextTotemDrops[AirTotem] = sim.CurrentTime + time.Second*300 } @@ -45,7 +44,7 @@ func (shaman *Shaman) registerWindfuryTotemSpell() { } func (shaman *Shaman) registerManaSpringTotemSpell() { - config := shaman.newTotemSpellConfig(shaman.BaseMana*0.04, 58774) + config := shaman.newTotemSpellConfig(0.04, 58774) config.ApplyEffects = func(sim *core.Simulation, _ *core.Unit, _ *core.Spell) { shaman.NextTotemDrops[WaterTotem] = sim.CurrentTime + time.Second*300 } @@ -53,7 +52,7 @@ func (shaman *Shaman) registerManaSpringTotemSpell() { } func (shaman *Shaman) registerTotemOfWrathSpell() { - config := shaman.newTotemSpellConfig(shaman.BaseMana*0.05, 57722) + config := shaman.newTotemSpellConfig(0.05, 57722) config.ApplyEffects = func(sim *core.Simulation, _ *core.Unit, _ *core.Spell) { shaman.NextTotemDrops[FireTotem] = sim.CurrentTime + time.Second*300 shaman.applyToWDebuff(sim) @@ -69,7 +68,7 @@ func (shaman *Shaman) applyToWDebuff(sim *core.Simulation) { } func (shaman *Shaman) registerFlametongueTotemSpell() { - config := shaman.newTotemSpellConfig(0.11*shaman.BaseMana, 58656) + config := shaman.newTotemSpellConfig(0.11, 58656) config.ApplyEffects = func(sim *core.Simulation, _ *core.Unit, _ *core.Spell) { shaman.NextTotemDrops[FireTotem] = sim.CurrentTime + time.Second*300 } @@ -77,7 +76,7 @@ func (shaman *Shaman) registerFlametongueTotemSpell() { } func (shaman *Shaman) registerStrengthOfEarthTotemSpell() { - config := shaman.newTotemSpellConfig(0.1*shaman.BaseMana, 58643) + config := shaman.newTotemSpellConfig(0.1, 58643) config.ApplyEffects = func(sim *core.Simulation, _ *core.Unit, _ *core.Spell) { shaman.NextTotemDrops[EarthTotem] = sim.CurrentTime + time.Second*300 } @@ -85,7 +84,7 @@ func (shaman *Shaman) registerStrengthOfEarthTotemSpell() { } func (shaman *Shaman) registerTremorTotemSpell() { - config := shaman.newTotemSpellConfig(0.02*shaman.BaseMana, 8143) + config := shaman.newTotemSpellConfig(0.02, 8143) config.ApplyEffects = func(sim *core.Simulation, _ *core.Unit, _ *core.Spell) { shaman.NextTotemDrops[EarthTotem] = sim.CurrentTime + time.Second*300 } @@ -93,7 +92,7 @@ func (shaman *Shaman) registerTremorTotemSpell() { } func (shaman *Shaman) registerStoneskinTotemSpell() { - config := shaman.newTotemSpellConfig(0.1*shaman.BaseMana, 58753) + config := shaman.newTotemSpellConfig(0.1, 58753) config.ApplyEffects = func(sim *core.Simulation, _ *core.Unit, _ *core.Spell) { shaman.NextTotemDrops[EarthTotem] = sim.CurrentTime + time.Second*300 } From 73aee519f6463b9d2aec6f69c98b465300eaba54 Mon Sep 17 00:00:00 2001 From: James Tanner Date: Wed, 11 Jan 2023 21:37:17 -0500 Subject: [PATCH 12/13] Update warlock spells --- sim/warlock/chaos_bolt.go | 15 +++--- sim/warlock/conflagrate.go | 17 ++++--- sim/warlock/corruption.go | 18 +++---- sim/warlock/curses.go | 77 +++++++++++++++--------------- sim/warlock/demonic_empowerment.go | 11 ++--- sim/warlock/drain_soul.go | 19 ++++---- sim/warlock/haunt.go | 10 ++-- sim/warlock/immolate.go | 15 +++--- sim/warlock/incinerate.go | 9 ++-- sim/warlock/inferno.go | 20 ++++---- sim/warlock/metamorphosis.go | 17 ++++--- sim/warlock/pet_abilities.go | 62 +++++++++++------------- sim/warlock/seed.go | 15 +++--- sim/warlock/shadowbolt.go | 11 +++-- sim/warlock/shadowburn.go | 17 ++++--- sim/warlock/soul_fire.go | 9 ++-- sim/warlock/unstable_affliction.go | 15 +++--- sim/warlock/warlock.go | 2 +- 18 files changed, 170 insertions(+), 189 deletions(-) diff --git a/sim/warlock/chaos_bolt.go b/sim/warlock/chaos_bolt.go index e21fbdec3b..7a440f84bc 100644 --- a/sim/warlock/chaos_bolt.go +++ b/sim/warlock/chaos_bolt.go @@ -5,26 +5,25 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (warlock *Warlock) registerChaosBoltSpell() { - baseCost := 0.07 * warlock.BaseMana spellCoeff := 0.7142 * (1 + 0.04*float64(warlock.Talents.ShadowAndFlame)) // ChaosBolt is affected by level-based partial resists. // TODO If there's bosses with elevated fire resistances, we'd need another spell flag, // or add an unlimited amount of "bonusSpellPenetration". warlock.ChaosBolt = warlock.RegisterSpell(core.SpellConfig{ - ActionID: core.ActionID{SpellID: 59172}, - SpellSchool: core.SpellSchoolFire, - ProcMask: core.ProcMaskSpellDamage, - ResourceType: stats.Mana, - BaseCost: baseCost, + ActionID: core.ActionID{SpellID: 59172}, + SpellSchool: core.SpellSchoolFire, + ProcMask: core.ProcMaskSpellDamage, + ManaCost: core.ManaCostOptions{ + BaseCost: 0.07, + Multiplier: 1 - []float64{0, .04, .07, .10}[warlock.Talents.Cataclysm], + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * (1 - []float64{0, .04, .07, .10}[warlock.Talents.Cataclysm]), GCD: core.GCDDefault, CastTime: time.Millisecond*2500 - (time.Millisecond * 100 * time.Duration(warlock.Talents.Bane)), }, diff --git a/sim/warlock/conflagrate.go b/sim/warlock/conflagrate.go index 61d15c5941..cb1803412e 100644 --- a/sim/warlock/conflagrate.go +++ b/sim/warlock/conflagrate.go @@ -6,30 +6,29 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (warlock *Warlock) registerConflagrateSpell() { actionID := core.ActionID{SpellID: 17962} hasGlyphOfConflag := warlock.HasMajorGlyph(proto.WarlockMajorGlyph_GlyphOfConflagrate) - baseCost := 0.16 * warlock.BaseMana directFlatDamage := 0.6 * 785 / 5 * float64(warlock.ImmolateDot.NumberOfTicks) directSpellCoeff := 0.6 * 0.2 * float64(warlock.ImmolateDot.NumberOfTicks) dotFlatDamage := 0.4 / 3 * 785 / 5 * float64(warlock.ImmolateDot.NumberOfTicks) dotSpellCoeff := 0.4 / 3 * 0.2 * float64(warlock.ImmolateDot.NumberOfTicks) warlock.Conflagrate = warlock.RegisterSpell(core.SpellConfig{ - ActionID: actionID, - SpellSchool: core.SpellSchoolFire, - ProcMask: core.ProcMaskSpellDamage, - ResourceType: stats.Mana, - BaseCost: baseCost, + ActionID: actionID, + SpellSchool: core.SpellSchoolFire, + ProcMask: core.ProcMaskSpellDamage, + ManaCost: core.ManaCostOptions{ + BaseCost: 0.16, + Multiplier: 1 - []float64{0, .04, .07, .10}[warlock.Talents.Cataclysm], + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * (1 - []float64{0, .04, .07, .10}[warlock.Talents.Cataclysm]), - GCD: core.GCDDefault, + GCD: core.GCDDefault, }, CD: core.Cooldown{ Timer: warlock.NewTimer(), diff --git a/sim/warlock/corruption.go b/sim/warlock/corruption.go index 57e42d4455..4f14a133e1 100644 --- a/sim/warlock/corruption.go +++ b/sim/warlock/corruption.go @@ -6,25 +6,25 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (warlock *Warlock) registerCorruptionSpell() { actionID := core.ActionID{SpellID: 47813} - baseCost := 0.14 * warlock.BaseMana spellCoeff := 0.2 + 0.12*float64(warlock.Talents.EmpoweredCorruption)/6 + 0.01*float64(warlock.Talents.EverlastingAffliction) canCrit := warlock.Talents.Pandemic warlock.Corruption = warlock.RegisterSpell(core.SpellConfig{ - ActionID: actionID, - SpellSchool: core.SpellSchoolShadow, - ProcMask: core.ProcMaskSpellDamage, - ResourceType: stats.Mana, - BaseCost: baseCost, + ActionID: actionID, + SpellSchool: core.SpellSchoolShadow, + ProcMask: core.ProcMaskSpellDamage, + + ManaCost: core.ManaCostOptions{ + BaseCost: 0.14, + Multiplier: 1 - 0.02*float64(warlock.Talents.Suppression), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * (1 - 0.02*float64(warlock.Talents.Suppression)), - GCD: core.GCDDefault, + GCD: core.GCDDefault, }, }, diff --git a/sim/warlock/curses.go b/sim/warlock/curses.go index 5a515ef0c3..94f1a86ff1 100644 --- a/sim/warlock/curses.go +++ b/sim/warlock/curses.go @@ -6,14 +6,12 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (warlock *Warlock) registerCurseOfElementsSpell() { if warlock.Rotation.Curse != proto.Warlock_Rotation_Elements { return } - baseCost := 0.1 * warlock.BaseMana warlock.CurseOfElementsAura = core.CurseOfElementsAura(warlock.CurrentTarget) warlock.CurseOfElements = warlock.RegisterSpell(core.SpellConfig{ @@ -21,13 +19,13 @@ func (warlock *Warlock) registerCurseOfElementsSpell() { SpellSchool: core.SpellSchoolShadow, ProcMask: core.ProcMaskEmpty, - ResourceType: stats.Mana, - BaseCost: baseCost, - + ManaCost: core.ManaCostOptions{ + BaseCost: 0.1, + Multiplier: 1 - 0.02*float64(warlock.Talents.Suppression), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * (1 - 0.02*float64(warlock.Talents.Suppression)), - GCD: core.GCDDefault - core.TernaryDuration(warlock.Talents.AmplifyCurse, 1, 0)*500*time.Millisecond, + GCD: core.GCDDefault - core.TernaryDuration(warlock.Talents.AmplifyCurse, 1, 0)*500*time.Millisecond, }, }, @@ -48,21 +46,21 @@ func (warlock *Warlock) ShouldCastCurseOfElements(sim *core.Simulation, target * } func (warlock *Warlock) registerCurseOfWeaknessSpell() { - baseCost := 0.1 * warlock.BaseMana warlock.CurseOfWeaknessAura = core.CurseOfWeaknessAura(warlock.CurrentTarget, warlock.Talents.ImprovedCurseOfWeakness) warlock.CurseOfWeaknessAura.Duration = time.Minute * 2 warlock.CurseOfWeakness = warlock.RegisterSpell(core.SpellConfig{ - ActionID: core.ActionID{SpellID: 50511}, - SpellSchool: core.SpellSchoolShadow, - ProcMask: core.ProcMaskEmpty, - ResourceType: stats.Mana, - BaseCost: baseCost, + ActionID: core.ActionID{SpellID: 50511}, + SpellSchool: core.SpellSchoolShadow, + ProcMask: core.ProcMaskEmpty, + ManaCost: core.ManaCostOptions{ + BaseCost: 0.1, + Multiplier: 1 - 0.02*float64(warlock.Talents.Suppression), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * (1 - 0.02*float64(warlock.Talents.Suppression)), - GCD: core.GCDDefault - core.TernaryDuration(warlock.Talents.AmplifyCurse, 1, 0)*500*time.Millisecond, + GCD: core.GCDDefault - core.TernaryDuration(warlock.Talents.AmplifyCurse, 1, 0)*500*time.Millisecond, }, }, @@ -80,7 +78,6 @@ func (warlock *Warlock) registerCurseOfWeaknessSpell() { func (warlock *Warlock) registerCurseOfTonguesSpell() { actionID := core.ActionID{SpellID: 11719} - baseCost := 0.04 * warlock.BaseMana // Empty aura so we can simulate cost/time to keep tongues up warlock.CurseOfTonguesAura = warlock.CurrentTarget.GetOrRegisterAura(core.Aura{ @@ -90,16 +87,17 @@ func (warlock *Warlock) registerCurseOfTonguesSpell() { }) warlock.CurseOfTongues = warlock.RegisterSpell(core.SpellConfig{ - ActionID: actionID, - SpellSchool: core.SpellSchoolShadow, - ProcMask: core.ProcMaskEmpty, - ResourceType: stats.Mana, - BaseCost: baseCost, + ActionID: actionID, + SpellSchool: core.SpellSchoolShadow, + ProcMask: core.ProcMaskEmpty, + ManaCost: core.ManaCostOptions{ + BaseCost: 0.04, + Multiplier: 1 - 0.02*float64(warlock.Talents.Suppression), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * (1 - 0.02*float64(warlock.Talents.Suppression)), - GCD: core.GCDDefault - core.TernaryDuration(warlock.Talents.AmplifyCurse, 1, 0)*500*time.Millisecond, + GCD: core.GCDDefault - core.TernaryDuration(warlock.Talents.AmplifyCurse, 1, 0)*500*time.Millisecond, }, }, @@ -117,7 +115,6 @@ func (warlock *Warlock) registerCurseOfTonguesSpell() { func (warlock *Warlock) registerCurseOfAgonySpell() { actionID := core.ActionID{SpellID: 47864} - baseCost := 0.1 * warlock.BaseMana numberOfTicks := int32(12) totalBaseDmg := 1740.0 if warlock.HasMajorGlyph(proto.WarlockMajorGlyph_GlyphOfCurseOfAgony) { @@ -126,15 +123,17 @@ func (warlock *Warlock) registerCurseOfAgonySpell() { } warlock.CurseOfAgony = warlock.RegisterSpell(core.SpellConfig{ - ActionID: actionID, - SpellSchool: core.SpellSchoolShadow, - ProcMask: core.ProcMaskSpellDamage, - ResourceType: stats.Mana, - BaseCost: baseCost, + ActionID: actionID, + SpellSchool: core.SpellSchoolShadow, + ProcMask: core.ProcMaskSpellDamage, + + ManaCost: core.ManaCostOptions{ + BaseCost: 0.1, + Multiplier: 1 - 0.02*float64(warlock.Talents.Suppression), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * (1 - 0.02*float64(warlock.Talents.Suppression)), - GCD: core.GCDDefault - core.TernaryDuration(warlock.Talents.AmplifyCurse, 1, 0)*500*time.Millisecond, + GCD: core.GCDDefault - core.TernaryDuration(warlock.Talents.AmplifyCurse, 1, 0)*500*time.Millisecond, }, }, @@ -174,19 +173,19 @@ func (warlock *Warlock) registerCurseOfAgonySpell() { func (warlock *Warlock) registerCurseOfDoomSpell() { actionID := core.ActionID{SpellID: 47867} - baseCost := 0.15 * warlock.BaseMana warlock.CurseOfDoom = warlock.RegisterSpell(core.SpellConfig{ - ActionID: actionID, - SpellSchool: core.SpellSchoolShadow, - ProcMask: core.ProcMaskSpellDamage, - ResourceType: stats.Mana, - BaseCost: baseCost, + ActionID: actionID, + SpellSchool: core.SpellSchoolShadow, + ProcMask: core.ProcMaskSpellDamage, + ManaCost: core.ManaCostOptions{ + BaseCost: 0.15, + Multiplier: 1 - 0.02*float64(warlock.Talents.Suppression), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * (1 - 0.02*float64(warlock.Talents.Suppression)), - GCD: core.GCDDefault - core.TernaryDuration(warlock.Talents.AmplifyCurse, 1, 0)*500*time.Millisecond, + GCD: core.GCDDefault - core.TernaryDuration(warlock.Talents.AmplifyCurse, 1, 0)*500*time.Millisecond, }, CD: core.Cooldown{ Timer: warlock.NewTimer(), diff --git a/sim/warlock/demonic_empowerment.go b/sim/warlock/demonic_empowerment.go index bb98d69f50..7c6d04d555 100644 --- a/sim/warlock/demonic_empowerment.go +++ b/sim/warlock/demonic_empowerment.go @@ -56,17 +56,16 @@ func (warlock *Warlock) registerDemonicEmpowermentSpell() { } warlock.DemonicEmpowerment = warlock.RegisterSpell(core.SpellConfig{ - ActionID: core.ActionID{SpellID: 47193}, - ResourceType: stats.Mana, + ActionID: core.ActionID{SpellID: 47193}, + + ManaCost: core.ManaCostOptions{ + BaseCost: 0.06, + }, Cast: core.CastConfig{ CD: core.Cooldown{ Timer: warlock.NewTimer(), Duration: time.Second * time.Duration(60.*(1.-0.1*float64(warlock.Talents.Nemesis))), }, - DefaultCast: core.Cast{ - Cost: 0.06 * warlock.BaseMana, - GCD: 0, - }, }, ApplyEffects: func(sim *core.Simulation, _ *core.Unit, _ *core.Spell) { warlock.Pet.DemonicEmpowermentAura.Activate(sim) diff --git a/sim/warlock/drain_soul.go b/sim/warlock/drain_soul.go index f3d934b56e..d12e600fe9 100644 --- a/sim/warlock/drain_soul.go +++ b/sim/warlock/drain_soul.go @@ -5,26 +5,25 @@ import ( "time" "github.com/wowsims/wotlk/sim/core" - "github.com/wowsims/wotlk/sim/core/stats" ) func (warlock *Warlock) registerDrainSoulSpell() { actionID := core.ActionID{SpellID: 47855} soulSiphonMultiplier := 0.03 * float64(warlock.Talents.SoulSiphon) - baseCost := warlock.BaseMana * 0.14 warlock.DrainSoul = warlock.RegisterSpell(core.SpellConfig{ - ActionID: actionID, - SpellSchool: core.SpellSchoolShadow, - ProcMask: core.ProcMaskSpellDamage, - Flags: core.SpellFlagChanneled, - ResourceType: stats.Mana, - BaseCost: baseCost, + ActionID: actionID, + SpellSchool: core.SpellSchoolShadow, + ProcMask: core.ProcMaskSpellDamage, + Flags: core.SpellFlagChanneled, + ManaCost: core.ManaCostOptions{ + BaseCost: 0.14, + Multiplier: 1 - 0.02*float64(warlock.Talents.Suppression), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * (1 - 0.02*float64(warlock.Talents.Suppression)), - GCD: core.GCDDefault, + GCD: core.GCDDefault, // ChannelTime: channelTime, }, }, diff --git a/sim/warlock/haunt.go b/sim/warlock/haunt.go index dd26d9e3cc..13dc479da3 100644 --- a/sim/warlock/haunt.go +++ b/sim/warlock/haunt.go @@ -5,12 +5,10 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (warlock *Warlock) registerHauntSpell() { actionID := core.ActionID{SpellID: 59164} - baseCost := 0.12 * warlock.BaseMana debuffMultiplier := 1.2 if warlock.HasMajorGlyph(proto.WarlockMajorGlyph_GlyphOfHaunt) { @@ -35,12 +33,12 @@ func (warlock *Warlock) registerHauntSpell() { ProcMask: core.ProcMaskSpellDamage, MissileSpeed: 20, - ResourceType: stats.Mana, - BaseCost: baseCost, - + ManaCost: core.ManaCostOptions{ + BaseCost: 0.12, + Multiplier: 1 - 0.02*float64(warlock.Talents.Suppression), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * (1 - 0.02*float64(warlock.Talents.Suppression)), GCD: core.GCDDefault, CastTime: time.Millisecond * 1500, }, diff --git a/sim/warlock/immolate.go b/sim/warlock/immolate.go index 102bfb9b43..daf7e88a73 100644 --- a/sim/warlock/immolate.go +++ b/sim/warlock/immolate.go @@ -6,23 +6,22 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (warlock *Warlock) registerImmolateSpell() { actionID := core.ActionID{SpellID: 47811} - baseCost := 0.17 * warlock.BaseMana warlock.Immolate = warlock.RegisterSpell(core.SpellConfig{ - ActionID: actionID, - SpellSchool: core.SpellSchoolFire, - ProcMask: core.ProcMaskSpellDamage, - ResourceType: stats.Mana, - BaseCost: baseCost, + ActionID: actionID, + SpellSchool: core.SpellSchoolFire, + ProcMask: core.ProcMaskSpellDamage, + ManaCost: core.ManaCostOptions{ + BaseCost: 0.17, + Multiplier: 1 - []float64{0, .04, .07, .10}[warlock.Talents.Cataclysm], + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * (1 - []float64{0, .04, .07, .10}[warlock.Talents.Cataclysm]), GCD: core.GCDDefault, CastTime: time.Millisecond * (2000 - 100*time.Duration(warlock.Talents.Bane)), }, diff --git a/sim/warlock/incinerate.go b/sim/warlock/incinerate.go index 4118786869..176280ace1 100644 --- a/sim/warlock/incinerate.go +++ b/sim/warlock/incinerate.go @@ -5,11 +5,9 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (warlock *Warlock) registerIncinerateSpell() { - baseCost := 0.14 * warlock.BaseMana spellCoeff := 0.713 * (1 + 0.04*float64(warlock.Talents.ShadowAndFlame)) mcCastMod := (1.0 - 0.1*float64(warlock.Talents.MoltenCore)) @@ -18,12 +16,13 @@ func (warlock *Warlock) registerIncinerateSpell() { SpellSchool: core.SpellSchoolFire, ProcMask: core.ProcMaskSpellDamage, MissileSpeed: 24, - ResourceType: stats.Mana, - BaseCost: baseCost, + ManaCost: core.ManaCostOptions{ + BaseCost: 0.14, + Multiplier: 1 - []float64{0, .04, .07, .10}[warlock.Talents.Cataclysm], + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * (1 - []float64{0, .04, .07, .10}[warlock.Talents.Cataclysm]), GCD: core.GCDDefault, CastTime: time.Millisecond * time.Duration(2500-50*warlock.Talents.Emberstorm), }, diff --git a/sim/warlock/inferno.go b/sim/warlock/inferno.go index c042aea742..7968548b37 100644 --- a/sim/warlock/inferno.go +++ b/sim/warlock/inferno.go @@ -20,18 +20,17 @@ func (warlock *Warlock) registerInfernoSpell() { Duration: time.Second * 60, }) - baseCost := 0.8 * warlock.BaseMana warlock.Inferno = warlock.RegisterSpell(core.SpellConfig{ - ActionID: core.ActionID{SpellID: 1122}, - SpellSchool: core.SpellSchoolFire, - ProcMask: core.ProcMaskEmpty, - ResourceType: stats.Mana, - BaseCost: baseCost, + ActionID: core.ActionID{SpellID: 1122}, + SpellSchool: core.SpellSchoolFire, + ProcMask: core.ProcMaskEmpty, + ManaCost: core.ManaCostOptions{ + BaseCost: 0.8, + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ CastTime: time.Millisecond * 1500, - Cost: baseCost, GCD: core.GCDDefault, }, CD: core.Cooldown{ @@ -182,10 +181,9 @@ func (infernal *InfernalPet) Initialize() { }) infernal.immolationAura = infernal.RegisterSpell(core.SpellConfig{ - ActionID: core.ActionID{SpellID: 20153}, - SpellSchool: core.SpellSchoolFire, - ProcMask: core.ProcMaskEmpty, - ResourceType: stats.Mana, + ActionID: core.ActionID{SpellID: 20153}, + SpellSchool: core.SpellSchoolFire, + ProcMask: core.ProcMaskEmpty, DamageMultiplier: 1, ThreatMultiplier: 1, diff --git a/sim/warlock/metamorphosis.go b/sim/warlock/metamorphosis.go index 0e86eac479..f9639aa618 100644 --- a/sim/warlock/metamorphosis.go +++ b/sim/warlock/metamorphosis.go @@ -5,7 +5,6 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (warlock *Warlock) registerMetamorphosisSpell() { @@ -56,7 +55,6 @@ func (warlock *Warlock) registerMetamorphosisSpell() { func (warlock *Warlock) registerImmolationAuraSpell() { // the spellID that deals damage in the combat log is 50590, but we don't use it here actionID := core.ActionID{SpellID: 50589} - baseCost := 0.64 * warlock.BaseMana warlock.ImmolationAuraDot = core.NewDot(core.Dot{ Aura: warlock.RegisterAura(core.Aura{ @@ -75,15 +73,16 @@ func (warlock *Warlock) registerImmolationAuraSpell() { }) warlock.ImmolationAura = warlock.RegisterSpell(core.SpellConfig{ - ActionID: actionID, - SpellSchool: core.SpellSchoolFire, - ProcMask: core.ProcMaskEmpty, - ResourceType: stats.Mana, - BaseCost: baseCost, + ActionID: actionID, + SpellSchool: core.SpellSchoolFire, + ProcMask: core.ProcMaskEmpty, + + ManaCost: core.ManaCostOptions{ + BaseCost: 0.64, + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - GCD: core.GCDDefault, - Cost: baseCost, + GCD: core.GCDDefault, }, CD: core.Cooldown{ Timer: warlock.NewTimer(), diff --git a/sim/warlock/pet_abilities.go b/sim/warlock/pet_abilities.go index 610f4e8ddc..073e97bb4e 100644 --- a/sim/warlock/pet_abilities.go +++ b/sim/warlock/pet_abilities.go @@ -5,7 +5,6 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) type PetAbilityType byte @@ -57,17 +56,16 @@ func (wp *WarlockPet) newIntercept() *core.Spell { } func (wp *WarlockPet) newFirebolt() *core.Spell { - baseCost := 180.0 return wp.RegisterSpell(core.SpellConfig{ - ActionID: core.ActionID{SpellID: 47964}, - SpellSchool: core.SpellSchoolFire, - ProcMask: core.ProcMaskSpellDamage, - ResourceType: stats.Mana, - BaseCost: baseCost, + ActionID: core.ActionID{SpellID: 47964}, + SpellSchool: core.SpellSchoolFire, + ProcMask: core.ProcMaskSpellDamage, + ManaCost: core.ManaCostOptions{ + FlatCost: 180, + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost, GCD: core.GCDDefault, CastTime: time.Millisecond * (2500 - time.Duration(250*wp.owner.Talents.DemonicPower)), }, @@ -87,21 +85,20 @@ func (wp *WarlockPet) newFirebolt() *core.Spell { } func (wp *WarlockPet) newCleave() *core.Spell { - baseCost := 439.0 // 10% of base numHits := core.MinInt32(2, wp.Env.GetNumTargets()) return wp.RegisterSpell(core.SpellConfig{ - ActionID: core.ActionID{SpellID: 47994}, - SpellSchool: core.SpellSchoolPhysical, - ProcMask: core.ProcMaskMeleeMHSpecial, - Flags: core.SpellFlagMeleeMetrics | core.SpellFlagIncludeTargetBonusDamage, - ResourceType: stats.Mana, - BaseCost: baseCost, + ActionID: core.ActionID{SpellID: 47994}, + SpellSchool: core.SpellSchoolPhysical, + ProcMask: core.ProcMaskMeleeMHSpecial, + Flags: core.SpellFlagMeleeMetrics | core.SpellFlagIncludeTargetBonusDamage, + ManaCost: core.ManaCostOptions{ + FlatCost: 439, + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost, - GCD: core.GCDDefault, + GCD: core.GCDDefault, }, IgnoreHaste: true, CD: core.Cooldown{ @@ -128,18 +125,17 @@ func (wp *WarlockPet) newCleave() *core.Spell { } func (wp *WarlockPet) newLashOfPain() *core.Spell { - baseCost := 250.0 return wp.RegisterSpell(core.SpellConfig{ - ActionID: core.ActionID{SpellID: 47992}, - SpellSchool: core.SpellSchoolShadow, - ProcMask: core.ProcMaskSpellDamage, - ResourceType: stats.Mana, - BaseCost: baseCost, + ActionID: core.ActionID{SpellID: 47992}, + SpellSchool: core.SpellSchoolShadow, + ProcMask: core.ProcMaskSpellDamage, + ManaCost: core.ManaCostOptions{ + FlatCost: 250, + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost, - GCD: core.GCDDefault, + GCD: core.GCDDefault, }, IgnoreHaste: true, CD: core.Cooldown{ @@ -163,7 +159,6 @@ func (wp *WarlockPet) newLashOfPain() *core.Spell { func (wp *WarlockPet) newShadowBite() *core.Spell { actionID := core.ActionID{SpellID: 54053} - baseCost := 131.0 // TODO: should be 3% of BaseMana, but it's unclear what that actually refers to with pets var petManaMetrics *core.ResourceMetrics maxManaMult := 0.04 * float64(wp.owner.Talents.ImprovedFelhunter) @@ -173,16 +168,17 @@ func (wp *WarlockPet) newShadowBite() *core.Spell { } return wp.RegisterSpell(core.SpellConfig{ - ActionID: actionID, - SpellSchool: core.SpellSchoolShadow, - ProcMask: core.ProcMaskSpellDamage, - ResourceType: stats.Mana, - BaseCost: baseCost, + ActionID: actionID, + SpellSchool: core.SpellSchoolShadow, + ProcMask: core.ProcMaskSpellDamage, + ManaCost: core.ManaCostOptions{ + // TODO: should be 3% of BaseMana, but it's unclear what that actually refers to with pets + FlatCost: 131, + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost, - GCD: core.GCDDefault, + GCD: core.GCDDefault, }, IgnoreHaste: true, CD: core.Cooldown{ diff --git a/sim/warlock/seed.go b/sim/warlock/seed.go index e3accda869..f3c1bf43ad 100644 --- a/sim/warlock/seed.go +++ b/sim/warlock/seed.go @@ -5,7 +5,6 @@ import ( "time" "github.com/wowsims/wotlk/sim/core" - "github.com/wowsims/wotlk/sim/core/stats" ) func (warlock *Warlock) registerSeedSpell() { @@ -22,7 +21,6 @@ func (warlock *Warlock) registerSeedSpell() { } func (warlock *Warlock) makeSeed(targetIdx int, numTargets int) { - baseCost := 0.34 * warlock.BaseMana actionID := core.ActionID{SpellID: 47836, Tag: 1} seedExplosion := warlock.RegisterSpell(core.SpellConfig{ @@ -56,15 +54,16 @@ func (warlock *Warlock) makeSeed(targetIdx int, numTargets int) { }) warlock.Seeds[targetIdx] = warlock.RegisterSpell(core.SpellConfig{ - ActionID: actionID, - SpellSchool: core.SpellSchoolShadow, - ProcMask: core.ProcMaskEmpty, - ResourceType: stats.Mana, - BaseCost: baseCost, + ActionID: actionID, + SpellSchool: core.SpellSchoolShadow, + ProcMask: core.ProcMaskEmpty, + ManaCost: core.ManaCostOptions{ + BaseCost: 0.34, + Multiplier: 1 - 0.02*float64(warlock.Talents.Suppression), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * (1 - 0.02*float64(warlock.Talents.Suppression)), GCD: core.GCDDefault, CastTime: time.Millisecond * 2000, }, diff --git a/sim/warlock/shadowbolt.go b/sim/warlock/shadowbolt.go index 8c3a54026d..60bddcab54 100644 --- a/sim/warlock/shadowbolt.go +++ b/sim/warlock/shadowbolt.go @@ -5,11 +5,9 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (warlock *Warlock) registerShadowBoltSpell() { - baseCost := 0.17 * warlock.BaseMana spellCoeff := 0.857 * (1 + 0.04*float64(warlock.Talents.ShadowAndFlame)) ISBProcChance := 0.2 * float64(warlock.Talents.ImprovedShadowBolt) @@ -23,12 +21,15 @@ func (warlock *Warlock) registerShadowBoltSpell() { SpellSchool: core.SpellSchoolShadow, ProcMask: core.ProcMaskSpellDamage, MissileSpeed: 20, - ResourceType: stats.Mana, - BaseCost: baseCost, + ManaCost: core.ManaCostOptions{ + BaseCost: 0.17, + Multiplier: 1 - + []float64{0, .04, .07, .10}[warlock.Talents.Cataclysm] - + core.TernaryFloat64(warlock.HasMajorGlyph(proto.WarlockMajorGlyph_GlyphOfShadowBolt), 0.1, 0), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * (1 - []float64{0, .04, .07, .10}[warlock.Talents.Cataclysm] - core.TernaryFloat64(warlock.HasMajorGlyph(proto.WarlockMajorGlyph_GlyphOfShadowBolt), 0.1, 0)), GCD: core.GCDDefault, CastTime: time.Millisecond * (3000 - 100*time.Duration(warlock.Talents.Bane)), }, diff --git a/sim/warlock/shadowburn.go b/sim/warlock/shadowburn.go index 7acc134cda..50d5e827b8 100644 --- a/sim/warlock/shadowburn.go +++ b/sim/warlock/shadowburn.go @@ -5,7 +5,6 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (warlock *Warlock) registerShadowBurnSpell() { @@ -13,7 +12,6 @@ func (warlock *Warlock) registerShadowBurnSpell() { return } - baseCost := 0.2 * warlock.BaseMana spellCoeff := 0.429 * (1 + 0.04*float64(warlock.Talents.ShadowAndFlame)) if warlock.HasMajorGlyph(proto.WarlockMajorGlyph_GlyphOfShadowburn) { @@ -27,16 +25,17 @@ func (warlock *Warlock) registerShadowBurnSpell() { } warlock.Shadowburn = warlock.RegisterSpell(core.SpellConfig{ - ActionID: core.ActionID{SpellID: 47827}, - SpellSchool: core.SpellSchoolShadow, - ProcMask: core.ProcMaskSpellDamage, - ResourceType: stats.Mana, - BaseCost: baseCost, + ActionID: core.ActionID{SpellID: 47827}, + SpellSchool: core.SpellSchoolShadow, + ProcMask: core.ProcMaskSpellDamage, + ManaCost: core.ManaCostOptions{ + BaseCost: 0.2, + Multiplier: 1 - []float64{0, .04, .07, .10}[warlock.Talents.Cataclysm], + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * (1 - []float64{0, .04, .07, .10}[warlock.Talents.Cataclysm]), - GCD: core.GCDDefault, // backdraft procs don't change the GCD of shadowburn + GCD: core.GCDDefault, // backdraft procs don't change the GCD of shadowburn }, CD: core.Cooldown{ Timer: warlock.NewTimer(), diff --git a/sim/warlock/soul_fire.go b/sim/warlock/soul_fire.go index 4b3f0e97e5..03fb77018b 100644 --- a/sim/warlock/soul_fire.go +++ b/sim/warlock/soul_fire.go @@ -4,11 +4,9 @@ import ( "time" "github.com/wowsims/wotlk/sim/core" - "github.com/wowsims/wotlk/sim/core/stats" ) func (warlock *Warlock) registerSoulFireSpell() { - baseCost := 0.09 * warlock.BaseMana decimationMod := 1.0 - 0.2*float64(warlock.Talents.Decimation) warlock.SoulFire = warlock.RegisterSpell(core.SpellConfig{ @@ -16,12 +14,13 @@ func (warlock *Warlock) registerSoulFireSpell() { SpellSchool: core.SpellSchoolFire, ProcMask: core.ProcMaskSpellDamage, MissileSpeed: 24, - ResourceType: stats.Mana, - BaseCost: baseCost, + ManaCost: core.ManaCostOptions{ + BaseCost: 0.09, + Multiplier: 1 - []float64{0, .04, .07, .10}[warlock.Talents.Cataclysm], + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * (1 - []float64{0, .04, .07, .10}[warlock.Talents.Cataclysm]), GCD: core.GCDDefault, CastTime: time.Millisecond * time.Duration(6000-400*warlock.Talents.Bane), }, diff --git a/sim/warlock/unstable_affliction.go b/sim/warlock/unstable_affliction.go index 23cc0580a5..f8d0f08d90 100644 --- a/sim/warlock/unstable_affliction.go +++ b/sim/warlock/unstable_affliction.go @@ -6,25 +6,24 @@ import ( "github.com/wowsims/wotlk/sim/core" "github.com/wowsims/wotlk/sim/core/proto" - "github.com/wowsims/wotlk/sim/core/stats" ) func (warlock *Warlock) registerUnstableAfflictionSpell() { - baseCost := 0.15 * warlock.BaseMana actionID := core.ActionID{SpellID: 47843} spellCoeff := 0.2 + 0.01*float64(warlock.Talents.EverlastingAffliction) canCrit := warlock.Talents.Pandemic warlock.UnstableAffliction = warlock.RegisterSpell(core.SpellConfig{ - ActionID: actionID, - SpellSchool: core.SpellSchoolShadow, - ProcMask: core.ProcMaskSpellDamage, - ResourceType: stats.Mana, - BaseCost: baseCost, + ActionID: actionID, + SpellSchool: core.SpellSchoolShadow, + ProcMask: core.ProcMaskSpellDamage, + ManaCost: core.ManaCostOptions{ + BaseCost: 0.15, + Multiplier: 1 - 0.02*float64(warlock.Talents.Suppression), + }, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost * (1 - 0.02*float64(warlock.Talents.Suppression)), GCD: core.GCDDefault, CastTime: time.Millisecond * (1500 - 200*core.TernaryDuration(warlock.HasMajorGlyph(proto.WarlockMajorGlyph_GlyphOfUnstableAffliction), 1, 0)), }, diff --git a/sim/warlock/warlock.go b/sim/warlock/warlock.go index e6e227cdab..d8bce46224 100644 --- a/sim/warlock/warlock.go +++ b/sim/warlock/warlock.go @@ -172,7 +172,7 @@ func (warlock *Warlock) Prepull(sim *core.Simulation) { warlock.SpiritsoftheDamnedAura.UpdateExpires(warlock.SpiritsoftheDamnedAura.Duration - delay) } - warlock.SpendMana(sim, spellChoice.DefaultCast.Cost, spellChoice.ResourceMetrics) + warlock.SpendMana(sim, spellChoice.DefaultCast.Cost, spellChoice.Cost.(*core.ManaCost).ResourceMetrics) spellChoice.CD.UsePrePull(sim, warlock.ApplyCastSpeed(spellChoice.DefaultCast.CastTime)) spellChoice.SkipCastAndApplyEffects(sim, warlock.CurrentTarget) } From 32eeb166ae287e9d6d257d50e813d89d2ece4d28 Mon Sep 17 00:00:00 2001 From: James Tanner Date: Wed, 11 Jan 2023 21:42:18 -0500 Subject: [PATCH 13/13] Clean up now that no more spells use old mana cost --- sim/core/cast.go | 24 ------------------------ sim/core/spell.go | 2 -- sim/druid/faerie_fire.go | 23 ++++++++++------------- 3 files changed, 10 insertions(+), 39 deletions(-) diff --git a/sim/core/cast.go b/sim/core/cast.go index ed53b4e5c4..7e6be77495 100644 --- a/sim/core/cast.go +++ b/sim/core/cast.go @@ -134,21 +134,6 @@ func (spell *Spell) wrapCastFuncResources(config CastConfig, onCastComplete Cast } switch spell.ResourceType { - case stats.Mana: - return func(sim *Simulation, target *Unit) bool { - spell.CurCast.Cost = spell.ApplyCostModifiers(spell.CurCast.Cost) - if spell.Unit.CurrentMana() < spell.CurCast.Cost { - if sim.Log != nil && !spell.Flags.Matches(SpellFlagNoLogs) { - spell.Unit.Log(sim, "Failed casting %s, not enough mana. (Current Mana = %0.03f, Mana Cost = %0.03f)", - spell.ActionID, spell.Unit.CurrentMana(), spell.CurCast.Cost) - } - return false - } - - // Mana is subtracted at the end of the cast. - onCastComplete(sim, target) - return true - } case stats.Rage: return func(sim *Simulation, target *Unit) bool { spell.CurCast.Cost = spell.ApplyCostModifiers(spell.CurCast.Cost) @@ -306,15 +291,6 @@ func (spell *Spell) makeCastFuncWait(config CastConfig, onCastComplete CastFunc) spell.Cost.SpendCost(sim, spell) oldOnCastComplete2(sim, target) } - } else if spell.ResourceType == stats.Mana && spell.DefaultCast.Cost != 0 { - oldOnCastComplete2 := onCastComplete - onCastComplete = func(sim *Simulation, target *Unit) { - if spell.CurCast.Cost > 0 { - spell.Unit.SpendMana(sim, spell.CurCast.Cost, spell.ResourceMetrics) - spell.Unit.PseudoStats.FiveSecondRuleRefreshTime = sim.CurrentTime + time.Second*5 - } - oldOnCastComplete2(sim, target) - } } if spell.DefaultCast.ChannelTime > 0 { diff --git a/sim/core/spell.go b/sim/core/spell.go index e2ca3f01f9..323a92924a 100644 --- a/sim/core/spell.go +++ b/sim/core/spell.go @@ -217,8 +217,6 @@ func (unit *Unit) RegisterSpell(config SpellConfig) *Spell { if spell.Cost == nil { switch spell.ResourceType { - case stats.Mana: - spell.ResourceMetrics = spell.Unit.NewManaMetrics(spell.ActionID) case stats.Rage: spell.ResourceMetrics = spell.Unit.NewRageMetrics(spell.ActionID) case stats.Energy: diff --git a/sim/druid/faerie_fire.go b/sim/druid/faerie_fire.go index cf35299b50..31b4f876f3 100644 --- a/sim/druid/faerie_fire.go +++ b/sim/druid/faerie_fire.go @@ -4,13 +4,13 @@ import ( "time" "github.com/wowsims/wotlk/sim/core" - "github.com/wowsims/wotlk/sim/core/stats" ) func (druid *Druid) registerFaerieFireSpell() { actionID := core.ActionID{SpellID: 770} - resourceType := stats.Mana - baseCost := 0.08 * druid.BaseMana + manaCostOptions := core.ManaCostOptions{ + BaseCost: 0.08, + } gcd := core.GCDDefault ignoreHaste := false cd := core.Cooldown{} @@ -19,8 +19,7 @@ func (druid *Druid) registerFaerieFireSpell() { if druid.InForm(Cat | Bear) { actionID = core.ActionID{SpellID: 16857} - resourceType = 0 - baseCost = 0 + manaCostOptions = core.ManaCostOptions{} gcd = time.Second ignoreHaste = true flags = core.SpellFlagNone @@ -34,17 +33,15 @@ func (druid *Druid) registerFaerieFireSpell() { druid.FaerieFireAura = core.FaerieFireAura(druid.CurrentTarget, druid.Talents.ImprovedFaerieFire) druid.FaerieFire = druid.RegisterSpell(core.SpellConfig{ - ActionID: actionID, - SpellSchool: core.SpellSchoolNature, - ProcMask: core.ProcMaskSpellDamage, - ResourceType: resourceType, - BaseCost: baseCost, - Flags: flags, + ActionID: actionID, + SpellSchool: core.SpellSchoolNature, + ProcMask: core.ProcMaskSpellDamage, + Flags: flags, + ManaCost: manaCostOptions, Cast: core.CastConfig{ DefaultCast: core.Cast{ - Cost: baseCost, - GCD: gcd, + GCD: gcd, }, IgnoreHaste: ignoreHaste, CD: cd,