Skip to content

Commit

Permalink
add gargoyle presence input
Browse files Browse the repository at this point in the history
  • Loading branch information
lime-green committed Jan 11, 2023
1 parent 2307094 commit 5e28e0f
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 2 deletions.
2 changes: 2 additions & 0 deletions proto/deathknight.proto
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,8 @@ message Deathknight {
bool use_gargoyle = 23;

bool nerfed_gargoyle = 24;

Presence gargoyle_presence = 25;
}
Rotation rotation = 1;

Expand Down
2 changes: 2 additions & 0 deletions sim/deathknight/dps/dps_deathknight.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ func (dk *DpsDeathknight) SetupRotations() {
dk.Rotation.StartingPresence = proto.Deathknight_Rotation_Unholy
dk.Rotation.BlPresence = proto.Deathknight_Rotation_Blood
dk.Rotation.Presence = proto.Deathknight_Rotation_Blood
// TODO: Change this to UP presence if nerfedGargoyle is live
dk.Rotation.GargoylePresence = proto.Deathknight_Rotation_Blood

mh := dk.GetMHWeapon()
oh := dk.GetOHWeapon()
Expand Down
2 changes: 1 addition & 1 deletion sim/deathknight/dps/rotation_unholy.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ func (dk *DpsDeathknight) uhAfterGargoyleSequence(sim *core.Simulation) {
dk.RotationSequence.NewAction(dk.RotationActionCallback_AOTD)
}

if dk.Rotation.BlPresence == proto.Deathknight_Rotation_Blood && !dk.PresenceMatches(deathknight.BloodPresence) {
if dk.Rotation.BlPresence == proto.Deathknight_Rotation_Blood && !dk.PresenceMatches(deathknight.BloodPresence) && (!dk.Rotation.NerfedGargoyle || dk.Rotation.GargoylePresence == proto.Deathknight_Rotation_Blood) {
if didErw || dk.CurrentBloodRunes() > 0 {
dk.RotationSequence.NewAction(dk.RotationActionCallback_BP)
} else if !didErw && !dk.Rotation.BtGhoulFrenzy && dk.BloodTap.IsReady(sim) {
Expand Down
23 changes: 22 additions & 1 deletion sim/deathknight/dps/rotation_unholy_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ func (dk *DpsDeathknight) uhGargoyleCheck(sim *core.Simulation, target *core.Uni
}

if dk.uhGargoyleCanCast(sim, castTime) {
if !dk.PresenceMatches(deathknight.UnholyPresence) {
if !dk.PresenceMatches(deathknight.UnholyPresence) && (!dk.Rotation.NerfedGargoyle || dk.Rotation.GargoylePresence != proto.Deathknight_Rotation_Unholy) {
if dk.CurrentUnholyRunes() == 0 {
if dk.BloodTap.IsReady(sim) {
dk.BloodTap.Cast(sim, dk.CurrentTarget)
Expand All @@ -218,6 +218,27 @@ func (dk *DpsDeathknight) uhGargoyleCheck(sim *core.Simulation, target *core.Uni
}
}

// Go back to Blood Presence after Gargoyle
if dk.Rotation.NerfedGargoyle && !dk.SummonGargoyle.IsReady(sim) && dk.Rotation.Presence == proto.Deathknight_Rotation_Blood && dk.Rotation.GargoylePresence == proto.Deathknight_Rotation_Unholy && dk.PresenceMatches(deathknight.UnholyPresence) && !dk.HasActiveAura("Summon Gargoyle") {
if dk.BloodTapAura.IsActive() {
dk.BloodTapAura.Deactivate(sim)
}
return dk.BloodPresence.Cast(sim, target)
}

// Go back to Unholy Presence after Gargoyle
if dk.Rotation.NerfedGargoyle && !dk.SummonGargoyle.IsReady(sim) && dk.Rotation.Presence == proto.Deathknight_Rotation_Unholy && dk.Rotation.GargoylePresence == proto.Deathknight_Rotation_Blood && dk.PresenceMatches(deathknight.BloodPresence) && !dk.HasActiveAura("Summon Gargoyle") {
if dk.BloodTapAura.IsActive() {
dk.BloodTapAura.Deactivate(sim)
}
return dk.UnholyPresence.Cast(sim, target)
}

// Do not switch presences if gargoyle is still up if it's nerfed gargoyle
if dk.Rotation.NerfedGargoyle && dk.HasActiveAura("Summon Gargoyle") {
return false
}

// Go back to Blood Presence after Bloodlust
if dk.Rotation.Presence == proto.Deathknight_Rotation_Blood && dk.Rotation.BlPresence == proto.Deathknight_Rotation_Unholy && dk.PresenceMatches(deathknight.UnholyPresence) && !dk.HasActiveAuraWithTag("Bloodlust") {
if dk.BloodTapAura.IsActive() {
Expand Down
13 changes: 13 additions & 0 deletions ui/deathknight/inputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,18 @@ export const BloodlustPresence = InputHelpers.makeRotationEnumInput<Spec.SpecDea
changeEmitter: (player: Player<Spec.SpecDeathknight>) => TypedEvent.onAny([player.rotationChangeEmitter, player.talentsChangeEmitter]),
});

export const GargoylePresence = InputHelpers.makeRotationEnumInput<Spec.SpecDeathknight, StartingPresence>({
fieldName: 'gargoylePresence',
label: 'Gargoyle Presence',
labelTooltip: 'Presence during Gargoyle.',
values: [
{ name: 'Blood', value: StartingPresence.Blood },
{ name: 'Unholy', value: StartingPresence.Unholy },
],
showWhen: (player: Player<Spec.SpecDeathknight>) => player.getTalents().summonGargoyle && !player.getRotation().autoRotation,
changeEmitter: (player: Player<Spec.SpecDeathknight>) => TypedEvent.onAny([player.rotationChangeEmitter, player.talentsChangeEmitter]),
});

export const BloodTapGhoulFrenzy = InputHelpers.makeRotationBooleanInput<Spec.SpecDeathknight>({
fieldName: 'btGhoulFrenzy',
label: 'BT Ghoul Frenzy',
Expand Down Expand Up @@ -330,6 +342,7 @@ export const DeathKnightRotationConfig = {
FirstDiseaseInput,
StartingPresenceInput,
BloodlustPresence,
GargoylePresence,
FightPresence,
BloodRuneFillerInput,
UseDeathAndDecay,
Expand Down

0 comments on commit 5e28e0f

Please sign in to comment.