Skip to content

Commit

Permalink
Merge pull request #2949 from TheGroxEmpire/master
Browse files Browse the repository at this point in the history
Warrior: Add Overpower Reaction times and Rend Health threshold to Arms
  • Loading branch information
TheGroxEmpire authored Apr 17, 2023
2 parents b36b865 + a418b07 commit ed53bf5
Show file tree
Hide file tree
Showing 10 changed files with 548 additions and 558 deletions.
524 changes: 262 additions & 262 deletions sim/warrior/dps/TestArms.results

Large diffs are not rendered by default.

526 changes: 263 additions & 263 deletions sim/warrior/dps/TestFury.results

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions sim/warrior/dps/dps_warrior_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,11 @@ var armsRotation = &proto.Warrior_Rotation{
UseMs: true,
UseCleave: false,

HsRageThreshold: 50,
MsRageThreshold: 35,
SlamRageThreshold: 25,
RendCdThreshold: 0,
HsRageThreshold: 50,
MsRageThreshold: 35,
SlamRageThreshold: 25,
RendCdThreshold: 0,
RendHealthThresholdAbove: 100,

SpamExecute: false,

Expand Down
26 changes: 7 additions & 19 deletions sim/warrior/dps/rotation.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,7 @@ import (
const DebuffRefreshWindow = time.Second * 2

func (war *DpsWarrior) OnGCDReady(sim *core.Simulation) {
rendRemainingDur := war.RendValidUntil - sim.CurrentTime

// Pause rotation on every rend tick to check if TFB procs
if rendRemainingDur != war.Rend.CurDot().Duration && rendRemainingDur%3 == 0 && war.Talents.TasteForBlood > 0 {
core.StartDelayedAction(sim, core.DelayedActionOptions{
DoAt: sim.CurrentTime + time.Microsecond*1,
OnAction: func(_ *core.Simulation) {
war.doRotation(sim)
},
})
} else {
war.doRotation(sim)
}
war.doRotation(sim)

if war.GCD.IsReady(sim) && !war.IsWaiting() {
// This means we did nothing
Expand Down Expand Up @@ -128,10 +116,10 @@ func (war *DpsWarrior) furyNormalRotation(sim *core.Simulation) {
war.Bloodthirst.Cast(sim, war.CurrentTarget)
} else if war.Rotation.MainGcd == proto.Warrior_Rotation_Whirlwind && war.CanWhirlwind(sim) {
war.Whirlwind.Cast(sim, war.CurrentTarget)
} else if war.Rotation.MainGcd != proto.Warrior_Rotation_Slam && war.ShouldInstantSlam(sim) {
war.CastSlam(sim, war.CurrentTarget)
} else if war.Rotation.MainGcd != proto.Warrior_Rotation_Bloodthirst && war.Bloodthirst.CanCast(sim, war.CurrentTarget) {
war.Bloodthirst.Cast(sim, war.CurrentTarget)
} else if war.Rotation.MainGcd != proto.Warrior_Rotation_Slam && war.ShouldInstantSlam(sim) {
war.CastSlam(sim, war.CurrentTarget)
} else if war.Rotation.MainGcd != proto.Warrior_Rotation_Whirlwind && war.CanWhirlwind(sim) {
war.Whirlwind.Cast(sim, war.CurrentTarget)
} else if war.Rotation.UseRend && war.ShouldRend(sim) {
Expand Down Expand Up @@ -195,12 +183,12 @@ func (war *DpsWarrior) furyExecuteRotation(sim *core.Simulation) {
} else if war.Rotation.MainGcd == proto.Warrior_Rotation_Whirlwind &&
war.Rotation.UseWwDuringExecute && war.CanWhirlwind(sim) {
war.Whirlwind.Cast(sim, war.CurrentTarget)
} else if war.Rotation.MainGcd != proto.Warrior_Rotation_Slam &&
war.Rotation.UseSlamOverExecute && war.ShouldInstantSlam(sim) {
war.CastSlam(sim, war.CurrentTarget)
} else if war.Rotation.MainGcd != proto.Warrior_Rotation_Bloodthirst &&
war.Rotation.UseBtDuringExecute && war.Bloodthirst.CanCast(sim, war.CurrentTarget) {
war.Bloodthirst.Cast(sim, war.CurrentTarget)
} else if war.Rotation.MainGcd != proto.Warrior_Rotation_Slam &&
war.Rotation.UseSlamOverExecute && war.ShouldInstantSlam(sim) {
war.CastSlam(sim, war.CurrentTarget)
} else if war.Rotation.MainGcd != proto.Warrior_Rotation_Whirlwind &&
war.Rotation.UseWwDuringExecute && war.CanWhirlwind(sim) {
war.Whirlwind.Cast(sim, war.CurrentTarget)
Expand Down Expand Up @@ -424,7 +412,7 @@ func (war *DpsWarrior) makeCustomRotation() *common.CustomRotation {
if !war.ShouldOverpower(sim) {
return false
}
if sim.IsExecutePhase20() && !war.Rotation.ExecutePhaseOverpower {
if sim.IsExecutePhase20() && !war.Rotation.ExecutePhaseOverpower && war.PrimaryTalentTree == warrior.FuryTree {
return false
}

Expand Down
4 changes: 3 additions & 1 deletion sim/warrior/overpower.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ func (warrior *Warrior) registerOverpowerSpell(cdTimer *core.Timer) {
OnSpellHitDealt: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {
if result.Outcome.Matches(outcomeMask) {
warrior.OverpowerAura.Activate(sim)
warrior.lastOverpowerProc = sim.CurrentTime
}
},
})
Expand Down Expand Up @@ -84,5 +85,6 @@ func (warrior *Warrior) registerOverpowerSpell(cdTimer *core.Timer) {
func (warrior *Warrior) ShouldOverpower(sim *core.Simulation) bool {
return warrior.OverpowerAura.IsActive() &&
warrior.Overpower.IsReady(sim) &&
warrior.CurrentRage() >= warrior.Overpower.DefaultCast.Cost
warrior.CurrentRage() >= warrior.Overpower.DefaultCast.Cost &&
sim.CurrentTime > (warrior.lastOverpowerProc+warrior.reactionTime)
}
8 changes: 2 additions & 6 deletions sim/warrior/rend.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,6 @@ func (warrior *Warrior) RegisterRendSpell(rageThreshold float64, healthThreshold
}

func (warrior *Warrior) ShouldRend(sim *core.Simulation) bool {
if warrior.PrimaryTalentTree == FuryTree {
return warrior.Rend.IsReady(sim) && sim.CurrentTime >= (warrior.RendValidUntil-warrior.RendCdThreshold) && !warrior.Whirlwind.IsReady(sim) &&
warrior.CurrentRage() <= warrior.RendRageThresholdBelow && warrior.RendHealthThresholdAbove < sim.GetRemainingDurationPercent() &&
warrior.CurrentRage() >= warrior.Rend.DefaultCast.Cost
}
return warrior.Rend.IsReady(sim) && sim.CurrentTime >= (warrior.RendValidUntil-warrior.RendCdThreshold) && warrior.CurrentRage() >= warrior.Rend.DefaultCast.Cost
return warrior.Rend.IsReady(sim) && sim.CurrentTime >= (warrior.RendValidUntil-warrior.RendCdThreshold) &&
warrior.CurrentRage() >= warrior.Rend.DefaultCast.Cost && warrior.RendHealthThresholdAbove < sim.GetRemainingDurationPercent()
}
1 change: 1 addition & 0 deletions sim/warrior/talents.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ func (warrior *Warrior) applyTasteForBlood() {
warrior.OverpowerAura.Duration = time.Second * 9
warrior.OverpowerAura.Activate(sim)
warrior.OverpowerAura.Duration = time.Second * 5
warrior.lastOverpowerProc = sim.CurrentTime
},
})
}
Expand Down
1 change: 1 addition & 0 deletions sim/warrior/warrior.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ type Warrior struct {
// Reaction time values
reactionTime time.Duration
lastBloodsurgeProc time.Duration
lastOverpowerProc time.Duration

// Cached values
shoutDuration time.Duration
Expand Down
4 changes: 2 additions & 2 deletions ui/warrior/inputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export const WarriorRotationConfig = {
label: 'Rend health threshold (%)',
labelTooltip: 'Rend will only be used when boss health is above this value in %.',
changeEmitter: (player: Player<Spec.SpecWarrior>) => TypedEvent.onAny([player.rotationChangeEmitter, player.talentsChangeEmitter]),
showWhen: (player: Player<Spec.SpecWarrior>) => (player.getRotation().useRend == true || player.getRotation().customRotationOption) && player.getTalentTree() == 1,
showWhen: (player: Player<Spec.SpecWarrior>) => (player.getRotation().useRend == true || player.getRotation().customRotationOption),
}),
InputHelpers.makeRotationNumberInput<Spec.SpecWarrior>({
fieldName: 'rendRageThresholdBelow',
Expand Down Expand Up @@ -185,7 +185,7 @@ export const WarriorRotationConfig = {
label: 'Overpower in Execute Phase',
labelTooltip: 'Use Overpower instead of Execute whenever it is available.',
changeEmitter: (player: Player<Spec.SpecWarrior>) => TypedEvent.onAny([player.rotationChangeEmitter, player.talentsChangeEmitter]),
showWhen: (player: Player<Spec.SpecWarrior>) => player.getRotation().useOverpower == true && player.getTalentTree() == 1 || player.getRotation().customRotationOption,
showWhen: (player: Player<Spec.SpecWarrior>) => (player.getRotation().useOverpower == true || player.getRotation().customRotationOption) && player.getTalentTree() == 1 ,
}),
InputHelpers.makeRotationBooleanInput<Spec.SpecWarrior>({
fieldName: 'spamExecute',
Expand Down
3 changes: 2 additions & 1 deletion ui/warrior/presets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const DefaultRotation = WarriorRotation.create({

msRageThreshold: 35,
hsRageThreshold: 30,
rendHealthThresholdAbove: 20,
rendHealthThresholdAbove: 20,
rendRageThresholdBelow: 100,
slamRageThreshold: 25,
rendCdThreshold: 0,
Expand All @@ -97,6 +97,7 @@ export const ArmsRotation = WarriorRotation.create({
slamRageThreshold: 25,
hsRageThreshold: 50,
rendCdThreshold: 0,
rendHealthThresholdAbove: 100,
useHsDuringExecute: true,
spamExecute: true,
stanceOption: StanceOption.DefaultStance,
Expand Down

0 comments on commit ed53bf5

Please sign in to comment.