Skip to content

Commit

Permalink
feral: enable apl rotation
Browse files Browse the repository at this point in the history
Signed-off-by: jarves <jarveson@gmail.com>
  • Loading branch information
jarveson committed Jul 14, 2023
1 parent bcf673a commit a2f1a0e
Show file tree
Hide file tree
Showing 20 changed files with 59 additions and 42 deletions.
4 changes: 2 additions & 2 deletions proto/druid.proto
Original file line number Diff line number Diff line change
Expand Up @@ -248,15 +248,15 @@ message FeralDruid {
bool manual_params = 17;
float max_ff_delay = 20;
AplType rotation_type = 21;
bool pre_pop_berserk = 22;
bool pre_pop_ooc = 23;
}
Rotation rotation = 1;

message Options {
RaidTarget innervate_target = 1;
int32 latency_ms = 2;
bool prepop_ooc = 3;
bool assume_bleed_active = 4;
bool pre_pop_berserk = 5;
}
Options options = 3;
}
Expand Down
2 changes: 1 addition & 1 deletion sim/druid/enrage.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func (druid *Druid) registerEnrageSpell() {

spell := druid.RegisterSpell(core.SpellConfig{
ActionID: actionID,

Flags: core.SpellFlagAPL,
Cast: core.CastConfig{
CD: core.Cooldown{
Timer: druid.NewTimer(),
Expand Down
2 changes: 1 addition & 1 deletion sim/druid/fake_gotw.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ func (druid *Druid) registerFakeGotw() {

druid.GiftOfTheWild = druid.RegisterSpell(core.SpellConfig{
ActionID: core.ActionID{SpellID: 48470},
Flags: SpellFlagOmenTrigger | core.SpellFlagHelpful,
Flags: SpellFlagOmenTrigger | core.SpellFlagHelpful | core.SpellFlagAPL,

ManaCost: core.ManaCostOptions{
BaseCost: baseCost,
Expand Down
8 changes: 6 additions & 2 deletions sim/druid/feral/feral.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ func NewFeralDruid(character core.Character, options *proto.Player) *FeralDruid

cat.AssumeBleedActive = feralOptions.Options.AssumeBleedActive
cat.maxRipTicks = cat.MaxRipTicks()
cat.prepopOoc = feralOptions.Options.PrepopOoc
cat.prepopOoc = feralOptions.Rotation.PrePopOoc
cat.RaidBuffTargets = int(core.MaxInt32(feralOptions.Rotation.RaidTargets, 1))
if !feralOptions.Rotation.ManualParams {
cat.RaidBuffTargets = 30
}
cat.PrePopBerserk = feralOptions.Options.PrePopBerserk
cat.PrePopBerserk = feralOptions.Rotation.PrePopBerserk
cat.setupRotation(feralOptions.Rotation)

cat.EnableEnergyBar(100.0, cat.OnEnergyGain)
Expand Down Expand Up @@ -100,6 +100,10 @@ func (cat *FeralDruid) Initialize() {
cat.Druid.Initialize()
cat.RegisterFeralCatSpells()

if cat.IsUsingAPL {
return
}

if cat.prepopOoc && cat.Talents.OmenOfClarity {
cat.RegisterPrepullAction(-time.Second, func(sim *core.Simulation) {
cat.ProcOoc(sim)
Expand Down
6 changes: 3 additions & 3 deletions sim/druid/feral/feral_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ var PlayerOptionsMonoCat = &proto.Player_FeralDruid{
Options: &proto.FeralDruid_Options{
InnervateTarget: &proto.RaidTarget{TargetIndex: -1}, // no Innervate
LatencyMs: 100,
PrepopOoc: true,
AssumeBleedActive: true,
},
Rotation: &proto.FeralDruid_Rotation{
Expand All @@ -170,6 +169,7 @@ var PlayerOptionsMonoCat = &proto.Player_FeralDruid{
SnekWeave: false,
FlowerWeave: false,
RaidTargets: 30,
PrePopOoc: true,
},
},
}
Expand All @@ -179,7 +179,6 @@ var PlayerOptionsMonoCatNoBleed = &proto.Player_FeralDruid{
Options: &proto.FeralDruid_Options{
InnervateTarget: &proto.RaidTarget{TargetIndex: -1}, // no Innervate
LatencyMs: 100,
PrepopOoc: true,
AssumeBleedActive: false,
},
Rotation: &proto.FeralDruid_Rotation{
Expand All @@ -199,6 +198,7 @@ var PlayerOptionsMonoCatNoBleed = &proto.Player_FeralDruid{
SnekWeave: false,
FlowerWeave: false,
RaidTargets: 30,
PrePopOoc: true,
},
},
}
Expand All @@ -208,7 +208,6 @@ var PlayerOptionsFlowerCatAoe = &proto.Player_FeralDruid{
Options: &proto.FeralDruid_Options{
InnervateTarget: &proto.RaidTarget{TargetIndex: -1}, // no Innervate
LatencyMs: 100,
PrepopOoc: true,
AssumeBleedActive: false,
},
Rotation: &proto.FeralDruid_Rotation{
Expand All @@ -228,6 +227,7 @@ var PlayerOptionsFlowerCatAoe = &proto.Player_FeralDruid{
SnekWeave: false,
FlowerWeave: true,
RaidTargets: 30,
PrePopOoc: true,
},
},
}
Expand Down
16 changes: 16 additions & 0 deletions sim/druid/feral/rotation.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,21 @@ import (
)

func (cat *FeralDruid) OnEnergyGain(sim *core.Simulation) {
if cat.IsUsingAPL {
return
}

cat.TryUseCooldowns(sim)
if cat.InForm(druid.Cat) && !cat.readyToShift {
cat.doTigersFury(sim)
}
}

func (cat *FeralDruid) OnGCDReady(sim *core.Simulation) {
if cat.IsUsingAPL {
return
}

cat.TryUseCooldowns(sim)
if !cat.GCD.IsReady(sim) {
return
Expand Down Expand Up @@ -49,6 +57,10 @@ func (cat *FeralDruid) OnGCDReady(sim *core.Simulation) {
}

func (cat *FeralDruid) OnAutoAttack(sim *core.Simulation, spell *core.Spell) {
if cat.IsUsingAPL {
return
}

if cat.InForm(druid.Humanoid) {
panic("auto attack out of form?")
}
Expand Down Expand Up @@ -81,6 +93,10 @@ func (cat *FeralDruid) NextRotationAction(sim *core.Simulation, kickAt time.Dura
// Ported from https://github.com/NerdEgghead/WOTLK_cat_sim

func (cat *FeralDruid) checkReplaceMaul(sim *core.Simulation) *core.Spell {
if cat.IsUsingAPL {
return nil
}

// If we will have enough time and Energy leeway to stay in
// Dire Bear Form once the GCD expires, then only Maul if we
// will be left with enough Rage to cast Mangle or Lacerate
Expand Down
2 changes: 1 addition & 1 deletion sim/druid/ferocious_bite.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func (druid *Druid) registerFerociousBiteSpell() {
ActionID: core.ActionID{SpellID: 48577},
SpellSchool: core.SpellSchoolPhysical,
ProcMask: core.ProcMaskMeleeMHSpecial,
Flags: core.SpellFlagMeleeMetrics | core.SpellFlagIncludeTargetBonusDamage,
Flags: core.SpellFlagMeleeMetrics | core.SpellFlagIncludeTargetBonusDamage | core.SpellFlagAPL,

EnergyCost: core.EnergyCostOptions{
Cost: 35,
Expand Down
4 changes: 2 additions & 2 deletions sim/druid/forms.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ func (druid *Druid) registerCatFormSpell() {

druid.CatForm = druid.RegisterSpell(core.SpellConfig{
ActionID: actionID,
Flags: core.SpellFlagNoOnCastComplete,
Flags: core.SpellFlagNoOnCastComplete | core.SpellFlagAPL,

ManaCost: core.ManaCostOptions{
BaseCost: 0.35,
Expand Down Expand Up @@ -342,7 +342,7 @@ func (druid *Druid) registerBearFormSpell() {

druid.BearForm = druid.RegisterSpell(core.SpellConfig{
ActionID: actionID,
Flags: core.SpellFlagNoOnCastComplete,
Flags: core.SpellFlagNoOnCastComplete | core.SpellFlagAPL,

ManaCost: core.ManaCostOptions{
BaseCost: 0.35,
Expand Down
4 changes: 2 additions & 2 deletions sim/druid/mangle.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func (druid *Druid) registerMangleBearSpell() {
ActionID: core.ActionID{SpellID: 48564},
SpellSchool: core.SpellSchoolPhysical,
ProcMask: core.ProcMaskMeleeMHSpecial,
Flags: core.SpellFlagMeleeMetrics | core.SpellFlagIncludeTargetBonusDamage,
Flags: core.SpellFlagMeleeMetrics | core.SpellFlagIncludeTargetBonusDamage | core.SpellFlagAPL,

RageCost: core.RageCostOptions{
Cost: 20 - float64(druid.Talents.Ferocity),
Expand Down Expand Up @@ -76,7 +76,7 @@ func (druid *Druid) registerMangleCatSpell() {
ActionID: core.ActionID{SpellID: 48566},
SpellSchool: core.SpellSchoolPhysical,
ProcMask: core.ProcMaskMeleeMHSpecial,
Flags: core.SpellFlagMeleeMetrics | core.SpellFlagIncludeTargetBonusDamage,
Flags: core.SpellFlagMeleeMetrics | core.SpellFlagIncludeTargetBonusDamage | core.SpellFlagAPL,

EnergyCost: core.EnergyCostOptions{
Cost: 45.0 - 2*float64(druid.Talents.ImprovedMangle) - float64(druid.Talents.Ferocity) - core.TernaryFloat64(druid.HasSetBonus(ItemSetThunderheartHarness, 2), 5, 0),
Expand Down
2 changes: 1 addition & 1 deletion sim/druid/maul.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func (druid *Druid) registerMaulSpell(rageThreshold float64) {
ActionID: core.ActionID{SpellID: 48480},
SpellSchool: core.SpellSchoolPhysical,
ProcMask: core.ProcMaskMeleeMHSpecial,
Flags: core.SpellFlagMeleeMetrics | core.SpellFlagIncludeTargetBonusDamage | core.SpellFlagNoOnCastComplete,
Flags: core.SpellFlagMeleeMetrics | core.SpellFlagIncludeTargetBonusDamage | core.SpellFlagNoOnCastComplete | core.SpellFlagAPL,

RageCost: core.RageCostOptions{
Cost: 15 - float64(druid.Talents.Ferocity),
Expand Down
2 changes: 1 addition & 1 deletion sim/druid/rake.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func (druid *Druid) registerRakeSpell() {
ActionID: core.ActionID{SpellID: 48574},
SpellSchool: core.SpellSchoolPhysical,
ProcMask: core.ProcMaskMeleeMHSpecial,
Flags: core.SpellFlagMeleeMetrics | core.SpellFlagIgnoreResists,
Flags: core.SpellFlagMeleeMetrics | core.SpellFlagIgnoreResists | core.SpellFlagAPL,

EnergyCost: core.EnergyCostOptions{
Cost: 40 - float64(druid.Talents.Ferocity),
Expand Down
2 changes: 1 addition & 1 deletion sim/druid/rip.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func (druid *Druid) registerRipSpell() {
ActionID: core.ActionID{SpellID: 49800},
SpellSchool: core.SpellSchoolPhysical,
ProcMask: core.ProcMaskMeleeMHSpecial,
Flags: core.SpellFlagMeleeMetrics,
Flags: core.SpellFlagMeleeMetrics | core.SpellFlagAPL,

EnergyCost: core.EnergyCostOptions{
Cost: 30 - core.TernaryFloat64(druid.HasSetBonus(ItemSetLasherweaveBattlegear, 2), 10, 0),
Expand Down
2 changes: 1 addition & 1 deletion sim/druid/savage_roar.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func (druid *Druid) registerSavageRoarSpell() {

srSpell := druid.RegisterSpell(core.SpellConfig{
ActionID: actionID,

Flags: core.SpellFlagAPL,
EnergyCost: core.EnergyCostOptions{
Cost: 25,
},
Expand Down
2 changes: 1 addition & 1 deletion sim/druid/shred.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func (druid *Druid) registerShredSpell() {
ActionID: core.ActionID{SpellID: 48572},
SpellSchool: core.SpellSchoolPhysical,
ProcMask: core.ProcMaskMeleeMHSpecial,
Flags: core.SpellFlagMeleeMetrics | core.SpellFlagIncludeTargetBonusDamage,
Flags: core.SpellFlagMeleeMetrics | core.SpellFlagIncludeTargetBonusDamage | core.SpellFlagAPL,

EnergyCost: core.EnergyCostOptions{
Cost: 60 - 9*float64(druid.Talents.ShreddingAttacks),
Expand Down
2 changes: 1 addition & 1 deletion sim/druid/swipe.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func (druid *Druid) registerSwipeBearSpell() {
ActionID: core.ActionID{SpellID: 48562},
SpellSchool: core.SpellSchoolPhysical,
ProcMask: core.ProcMaskMeleeMHSpecial,
Flags: core.SpellFlagMeleeMetrics | core.SpellFlagIncludeTargetBonusDamage,
Flags: core.SpellFlagMeleeMetrics | core.SpellFlagIncludeTargetBonusDamage | core.SpellFlagAPL,

RageCost: core.RageCostOptions{
Cost: 20 - float64(druid.Talents.Ferocity),
Expand Down
2 changes: 1 addition & 1 deletion sim/druid/tigers_fury.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func (druid *Druid) registerTigersFurySpell() {

spell := druid.RegisterSpell(core.SpellConfig{
ActionID: actionID,

Flags: core.SpellFlagAPL,
Cast: core.CastConfig{
CD: core.Cooldown{
Timer: druid.NewTimer(),
Expand Down
2 changes: 1 addition & 1 deletion ui/core/launched_sims.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const simLaunchStatuses: Record<Spec, LaunchStatus> = {
// Alpha and Beta show an info notice at the top of the page.
export const aplLaunchStatuses: Record<Spec, LaunchStatus> = {
[Spec.SpecBalanceDruid]: LaunchStatus.Alpha,
[Spec.SpecFeralDruid]: LaunchStatus.Unlaunched,
[Spec.SpecFeralDruid]: LaunchStatus.Alpha,
[Spec.SpecFeralTankDruid]: LaunchStatus.Unlaunched,
[Spec.SpecRestorationDruid]: LaunchStatus.Unlaunched,
[Spec.SpecElementalShaman]: LaunchStatus.Alpha,
Expand Down
33 changes: 16 additions & 17 deletions ui/feral_druid/inputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,6 @@ export const LatencyMs = InputHelpers.makeSpecOptionsNumberInput<Spec.SpecFeralD
labelTooltip: 'Player latency, in milliseconds. Adds a delay to actions that cannot be spell queued.',
});

export const PrepopOoc = InputHelpers.makeSpecOptionsBooleanInput<Spec.SpecFeralDruid>({
fieldName: 'prepopOoc',
label: 'Pre-pop Clearcasting',
labelTooltip: 'Start fight with clearcasting',
showWhen: (player: Player<Spec.SpecFeralDruid>) => player.getTalents().omenOfClarity,
changeEmitter: (player: Player<Spec.SpecFeralDruid>) => TypedEvent.onAny([player.rotationChangeEmitter, player.talentsChangeEmitter]),
})

export const PrepopBerserk = InputHelpers.makeSpecOptionsBooleanInput<Spec.SpecFeralDruid>({
fieldName: 'prePopBerserk',
label: 'Pre-pop Berserk',
labelTooltip: 'Pre pop berserk 1 sec before fight',
showWhen: (player: Player<Spec.SpecFeralDruid>) => player.getTalents().berserk,
changeEmitter: (player: Player<Spec.SpecFeralDruid>) => TypedEvent.onAny([player.rotationChangeEmitter, player.talentsChangeEmitter]),
})

export const AssumeBleedActive = InputHelpers.makeSpecOptionsBooleanInput<Spec.SpecFeralDruid>({
fieldName: 'assumeBleedActive',
label: 'Assume Bleed Always Active',
Expand Down Expand Up @@ -85,6 +69,20 @@ export const FeralDruidRotationConfig = {
{ name: 'AOE', value: AplType.Aoe },
],
}),
InputHelpers.makeRotationBooleanInput<Spec.SpecFeralDruid>({
fieldName: 'prePopOoc',
label: 'Pre-pop Clearcasting',
labelTooltip: 'Start fight with clearcasting',
showWhen: (player: Player<Spec.SpecFeralDruid>) => player.getTalents().omenOfClarity,
changeEmitter: (player: Player<Spec.SpecFeralDruid>) => TypedEvent.onAny([player.rotationChangeEmitter, player.talentsChangeEmitter]),
}),
InputHelpers.makeRotationBooleanInput<Spec.SpecFeralDruid>({
fieldName: 'prePopBerserk',
label: 'Pre-pop Berserk',
labelTooltip: 'Pre pop berserk 1 sec before fight',
showWhen: (player: Player<Spec.SpecFeralDruid>) => player.getTalents().berserk,
changeEmitter: (player: Player<Spec.SpecFeralDruid>) => TypedEvent.onAny([player.rotationChangeEmitter, player.talentsChangeEmitter]),
}),
InputHelpers.makeRotationBooleanInput<Spec.SpecFeralDruid>({
fieldName: 'manualParams',
label: 'Manual Advanced Parameters',
Expand Down Expand Up @@ -136,10 +134,11 @@ export const FeralDruidRotationConfig = {
showWhen: ShouldShowAdvParamAoe,
}),
InputHelpers.makeRotationNumberInput<Spec.SpecFeralDruid>({
extraCssClasses: ['used-in-apl'],
fieldName: 'raidTargets',
label: 'GotW Raid Targets',
labelTooltip: 'Raid size to assume for clearcast proc chance (can include pets as well, so 25 man raid potentically can be ~30)',
showWhen: (player: Player<Spec.SpecFeralDruid>) => ShouldShowAdvParamAoe(player) && player.getRotation().flowerWeave == true,
showWhen: (player: Player<Spec.SpecFeralDruid>) => player.aplRotation.enabled || (ShouldShowAdvParamAoe(player) && player.getRotation().flowerWeave == true),
}),
// Can be uncommented if/when analytical bite mode is added
//InputHelpers.makeRotationEnumInput<Spec.SpecFeralDruid, BiteModeType>({
Expand Down
2 changes: 1 addition & 1 deletion ui/feral_druid/presets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ export const DefaultRotation = FeralDruidRotation.create({
flowerWeave: false,
raidTargets: 30,
maxFfDelay: 0.1,
prePopOoc: true,
});

export const DefaultOptions = FeralDruidOptions.create({
latencyMs: 100,
prepopOoc: true,
assumeBleedActive: true,
});

Expand Down
2 changes: 0 additions & 2 deletions ui/feral_druid/sim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,6 @@ export class FeralDruidSimUI extends IndividualSimUI<Spec.SpecFeralDruid> {
otherInputs: {
inputs: [
DruidInputs.LatencyMs,
DruidInputs.PrepopOoc,
DruidInputs.PrepopBerserk,
DruidInputs.AssumeBleedActive,
OtherInputs.TankAssignment,
OtherInputs.InFrontOfTarget,
Expand Down

0 comments on commit a2f1a0e

Please sign in to comment.