-
Notifications
You must be signed in to change notification settings - Fork 51
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
Prot Paladin: Libram of the Devoted + Libram of Avengement #1066
Conversation
sim/paladin/items.go
Outdated
paladin.OnSpellRegistered(func(spell *core.Spell) { | ||
if spell.SpellCode == SpellCode_PaladinAvengersShield { | ||
// Libram of Avenging causes Avenger's Shield to now hit the primary target | ||
// twice (two projectiles). Note: Avenger's Shield cannot miss or be resisted. | ||
results := make([]*core.SpellResult, 2) | ||
lowDamage := 366 * paladin.baseRuneAbilityDamage() / 100 | ||
highDamage := 448 * paladin.baseRuneAbilityDamage() / 100 | ||
|
||
spell.ApplyEffects = func(sim *core.Simulation, target *core.Unit, spell *core.Spell) { | ||
apBonus := 0.091 * spell.MeleeAttackPower() | ||
for idx := range results { | ||
baseDamage := sim.Roll(lowDamage, highDamage) + apBonus | ||
// Avenger's Shield cannot miss and uses magic critical _chance_. | ||
results[idx] = spell.CalcDamage(sim, target, baseDamage, spell.OutcomeMagicCrit) | ||
} | ||
// The second projectile fires after a fixed 1.5s delay (2nd autocast does not trigger GCD) | ||
|
||
// First hit | ||
spell.WaitTravelTime(sim, func(sim *core.Simulation) { | ||
spell.DealDamage(sim, results[0]) | ||
}) | ||
|
||
// Second hit | ||
timeToHit := spell.TravelTime() + time.Millisecond*1500 | ||
core.StartDelayedAction(sim, core.DelayedActionOptions{ | ||
DoAt: sim.CurrentTime + timeToHit, | ||
OnAction: func(s *core.Simulation) { | ||
spell.DealDamage(sim, results[1]) | ||
}, | ||
}) | ||
} | ||
} |
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.
I wonder if this could just be a second cast of avenger's shield but then manually adjusting the cast metrics?
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.
The base version of the spell is setup to bounce to neighboring enemies, so casting it twice on the same target would only behave correctly if you are simulating a single target encounter.
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.
Oh gotcha. Hm, I wonder if this should just be a toggle on the avenging wrath spell then with an attribute you can override here? I don't love the spell's code being copied here
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.
Sure, I can probably set it up as a branch in the code for the base spell that checks for the item effect (and have the item effect do basically nothing itself). Did it this way because I assumed you might prefer things like item effects to not be intermingled with base ability implementations.
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.
Yeah idk sometimes these effects are a total pain lol. You could just tie it to a paladin struct attribute and have the libram toggle that attribute on. Something like
paladin.DoRighteousShieldSingleTarget
or something idk. In Wrath it was just a glyph IIRC
Implements the Phase 4/5 Paladin librams.