Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sim/common/mop/trinkets_phase_1_50.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func init() {
character := agent.GetCharacter()
duration := time.Second * 15

statValue := core.GetItemEffectScaling(75274, 2.66700005531, state)
statValue := core.GetItemEffectScalingStatValue(75274, 2.66700005531, state)
statTypeOptions := []stats.Stat{stats.Strength, stats.Agility, stats.Intellect}

auras := make(map[stats.Stat]*core.StatBuffAura, 3)
Expand Down Expand Up @@ -62,7 +62,7 @@ func init() {
actionID := core.ActionID{SpellID: 126467}
manaMetrics := character.NewManaMetrics(actionID)

mana := core.GetItemEffectScaling(81266, 2.97199988365, state)
mana := core.GetItemEffectScalingStatValue(81266, 2.97199988365, state)

triggerAura := character.MakeProcTriggerAura(core.ProcTrigger{
Name: "Price of Progress (Heroic)",
Expand Down
26 changes: 13 additions & 13 deletions sim/common/mop/trinkets_phase_3_52.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func init() {
core.NewItemEffect(itemID, func(agent core.Agent, state proto.ItemLevelState) {
character := agent.GetCharacter()

statValue := core.GetItemEffectScaling(itemID, 0.44999998808, state)
statValue := core.GetItemEffectScalingStatValue(itemID, 0.44999998808, state)

statBuffAura, aura := character.NewTemporaryStatBuffWithStacks(core.TemporaryStatBuffWithStacksConfig{
AuraLabel: fmt.Sprintf("Blades of Renataki (%s)", versionLabel),
Expand Down Expand Up @@ -74,7 +74,7 @@ func init() {
core.NewItemEffect(itemID, func(agent core.Agent, state proto.ItemLevelState) {
character := agent.GetCharacter()

manaValue := core.GetItemEffectScaling(itemID, 0.55900001526, state)
manaValue := core.GetItemEffectScalingStatValue(itemID, 0.55900001526, state)
manaMetrics := character.NewManaMetrics(core.ActionID{SpellID: 138856})

stackingAura := character.RegisterAura(core.Aura{
Expand Down Expand Up @@ -141,7 +141,7 @@ func init() {
core.NewItemEffect(itemID, func(agent core.Agent, state proto.ItemLevelState) {
character := agent.GetCharacter()

statValue := core.GetItemEffectScaling(itemID, 0.44999998808, state)
statValue := core.GetItemEffectScalingStatValue(itemID, 0.44999998808, state)

statBuffAura, aura := character.NewTemporaryStatBuffWithStacks(core.TemporaryStatBuffWithStacksConfig{
AuraLabel: fmt.Sprintf("Wushoolay's Lightning (%s)", versionLabel),
Expand Down Expand Up @@ -189,7 +189,7 @@ func init() {
core.NewItemEffect(itemID, func(agent core.Agent, state proto.ItemLevelState) {
character := agent.GetCharacter()

statValue := core.GetItemEffectScaling(itemID, 0.44999998808, state)
statValue := core.GetItemEffectScalingStatValue(itemID, 0.44999998808, state)

statBuffAura, aura := character.NewTemporaryStatBuffWithStacks(core.TemporaryStatBuffWithStacksConfig{
AuraLabel: fmt.Sprintf("Feathers of Fury (%s)", versionLabel),
Expand Down Expand Up @@ -235,7 +235,7 @@ func init() {

core.NewItemEffect(itemID, func(agent core.Agent, state proto.ItemLevelState) {
character := agent.GetCharacter()
statValue := core.GetItemEffectScaling(itemID, 2.97000002861, state)
statValue := core.GetItemEffectScalingStatValue(itemID, 2.97000002861, state)

aura, _ := character.NewTemporaryStatBuffWithStacks(core.TemporaryStatBuffWithStacksConfig{
Duration: time.Second * 20,
Expand Down Expand Up @@ -276,7 +276,7 @@ func init() {

core.NewItemEffect(itemID, func(agent core.Agent, state proto.ItemLevelState) {
character := agent.GetCharacter()
statValue := core.GetItemEffectScaling(itemID, 0.5189999938, state)
statValue := core.GetItemEffectScalingStatValue(itemID, 0.5189999938, state)

aura, _ := character.NewTemporaryStatBuffWithStacks(core.TemporaryStatBuffWithStacksConfig{
Duration: time.Second * 10,
Expand Down Expand Up @@ -320,7 +320,7 @@ func init() {
core.NewItemEffect(itemID, func(agent core.Agent, state proto.ItemLevelState) {
character := agent.GetCharacter()

shieldValue := core.GetItemEffectScaling(itemID, 9.45600032806, state)
shieldValue := core.GetItemEffectScalingStatValue(itemID, 9.45600032806, state)

// TODO: For now self-shield as there is no healing Sim
shield := character.NewDamageAbsorptionAura(core.AbsorptionAuraConfig{
Expand Down Expand Up @@ -365,7 +365,7 @@ func init() {
core.NewItemEffect(itemID, func(agent core.Agent, state proto.ItemLevelState) {
character := agent.GetCharacter()

healValue := core.GetItemEffectScaling(itemID, 13.61499977112, state)
healValue := core.GetItemEffectScalingStatValue(itemID, 13.61499977112, state)

spell := character.RegisterSpell(core.SpellConfig{
ActionID: core.ActionID{SpellID: 138973},
Expand Down Expand Up @@ -416,7 +416,7 @@ func init() {

core.NewItemEffect(itemID, func(agent core.Agent, state proto.ItemLevelState) {
character := agent.GetCharacter()
statValue := core.GetItemEffectScaling(itemID, 0.5189999938, state)
statValue := core.GetItemEffectScalingStatValue(itemID, 0.5189999938, state)

aura, _ := character.NewTemporaryStatBuffWithStacks(core.TemporaryStatBuffWithStacksConfig{
Duration: time.Second * 10,
Expand Down Expand Up @@ -460,7 +460,7 @@ func init() {

core.NewItemEffect(itemID, func(agent core.Agent, state proto.ItemLevelState) {
character := agent.GetCharacter()
statValue := core.GetItemEffectScaling(itemID, 0.96799999475, state)
statValue := core.GetItemEffectScalingStatValue(itemID, 0.96799999475, state)

aura, _ := character.NewTemporaryStatBuffWithStacks(core.TemporaryStatBuffWithStacksConfig{
Duration: time.Second * 20,
Expand Down Expand Up @@ -677,7 +677,7 @@ func init() {
core.NewItemEffect(itemID, func(agent core.Agent, state proto.ItemLevelState) {
character := agent.GetCharacter()
actionId := core.ActionID{SpellID: 138979, ItemID: itemID}
absorbPerHitValue := core.GetItemEffectScaling(itemID, 3.78200006485, state)
absorbPerHitValue := core.GetItemEffectScalingStatValue(itemID, 3.78200006485, state)

damageAbsorptionAura := character.NewDamageAbsorptionAura(core.AbsorptionAuraConfig{
Aura: core.Aura{
Expand Down Expand Up @@ -744,7 +744,7 @@ func init() {
core.NewItemEffect(itemID, func(agent core.Agent, state proto.ItemLevelState) {
character := agent.GetCharacter()

strengthValue := core.GetItemEffectScaling(itemID, 2.47499990463, state)
strengthValue := core.GetItemEffectScalingStatValue(itemID, 2.47499990463, state)

buffAura := character.NewTemporaryStatsAura(
fmt.Sprintf("Zandalari Warrior (%s)", versionLabel),
Expand Down Expand Up @@ -793,7 +793,7 @@ func init() {
character := agent.GetCharacter()
actionId := core.ActionID{SpellID: 138724, ItemID: 94509}

manaValue := core.GetItemEffectScaling(94509, 10.05900001526, state)
manaValue := core.GetItemEffectScalingStatValue(94509, 10.05900001526, state)
manaMetrics := character.NewManaMetrics(actionId)

spell := character.RegisterSpell(core.SpellConfig{
Expand Down
22 changes: 11 additions & 11 deletions sim/common/mop/trinkets_phase_4_54.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func init() {
auraID, exists := config.cdrAuraIDs[character.Spec]
var cdrAura *core.Aura
if exists {
cdr := 1.0 / (1.0 + core.GetItemEffectScaling(itemID, 0.00989999995, state)/100)
cdr := 1.0 / (1.0 + core.GetItemEffectScalingStatValue(itemID, 0.00989999995, state)/100)
cdrAura = core.MakePermanent(character.RegisterAura(core.Aura{
Label: fmt.Sprintf("Readiness (%s)", versionLabel),
ActionID: core.ActionID{SpellID: auraID},
Expand All @@ -66,7 +66,7 @@ func init() {
}

stats := stats.Stats{}
stats[config.buffedStat] = core.GetItemEffectScaling(itemID, 2.97300004959, state)
stats[config.buffedStat] = core.GetItemEffectScalingStatValue(itemID, 2.97300004959, state)

aura := character.NewTemporaryStatsAura(
fmt.Sprintf("%s (%s)", config.buffAuraLabel, versionLabel),
Expand Down Expand Up @@ -263,7 +263,7 @@ func init() {

multistrikeTriggerAura := character.MakeProcTriggerAura(core.ProcTrigger{
Name: fmt.Sprintf("%s (%s) - Multistrike Trigger", config.baseTrinketLabel, versionLabel),
ProcChance: core.GetItemEffectScaling(itemID, 0.03539999947, state) / 1000,
ProcChance: core.GetItemEffectScalingStatValue(itemID, 0.03539999947, state) / 1000,
Outcome: core.OutcomeLanded,
Callback: core.CallbackOnSpellHitDealt | core.CallbackOnPeriodicDamageDealt,
RequireDamageDealt: true,
Expand All @@ -287,7 +287,7 @@ func init() {
})

stats := stats.Stats{}
stats[config.buffedStat] = core.GetItemEffectScaling(itemID, 2.97300004959, state)
stats[config.buffedStat] = core.GetItemEffectScalingStatValue(itemID, 2.97300004959, state)

statBuffAura := character.NewTemporaryStatsAura(
fmt.Sprintf("%s (%s)", config.buffAuraLabel, versionLabel),
Expand Down Expand Up @@ -382,7 +382,7 @@ func init() {
AttachMultiplicativePseudoStatBuff(&character.PseudoStats.CritDamageMultiplier, critDamageValue)

stats := stats.Stats{}
stats[config.buffedStat] = core.GetItemEffectScaling(itemID, 2.97300004959, state)
stats[config.buffedStat] = core.GetItemEffectScalingStatValue(itemID, 2.97300004959, state)

aura := character.NewTemporaryStatsAura(
fmt.Sprintf("%s (%s)", config.buffAuraLabel, versionLabel),
Expand Down Expand Up @@ -466,7 +466,7 @@ func init() {
core.NewItemEffect(itemID, func(agent core.Agent, state proto.ItemLevelState) {
character := agent.GetCharacter()

statValue := core.GetItemEffectScaling(itemID, 0.27030000091, state)
statValue := core.GetItemEffectScalingStatValue(itemID, 0.27030000091, state)
statBuffAura, aura := character.NewTemporaryStatBuffWithStacks(core.TemporaryStatBuffWithStacksConfig{
AuraLabel: fmt.Sprintf("Item - Proc Agility (%s)", versionLabel),
ActionID: core.ActionID{SpellID: 146311},
Expand Down Expand Up @@ -579,7 +579,7 @@ func init() {

cleaveTriggerAura := character.MakeProcTriggerAura(core.ProcTrigger{
Name: fmt.Sprintf("%s (%s) - Cleave Trigger", config.baseTrinketLabel, versionLabel),
ProcChance: core.GetItemEffectScaling(itemID, 0.07859999686, state) / 10000,
ProcChance: core.GetItemEffectScalingStatValue(itemID, 0.07859999686, state) / 10000,
Outcome: core.OutcomeLanded,
Callback: core.CallbackOnSpellHitDealt | core.CallbackOnPeriodicDamageDealt,
RequireDamageDealt: true,
Expand All @@ -602,7 +602,7 @@ func init() {
})

stats := stats.Stats{}
stats[config.buffedStat] = core.GetItemEffectScaling(itemID, 2.97300004959, state)
stats[config.buffedStat] = core.GetItemEffectScalingStatValue(itemID, 2.97300004959, state)

statBuffAura := character.NewTemporaryStatsAura(
fmt.Sprintf("%s (%s)", config.buffAuraLabel, versionLabel),
Expand Down Expand Up @@ -703,7 +703,7 @@ func init() {
aura := character.NewTemporaryStatsAura(
"Winds of Time",
core.ActionID{SpellID: 148447},
stats.Stats{stats.HasteRating: core.GetItemEffectScaling(103678, 1.56799995899, state)},
stats.Stats{stats.HasteRating: core.GetItemEffectScalingStatValue(103678, 1.56799995899, state)},
time.Second*20,
)

Expand Down Expand Up @@ -744,7 +744,7 @@ func init() {
core.NewItemEffect(itemID, func(agent core.Agent, state proto.ItemLevelState) {
character := agent.GetCharacter()

statValue := core.GetItemEffectScaling(itemID, 0.29699999094, state)
statValue := core.GetItemEffectScalingStatValue(itemID, 0.29699999094, state)
statBuffAura, aura := character.NewTemporaryStatBuffWithStacks(core.TemporaryStatBuffWithStacksConfig{
AuraLabel: fmt.Sprintf("Item - Proc Critical Strike (%s)", versionLabel),
ActionID: core.ActionID{SpellID: 146286},
Expand Down Expand Up @@ -797,7 +797,7 @@ func init() {
core.NewItemEffect(itemID, func(agent core.Agent, state proto.ItemLevelState) {
character := agent.GetCharacter()

statValue := core.GetItemEffectScaling(itemID, 0.59399998188, state)
statValue := core.GetItemEffectScalingStatValue(itemID, 0.59399998188, state)
statBuffAura, aura := character.NewTemporaryStatBuffWithStacks(core.TemporaryStatBuffWithStacksConfig{
AuraLabel: fmt.Sprintf("Item - Proc Intellect (%s)", versionLabel),
ActionID: core.ActionID{SpellID: 146183},
Expand Down
4 changes: 2 additions & 2 deletions sim/common/mop/weapons.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func init() {
core.NewItemEffect(86518, func(agent core.Agent, state proto.ItemLevelState) {
character := agent.GetCharacter()

statValue := core.GetItemEffectScaling(86518, 0.58200001717, state)
statValue := core.GetItemEffectScalingStatValue(86518, 0.58200001717, state)

dot := character.RegisterSpell(core.SpellConfig{
ActionID: core.ActionID{SpellID: 126211},
Expand Down Expand Up @@ -66,7 +66,7 @@ func init() {
core.NewItemEffect(88149, func(agent core.Agent, state proto.ItemLevelState) {
character := agent.GetCharacter()

statValue := core.GetItemEffectScaling(88149, 0.19400000572, state)
statValue := core.GetItemEffectScalingStatValue(88149, 0.19400000572, state)

aura, _ := character.NewTemporaryStatBuffWithStacks(core.TemporaryStatBuffWithStacksConfig{
AuraLabel: "The Deepest Night",
Expand Down
9 changes: 8 additions & 1 deletion sim/core/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,16 @@ func ApplyVarianceMinMax(avgEffect float64, variance float64) (float64, float64)
return min, max
}

// Used to get stat values for item effects which are rounded
func GetItemEffectScalingStatValue(itemID int32, coeff float64, state proto.ItemLevelState) float64 {
return math.Round(GetItemEffectScaling(itemID, coeff, state))
}

// Used to get non-rounded stat values for item effects such as the amplify trinkets
func GetItemEffectScaling(itemID int32, coeff float64, state proto.ItemLevelState) float64 {
return math.Round(GetItemEffectRandomPropPointsForItem(itemID, state) * coeff)
return GetItemEffectRandomPropPointsForItem(itemID, state) * coeff
}

func GetItemEffectRandomPropPointsForItem(itemID int32, state proto.ItemLevelState) float64 {
return float64(GetItemByID(itemID).GetItemEffectRandomPropPoints(state))
}
Expand Down
16 changes: 8 additions & 8 deletions sim/death_knight/blood/TestBlood.results
Original file line number Diff line number Diff line change
Expand Up @@ -2175,10 +2175,10 @@ dps_results: {
dps_results: {
key: "TestBlood-AllItems-PurifiedBindingsofImmerseus-105422"
value: {
dps: 221038.23925
tps: 1.12998075584e+06
dtps: 65350.88916
hps: 75774.17892
dps: 222522.07303
tps: 1.13700032401e+06
dtps: 65501.94312
hps: 77051.43884
}
}
dps_results: {
Expand Down Expand Up @@ -2778,10 +2778,10 @@ dps_results: {
dps_results: {
key: "TestBlood-AllItems-Thok'sTailTip-105609"
value: {
dps: 235162.10111
tps: 1.17836885814e+06
dtps: 61829.69343
hps: 74675.65419
dps: 234442.55094
tps: 1.16684998645e+06
dtps: 61978.86325
hps: 73970.5914
}
}
dps_results: {
Expand Down
12 changes: 6 additions & 6 deletions sim/death_knight/frost/TestFrostMasterfrost.results
Original file line number Diff line number Diff line change
Expand Up @@ -1937,9 +1937,9 @@ dps_results: {
dps_results: {
key: "TestFrostMasterfrost-AllItems-PurifiedBindingsofImmerseus-105422"
value: {
dps: 234412.98661
tps: 214004.69927
hps: 2116.65143
dps: 233612.54513
tps: 213549.54703
hps: 2124.6119
}
}
dps_results: {
Expand Down Expand Up @@ -2465,9 +2465,9 @@ dps_results: {
dps_results: {
key: "TestFrostMasterfrost-AllItems-Thok'sTailTip-105609"
value: {
dps: 257692.42948
tps: 232208.58857
hps: 2127.9856
dps: 256317.34127
tps: 231164.20664
hps: 2119.20265
}
}
dps_results: {
Expand Down
12 changes: 6 additions & 6 deletions sim/death_knight/frost/TestFrostTwoHand.results
Original file line number Diff line number Diff line change
Expand Up @@ -1937,9 +1937,9 @@ dps_results: {
dps_results: {
key: "TestFrostTwoHand-AllItems-PurifiedBindingsofImmerseus-105422"
value: {
dps: 231878.42616
tps: 207103.0317
hps: 3517.82943
dps: 232276.34849
tps: 207290.01726
hps: 3499.50485
}
}
dps_results: {
Expand Down Expand Up @@ -2473,9 +2473,9 @@ dps_results: {
dps_results: {
key: "TestFrostTwoHand-AllItems-Thok'sTailTip-105609"
value: {
dps: 251613.47133
tps: 221092.1543
hps: 3517.82943
dps: 251818.94755
tps: 221019.39547
hps: 3499.50485
}
}
dps_results: {
Expand Down
12 changes: 6 additions & 6 deletions sim/death_knight/unholy/TestUnholy.results
Original file line number Diff line number Diff line change
Expand Up @@ -1929,9 +1929,9 @@ dps_results: {
dps_results: {
key: "TestUnholy-AllItems-PurifiedBindingsofImmerseus-105422"
value: {
dps: 225715.95142
tps: 159412.01859
hps: 2614.42257
dps: 225580.43504
tps: 159245.02815
hps: 2642.48736
}
}
dps_results: {
Expand Down Expand Up @@ -2465,9 +2465,9 @@ dps_results: {
dps_results: {
key: "TestUnholy-AllItems-Thok'sTailTip-105609"
value: {
dps: 253481.52708
tps: 175046.05169
hps: 2612.06585
dps: 252511.72443
tps: 174076.39906
hps: 2619.82608
}
}
dps_results: {
Expand Down
Loading