Skip to content

Commit

Permalink
Merge pull request #2146 from jarveson/jake/feral-display-form-bonus
Browse files Browse the repository at this point in the history
feral: form bonus / misc
  • Loading branch information
jarveson authored Dec 13, 2022
2 parents 6784acc + b7eba14 commit e3b2f6d
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 52 deletions.
4 changes: 0 additions & 4 deletions sim/core/character.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,6 @@ func (character *Character) addUniversalStatDependencies() {
character.AddStatDependency(stats.Agility, stats.Armor, 2)
}

func (character *Character) ApplyFormBonuses(enable bool) stats.Stats {
return stats.Stats{}
}

// Returns a partially-filled PlayerStats proto for use in the CharacterStats api call.
func (character *Character) applyAllEffects(agent Agent, raidBuffs *proto.RaidBuffs, partyBuffs *proto.PartyBuffs, individualBuffs *proto.IndividualBuffs) *proto.PlayerStats {
playerStats := &proto.PlayerStats{}
Expand Down
12 changes: 6 additions & 6 deletions sim/druid/feral/TestFeral.results
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ character_stats_results: {
value: {
final_stats: 648.1794
final_stats: 1403.3976
final_stats: 2295.1646
final_stats: 1669.21062
final_stats: 385.33968
final_stats: 394.85424
final_stats: 280
Expand All @@ -12,24 +12,24 @@ character_stats_results: {
final_stats: 990.62917
final_stats: 318
final_stats: 0
final_stats: 10964.38433
final_stats: 10445.87724
final_stats: 255
final_stats: 2211.60753
final_stats: 2395.24753
final_stats: 318
final_stats: 172
final_stats: 194.975
final_stats: 8996.0952
final_stats: 0
final_stats: 0
final_stats: 27630.3092
final_stats: 9178.2952
final_stats: 3084.4
final_stats: 0
final_stats: 0
final_stats: 0
final_stats: 1346.5594
final_stats: 0
final_stats: 0
final_stats: 30188.24603
final_stats: 23928.7062
final_stats: 75
final_stats: 75
final_stats: 75
Expand Down Expand Up @@ -770,7 +770,7 @@ dps_results: {
key: "TestFeral-AllItems-ThunderheartHarness"
value: {
dps: 5675.72738
tps: 4281.08493
tps: 4294.78658
}
}
dps_results: {
Expand Down
8 changes: 3 additions & 5 deletions sim/druid/feral/rotation.go
Original file line number Diff line number Diff line change
Expand Up @@ -403,8 +403,6 @@ func (cat *FeralDruid) doRotation(sim *core.Simulation) {
excessE := curEnergy - floatingEnergy
timeToNextAction := time.Duration(0)

var nextCastEnd time.Duration

if !cat.CatFormAura.IsActive() && rotation.FlowerWeave {
// If the previous GotW cast was unsuccessful and we still have
// leeway available, then try again. Otherwise, shift back into Cat
Expand Down Expand Up @@ -549,7 +547,7 @@ func (cat *FeralDruid) doRotation(sim *core.Simulation) {
// since we will be forced to shift into Dire Bear Form immediately
// after pooling in order to save the Lacerate. Instead, it is
// preferable to just Shred and bearweave early.
nextCastEnd = sim.CurrentTime + timeToNextAction + cat.latency + time.Second*2
nextCastEnd := sim.CurrentTime + timeToNextAction + cat.latency + time.Second*2
ignorePooling := rotation.BearweaveType == proto.FeralDruid_Rotation_Lacerate && cat.LacerateDot.IsActive() && (cat.LacerateDot.ExpiresAt().Seconds()-1.5-latencySecs <= nextCastEnd.Seconds())

if ignorePooling {
Expand All @@ -575,8 +573,8 @@ func (cat *FeralDruid) doRotation(sim *core.Simulation) {
// If Lacerateweaving, then also schedule an action just before Lacerate
// expires to ensure we can save it in time.
lacRefreshTime := cat.LacerateDot.ExpiresAt() - (time.Duration(1.5*float64(time.Second) - float64(3*cat.latency*time.Second)))
if rotation.BearweaveType == proto.FeralDruid_Rotation_Lacerate && cat.LacerateDot.IsActive() && cat.LacerateDot.RemainingDuration(sim) < sim.GetRemainingDuration() && (lacRefreshTime <= nextCastEnd) && (lacRefreshTime > sim.CurrentTime) {
nextAction = core.MinDuration(nextAction, time.Duration(lacRefreshTime))
if rotation.BearweaveType == proto.FeralDruid_Rotation_Lacerate && cat.LacerateDot.IsActive() && cat.LacerateDot.RemainingDuration(sim) < sim.GetRemainingDuration() && (sim.CurrentTime < lacRefreshTime) {
nextAction = core.MinDuration(nextAction, lacRefreshTime)
}
nextAction += cat.latency

Expand Down
10 changes: 5 additions & 5 deletions sim/druid/forms.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
type DruidForm uint8

const (
Humanoid = 1 << iota
Humanoid DruidForm = 1 << iota
Bear
Cat
Moonkin
Expand Down Expand Up @@ -88,9 +88,9 @@ func (druid *Druid) registerCatFormSpell() {
Label: "Cat Form",
ActionID: actionID,
Duration: core.NeverExpires,
BuildPhase: core.CharacterBuildPhaseBase,
BuildPhase: core.Ternary(druid.StartingForm.Matches(Cat), core.CharacterBuildPhaseBase, core.CharacterBuildPhaseNone),
OnGain: func(aura *core.Aura, sim *core.Simulation) {
if druid.form != Humanoid {
if !druid.Env.MeasuringStats && druid.form != Humanoid {
druid.ClearForm(sim)
}
druid.form = Cat
Expand Down Expand Up @@ -244,9 +244,9 @@ func (druid *Druid) registerBearFormSpell() {
Label: "Bear Form",
ActionID: actionID,
Duration: core.NeverExpires,
BuildPhase: core.CharacterBuildPhaseBase,
BuildPhase: core.Ternary(druid.StartingForm.Matches(Bear), core.CharacterBuildPhaseBase, core.CharacterBuildPhaseNone),
OnGain: func(aura *core.Aura, sim *core.Simulation) {
if druid.form != Humanoid {
if !druid.Env.MeasuringStats && druid.form != Humanoid {
druid.ClearForm(sim)
}
druid.form = Bear
Expand Down
33 changes: 20 additions & 13 deletions sim/druid/items.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,11 +376,7 @@ func init() {
})

core.MakePermanent(druid.RegisterAura(core.Aura{
Label: "Idol of the Lunar Eclipse",
Duration: core.NeverExpires,
OnReset: func(aura *core.Aura, sim *core.Simulation) {
aura.Activate(sim)
},
Label: "Idol of the Lunar Eclipse",
OnPeriodicDamageDealt: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, result *core.SpellResult) {
procAura.Activate(sim)
procAura.AddStack(sim)
Expand All @@ -389,15 +385,26 @@ func init() {
})

core.NewItemEffect(32387, func(agent core.Agent) {
// Idol of the Raven Goddess
// This should maybe be an Aura, but this way it changes stats on sheet
druid := agent.(DruidAgent).GetDruid()

if druid.InForm(Bear | Cat) {
druid.AddStat(stats.MeleeCrit, 40.0)
} else if druid.InForm(Moonkin) {
druid.AddStat(stats.SpellCrit, 40.0)
}
core.MakePermanent(druid.RegisterAura(core.Aura{
Label: "Idol of the Raven Goddess",
BuildPhase: core.CharacterBuildPhaseGear,
OnGain: func(aura *core.Aura, sim *core.Simulation) {
// For now this assume we'll never leave main form
if druid.StartingForm.Matches(Bear | Cat) {
druid.AddStatDynamic(sim, stats.MeleeCrit, 40.0)
} else if druid.StartingForm.Matches(Moonkin) {
druid.AddStatDynamic(sim, stats.SpellCrit, 40.0)
}
},
OnExpire: func(aura *core.Aura, sim *core.Simulation) {
if druid.StartingForm.Matches(Bear | Cat) {
druid.AddStatDynamic(sim, stats.MeleeCrit, -40.0)
} else if druid.StartingForm.Matches(Moonkin) {
druid.AddStatDynamic(sim, stats.SpellCrit, -40.0)
}
},
}))
})

//core.NewItemEffect(37573, func(agent core.Agent) {
Expand Down
2 changes: 1 addition & 1 deletion sim/druid/mangle.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (druid *Druid) registerMangleBearSpell() {
DamageMultiplier: (1 + 0.1*float64(druid.Talents.SavageFury)) * 1.15 * glyphBonus,
CritMultiplier: druid.MeleeCritMultiplier(Bear),
ThreatMultiplier: (1.5 / 1.15) *
core.TernaryFloat64(druid.InForm(Bear) && druid.HasSetBonus(ItemSetThunderheartHarness, 2), 1.15, 1),
core.TernaryFloat64(druid.HasSetBonus(ItemSetThunderheartHarness, 2), 1.15, 1),

ApplyEffects: func(sim *core.Simulation, target *core.Unit, spell *core.Spell) {
baseDamage := 299/1.15 +
Expand Down
36 changes: 18 additions & 18 deletions ui/feral_druid/inputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,24 @@ export const FeralDruidRotationConfig = {
{ name: 'Lacerate', value: BearweaveType.Lacerate },
],
}),
InputHelpers.makeRotationBooleanInput<Spec.SpecFeralDruid>({
fieldName: 'snekWeave',
label: 'Snek Weave',
labelTooltip: 'Reset swing timer using albino snek, when going from bear to cat',
showWhen: (player: Player<Spec.SpecFeralDruid>) => player.getRotation().bearWeaveType != BearweaveType.None,
}),
InputHelpers.makeRotationBooleanInput<Spec.SpecFeralDruid>({
fieldName: 'flowerWeave',
label: 'Flower Weave',
labelTooltip: 'Fish for clearcasting during rotation with gotw',
showWhen: (player: Player<Spec.SpecFeralDruid>) => player.getRotation().bearWeaveType == BearweaveType.None,
}),
InputHelpers.makeRotationNumberInput<Spec.SpecFeralDruid>({
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>) => player.getRotation().bearWeaveType == BearweaveType.None && player.getRotation().flowerWeave == true,
}),
InputHelpers.makeRotationNumberInput<Spec.SpecFeralDruid>({
fieldName: 'hotUptime',
label: 'Revitalize Hot Uptime',
Expand Down Expand Up @@ -117,23 +135,5 @@ export const FeralDruidRotationConfig = {
labelTooltip: 'Min seconds on Rip/Roar to bite',
showWhen: (player: Player<Spec.SpecFeralDruid>) => player.getRotation().useBite == true && player.getRotation().biteModeType == BiteModeType.Emperical,
}),
InputHelpers.makeRotationBooleanInput<Spec.SpecFeralDruid>({
fieldName: 'snekWeave',
label: 'Snek Weave',
labelTooltip: 'Reset swing timer using albino snek, when going from bear to cat',
showWhen: (player: Player<Spec.SpecFeralDruid>) => player.getRotation().bearWeaveType != BearweaveType.None,
}),
InputHelpers.makeRotationBooleanInput<Spec.SpecFeralDruid>({
fieldName: 'flowerWeave',
label: 'Flower Weave',
labelTooltip: 'Fish for clearcasting during rotation with gotw',
showWhen: (player: Player<Spec.SpecFeralDruid>) => player.getRotation().bearWeaveType == BearweaveType.None,
}),
InputHelpers.makeRotationNumberInput<Spec.SpecFeralDruid>({
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>) => player.getRotation().bearWeaveType == BearweaveType.None && player.getRotation().flowerWeave == true,
}),
],
};

0 comments on commit e3b2f6d

Please sign in to comment.