Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/wowsims/sod
Browse files Browse the repository at this point in the history
  • Loading branch information
kayla-glick committed Jan 18, 2025
2 parents f7b9df5 + 4a694b1 commit 7420ad9
Show file tree
Hide file tree
Showing 54 changed files with 1,402 additions and 752 deletions.
6 changes: 6 additions & 0 deletions sim/core/apl_action.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ func (action *APLAction) GetAllSpells() []*Spell {
spells = append(spells, impl.spell)
} else if impl, ok := a.impl.(*APLActionMultishield); ok {
spells = append(spells, impl.spell)
} else if spell := a.impl.GetSpellFromAction(); spell != nil {
spells = append(spells, spell)
}
}
return spells
Expand All @@ -78,6 +80,9 @@ type APLActionImpl interface {
// Returns all inner APL Actions.
GetInnerActions() []*APLAction

// Returns the spell from this action, if any exists.
GetSpellFromAction() *Spell

// Returns all APLValues used by this Action (but not by inner Actions).
GetAPLValues() []APLValue

Expand Down Expand Up @@ -109,6 +114,7 @@ func (impl defaultAPLActionImpl) GetAPLValues() []APLValue { return
func (impl defaultAPLActionImpl) Finalize(*APLRotation) {}
func (impl defaultAPLActionImpl) Reset(*Simulation) {}
func (impl defaultAPLActionImpl) GetNextAction(*Simulation) *APLAction { return nil }
func (impl defaultAPLActionImpl) GetSpellFromAction() *Spell { return nil }

func (rot *APLRotation) newAPLAction(config *proto.APLAction) *APLAction {
if config == nil {
Expand Down
21 changes: 15 additions & 6 deletions sim/core/apl_actions_sequences.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,10 @@ func (action *APLActionResetSequence) String() string {

type APLActionStrictSequence struct {
defaultAPLActionImpl
unit *Unit
subactions []*APLAction
curIdx int
unit *Unit
subactions []*APLAction
curIdx int
requiresGCDCheck bool

subactionSpells []*Spell
}
Expand All @@ -105,8 +106,9 @@ func (rot *APLRotation) newActionStrictSequence(config *proto.APLActionStrictSeq
}

return &APLActionStrictSequence{
unit: rot.unit,
subactions: subactions,
unit: rot.unit,
subactions: subactions,
requiresGCDCheck: false,
}
}
func (action *APLActionStrictSequence) GetInnerActions() []*APLAction {
Expand All @@ -117,12 +119,19 @@ func (action *APLActionStrictSequence) Finalize(rot *APLRotation) {
subaction.impl.Finalize(rot)
action.subactionSpells = append(action.subactionSpells, subaction.GetAllSpells()...)
}

for _, spell := range action.subactionSpells {
if spell.DefaultCast.GCD > 0 {
action.requiresGCDCheck = true
break
}
}
}
func (action *APLActionStrictSequence) Reset(*Simulation) {
action.curIdx = 0
}
func (action *APLActionStrictSequence) IsReady(sim *Simulation) bool {
if !action.unit.GCD.IsReady(sim) {
if action.requiresGCDCheck && !action.unit.GCD.IsReady(sim) {
return false
}
if !action.subactions[0].IsReady(sim) {
Expand Down
29 changes: 14 additions & 15 deletions sim/core/buffs.go
Original file line number Diff line number Diff line change
Expand Up @@ -710,11 +710,11 @@ func applyBuffEffects(agent Agent, playerFaction proto.Faction, raidBuffs *proto
if raidBuffs.AspectOfTheLion {
HeartOfTheLionAura(character)
} else if individualBuffs.BlessingOfKings && isAlliance {
MakePermanent(BlessingOfKingsAura(character))
BlessingOfKingsAura(character)
}

if raidBuffs.SanctityAura && isAlliance {
MakePermanent(SanctityAuraAura(character))
SanctityAuraAura(character)
}

// TODO: Classic
Expand Down Expand Up @@ -746,9 +746,9 @@ func applyBuffEffects(agent Agent, playerFaction proto.Faction, raidBuffs *proto
}

if raidBuffs.HornOfLordaeron && isAlliance {
MakePermanent(HornOfLordaeronAura(&character.Unit, level))
HornOfLordaeronAura(&character.Unit, level)
} else if individualBuffs.BlessingOfMight != proto.TristateEffect_TristateEffectMissing && isAlliance {
MakePermanent(BlessingOfMightAura(&character.Unit, GetTristateValueInt32(individualBuffs.BlessingOfMight, 0, 5), level))
BlessingOfMightAura(&character.Unit, GetTristateValueInt32(individualBuffs.BlessingOfMight, 0, 5), level)
}

if raidBuffs.DemonicPact > 0 {
Expand Down Expand Up @@ -903,7 +903,16 @@ func applyPetBuffEffects(petAgent PetAgent, playerFaction proto.Faction, raidBuf
}

func SanctityAuraAura(character *Character) *Aura {
aura := MakePermanent(character.GetOrRegisterAura(Aura{
if character.Level < 30 {
return nil
}

aura := character.GetAura("Sanctity Aura")
if aura != nil {
return aura
}

aura = MakePermanent(character.GetOrRegisterAura(Aura{
Label: "Sanctity Aura",
ActionID: ActionID{SpellID: 20218},
}))
Expand Down Expand Up @@ -2211,16 +2220,6 @@ func CreateExtraAttackAuraCommon(character *Character, buffActionID ActionID, au
},
})

MakePermanent(character.GetOrRegisterAura(Aura{
Label: "Extra Attacks (Main Hand)", // Tracks Stored Extra Attacks from all sources
ActionID: ActionID{SpellID: 21919}, // Thrash ID
Duration: NeverExpires,
MaxStacks: 4, // Max is 4 extra attacks stored - more can proc after
OnInit: func(aura *Aura, sim *Simulation) {
aura.Unit.AutoAttacks.mh.extraAttacksAura = aura
},
}))

icd := Cooldown{
Timer: character.NewTimer(),
Duration: time.Millisecond * 1500,
Expand Down
1 change: 1 addition & 0 deletions sim/druid/feral/apl_values.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ func (impl *APLActionCatOptimalRotationAction) Finalize(*core.APLRotation)
func (impl *APLActionCatOptimalRotationAction) GetNextAction(*core.Simulation) *core.APLAction {
return nil
}
func (impl *APLActionCatOptimalRotationAction) GetSpellFromAction() *core.Spell { return nil }

func (cat *FeralDruid) newActionCatOptimalRotationAction(_ *core.APLRotation, config *proto.APLActionCatOptimalRotationAction) core.APLActionImpl {
cat.setupRotation(config)
Expand Down
3 changes: 3 additions & 0 deletions sim/paladin/apl_values.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ func (x *APLActionCastPaladinPrimarySeal) GetInnerActions() []*core.APLAction
func (x *APLActionCastPaladinPrimarySeal) GetAPLValues() []core.APLValue { return nil }
func (x *APLActionCastPaladinPrimarySeal) Finalize(*core.APLRotation) {}
func (x *APLActionCastPaladinPrimarySeal) GetNextAction(*core.Simulation) *core.APLAction { return nil }
func (x *APLActionCastPaladinPrimarySeal) GetSpellFromAction() *core.Spell {
return x.paladin.primarySeal
}

func (paladin *Paladin) newActionPaladinPrimarySealAction(_ *core.APLRotation, _ *proto.APLActionCastPaladinPrimarySeal) core.APLActionImpl {
return &APLActionCastPaladinPrimarySeal{
Expand Down
4 changes: 2 additions & 2 deletions sim/paladin/item_sets_pve.go
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ func (paladin *Paladin) applyPaladinT2Holy4P() {
//Increases damage done by your Consecration spell by 50%
paladin.OnSpellRegistered(func(spell *core.Spell) {
if spell.SpellCode == SpellCode_PaladinConsecration {
spell.AOEDot().DamageMultiplier += 0.5
spell.DamageMultiplierAdditive += 0.5
}
})
}
Expand Down Expand Up @@ -623,7 +623,7 @@ func (paladin *Paladin) applyPaladinTAQRet2P() {
//"S03 - Item - TAQ - Paladin - Retribution 2P Bonus",
if spell.SpellCode == SpellCode_PaladinCrusaderStrike {
// 2 Set: Increases Crusader Strike Damage by 50%
spell.DamageMultiplier += 0.5
spell.DamageMultiplierAdditive += 0.5
}
})
}
Expand Down
7 changes: 6 additions & 1 deletion sim/paladin/paladin.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ type Paladin struct {
primarySeal *core.Spell // the seal configured in options, available via "Cast Primary Seal"
primaryPaladinAura proto.PaladinAura
currentPaladinAura *core.Aura
sanctityAura *core.Aura

currentSeal *core.Aura
prevSeal *core.Aura
Expand Down Expand Up @@ -155,10 +156,14 @@ func (paladin *Paladin) Initialize() {
paladin.enableMultiJudge = false // Was previously true in Phase 4 but disabled in Phase 5
paladin.lingerDuration = time.Millisecond * 400
paladin.consumeSealsOnJudge = true
if paladin.Options.Aura == proto.PaladinAura_SanctityAura || paladin.HasAura("Sanctity Aura") {
paladin.sanctityAura = core.SanctityAuraAura(paladin.GetCharacter())
}

paladin.registerStopAttackMacros()

paladin.ResetCurrentPaladinAura()
paladin.ResetPrimarySeal(paladin.Options.PrimarySeal)
}

func (paladin *Paladin) Reset(_ *core.Simulation) {
Expand Down Expand Up @@ -232,7 +237,7 @@ func (paladin *Paladin) registerStopAttackMacros() {
func (paladin *Paladin) ResetCurrentPaladinAura() {
paladin.currentPaladinAura = nil
if paladin.primaryPaladinAura == proto.PaladinAura_SanctityAura {
paladin.currentPaladinAura = core.SanctityAuraAura(paladin.GetCharacter())
paladin.currentPaladinAura = paladin.sanctityAura
}
}

Expand Down
2 changes: 0 additions & 2 deletions sim/paladin/protection/protection.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ func NewProtectionPaladin(character *core.Character, options *proto.Player) *Pro

prot := &ProtectionPaladin{
Paladin: pal,
primarySeal: protOptions.PrimarySeal,
righteousFury: protOptions.RighteousFury,
IsUsingDivineStormStopAttack: protOptions.IsUsingDivineStormStopAttack,
IsUsingJudgementStopAttack: protOptions.IsUsingJudgementStopAttack,
Expand All @@ -49,7 +48,6 @@ func NewProtectionPaladin(character *core.Character, options *proto.Player) *Pro
type ProtectionPaladin struct {
*paladin.Paladin

primarySeal proto.PaladinSeal
righteousFury bool
IsUsingDivineStormStopAttack bool
IsUsingJudgementStopAttack bool
Expand Down
Loading

0 comments on commit 7420ad9

Please sign in to comment.