Skip to content

Commit

Permalink
Merge branch 'master' into guardian
Browse files Browse the repository at this point in the history
  • Loading branch information
NerdEgghead committed Nov 12, 2024
2 parents 8575871 + 4c3f888 commit 2c230de
Show file tree
Hide file tree
Showing 38 changed files with 7,585 additions and 4,401 deletions.
9 changes: 8 additions & 1 deletion sim/common/cata/other_effects.go
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,12 @@ func init() {
5,
buffDuration)

buffAura := character.RegisterAura(core.Aura{
Label: "Apparatus of Khaz'goroth" + labelSuffix,
ActionID: core.ActionID{ItemID: apparatusItemID},
Duration: buffDuration,
})

titanicPower := character.RegisterAura(core.Aura{
Label: "Titanic Power" + labelSuffix,
ActionID: core.ActionID{SpellID: 96923},
Expand All @@ -582,7 +588,7 @@ func init() {
}

core.MakePermanent(core.MakeProcTriggerAura(&character.Unit, core.ProcTrigger{
Name: "Titanic Power Aura" + labelSuffix,
Name: "Titanic Power Trigger" + labelSuffix,
ActionID: core.ActionID{SpellID: 96924},
Callback: core.CallbackOnSpellHitDealt,
ProcMask: core.ProcMaskMelee,
Expand Down Expand Up @@ -640,6 +646,7 @@ func init() {
panic("unexpected statType")
}

buffAura.Activate(sim)
titanicPower.Deactivate(sim)
},
ExtraCastCondition: func(sim *core.Simulation, target *core.Unit) bool {
Expand Down
14 changes: 11 additions & 3 deletions sim/core/pet.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ type Pet struct {
// Some pets expire after a certain duration. This is the pending action that disables
// the pet on expiration.
timeoutAction *PendingAction

// DK Raise Dead is doing its whole RP thing by climbing out of the ground before attacking.
startAttackDelay time.Duration
}

func NewPet(name string, owner *Character, baseStats stats.Stats, statInheritance PetStatInheritance, enabledOnStart bool, isGuardian bool) Pet {
Expand Down Expand Up @@ -171,12 +174,12 @@ func (pet *Pet) Enable(sim *Simulation, petAgent PetAgent) {
pet.OnPetEnable(sim)
}

pet.SetGCDTimer(sim, max(0, sim.CurrentTime))
if sim.CurrentTime >= 0 {
pet.SetGCDTimer(sim, max(0, sim.CurrentTime+pet.startAttackDelay, sim.CurrentTime))
if sim.CurrentTime >= 0 && pet.startAttackDelay <= 0 {
pet.AutoAttacks.EnableAutoSwing(sim)
} else {
sim.AddPendingAction(&PendingAction{
NextActionAt: 0,
NextActionAt: max(0, sim.CurrentTime+pet.startAttackDelay),
OnAction: func(sim *Simulation) {
if pet.enabled {
pet.AutoAttacks.EnableAutoSwing(sim)
Expand All @@ -198,6 +201,11 @@ func (pet *Pet) Enable(sim *Simulation, petAgent PetAgent) {
}
}

func (pet *Pet) EnableWithStartAttackDelay(sim *Simulation, petAgent PetAgent, startAttackDelay time.Duration) {
pet.startAttackDelay = startAttackDelay
pet.Enable(sim, petAgent)
}

// Helper for enabling a pet that will expire after a certain duration.
func (pet *Pet) EnableWithTimeout(sim *Simulation, petAgent PetAgent, petDuration time.Duration) {
pet.Enable(sim, petAgent)
Expand Down
Loading

0 comments on commit 2c230de

Please sign in to comment.