From d8da12ed40fb563ed522bc992a7298cbd720d363 Mon Sep 17 00:00:00 2001 From: ToxicKevinFerm Date: Tue, 11 Jun 2024 17:45:34 +0200 Subject: [PATCH 1/4] Use RangedSpeedMultiplier for Hunter --- sim/core/character.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/sim/core/character.go b/sim/core/character.go index 89da383fe5..f4024ab1f9 100644 --- a/sim/core/character.go +++ b/sim/core/character.go @@ -259,8 +259,11 @@ func (character *Character) applyAllEffects(agent Agent, raidBuffs *proto.RaidBu meleeMulti := 1 + (base.Stats[stats.MeleeHaste] / (HasteRatingPerHastePercent * 100)) spellMulti := 1 + (base.Stats[stats.SpellHaste] / (HasteRatingPerHastePercent * 100)) - // TODO: Hunter would like to use RangedSpeedMultiplier - base.Stats[stats.MeleeHaste] = (meleeMulti*character.PseudoStats.MeleeSpeedMultiplier - 1) * 100 * HasteRatingPerHastePercent + if agent.GetCharacter().Class == proto.Class_ClassHunter { + base.Stats[stats.MeleeHaste] = (meleeMulti*character.PseudoStats.RangedSpeedMultiplier - 1) * 100 * HasteRatingPerHastePercent + } else { + base.Stats[stats.MeleeHaste] = (meleeMulti*character.PseudoStats.MeleeSpeedMultiplier - 1) * 100 * HasteRatingPerHastePercent + } base.Stats[stats.SpellHaste] = (spellMulti*character.PseudoStats.CastSpeedMultiplier - 1) * 100 * HasteRatingPerHastePercent return base } @@ -479,8 +482,12 @@ func (character *Character) FillPlayerStats(playerStats *proto.PlayerStats) { meleeMulti := 1 + (playerStats.FinalStats.Stats[stats.MeleeHaste] / (HasteRatingPerHastePercent * 100)) spellMulti := 1 + (playerStats.FinalStats.Stats[stats.SpellHaste] / (HasteRatingPerHastePercent * 100)) + if character.Class == proto.Class_ClassHunter { + playerStats.FinalStats.Stats[stats.MeleeHaste] = (meleeMulti*character.PseudoStats.RangedSpeedMultiplier - 1) * 100 * HasteRatingPerHastePercent + } else { + playerStats.FinalStats.Stats[stats.MeleeHaste] = (meleeMulti*character.PseudoStats.MeleeSpeedMultiplier - 1) * 100 * HasteRatingPerHastePercent + } - playerStats.FinalStats.Stats[stats.MeleeHaste] = (meleeMulti*character.PseudoStats.MeleeSpeedMultiplier - 1) * 100 * HasteRatingPerHastePercent playerStats.FinalStats.Stats[stats.SpellHaste] = (spellMulti*character.PseudoStats.CastSpeedMultiplier - 1) * 100 * HasteRatingPerHastePercent character.clearBuildPhaseAuras(CharacterBuildPhaseAll) From 8493919866690de8bd08eed164b2d56778c28d4a Mon Sep 17 00:00:00 2001 From: ToxicKevinFerm Date: Tue, 11 Jun 2024 17:45:48 +0200 Subject: [PATCH 2/4] Fix suggest reforge --- sim/hunter/survival_talents.go | 12 ++++++++++-- ui/hunter/beast_mastery/sim.ts | 19 ++++++++++++------- ui/hunter/marksmanship/sim.ts | 21 +++++++++++++-------- ui/hunter/survival/sim.ts | 23 ++++++++++++++--------- 4 files changed, 49 insertions(+), 26 deletions(-) diff --git a/sim/hunter/survival_talents.go b/sim/hunter/survival_talents.go index 8211214e52..ef6564c0f0 100644 --- a/sim/hunter/survival_talents.go +++ b/sim/hunter/survival_talents.go @@ -10,7 +10,16 @@ import ( func (hunter *Hunter) ApplySurvivalTalents() { if hunter.Talents.Pathing > 0 { bonus := 0.01 * float64(hunter.Talents.Pathing) - hunter.PseudoStats.RangedSpeedMultiplier *= 1 + bonus + core.MakePermanent(hunter.RegisterAura(core.Aura{ + BuildPhase: core.CharacterBuildPhaseBase, + Label: "Pathing", + OnReset: func(aura *core.Aura, sim *core.Simulation) { + hunter.PseudoStats.RangedSpeedMultiplier /= 1 + bonus + }, + OnGain: func(aura *core.Aura, sim *core.Simulation) { + hunter.PseudoStats.RangedSpeedMultiplier *= 1 + bonus + }, + })) } if hunter.Talents.HunterVsWild > 0 { @@ -78,7 +87,6 @@ func (hunter *Hunter) applyThrillOfTheHunt() { hunter.AddFocus(sim, spell.CurCast.Cost*0.4, focusMetrics) } } - }, }) } diff --git a/ui/hunter/beast_mastery/sim.ts b/ui/hunter/beast_mastery/sim.ts index a95016aa83..ea13041ba0 100644 --- a/ui/hunter/beast_mastery/sim.ts +++ b/ui/hunter/beast_mastery/sim.ts @@ -1,5 +1,6 @@ import * as BuffDebuffInputs from '../../core/components/inputs/buffs_debuffs'; import * as OtherInputs from '../../core/components/other_inputs'; +import { ReforgeOptimizer } from '../../core/components/suggest_reforges_action'; import * as Mechanics from '../../core/constants/mechanics'; import { IndividualSimUI, registerSpecConfig } from '../../core/individual_sim_ui'; import { Player } from '../../core/player'; @@ -74,9 +75,6 @@ const SPEC_CONFIG = registerSpecConfig(Spec.SpecBeastMasteryHunter, { if (player.getRace() == Race.RaceTroll && rangedWeapon?.item.rangedWeaponType == RangedWeaponType.RangedWeaponTypeBow) { stats = stats.addStat(Stat.StatMeleeCrit, 1 * Mechanics.MELEE_CRIT_RATING_PER_CRIT_CHANCE); } - if (player.getTalents().pathing) { - stats = stats.addStat(Stat.StatMeleeHaste, player.getTalents().pathing * Mechanics.HASTE_RATING_PER_HASTE_PERCENT); - } return { talents: stats, }; @@ -89,11 +87,11 @@ const SPEC_CONFIG = registerSpecConfig(Spec.SpecBeastMasteryHunter, { { [Stat.StatStamina]: 0.5, [Stat.StatAgility]: 2.65, - [Stat.StatIntellect]: 1.1, [Stat.StatRangedAttackPower]: 1.0, - [Stat.StatMeleeHit]: 2, - [Stat.StatMeleeCrit]: 1.5, - [Stat.StatMeleeHaste]: 1.39, + [Stat.StatMeleeHit]: 2.12, + [Stat.StatMeleeCrit]: 1.19, + [Stat.StatMeleeHaste]: 0.97, + [Stat.StatMastery]: 0.55, }, { [PseudoStat.PseudoStatRangedDps]: 6.32, @@ -264,5 +262,12 @@ const SPEC_CONFIG = registerSpecConfig(Spec.SpecBeastMasteryHunter, { export class BeastMasteryHunterSimUI extends IndividualSimUI { constructor(parentElem: HTMLElement, player: Player) { super(parentElem, player, SPEC_CONFIG); + // Auto-Reforge configuration + const hitCap = new Stats().withStat(Stat.StatMeleeHit, 8 * Mechanics.MELEE_HIT_RATING_PER_HIT_CHANCE); + const statWeightsConfig = { + statCaps: hitCap, + preCapEPs: this.individualConfig.defaults.epWeights, + }; + const reforgeOptimizer = new ReforgeOptimizer(this, statWeightsConfig); } } diff --git a/ui/hunter/marksmanship/sim.ts b/ui/hunter/marksmanship/sim.ts index ff5ccb4508..fb4b206b8b 100644 --- a/ui/hunter/marksmanship/sim.ts +++ b/ui/hunter/marksmanship/sim.ts @@ -1,5 +1,6 @@ import * as BuffDebuffInputs from '../../core/components/inputs/buffs_debuffs'; import * as OtherInputs from '../../core/components/other_inputs'; +import { ReforgeOptimizer } from '../../core/components/suggest_reforges_action'; import * as Mechanics from '../../core/constants/mechanics'; import { IndividualSimUI, registerSpecConfig } from '../../core/individual_sim_ui'; import { Player } from '../../core/player'; @@ -72,9 +73,6 @@ const SPEC_CONFIG = registerSpecConfig(Spec.SpecMarksmanshipHunter, { if (player.getRace() == Race.RaceTroll && rangedWeapon?.item.rangedWeaponType == RangedWeaponType.RangedWeaponTypeBow) { stats = stats.addStat(Stat.StatMeleeCrit, 1 * Mechanics.MELEE_CRIT_RATING_PER_CRIT_CHANCE); } - if (player.getTalents().pathing) { - stats = stats.addStat(Stat.StatMeleeHaste, player.getTalents().pathing * Mechanics.HASTE_RATING_PER_HASTE_PERCENT); - } return { talents: stats, }; @@ -87,12 +85,12 @@ const SPEC_CONFIG = registerSpecConfig(Spec.SpecMarksmanshipHunter, { epWeights: Stats.fromMap( { [Stat.StatStamina]: 0.5, - [Stat.StatAgility]: 2.65, - [Stat.StatIntellect]: 1.1, + [Stat.StatAgility]: 3.05, [Stat.StatRangedAttackPower]: 1.0, - [Stat.StatMeleeHit]: 2, - [Stat.StatMeleeCrit]: 1.5, - [Stat.StatMeleeHaste]: 1.39, + [Stat.StatMeleeHit]: 2.25, + [Stat.StatMeleeCrit]: 1.39, + [Stat.StatMeleeHaste]: 1.33, + [Stat.StatMastery]: 1.15, }, { [PseudoStat.PseudoStatRangedDps]: 6.32, @@ -270,5 +268,12 @@ const SPEC_CONFIG = registerSpecConfig(Spec.SpecMarksmanshipHunter, { export class MarksmanshipHunterSimUI extends IndividualSimUI { constructor(parentElem: HTMLElement, player: Player) { super(parentElem, player, SPEC_CONFIG); + // Auto-Reforge configuration + const hitCap = new Stats().withStat(Stat.StatMeleeHit, 8 * Mechanics.MELEE_HIT_RATING_PER_HIT_CHANCE); + const statWeightsConfig = { + statCaps: hitCap, + preCapEPs: this.individualConfig.defaults.epWeights, + }; + const reforgeOptimizer = new ReforgeOptimizer(this, statWeightsConfig); } } diff --git a/ui/hunter/survival/sim.ts b/ui/hunter/survival/sim.ts index f514b4093f..3f039ec17e 100644 --- a/ui/hunter/survival/sim.ts +++ b/ui/hunter/survival/sim.ts @@ -1,5 +1,6 @@ import * as BuffDebuffInputs from '../../core/components/inputs/buffs_debuffs'; import * as OtherInputs from '../../core/components/other_inputs'; +import { ReforgeOptimizer } from '../../core/components/suggest_reforges_action'; import * as Mechanics from '../../core/constants/mechanics'; import { IndividualSimUI, registerSpecConfig } from '../../core/individual_sim_ui'; import { Player } from '../../core/player'; @@ -65,9 +66,6 @@ const SPEC_CONFIG = registerSpecConfig(Spec.SpecSurvivalHunter, { if (player.getRace() == Race.RaceTroll && rangedWeapon?.item.rangedWeaponType == RangedWeaponType.RangedWeaponTypeBow) { stats = stats.addStat(Stat.StatMeleeCrit, 1 * Mechanics.MELEE_CRIT_RATING_PER_CRIT_CHANCE); } - if (player.getTalents().pathing) { - stats = stats.addStat(Stat.StatMeleeHaste, player.getTalents().pathing * Mechanics.HASTE_RATING_PER_HASTE_PERCENT); - } return { talents: stats, }; @@ -80,16 +78,16 @@ const SPEC_CONFIG = registerSpecConfig(Spec.SpecSurvivalHunter, { epWeights: Stats.fromMap( { [Stat.StatStamina]: 0.5, - [Stat.StatAgility]: 2.65, + [Stat.StatAgility]: 3.27, [Stat.StatIntellect]: 1.1, [Stat.StatRangedAttackPower]: 1.0, - [Stat.StatMeleeHit]: 2, - [Stat.StatMeleeCrit]: 1.5, - [Stat.StatMeleeHaste]: 1.39, - [Stat.StatMastery]: 1.32, + [Stat.StatMeleeHit]: 2.16, + [Stat.StatMeleeCrit]: 1.17, + [Stat.StatMeleeHaste]: 0.89, + [Stat.StatMastery]: 0.88, }, { - [PseudoStat.PseudoStatRangedDps]: 6.32, + [PseudoStat.PseudoStatRangedDps]: 3.75, }, ), other: Presets.OtherDefaults, @@ -265,5 +263,12 @@ const SPEC_CONFIG = registerSpecConfig(Spec.SpecSurvivalHunter, { export class SurvivalHunterSimUI extends IndividualSimUI { constructor(parentElem: HTMLElement, player: Player) { super(parentElem, player, SPEC_CONFIG); + // Auto-Reforge configuration + const hitCap = new Stats().withStat(Stat.StatMeleeHit, 8 * Mechanics.MELEE_HIT_RATING_PER_HIT_CHANCE); + const statWeightsConfig = { + statCaps: hitCap, + preCapEPs: this.individualConfig.defaults.epWeights, + }; + const reforgeOptimizer = new ReforgeOptimizer(this, statWeightsConfig); } } From a0ee9ff5360b32e2f1cbccc7be94f43b67d145fc Mon Sep 17 00:00:00 2001 From: ToxicKevinFerm Date: Tue, 11 Jun 2024 17:50:40 +0200 Subject: [PATCH 3/4] WaitforInit --- ui/hunter/beast_mastery/sim.ts | 14 ++++++++------ ui/hunter/marksmanship/sim.ts | 15 ++++++++------- ui/hunter/survival/sim.ts | 14 ++++++++------ 3 files changed, 24 insertions(+), 19 deletions(-) diff --git a/ui/hunter/beast_mastery/sim.ts b/ui/hunter/beast_mastery/sim.ts index ea13041ba0..f1cde45ff6 100644 --- a/ui/hunter/beast_mastery/sim.ts +++ b/ui/hunter/beast_mastery/sim.ts @@ -263,11 +263,13 @@ export class BeastMasteryHunterSimUI extends IndividualSimUI) { super(parentElem, player, SPEC_CONFIG); // Auto-Reforge configuration - const hitCap = new Stats().withStat(Stat.StatMeleeHit, 8 * Mechanics.MELEE_HIT_RATING_PER_HIT_CHANCE); - const statWeightsConfig = { - statCaps: hitCap, - preCapEPs: this.individualConfig.defaults.epWeights, - }; - const reforgeOptimizer = new ReforgeOptimizer(this, statWeightsConfig); + player.sim.waitForInit().then(() => { + const hitCap = new Stats().withStat(Stat.StatMeleeHit, 8 * Mechanics.MELEE_HIT_RATING_PER_HIT_CHANCE); + const statWeightsConfig = { + statCaps: hitCap, + preCapEPs: this.individualConfig.defaults.epWeights, + }; + new ReforgeOptimizer(this, statWeightsConfig); + }); } } diff --git a/ui/hunter/marksmanship/sim.ts b/ui/hunter/marksmanship/sim.ts index fb4b206b8b..fce27e5381 100644 --- a/ui/hunter/marksmanship/sim.ts +++ b/ui/hunter/marksmanship/sim.ts @@ -268,12 +268,13 @@ const SPEC_CONFIG = registerSpecConfig(Spec.SpecMarksmanshipHunter, { export class MarksmanshipHunterSimUI extends IndividualSimUI { constructor(parentElem: HTMLElement, player: Player) { super(parentElem, player, SPEC_CONFIG); - // Auto-Reforge configuration - const hitCap = new Stats().withStat(Stat.StatMeleeHit, 8 * Mechanics.MELEE_HIT_RATING_PER_HIT_CHANCE); - const statWeightsConfig = { - statCaps: hitCap, - preCapEPs: this.individualConfig.defaults.epWeights, - }; - const reforgeOptimizer = new ReforgeOptimizer(this, statWeightsConfig); + player.sim.waitForInit().then(() => { + const hitCap = new Stats().withStat(Stat.StatMeleeHit, 8 * Mechanics.MELEE_HIT_RATING_PER_HIT_CHANCE); + const statWeightsConfig = { + statCaps: hitCap, + preCapEPs: this.individualConfig.defaults.epWeights, + }; + new ReforgeOptimizer(this, statWeightsConfig); + }); } } diff --git a/ui/hunter/survival/sim.ts b/ui/hunter/survival/sim.ts index 3f039ec17e..8b9cb5c273 100644 --- a/ui/hunter/survival/sim.ts +++ b/ui/hunter/survival/sim.ts @@ -264,11 +264,13 @@ export class SurvivalHunterSimUI extends IndividualSimUI) { super(parentElem, player, SPEC_CONFIG); // Auto-Reforge configuration - const hitCap = new Stats().withStat(Stat.StatMeleeHit, 8 * Mechanics.MELEE_HIT_RATING_PER_HIT_CHANCE); - const statWeightsConfig = { - statCaps: hitCap, - preCapEPs: this.individualConfig.defaults.epWeights, - }; - const reforgeOptimizer = new ReforgeOptimizer(this, statWeightsConfig); + player.sim.waitForInit().then(() => { + const hitCap = new Stats().withStat(Stat.StatMeleeHit, 8 * Mechanics.MELEE_HIT_RATING_PER_HIT_CHANCE); + const statWeightsConfig = { + statCaps: hitCap, + preCapEPs: this.individualConfig.defaults.epWeights, + }; + new ReforgeOptimizer(this, statWeightsConfig); + }); } } From 2423a7c60c24f3e0fef081f31c04fefb085db0c4 Mon Sep 17 00:00:00 2001 From: ToxicKevinFerm Date: Tue, 11 Jun 2024 18:13:25 +0200 Subject: [PATCH 4/4] Use OnExpire instead --- sim/hunter/beast_mastery/TestBM.results | 2 +- sim/hunter/marksmanship/TestMM.results | 2 +- sim/hunter/survival/TestSV.results | 2 +- sim/hunter/survival_talents.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sim/hunter/beast_mastery/TestBM.results b/sim/hunter/beast_mastery/TestBM.results index caebec1570..35f1a9adc1 100644 --- a/sim/hunter/beast_mastery/TestBM.results +++ b/sim/hunter/beast_mastery/TestBM.results @@ -15,7 +15,7 @@ character_stats_results: { final_stats: 17922.0288 final_stats: 962 final_stats: 5623.72809 - final_stats: 2162.7716 + final_stats: 2611.82623 final_stats: 0 final_stats: 0 final_stats: 14342 diff --git a/sim/hunter/marksmanship/TestMM.results b/sim/hunter/marksmanship/TestMM.results index dba33ae527..c11370c99f 100644 --- a/sim/hunter/marksmanship/TestMM.results +++ b/sim/hunter/marksmanship/TestMM.results @@ -15,7 +15,7 @@ character_stats_results: { final_stats: 13786.176 final_stats: 962 final_stats: 5623.72809 - final_stats: 2162.7716 + final_stats: 2611.82623 final_stats: 0 final_stats: 0 final_stats: 14342 diff --git a/sim/hunter/survival/TestSV.results b/sim/hunter/survival/TestSV.results index 62ac06d4dd..760abefdda 100644 --- a/sim/hunter/survival/TestSV.results +++ b/sim/hunter/survival/TestSV.results @@ -15,7 +15,7 @@ character_stats_results: { final_stats: 15418.31347 final_stats: 962 final_stats: 6001.68224 - final_stats: 2162.7716 + final_stats: 2611.82623 final_stats: 0 final_stats: 0 final_stats: 14342 diff --git a/sim/hunter/survival_talents.go b/sim/hunter/survival_talents.go index ef6564c0f0..93b31ba7eb 100644 --- a/sim/hunter/survival_talents.go +++ b/sim/hunter/survival_talents.go @@ -13,7 +13,7 @@ func (hunter *Hunter) ApplySurvivalTalents() { core.MakePermanent(hunter.RegisterAura(core.Aura{ BuildPhase: core.CharacterBuildPhaseBase, Label: "Pathing", - OnReset: func(aura *core.Aura, sim *core.Simulation) { + OnExpire: func(aura *core.Aura, sim *core.Simulation) { hunter.PseudoStats.RangedSpeedMultiplier /= 1 + bonus }, OnGain: func(aura *core.Aura, sim *core.Simulation) {