Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More moonfire snapshot settings #3246

Merged
merged 1 commit into from
Jul 4, 2023
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
18 changes: 12 additions & 6 deletions proto/druid.proto
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,6 @@ message BalanceDruid {
BeforeLunar = 1;
MaximizeMf = 2;
MultidotMf = 3;
ExtendFishingForLunar = 4;
ExtendFishingForSolar = 5;
ExtendDuringLunar = 6;
ExtendDuringSolar = 7;
ExtendAlways = 8;
ExtendOutsideSolar = 9;
}
MfUsage mf_usage = 2;

Expand Down Expand Up @@ -196,6 +190,18 @@ message BalanceDruid {
}
EclipsePrio eclipse_prio = 12;
bool eclipse_shuffling = 13;

enum MfExtension {
ExtendFishingForLunar = 0;
ExtendFishingForSolar = 1;
ExtendDuringLunar = 2;
ExtendDuringSolar = 3;
ExtendAlways = 4;
ExtendOutsideSolar = 5;
DontExtend = 6;
}
MfExtension mf_extension = 15;
bool snapshot_mf = 16;
}
Rotation rotation = 1;

Expand Down
8 changes: 4 additions & 4 deletions sim/druid/balance/TestBalancePhase3.results
Original file line number Diff line number Diff line change
Expand Up @@ -915,8 +915,8 @@ dps_results: {
dps_results: {
key: "TestBalancePhase3-Settings-Tauren-P3-Default-FullBuffs-LongMultiTarget"
value: {
dps: 16601.28562
tps: 19435.22438
dps: 16644.11888
tps: 19482.60859
}
}
dps_results: {
Expand All @@ -936,8 +936,8 @@ dps_results: {
dps_results: {
key: "TestBalancePhase3-Settings-Tauren-P3-Default-NoBuffs-LongMultiTarget"
value: {
dps: 7637.96063
tps: 8596.52107
dps: 7653.4313
tps: 8600.40001
}
}
dps_results: {
Expand Down
46 changes: 37 additions & 9 deletions sim/druid/balance/rotation.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,24 @@ func (moonkin *BalanceDruid) rotation(sim *core.Simulation) (*core.Spell, *core.
moonkin.useTrinkets(stats.SpellCrit, sim, target)
}

if rotation.SnapshotMf {
flareProc := moonkin.GetAura("Flare of the Heavens Proc")
pleaProc := moonkin.GetAura("Pandora's Plea Proc")
lightweaveProc := moonkin.GetAura("Lightweave Proc")
wildMagicProc := moonkin.GetAura("Potion of Wild Magic")
shouldCheckForSnapshot := flareProc.IsActive() || lightweaveProc.IsActive() || wildMagicProc.IsActive() || pleaProc.IsActive()
if shouldCheckForSnapshot {
if moonkin.shouldSnapshotMf(sim, flareProc) || moonkin.shouldSnapshotMf(sim, lightweaveProc) || moonkin.shouldSnapshotMf(sim, wildMagicProc) || moonkin.shouldSnapshotMf(sim, pleaProc) {
return moonkin.Moonfire, target
}
}
}

var lunarUptime time.Duration
shouldRefreshMf := moonkin.Moonfire.CurDot().RemainingDuration(sim) <= 0
maximizeMf := !(rotation.MfUsage == proto.BalanceDruid_Rotation_NoMf) && !(rotation.MfUsage == proto.BalanceDruid_Rotation_BeforeLunar)
hasLunarFury := core.Ternary(moonkin.Equip[core.ItemSlotRanged].ID == 47670, true, false)
lunarIsActive := moonkin.LunarEclipseProcAura.IsActive()
maximizeMf := !(rotation.MfUsage == proto.BalanceDruid_Rotation_NoMf) && !(rotation.MfUsage == proto.BalanceDruid_Rotation_BeforeLunar)

if moonkin.LunarEclipseProcAura != nil {
lunarUptime = moonkin.LunarEclipseProcAura.RemainingDuration(sim)
Expand Down Expand Up @@ -123,7 +136,7 @@ func (moonkin *BalanceDruid) rotation(sim *core.Simulation) (*core.Spell, *core.
// Eclipse
if solarIsActive || lunarIsActive {
if lunarIsActive {
canExtendMf := rotation.MfUsage == proto.BalanceDruid_Rotation_ExtendAlways || rotation.MfUsage == proto.BalanceDruid_Rotation_ExtendOutsideSolar || rotation.MfUsage == proto.BalanceDruid_Rotation_ExtendDuringLunar
canExtendMf := rotation.MfExtension == proto.BalanceDruid_Rotation_ExtendAlways || rotation.MfExtension == proto.BalanceDruid_Rotation_ExtendOutsideSolar || rotation.MfExtension == proto.BalanceDruid_Rotation_ExtendDuringLunar
if canExtendMf && moonkin.ExtendingMoonfireStacks == 0 {
if extendTarget := moonkin.tryExtendMoonfire(sim); extendTarget != nil {
return moonkin.Moonfire, extendTarget
Expand All @@ -144,7 +157,7 @@ func (moonkin *BalanceDruid) rotation(sim *core.Simulation) (*core.Spell, *core.
return moonkin.Starfire, target
}
}
canExtendMf := rotation.MfUsage == proto.BalanceDruid_Rotation_ExtendAlways || rotation.MfUsage == proto.BalanceDruid_Rotation_ExtendDuringSolar
canExtendMf := rotation.MfExtension == proto.BalanceDruid_Rotation_ExtendAlways || rotation.MfExtension == proto.BalanceDruid_Rotation_ExtendDuringSolar
if canExtendMf && moonkin.ExtendingMoonfireStacks == 0 {
if extendTarget := moonkin.tryExtendMoonfire(sim); extendTarget != nil {
return moonkin.Moonfire, extendTarget
Expand All @@ -168,20 +181,20 @@ func (moonkin *BalanceDruid) rotation(sim *core.Simulation) (*core.Spell, *core.
}
}

canExtendMf := rotation.MfUsage == proto.BalanceDruid_Rotation_ExtendAlways || rotation.MfUsage == proto.BalanceDruid_Rotation_ExtendOutsideSolar
canExtendMf := rotation.MfExtension == proto.BalanceDruid_Rotation_ExtendAlways || rotation.MfExtension == proto.BalanceDruid_Rotation_ExtendOutsideSolar

fishingForLunar := lunarICD <= solarICD
if rotation.EclipsePrio == proto.BalanceDruid_Rotation_Solar {
fishingForLunar = lunarICD < solarICD
}

if fishingForLunar && (canExtendMf || rotation.MfUsage == proto.BalanceDruid_Rotation_ExtendFishingForLunar) && moonkin.ExtendingMoonfireStacks == 0 {
if fishingForLunar && (canExtendMf || rotation.MfExtension == proto.BalanceDruid_Rotation_ExtendFishingForLunar) && moonkin.ExtendingMoonfireStacks == 0 {
if extendTarget := moonkin.tryExtendMoonfire(sim); extendTarget != nil {
return moonkin.Moonfire, extendTarget
}
}

if !fishingForLunar && (canExtendMf || rotation.MfUsage == proto.BalanceDruid_Rotation_ExtendFishingForSolar) && moonkin.ExtendingMoonfireStacks == 0 {
if !fishingForLunar && (canExtendMf || rotation.MfExtension == proto.BalanceDruid_Rotation_ExtendFishingForSolar) && moonkin.ExtendingMoonfireStacks == 0 {
if extendTarget := moonkin.tryExtendMoonfire(sim); extendTarget != nil {
return moonkin.Moonfire, extendTarget
}
Expand Down Expand Up @@ -227,11 +240,26 @@ func (moonkin *BalanceDruid) useTrinkets(stat stats.Stat, sim *core.Simulation,
}

func (moonkin *BalanceDruid) tryExtendMoonfire(sim *core.Simulation) *core.Unit {
if len(sim.Encounter.Targets) < 2 {
return nil
}
minTarget := moonkin.CurrentTarget
minTimer := moonkin.Moonfire.CurDot().RemainingDuration(sim)
for range sim.Encounter.Targets {
if moonkin.Moonfire.CurDot().RemainingDuration(sim) <= 0 {
return moonkin.CurrentTarget
if moonkin.Moonfire.CurDot().RemainingDuration(sim) < minTimer {
minTarget = moonkin.CurrentTarget
minTimer = moonkin.Moonfire.CurDot().RemainingDuration(sim)
}
moonkin.CurrentTarget = sim.Environment.NextTargetUnit(moonkin.CurrentTarget)
}
return nil
return minTarget
}

func (moonkin *BalanceDruid) shouldSnapshotMf(sim *core.Simulation, aura *core.Aura) bool {
if aura.IsActive() && aura.RemainingDuration(sim) < moonkin.Moonfire.CurDot().RemainingDuration(sim) {
if moonkin.Moonfire.CurDot().SnapshotBaseDamage < (200 + 0.13*moonkin.Moonfire.CurDot().Spell.SpellPower()) {
return true
}
}
return false
}
31 changes: 23 additions & 8 deletions ui/balance_druid/inputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
BalanceDruid_Options as DruidOptions,
BalanceDruid_Rotation_Type as RotationType,
BalanceDruid_Rotation_MfUsage as MfUsage,
BalanceDruid_Rotation_MfExtension as MfExtension,
BalanceDruid_Rotation_IsUsage as IsUsage,
BalanceDruid_Rotation_WrathUsage as WrathUsage,
BalanceDruid_Rotation_EclipsePrio as EclipsePrio,
Expand Down Expand Up @@ -72,13 +73,21 @@ export const BalanceDruidRotationConfig = {
{ name: 'Before lunar', value: MfUsage.BeforeLunar },
{ name: 'Maximize', value: MfUsage.MaximizeMf },
{ name: 'Multidot', value: MfUsage.MultidotMf },
{ name: 'Extend fishing for lunar', value: MfUsage.ExtendFishingForLunar },
{ name: 'Extend fishing for solar', value: MfUsage.ExtendFishingForSolar },
{ name: 'Extend during lunar', value: MfUsage.ExtendDuringLunar },
{ name: 'Extend during solar', value: MfUsage.ExtendDuringSolar },
{ name: 'Extend always', value: MfUsage.ExtendAlways },
{ name: 'Extend outside solar', value: MfUsage.ExtendOutsideSolar },

],
showWhen: (player: Player<Spec.SpecBalanceDruid>) => player.getRotation().type == RotationType.Manual,
}),
InputHelpers.makeRotationEnumInput<Spec.SpecBalanceDruid, MfExtension>({
fieldName: 'mfExtension',
label: 'Moonfire Extension',
labelTooltip: 'When should the rotation try to extend Moonfire on the main target.',
values: [
{ name: 'Extend fishing for lunar', value: MfExtension.ExtendFishingForLunar },
{ name: 'Extend fishing for solar', value: MfExtension.ExtendFishingForSolar },
{ name: 'Extend during lunar', value: MfExtension.ExtendDuringLunar },
{ name: 'Extend during solar', value: MfExtension.ExtendDuringSolar },
{ name: 'Extend always', value: MfExtension.ExtendAlways },
{ name: 'Extend outside solar', value: MfExtension.ExtendOutsideSolar },
{ name: 'Do not extend', value: MfExtension.DontExtend },
],
showWhen: (player: Player<Spec.SpecBalanceDruid>) => player.getRotation().type == RotationType.Manual,
}),
Expand Down Expand Up @@ -117,6 +126,12 @@ export const BalanceDruidRotationConfig = {
labelTooltip: 'The rotation will use cooldowns during eclipses, avoiding Haste CDs in solar and Crit CDs in lunar',
showWhen: (player: Player<Spec.SpecBalanceDruid>) => player.getRotation().type == RotationType.Manual,
}),
InputHelpers.makeRotationBooleanInput<Spec.SpecBalanceDruid>({
fieldName: 'snapshotMf',
label: 'Snapshot Moonfire',
labelTooltip: 'The rotation will try to snapshot Moonfire with SP procs',
showWhen: (player: Player<Spec.SpecBalanceDruid>) => player.getRotation().type == RotationType.Manual,
}),
InputHelpers.makeRotationBooleanInput<Spec.SpecBalanceDruid>({
fieldName: 'eclipseShuffling',
label: 'Eclipse Shuffling',
Expand Down Expand Up @@ -145,7 +160,7 @@ export const BalanceDruidRotationConfig = {
fieldName: 'okfPpm',
label: 'Owlkin Frenzy PPM',
labelTooltip: 'Amount of Owlkin Frenzy procs per minute.',
showWhen: (player: Player<Spec.SpecBalanceDruid>) => player.getRotation().type == RotationType.Manual && player.getTalents().owlkinFrenzy > 0,
showWhen: (player: Player<Spec.SpecBalanceDruid>) => player.getRotation().type == RotationType.Manual,
float: true,
positive: true,
}),
Expand Down