Skip to content

Commit

Permalink
Merge pull request #1119 from wowsims/fix/mage-t3-hs-formula
Browse files Browse the repository at this point in the history
[MAGE] Fix T3 HS formula
  • Loading branch information
1337LutZ authored Oct 22, 2024
2 parents 74e1ef2 + f6d6816 commit 2aaba98
Show file tree
Hide file tree
Showing 10 changed files with 914 additions and 953 deletions.
650 changes: 325 additions & 325 deletions sim/mage/arcane/TestArcane.results

Large diffs are not rendered by default.

1,144 changes: 572 additions & 572 deletions sim/mage/fire/TestFire.results

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions sim/mage/items.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ var ItemSetFirehawkRobesOfConflagration = core.NewItemSet(core.ItemSet{
ActionID: core.ActionID{SpellID: 99064},
OnGain: func(aura *core.Aura, sim *core.Simulation) {
mage.brainFreezeProcChance += .15
mage.hotStreakProcChance += 0.30
mage.baseHotStreakProcChance += 0.30
},
OnExpire: func(aura *core.Aura, sim *core.Simulation) {
mage.brainFreezeProcChance -= .15
mage.hotStreakProcChance -= .30
mage.baseHotStreakProcChance -= .30
},
}))

Expand Down
2 changes: 1 addition & 1 deletion sim/mage/mage.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ type Mage struct {

arcaneMissileCritSnapshot float64
brainFreezeProcChance float64
hotStreakProcChance float64
baseHotStreakProcChance float64

previousCombustionDotEstimate int32

Expand Down
19 changes: 10 additions & 9 deletions sim/mage/talents_fire.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,12 @@ func (mage *Mage) applyHotStreak() {
return
}

ImprovedHotStreakProcChance := float64(mage.Talents.ImprovedHotStreak) * 0.5
improvedHotStreakProcChance := float64(mage.Talents.ImprovedHotStreak) * 0.5

// Simcraft uses a reference from ElitistJerks that's no longer available, but their formula is
// max(0, -2.73 * player crit + 0.95)
// https://web.archive.org/web/20120208064232/http://elitistjerks.com/f75/t110326-cataclysm_fire_mage_compendium/p6/#post1831143 or
// https://web.archive.org/web/20120208064232/http://elitistjerks.com/f75/t110326-cataclysm_fire_mage_compendium/p6/#post1831207
baseCritPercent := mage.GetStat(stats.SpellCritPercent) + (mage.GetStat(stats.CritRating) / core.CritRatingPerCritPercent) + 1*float64(mage.Talents.PiercingIce)
mage.hotStreakProcChance = max(0, float64(-2.7*baseCritPercent/100+0.9)) // EJ settled on -2.7*critChance+0.9
// This is the new formula as the old Simcraft / EJ has been debunked by PTR testing.
calculateHotStreakProcChance := func(x float64) float64 {
return -2.67*min(x, 0.3402) + 0.9230
}

hotStreakCostMod := mage.AddDynamicMod(core.SpellModConfig{
Kind: core.SpellMod_PowerCost_Pct,
Expand Down Expand Up @@ -194,7 +192,10 @@ func (mage *Mage) applyHotStreak() {
}
// Hot Streak Base Talent Proc
if result.DidCrit() {
if sim.Proc(mage.hotStreakProcChance, "Hot Streak") {
baseCritPercent := mage.GetStat(stats.SpellCritPercent)
hotStreakProcChance := mage.baseHotStreakProcChance + calculateHotStreakProcChance(baseCritPercent/100)

if sim.Proc(hotStreakProcChance, "Hot Streak") {
hotStreakAura.Activate(sim)
}
}
Expand All @@ -211,7 +212,7 @@ func (mage *Mage) applyHotStreak() {
// If you did crit, check against talents to see if you proc
// If you proc and had 1 stack, set crit counter to 0 and give hot streak.
if hotStreakCritAura.GetStacks() == 1 {
if sim.Proc(ImprovedHotStreakProcChance, "Improved Hot Streak") {
if sim.Proc(improvedHotStreakProcChance, "Improved Hot Streak") {
hotStreakCritAura.SetStacks(sim, 0)
hotStreakCritAura.Deactivate(sim)

Expand Down
6 changes: 1 addition & 5 deletions sim/mage/talents_frost.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,7 @@ func (mage *Mage) ApplyFrostTalents() {

// Piercing Ice
if mage.Talents.PiercingIce > 0 {
mage.AddStaticMod(core.SpellModConfig{
ClassMask: MageSpellsAll,
FloatValue: 1 * float64(mage.Talents.PiercingIce),
Kind: core.SpellMod_BonusCrit_Percent,
})
mage.AddStat(stats.SpellCritPercent, 1*float64(mage.Talents.PiercingIce))
}

// Ice Floes inside spells
Expand Down
4 changes: 0 additions & 4 deletions ui/mage/arcane/sim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { APLRotation } from '../../core/proto/apl';
import { Faction, IndividualBuffs, PartyBuffs, PseudoStat, Race, Spec, Stat } from '../../core/proto/common';
import { StatCapType } from '../../core/proto/ui';
import { StatCap, Stats, UnitStat } from '../../core/proto_utils/stats';
import { sharedMageDisplayStatsModifiers } from '../shared';
import * as ArcaneInputs from './inputs';
import * as Presets from './presets';

Expand All @@ -27,9 +26,6 @@ const SPEC_CONFIG = registerSpecConfig(Spec.SpecArcaneMage, {
[Stat.StatHealth, Stat.StatMana, Stat.StatStamina, Stat.StatIntellect, Stat.StatSpellPower, Stat.StatMasteryRating],
[PseudoStat.PseudoStatSpellHitPercent, PseudoStat.PseudoStatSpellCritPercent, PseudoStat.PseudoStatSpellHastePercent],
),
modifyDisplayStats: (player: Player<Spec.SpecArcaneMage>) => {
return sharedMageDisplayStatsModifiers(player);
},

defaults: {
// Default equipped gear.
Expand Down
4 changes: 0 additions & 4 deletions ui/mage/fire/sim.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { StatCapType } from '../../core/proto/ui';
import { StatCap, Stats, UnitStat } from '../../core/proto_utils/stats';
import { TypedEvent } from '../../core/typed_event';
import { formatToNumber } from '../../core/utils';
import { sharedMageDisplayStatsModifiers } from '../shared';
import * as FireInputs from './inputs';
import * as Presets from './presets';

Expand All @@ -31,9 +30,6 @@ const SPEC_CONFIG = registerSpecConfig(Spec.SpecFireMage, {
[Stat.StatHealth, Stat.StatMana, Stat.StatStamina, Stat.StatIntellect, Stat.StatSpellPower, Stat.StatMasteryRating],
[PseudoStat.PseudoStatSpellHitPercent, PseudoStat.PseudoStatSpellCritPercent, PseudoStat.PseudoStatSpellHastePercent],
),
modifyDisplayStats: (player: Player<Spec.SpecFireMage>) => {
return sharedMageDisplayStatsModifiers(player);
},

defaults: {
// Default equipped gear.
Expand Down
23 changes: 3 additions & 20 deletions ui/mage/frost/sim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import { Player } from '../../core/player';
import { PlayerClasses } from '../../core/player_classes';
import { APLRotation } from '../../core/proto/apl';
import { Debuffs, Faction, IndividualBuffs, PartyBuffs, PseudoStat, Race, RaidBuffs, Spec, Stat } from '../../core/proto/common';
import { Stats, UnitStat } from '../../core/proto_utils/stats';
import { sharedMageDisplayStatsModifiers } from '../shared';
import { UnitStat } from '../../core/proto_utils/stats';
import * as FrostInputs from './inputs';
import * as Presets from './presets';

Expand All @@ -30,25 +29,9 @@ const SPEC_CONFIG = registerSpecConfig(Spec.SpecFrostMage, {
epReferenceStat: Stat.StatSpellPower,
// Which stats to display in the Character Stats section, at the bottom of the left-hand sidebar.
displayStats: UnitStat.createDisplayStatArray(
[
Stat.StatHealth,
Stat.StatMana,
Stat.StatStamina,
Stat.StatIntellect,
Stat.StatSpirit,
Stat.StatSpellPower,
Stat.StatMP5,
Stat.StatMasteryRating,
],
[
PseudoStat.PseudoStatSpellHitPercent,
PseudoStat.PseudoStatSpellCritPercent,
PseudoStat.PseudoStatSpellHastePercent,
],
[Stat.StatHealth, Stat.StatMana, Stat.StatStamina, Stat.StatIntellect, Stat.StatSpirit, Stat.StatSpellPower, Stat.StatMP5, Stat.StatMasteryRating],
[PseudoStat.PseudoStatSpellHitPercent, PseudoStat.PseudoStatSpellCritPercent, PseudoStat.PseudoStatSpellHastePercent],
),
modifyDisplayStats: (player: Player<Spec.SpecFrostMage>) => {
return sharedMageDisplayStatsModifiers(player);
},

defaults: {
// Default equipped gear.
Expand Down
11 changes: 0 additions & 11 deletions ui/mage/shared.ts

This file was deleted.

0 comments on commit 2aaba98

Please sign in to comment.