@@ -538,6 +538,8 @@ struct druid_t final : public parse_player_effects_t
538538 // Feral
539539 timespan_t halazzis_fury_duration; // mid2 2pc
540540 // Guardian
541+ player_t* red_moon_target; // lunar wrath hits most recent rm target
542+ double lunar_wrath_rage_spent;
541543 timespan_t rampant_thorn_berserk_extension; // mid2 4pc
542544
543545 struct dot_list_t
@@ -4978,9 +4980,9 @@ struct rage_spender_t : public BASE
49784980private:
49794981 druid_t* p_;
49804982 buff_t* atw_buff;
4981- double moy_hp_pct_per_rage = 0.0;
4983+ double lw_rage_per_proc;
4984+ double moy_hp_pct_per_rage;
49824985 double ug_rage_per_cdr;
4983- double lw_rage_bucket = 0.0;
49844986 double wg_pct;
49854987
49864988protected:
@@ -4991,51 +4993,19 @@ struct rage_spender_t : public BASE
49914993 : BASE( n, p, s, f ),
49924994 p_( p ),
49934995 atw_buff( p->buff.after_the_wildfire ),
4996+ lw_rage_per_proc( p->talent.red_moon.ok()
4997+ ? p->talent.galactic_guardian->effectN( 3 ).base_value()
4998+ : 0.0 ),
4999+ moy_hp_pct_per_rage( p->talent.memory_of_ysera.ok()
5000+ ? p->talent.memory_of_ysera->effectN( 1 ).percent() * 0.01 / p->talent.memory_of_ysera->effectN( 2 ).base_value()
5001+ : 0.0 ),
49945002 ug_rage_per_cdr( p->talent.ursocs_guidance->effectN( 5 ).base_value() ),
49955003 wg_pct( p->talent.wild_guardian_1->effectN( 2 ).percent() )
4996- {
4997- if ( p->talent.memory_of_ysera.ok() )
4998- {
4999- moy_hp_pct_per_rage =
5000- p->talent.memory_of_ysera->effectN( 1 ).percent() * 0.01 / p->talent.memory_of_ysera->effectN( 2 ).base_value();
5001- }
5002-
5003- if ( p->talent.galactic_guardian.ok() && p->talent.red_moon.ok() )
5004- lw_rage_bucket = p->talent.galactic_guardian->effectN( 3 ).base_value();
5005- }
5006-
5007- void impact( action_state_t* s ) override
5008- {
5009- BASE::impact( s );
5010-
5011- if ( !BASE::proc && BASE::td( s->target )->dots.red_moon->is_ticking() )
5012- {
5013- if ( lw_rage_bucket )
5014- {
5015- auto _stacks = static_cast<int>( BASE::last_resource_cost / lw_rage_bucket );
5016- if ( p_->buff.lunar_wrath->consume( this, _stacks ) )
5017- {
5018- for ( int i = 0; i < _stacks; ++i )
5019- {
5020- p_->active.lunar_wrath_heal->execute();
5021- p_->active.lunar_wrath->execute_on_target( s->target );
5022- }
5023- }
5024- }
5025- else
5026- {
5027- if ( p_->buff.lunar_wrath->consume( this ) )
5028- {
5029- p_->active.lunar_wrath_heal->execute();
5030- p_->active.lunar_wrath->execute_on_target( s->target );
5031- }
5032- }
5033- }
5034- }
5004+ {}
50355005
50365006 void consume_rage_after_the_wildfire( double amount )
50375007 {
5038- if ( !p_->talent.after_the_wildfire.ok() )
5008+ if ( !p_->talent.after_the_wildfire.ok() || amount < 0.0 )
50395009 return;
50405010
50415011 if ( !atw_buff->check() )
@@ -5051,9 +5021,31 @@ struct rage_spender_t : public BASE
50515021 }
50525022 }
50535023
5024+ void consume_rage_lunar_wrath( double amount )
5025+ {
5026+ if ( !lw_rage_per_proc || amount < 0.0 || !p_->red_moon_target )
5027+ return;
5028+
5029+ assert( BASE::td( p_->red_moon_target )->dots.red_moon->is_ticking() &&
5030+ "Lunar Wrath attempting to proc on target without Red Moon" );
5031+
5032+ p_->lunar_wrath_rage_spent += amount;
5033+
5034+ while ( p_->lunar_wrath_rage_spent >= lw_rage_per_proc )
5035+ {
5036+ p_->lunar_wrath_rage_spent -= lw_rage_per_proc;
5037+
5038+ if ( p_->buff.lunar_wrath->consume( this ) )
5039+ {
5040+ p_->active.lunar_wrath_heal->execute();
5041+ p_->active.lunar_wrath->execute_on_target( p_->red_moon_target );
5042+ }
5043+ }
5044+ }
5045+
50545046 void consume_rage_memory_of_ysera( double amount )
50555047 {
5056- if ( !p_->talent.memory_of_ysera.ok() )
5048+ if ( !moy_hp_pct_per_rage || amount < 0.0 )
50575049 return;
50585050
50595051 auto heal_amount = p_->resources.max[ RESOURCE_HEALTH ] * amount * moy_hp_pct_per_rage;
@@ -5066,7 +5058,7 @@ struct rage_spender_t : public BASE
50665058
50675059 void consume_rage_ursocs_guidance( double amount )
50685060 {
5069- if ( !p_->talent.ursocs_guidance.ok() )
5061+ if ( !ug_rage_per_cdr || amount < 0.0 )
50705062 return;
50715063
50725064 auto dur = timespan_t::from_seconds( amount / -ug_rage_per_cdr );
@@ -5080,19 +5072,19 @@ struct rage_spender_t : public BASE
50805072
50815073 void consume_rage_wild_guardian( double chance )
50825074 {
5083- if ( chance && p_->rng().roll( chance ) )
5075+ if ( !chance || !p_->rng().roll( chance ) )
5076+ return;
5077+
5078+ // trigger wild guardian 1, if possible
5079+ if ( p_->buff.answered_calling_summon->trigger( this ) )
50845080 {
5085- // trigger wild guardian 1 , if possible
5086- if ( p_->buff.answered_calling_summon ->trigger( this ) )
5081+ // trigger wild guardian 3 , if possible
5082+ if ( p_->buff.answered_calling ->trigger() )
50875083 {
5088- // trigger wild guardian 3, if possible
5089- if ( p_->buff.answered_calling->trigger() )
5090- {
5091- if ( p_->cooldown.mangle )
5092- p_->cooldown.mangle->reset( true );
5093- if ( p_->cooldown.thrash )
5094- p_->cooldown.thrash->reset( true );
5095- }
5084+ if ( p_->cooldown.mangle )
5085+ p_->cooldown.mangle->reset( true );
5086+ if ( p_->cooldown.thrash )
5087+ p_->cooldown.thrash->reset( true );
50965088 }
50975089 }
50985090 }
@@ -7991,6 +7983,24 @@ struct red_moon_t final : public druid_spell_t
79917983 {
79927984 dot_name = "red_moon";
79937985 }
7986+
7987+ void trigger_dot( action_state_t* s ) override
7988+ {
7989+ druid_spell_t::trigger_dot( s );
7990+
7991+ p()->red_moon_target = s->target;
7992+
7993+ // rage tracking is reset on new cast
7994+ p()->lunar_wrath_rage_spent = 0.0;
7995+ }
7996+
7997+ void last_tick( dot_t* d ) override
7998+ {
7999+ druid_spell_t::last_tick( d );
8000+
8001+ if ( p()->red_moon_target == d->target )
8002+ p()->red_moon_target = nullptr;
8003+ }
79948004};
79958005
79968006// Proxy Swipe Spell ========================================================
@@ -13011,6 +13021,8 @@ void druid_t::reset()
1301113021 stellar_amplification_target = nullptr;
1301213022 moon_stage = static_cast<moon_stage_e>( options.initial_moon_stage );
1301313023 halazzis_fury_duration = 0_ms;
13024+ red_moon_target = nullptr;
13025+ lunar_wrath_rage_spent = 0;
1301413026 rampant_thorn_berserk_extension = 0_ms;
1301513027 dot_lists.moonfire.clear();
1301613028 dot_lists.sunfire.clear();
0 commit comments