Skip to content

Commit

Permalink
[core] move energy threshold setup from unit to character
Browse files Browse the repository at this point in the history
[druid/feral] add a default APL, and related test, slightly refactor APLValueCatExcessEnergy
[shaman] Spirit Weapons' threat reduction now works like "every other threat reduction", and doesn't apply to AutoAttacks twice
[shaman] while at it, fix Mental Dexterity to use the correct Intellect -> AP stat multipliers (tested in-game)
  • Loading branch information
vigo2 committed Nov 12, 2023
1 parent 57c6bc1 commit 85540eb
Show file tree
Hide file tree
Showing 9 changed files with 1,469 additions and 445 deletions.
8 changes: 8 additions & 0 deletions sim/core/character.go
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,14 @@ func (character *Character) Finalize() {

character.Unit.finalize()

// For now, restrict this optimization to rogues only. Ferals will require
// some extra logic to handle their ExcessEnergy() calc.
if character.Class == proto.Class_ClassRogue {
character.Env.RegisterPostFinalizeEffect(func() {
character.energyBar.setupEnergyThresholds()
})
}

character.majorCooldownManager.finalize()
character.ItemSwap.finalize()
}
Expand Down
11 changes: 1 addition & 10 deletions sim/core/unit.go
Original file line number Diff line number Diff line change
Expand Up @@ -443,15 +443,6 @@ func (unit *Unit) finalize() {
for _, spell := range unit.Spellbook {
spell.finalize()
}

// For now, restrict this optimization to rogues only. Ferals will require
// some extra logic to handle their ExcessEnergy() calc.
agent := unit.Env.Raid.GetPlayerFromUnit(unit)
if agent != nil && agent.GetCharacter().Class == proto.Class_ClassRogue {
unit.Env.RegisterPostFinalizeEffect(func() {
unit.energyBar.setupEnergyThresholds()
})
}
}

func (unit *Unit) reset(sim *Simulation, _ Agent) {
Expand Down Expand Up @@ -563,7 +554,7 @@ func (unit *Unit) GetMetadata() *proto.UnitMetadata {
return metadata
}

func (unit *Unit) StartAPLLoop(sim *Simulation) {
func (unit *Unit) StartAPLLoop(_ *Simulation) {
if unit.HasManaBar() {
unit.ManaRequired = 0
}
Expand Down
Loading

0 comments on commit 85540eb

Please sign in to comment.