@@ -8,75 +8,61 @@ import (
88 "github.com/wowsims/mop/sim/core/stats"
99)
1010
11- func (druid * Druid ) registerFrenziedRegenerationCD () {
11+ func (druid * Druid ) registerFrenziedRegenerationSpell () {
1212 actionID := core.ActionID {SpellID : 22842 }
13- healthMetrics := druid .NewHealthMetrics (actionID )
14- rageMetrics := druid .NewRageMetrics (actionID )
15-
16- cdTimer := druid .NewTimer ()
17- cd := time .Minute * 3
1813 isGlyphed := druid .HasMajorGlyph (proto .DruidMajorGlyph_GlyphOfFrenziedRegeneration )
19- healingMulti := core .TernaryFloat64 (isGlyphed , 1.3 , 1.0 )
20-
21- var bonusHealth float64
22- druid .FrenziedRegenerationAura = druid .RegisterAura (core.Aura {
14+ buffConfig := core.Aura {
2315 Label : "Frenzied Regeneration" ,
2416 ActionID : actionID ,
25- Duration : time .Second * 20 ,
26- OnGain : func (aura * core.Aura , sim * core.Simulation ) {
27- druid .PseudoStats .HealingTakenMultiplier *= healingMulti
28- bonusHealth = druid .MaxHealth () * 0.3
29- druid .AddStatsDynamic (sim , stats.Stats {stats .Health : bonusHealth })
17+ Duration : time .Second * 6 ,
3018
31- if druid .CurrentHealth () < bonusHealth {
32- druid .GainHealth (sim , bonusHealth - druid .CurrentHealth (), healthMetrics )
33- }
19+ OnGain : func (aura * core.Aura , _ * core.Simulation ) {
20+ aura .Unit .PseudoStats .HealingTakenMultiplier *= 1.4
3421 },
3522
36- OnExpire : func (aura * core.Aura , sim * core.Simulation ) {
37- druid .PseudoStats .HealingTakenMultiplier /= healingMulti
38- druid .AddStatsDynamic (sim , stats.Stats {stats .Health : - bonusHealth })
39-
40- if druid .CurrentHealth () > druid .MaxHealth () {
41- druid .RemoveHealth (sim , druid .CurrentHealth ()- druid .MaxHealth ())
42- }
23+ OnExpire : func (aura * core.Aura , _ * core.Simulation ) {
24+ aura .Unit .PseudoStats .HealingTakenMultiplier /= 1.4
4325 },
44- })
26+ }
27+
28+ var rageMetrics * core.ResourceMetrics
29+
30+ if isGlyphed {
31+ druid .FrenziedRegenerationAura = druid .RegisterAura (buffConfig )
32+ } else {
33+ rageMetrics = druid .NewRageMetrics (actionID )
34+ }
4535
4636 druid .FrenziedRegeneration = druid .RegisterSpell (Bear , core.SpellConfig {
47- ActionID : actionID ,
37+ ActionID : actionID ,
38+ SpellSchool : core .SpellSchoolPhysical ,
39+ ProcMask : core .ProcMaskSpellHealing ,
40+ Flags : core .SpellFlagNoOnCastComplete | core .SpellFlagAPL ,
41+ DamageMultiplier : 1 ,
42+ CritMultiplier : druid .DefaultCritMultiplier (),
43+ ThreatMultiplier : 1 ,
44+
4845 Cast : core.CastConfig {
4946 CD : core.Cooldown {
50- Timer : cdTimer ,
51- Duration : cd ,
47+ Timer : druid . NewTimer () ,
48+ Duration : time . Millisecond * 1500 ,
5249 },
5350 },
54- ApplyEffects : func (sim * core.Simulation , target * core.Unit , spell * core.Spell ) {
55- druid .FrenziedRegenerationAura .Activate (sim )
5651
52+ RageCost : core.RageCostOptions {
53+ Cost : core .TernaryInt32 (isGlyphed , 50 , 0 ),
54+ },
55+
56+ ApplyEffects : func (sim * core.Simulation , _ * core.Unit , spell * core.Spell ) {
5757 if isGlyphed {
58- return
58+ druid .FrenziedRegenerationAura .Activate (sim )
59+ } else {
60+ const maxRageCost = 60.0
61+ rageDumped := min (druid .CurrentRage (), maxRageCost )
62+ healthGained := max ((druid .GetStat (stats .AttackPower ) - 2 * druid .GetStat (stats .Agility )) * 2.2 , druid .GetStat (stats .Stamina ) * 2.5 ) * rageDumped / maxRageCost
63+ spell .CalcAndDealHealing (sim , spell .Unit , healthGained , spell .OutcomeHealing )
64+ druid .SpendRage (sim , rageDumped , rageMetrics )
5965 }
60-
61- core .StartPeriodicAction (sim , core.PeriodicActionOptions {
62- NumTicks : 20 ,
63- Period : time .Second * 1 ,
64- Priority : core .ActionPriorityDOT ,
65- OnAction : func (sim * core.Simulation ) {
66- rageDumped := min (druid .CurrentRage (), 10.0 )
67- healthGained := rageDumped * 0.3 / 100 * druid .MaxHealth () * druid .PseudoStats .HealingTakenMultiplier
68-
69- if druid .FrenziedRegenerationAura .IsActive () {
70- druid .SpendRage (sim , rageDumped , rageMetrics )
71- druid .GainHealth (sim , healthGained , healthMetrics )
72- }
73- },
74- })
7566 },
7667 })
77-
78- druid .AddMajorCooldown (core.MajorCooldown {
79- Spell : druid .FrenziedRegeneration .Spell ,
80- Type : core .CooldownTypeSurvival ,
81- })
8268}
0 commit comments