Skip to content

Commit

Permalink
Merge pull request #1168 from wowsims/feature/apl-aura-sets
Browse files Browse the repository at this point in the history
Generalize default Unholy APL using aura set APL values
  • Loading branch information
NerdEgghead authored Nov 5, 2024
2 parents d0e986d + 5247441 commit 0772911
Show file tree
Hide file tree
Showing 8 changed files with 235 additions and 1,839 deletions.
4 changes: 4 additions & 0 deletions proto/apl.proto
Original file line number Diff line number Diff line change
Expand Up @@ -568,21 +568,25 @@ message APLValueAllTrinketStatProcsActive {
int32 stat_type1 = 1;
int32 stat_type2 = 2;
int32 stat_type3 = 3;
bool exclude_stacking_procs = 4;
}
message APLValueAnyTrinketStatProcsActive {
int32 stat_type1 = 1;
int32 stat_type2 = 2;
int32 stat_type3 = 3;
bool exclude_stacking_procs = 4;
}
message APLValueTrinketProcsMinRemainingTime {
int32 stat_type1 = 1;
int32 stat_type2 = 2;
int32 stat_type3 = 3;
bool exclude_stacking_procs = 4;
}
message APLValueNumEquippedStatProcTrinkets {
int32 stat_type1 = 1;
int32 stat_type2 = 2;
int32 stat_type3 = 3;
bool exclude_stacking_procs = 4;
}

message APLValueDotIsActive {
Expand Down
4 changes: 2 additions & 2 deletions sim/core/apl_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ func (rot *APLRotation) GetAPLICDAura(sourceUnit UnitReference, auraId *proto.Ac
return aura
}

func (rot *APLRotation) GetAPLTrinketProcAuras(statTypesToMatch []stats.Stat, warnIfNoneFound bool) []*StatBuffAura {
func (rot *APLRotation) GetAPLTrinketProcAuras(statTypesToMatch []stats.Stat, excludeStackingProcs bool, warnIfNoneFound bool) []*StatBuffAura {
unit := rot.unit
character := unit.Env.Raid.GetPlayerFromUnit(unit).GetCharacter()
matchingAuras := character.GetMatchingTrinketProcAuras(statTypesToMatch)
matchingAuras := character.GetMatchingTrinketProcAuras(statTypesToMatch, excludeStackingProcs)

if (len(matchingAuras) == 0) && warnIfNoneFound {
rot.ValidationWarning("No trinket proc buffs found for: %s", StringFromStatTypes(statTypesToMatch))
Expand Down
12 changes: 6 additions & 6 deletions sim/core/apl_values_aura_sets.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ type APLValueTrinketStatProcCheck struct {
matchingAuras []*StatBuffAura
}

func (rot *APLRotation) newTrinketStatProcValue(valueName string, statType1 int32, statType2 int32, statType3 int32, requireMatch bool) *APLValueTrinketStatProcCheck {
func (rot *APLRotation) newTrinketStatProcValue(valueName string, statType1 int32, statType2 int32, statType3 int32, excludeStackingProcs bool, requireMatch bool) *APLValueTrinketStatProcCheck {
statTypesToMatch := stats.IntTupleToStatsList(statType1, statType2, statType3)
matchingAuras := rot.GetAPLTrinketProcAuras(statTypesToMatch, requireMatch)
matchingAuras := rot.GetAPLTrinketProcAuras(statTypesToMatch, excludeStackingProcs, requireMatch)

if (len(matchingAuras) == 0) && requireMatch {
return nil
Expand Down Expand Up @@ -55,7 +55,7 @@ type APLValueAllTrinketStatProcsActive struct {
}

func (rot *APLRotation) newValueAllTrinketStatProcsActive(config *proto.APLValueAllTrinketStatProcsActive) APLValue {
parentImpl := rot.newTrinketStatProcValue("AllTrinketStatProcsActive", config.StatType1, config.StatType2, config.StatType3, true)
parentImpl := rot.newTrinketStatProcValue("AllTrinketStatProcsActive", config.StatType1, config.StatType2, config.StatType3, config.ExcludeStackingProcs, true)

if parentImpl == nil {
return nil
Expand Down Expand Up @@ -83,7 +83,7 @@ type APLValueAnyTrinketStatProcsActive struct {
}

func (rot *APLRotation) newValueAnyTrinketStatProcsActive(config *proto.APLValueAnyTrinketStatProcsActive) APLValue {
parentImpl := rot.newTrinketStatProcValue("AnyTrinketStatProcsActive", config.StatType1, config.StatType2, config.StatType3, true)
parentImpl := rot.newTrinketStatProcValue("AnyTrinketStatProcsActive", config.StatType1, config.StatType2, config.StatType3, config.ExcludeStackingProcs, true)

if parentImpl == nil {
return nil
Expand Down Expand Up @@ -111,7 +111,7 @@ type APLValueTrinketProcsMinRemainingTime struct {
}

func (rot *APLRotation) newValueTrinketProcsMinRemainingTime(config *proto.APLValueTrinketProcsMinRemainingTime) APLValue {
parentImpl := rot.newTrinketStatProcValue("TrinketProcsMinRemainingTime", config.StatType1, config.StatType2, config.StatType3, true)
parentImpl := rot.newTrinketStatProcValue("TrinketProcsMinRemainingTime", config.StatType1, config.StatType2, config.StatType3, config.ExcludeStackingProcs, true)

if parentImpl == nil {
return nil
Expand Down Expand Up @@ -141,7 +141,7 @@ type APLValueNumEquippedStatProcTrinkets struct {
}

func (rot *APLRotation) newValueNumEquippedStatProcTrinkets(config *proto.APLValueNumEquippedStatProcTrinkets) APLValue {
parentImpl := rot.newTrinketStatProcValue("NumEquippedStatProcTrinkets", config.StatType1, config.StatType2, config.StatType3, false)
parentImpl := rot.newTrinketStatProcValue("NumEquippedStatProcTrinkets", config.StatType1, config.StatType2, config.StatType3, config.ExcludeStackingProcs, false)

return &APLValueNumEquippedStatProcTrinkets{
APLValueTrinketStatProcCheck: parentImpl,
Expand Down
4 changes: 2 additions & 2 deletions sim/core/character.go
Original file line number Diff line number Diff line change
Expand Up @@ -691,9 +691,9 @@ func (character *Character) GetOffensiveTrinketCD() *Timer {
func (character *Character) GetConjuredCD() *Timer {
return character.GetOrInitTimer(&character.conjuredCD)
}
func (character *Character) GetMatchingTrinketProcAuras(statTypesToMatch []stats.Stat) []*StatBuffAura {
func (character *Character) GetMatchingTrinketProcAuras(statTypesToMatch []stats.Stat, excludeStackingProcs bool) []*StatBuffAura {
return FilterSlice(character.TrinketProcBuffs, func(aura *StatBuffAura) bool {
return aura.BuffsMatchingStat(statTypesToMatch)
return aura.BuffsMatchingStat(statTypesToMatch) && (!excludeStackingProcs || (aura.MaxStacks <= 1))
})
}

Expand Down
Loading

0 comments on commit 0772911

Please sign in to comment.