-
Notifications
You must be signed in to change notification settings - Fork 26
Add Badge of the Swarmguard #134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
sim/common/item_effects.go
Outdated
| trinketAura := character.RegisterAura(core.Aura{ | ||
| Label: auraLabel, | ||
| ActionID: actionID, | ||
| Duration: time.Second * 30, | ||
| OnExpire: func(aura *core.Aura, sim *core.Simulation) { | ||
| procAura.Deactivate(sim) | ||
| }, | ||
| OnSpellHitDealt: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, result *core.SpellResult) { | ||
| if !result.Landed() { | ||
| return | ||
| } | ||
| if !spell.ProcMask.Matches(core.ProcMaskMeleeOrRanged) { | ||
| return | ||
| } | ||
| if !ppmm.ProcWithWeaponSpecials(sim, spell.ProcMask, auraLabel) { | ||
| return | ||
| } | ||
|
|
||
| procAura.Activate(sim) | ||
| procAura.AddStack(sim) | ||
| }, | ||
| }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can simplify this by using the MakeProcTriggerAura helper (I edited this together in browser so I'd double check that I did all of the syntax correctly)
| trinketAura := character.RegisterAura(core.Aura{ | |
| Label: auraLabel, | |
| ActionID: actionID, | |
| Duration: time.Second * 30, | |
| OnExpire: func(aura *core.Aura, sim *core.Simulation) { | |
| procAura.Deactivate(sim) | |
| }, | |
| OnSpellHitDealt: func(aura *core.Aura, sim *core.Simulation, spell *core.Spell, result *core.SpellResult) { | |
| if !result.Landed() { | |
| return | |
| } | |
| if !spell.ProcMask.Matches(core.ProcMaskMeleeOrRanged) { | |
| return | |
| } | |
| if !ppmm.ProcWithWeaponSpecials(sim, spell.ProcMask, auraLabel) { | |
| return | |
| } | |
| procAura.Activate(sim) | |
| procAura.AddStack(sim) | |
| }, | |
| }) | |
| trinketAura := core.MakeProcTriggerAura(&character.Unit, core.ProcTrigger{ | |
| Name: auraLabel, | |
| ActionID: actionID, | |
| Duration: time.Second * 30, | |
| Callback: core.CallbackOnSpellHitDealt, | |
| Outcome: core.OutcomeLanded, | |
| ProcMask: core.ProcMaskMeleeOrRanged, | |
| SpellFlagsExclude: core.SpellFlagSuppressEquipProcs, | |
| PPM: 10.0, | |
| Handler: func(sim *core.Simulation, _ *core.Spell, _ *core.SpellResult) { | |
| procAura.Activate(sim) | |
| procAura.AddStack(sim) | |
| }, | |
| }) |
sim/common/item_effects.go
Outdated
|
|
||
| spell := character.RegisterSpell(core.SpellConfig{ | ||
| ActionID: actionID, | ||
| Flags: core.SpellFlagNoOnCastComplete, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Flags: core.SpellFlagNoOnCastComplete, | |
| Flags: core.SpellFlagNoOnCastComplete | SpellFlagOffensiveEquipment, |
Mostly based on the TBC implementation but had to make a few changes.