From 5b0194acdfb5c3a5d5b0fade628bd6549fbb343f Mon Sep 17 00:00:00 2001 From: James Tanner Date: Sat, 6 Jan 2024 18:52:06 -0800 Subject: [PATCH 1/2] Move DK AMS fields from Rotation --> Options --- proto/deathknight.proto | 10 ++++-- sim/deathknight/dps/dps_deathknight.go | 6 ++-- ui/deathknight/inputs.ts | 48 +++++++++++++------------- ui/deathknight/sim.ts | 3 ++ 4 files changed, 37 insertions(+), 30 deletions(-) diff --git a/proto/deathknight.proto b/proto/deathknight.proto index 689f877ac2..4f9d2955ff 100644 --- a/proto/deathknight.proto +++ b/proto/deathknight.proto @@ -240,9 +240,9 @@ message Deathknight { Presence starting_presence = 10; BloodTap blood_tap = 11; - bool use_ams = 13; - double avg_ams_success_rate = 14; - double avg_ams_hit = 15; + bool use_ams = 13 [deprecated = true]; + double avg_ams_success_rate = 14 [deprecated = true]; + double avg_ams_hit = 15 [deprecated = true]; bool auto_rotation = 16; @@ -288,6 +288,10 @@ message Deathknight { bool new_drw = 7; double disease_downtime = 8; + + bool use_ams = 9; + double avg_ams_success_rate = 10; + double avg_ams_hit = 11; } Options options = 3; } diff --git a/sim/deathknight/dps/dps_deathknight.go b/sim/deathknight/dps/dps_deathknight.go index e342615622..1bc5ebd080 100644 --- a/sim/deathknight/dps/dps_deathknight.go +++ b/sim/deathknight/dps/dps_deathknight.go @@ -60,9 +60,9 @@ func NewDpsDeathknight(character *core.Character, player *proto.Player) *DpsDeat RefreshHornOfWinter: dk.Rotation.RefreshHornOfWinter, ArmyOfTheDeadType: dk.Rotation.ArmyOfTheDead, StartingPresence: dk.Rotation.StartingPresence, - UseAMS: dk.Rotation.UseAms, - AvgAMSSuccessRate: dk.Rotation.AvgAmsSuccessRate, - AvgAMSHit: dk.Rotation.AvgAmsHit, + UseAMS: dk.Options.UseAms, + AvgAMSSuccessRate: dk.Options.AvgAmsSuccessRate, + AvgAMSHit: dk.Options.AvgAmsHit, }, player.TalentsString, dk.Rotation.PreNerfedGargoyle), Rotation: dk.Rotation, } diff --git a/ui/deathknight/inputs.ts b/ui/deathknight/inputs.ts index 84e520a551..37bbb70124 100644 --- a/ui/deathknight/inputs.ts +++ b/ui/deathknight/inputs.ts @@ -83,6 +83,30 @@ export const DrwPestiApply = InputHelpers.makeSpecOptionsBooleanInput) => TypedEvent.onAny([player.specOptionsChangeEmitter, player.rotationChangeEmitter, player.talentsChangeEmitter]), }); +export const UseAMSInput = InputHelpers.makeSpecOptionsBooleanInput({ + fieldName: 'useAms', + label: 'Use AMS', + labelTooltip: 'Use AMS around predicted damage for a RP gain.', + showWhen: (player: Player) => player.getTalents().howlingBlast, + changeEmitter: (player: Player) => TypedEvent.onAny([player.rotationChangeEmitter, player.talentsChangeEmitter]), +}); + +export const AvgAMSSuccessRateInput = InputHelpers.makeSpecOptionsNumberInput({ + fieldName: 'avgAmsSuccessRate', + label: 'Avg AMS Success %', + labelTooltip: 'Chance for damage to be taken during the 5 second window of AMS.', + showWhen: (player: Player) => player.getSpecOptions().useAms == true && player.getTalents().howlingBlast, + changeEmitter: (player: Player) => TypedEvent.onAny([player.rotationChangeEmitter, player.talentsChangeEmitter]), +}); + +export const AvgAMSHitInput = InputHelpers.makeSpecOptionsNumberInput({ + fieldName: 'avgAmsHit', + label: 'Avg AMS Hit', + labelTooltip: 'How much on average (+-10%) the character is hit for when AMS is successful.', + showWhen: (player: Player) => player.getSpecOptions().useAms == true && player.getTalents().howlingBlast, + changeEmitter: (player: Player) => TypedEvent.onAny([player.rotationChangeEmitter, player.talentsChangeEmitter]), +}); + export const DiseaseRefreshDuration = InputHelpers.makeRotationNumberInput({ fieldName: 'diseaseRefreshDuration', label: 'Disease Refresh Duration', @@ -249,30 +273,6 @@ export const BloodTapInput = InputHelpers.makeRotationEnumInput) => TypedEvent.onAny([player.rotationChangeEmitter, player.talentsChangeEmitter]), }) -export const UseAMSInput = InputHelpers.makeRotationBooleanInput({ - fieldName: 'useAms', - label: 'Use AMS', - labelTooltip: 'Use AMS around predicted damage for a RP gain.', - showWhen: (player: Player) => player.getTalents().howlingBlast && !player.getRotation().autoRotation && player.getRotation().frostRotationType != FrostRotationType.Custom, - changeEmitter: (player: Player) => TypedEvent.onAny([player.rotationChangeEmitter, player.talentsChangeEmitter]), -}); - -export const AvgAMSSuccessRateInput = InputHelpers.makeRotationNumberInput({ - fieldName: 'avgAmsSuccessRate', - label: 'Avg AMS Success %', - labelTooltip: 'Chance for damage to be taken during the 5 second window of AMS.', - showWhen: (player: Player) => player.getRotation().useAms == true && !player.getRotation().autoRotation && player.getTalents().howlingBlast && player.getRotation().frostRotationType != FrostRotationType.Custom, - changeEmitter: (player: Player) => TypedEvent.onAny([player.rotationChangeEmitter, player.talentsChangeEmitter]), -}); - -export const AvgAMSHitInput = InputHelpers.makeRotationNumberInput({ - fieldName: 'avgAmsHit', - label: 'Avg AMS Hit', - labelTooltip: 'How much on average (+-10%) the character is hit for when AMS is successful.', - showWhen: (player: Player) => player.getRotation().useAms == true && !player.getRotation().autoRotation && player.getTalents().howlingBlast && player.getRotation().frostRotationType != FrostRotationType.Custom, - changeEmitter: (player: Player) => TypedEvent.onAny([player.rotationChangeEmitter, player.talentsChangeEmitter]), -}); - export const UseAutoRotation = InputHelpers.makeRotationBooleanInput({ fieldName: 'autoRotation', label: 'Automatic Rotation', diff --git a/ui/deathknight/sim.ts b/ui/deathknight/sim.ts index 0aebcc9f37..cb4cc31e25 100644 --- a/ui/deathknight/sim.ts +++ b/ui/deathknight/sim.ts @@ -191,6 +191,9 @@ const SPEC_CONFIG = registerSpecConfig(Spec.SpecDeathknight, { DeathKnightInputs.SelfUnholyFrenzy, DeathKnightInputs.StartingRunicPower, DeathKnightInputs.PetUptime, + DeathKnightInputs.UseAMSInput, + DeathKnightInputs.AvgAMSSuccessRateInput, + DeathKnightInputs.AvgAMSHitInput, DeathKnightInputs.PrecastGhoulFrenzy, DeathKnightInputs.PrecastHornOfWinter, From 6c4707f27dcaad3b32a437148ecdf8638df9ac56 Mon Sep 17 00:00:00 2001 From: James Tanner Date: Sat, 6 Jan 2024 18:53:31 -0800 Subject: [PATCH 2/2] Fix change emitters --- ui/deathknight/inputs.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/deathknight/inputs.ts b/ui/deathknight/inputs.ts index 37bbb70124..647544ff9e 100644 --- a/ui/deathknight/inputs.ts +++ b/ui/deathknight/inputs.ts @@ -88,7 +88,7 @@ export const UseAMSInput = InputHelpers.makeSpecOptionsBooleanInput) => player.getTalents().howlingBlast, - changeEmitter: (player: Player) => TypedEvent.onAny([player.rotationChangeEmitter, player.talentsChangeEmitter]), + changeEmitter: (player: Player) => TypedEvent.onAny([player.specOptionsChangeEmitter, player.talentsChangeEmitter]), }); export const AvgAMSSuccessRateInput = InputHelpers.makeSpecOptionsNumberInput({ @@ -96,7 +96,7 @@ export const AvgAMSSuccessRateInput = InputHelpers.makeSpecOptionsNumberInput) => player.getSpecOptions().useAms == true && player.getTalents().howlingBlast, - changeEmitter: (player: Player) => TypedEvent.onAny([player.rotationChangeEmitter, player.talentsChangeEmitter]), + changeEmitter: (player: Player) => TypedEvent.onAny([player.specOptionsChangeEmitter, player.talentsChangeEmitter]), }); export const AvgAMSHitInput = InputHelpers.makeSpecOptionsNumberInput({ @@ -104,7 +104,7 @@ export const AvgAMSHitInput = InputHelpers.makeSpecOptionsNumberInput) => player.getSpecOptions().useAms == true && player.getTalents().howlingBlast, - changeEmitter: (player: Player) => TypedEvent.onAny([player.rotationChangeEmitter, player.talentsChangeEmitter]), + changeEmitter: (player: Player) => TypedEvent.onAny([player.specOptionsChangeEmitter, player.talentsChangeEmitter]), }); export const DiseaseRefreshDuration = InputHelpers.makeRotationNumberInput({