Skip to content

Commit

Permalink
Merge pull request #663 from wowsims/hunter-mm-reforge
Browse files Browse the repository at this point in the history
Fix Hunter Pathing visualisation and add suggest reforge implementation
  • Loading branch information
ToxicKevinFerm authored Jun 11, 2024
2 parents 9423c94 + 2423a7c commit 799d6d7
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 32 deletions.
13 changes: 10 additions & 3 deletions sim/core/character.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion sim/hunter/beast_mastery/TestBM.results
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion sim/hunter/marksmanship/TestMM.results
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion sim/hunter/survival/TestSV.results
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 10 additions & 2 deletions sim/hunter/survival_talents.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
OnExpire: 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 {
Expand Down Expand Up @@ -78,7 +87,6 @@ func (hunter *Hunter) applyThrillOfTheHunt() {
hunter.AddFocus(sim, spell.CurCast.Cost*0.4, focusMetrics)
}
}

},
})
}
Expand Down
21 changes: 14 additions & 7 deletions ui/hunter/beast_mastery/sim.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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,
};
Expand All @@ -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,
Expand Down Expand Up @@ -264,5 +262,14 @@ const SPEC_CONFIG = registerSpecConfig(Spec.SpecBeastMasteryHunter, {
export class BeastMasteryHunterSimUI extends IndividualSimUI<Spec.SpecBeastMasteryHunter> {
constructor(parentElem: HTMLElement, player: Player<Spec.SpecBeastMasteryHunter>) {
super(parentElem, player, SPEC_CONFIG);
// Auto-Reforge configuration
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);
});
}
}
22 changes: 14 additions & 8 deletions ui/hunter/marksmanship/sim.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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,
};
Expand All @@ -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,
Expand Down Expand Up @@ -270,5 +268,13 @@ const SPEC_CONFIG = registerSpecConfig(Spec.SpecMarksmanshipHunter, {
export class MarksmanshipHunterSimUI extends IndividualSimUI<Spec.SpecMarksmanshipHunter> {
constructor(parentElem: HTMLElement, player: Player<Spec.SpecMarksmanshipHunter>) {
super(parentElem, player, SPEC_CONFIG);
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);
});
}
}
25 changes: 16 additions & 9 deletions ui/hunter/survival/sim.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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,
};
Expand All @@ -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,
Expand Down Expand Up @@ -265,5 +263,14 @@ const SPEC_CONFIG = registerSpecConfig(Spec.SpecSurvivalHunter, {
export class SurvivalHunterSimUI extends IndividualSimUI<Spec.SpecSurvivalHunter> {
constructor(parentElem: HTMLElement, player: Player<Spec.SpecSurvivalHunter>) {
super(parentElem, player, SPEC_CONFIG);
// Auto-Reforge configuration
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);
});
}
}

0 comments on commit 799d6d7

Please sign in to comment.