Skip to content

Commit 22ae053

Browse files
committed
[Havoc] Relentless Onslaught triggers based on buff state after delay
1 parent 1a91909 commit 22ae053

1 file changed

Lines changed: 59 additions & 32 deletions

File tree

engine/class_modules/sc_demon_hunter.cpp

Lines changed: 59 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ namespace
1515
class demon_hunter_t;
1616
struct soul_fragment_t;
1717

18+
namespace actions::attacks
19+
{
20+
struct relentless_onslaught_t;
21+
}
22+
1823
// Target Data
1924
class demon_hunter_td_t : public actor_target_data_t
2025
{
@@ -905,17 +910,16 @@ class demon_hunter_t : public parse_player_effects_t
905910
spell_t* collective_anguish = nullptr;
906911

907912
// Havoc
908-
spell_t* burning_wound = nullptr;
909-
attack_t* demon_blades = nullptr;
910-
spell_t* fel_barrage = nullptr;
911-
spell_t* inner_demon = nullptr;
912-
spell_t* ragefire = nullptr;
913-
attack_t* relentless_onslaught = nullptr;
914-
attack_t* relentless_onslaught_annihilation = nullptr;
915-
action_t* soulscar = nullptr;
916-
attack_t* screaming_brutality_blade_dance_throw_glaive = nullptr;
917-
attack_t* screaming_brutality_death_sweep_throw_glaive = nullptr;
918-
attack_t* screaming_brutality_slash_proc_throw_glaive = nullptr;
913+
spell_t* burning_wound = nullptr;
914+
attack_t* demon_blades = nullptr;
915+
spell_t* fel_barrage = nullptr;
916+
spell_t* inner_demon = nullptr;
917+
spell_t* ragefire = nullptr;
918+
actions::attacks::relentless_onslaught_t* relentless_onslaught = nullptr;
919+
action_t* soulscar = nullptr;
920+
attack_t* screaming_brutality_blade_dance_throw_glaive = nullptr;
921+
attack_t* screaming_brutality_death_sweep_throw_glaive = nullptr;
922+
attack_t* screaming_brutality_slash_proc_throw_glaive = nullptr;
919923

920924
// Vengeance
921925
spell_t* infernal_armor = nullptr;
@@ -5550,6 +5554,36 @@ struct death_sweep_t : public blade_dance_base_t
55505554
}
55515555
};
55525556

5557+
// Relentless Onslaught =====================================================
5558+
5559+
struct relentless_onslaught_t : public demon_hunter_spell_t
5560+
{
5561+
attack_t* chaos_strike;
5562+
attack_t* annihilation;
5563+
5564+
relentless_onslaught_t( util::string_view n, demon_hunter_t* p, attack_t* cs, attack_t* anni )
5565+
: demon_hunter_spell_t( n, p ), chaos_strike( cs ), annihilation( anni )
5566+
{
5567+
background = dual = true;
5568+
}
5569+
5570+
void execute() override
5571+
{
5572+
demon_hunter_spell_t::execute();
5573+
5574+
if ( p()->buff.metamorphosis->up() )
5575+
{
5576+
annihilation->execute_on_target( target );
5577+
}
5578+
else
5579+
{
5580+
chaos_strike->execute_on_target( target );
5581+
}
5582+
5583+
p()->cooldown.relentless_onslaught_icd->start( p()->talent.havoc.relentless_onslaught->internal_cooldown() );
5584+
}
5585+
};
5586+
55535587
// Chaos Strike =============================================================
55545588

55555589
struct chaos_strike_base_t
@@ -5626,20 +5660,13 @@ struct chaos_strike_base_t
56265660
base_t::impact( s );
56275661

56285662
// Relentless Onslaught cannot self-proc and is delayed by ~300ms after the normal OH impact
5629-
if ( p()->talent.havoc.relentless_onslaught->ok() )
5663+
if ( p()->talent.havoc.relentless_onslaught->ok() && result_is_hit( s->result ) && may_refund &&
5664+
!parent->from_onslaught )
56305665
{
5631-
if ( result_is_hit( s->result ) && may_refund && !parent->from_onslaught )
5666+
double chance = p()->talent.havoc.relentless_onslaught->effectN( 1 ).percent();
5667+
if ( p()->cooldown.relentless_onslaught_icd->up() && p()->rng().roll( chance ) )
56325668
{
5633-
double chance = p()->talent.havoc.relentless_onslaught->effectN( 1 ).percent();
5634-
if ( p()->cooldown.relentless_onslaught_icd->up() && p()->rng().roll( chance ) )
5635-
{
5636-
attack_t* const relentless_onslaught = p()->buff.metamorphosis->check()
5637-
? p()->active.relentless_onslaught_annihilation
5638-
: p()->active.relentless_onslaught;
5639-
make_event<delayed_execute_event_t>( *sim, p(), relentless_onslaught, target, this->delay );
5640-
p()->cooldown.relentless_onslaught_icd->start(
5641-
p()->talent.havoc.relentless_onslaught->internal_cooldown() );
5642-
}
5669+
make_event<delayed_execute_event_t>( *sim, p(), p()->active.relentless_onslaught, target, this->delay );
56435670
}
56445671
}
56455672

@@ -5769,7 +5796,7 @@ struct chaos_strike_t : public chaos_strike_base_t
57695796

57705797
if ( !from_onslaught && p()->active.relentless_onslaught )
57715798
{
5772-
add_child( p()->active.relentless_onslaught );
5799+
add_child( p()->active.relentless_onslaught->chaos_strike );
57735800
}
57745801
}
57755802

@@ -5815,9 +5842,9 @@ struct annihilation_t : public demonsurge_trigger_t<demonsurge_ability::ANNIHILA
58155842
{
58165843
chaos_strike_base_t::init();
58175844

5818-
if ( !from_onslaught && p()->active.relentless_onslaught_annihilation )
5845+
if ( !from_onslaught && p()->active.relentless_onslaught )
58195846
{
5820-
add_child( p()->active.relentless_onslaught_annihilation );
5847+
add_child( p()->active.relentless_onslaught->annihilation );
58215848
}
58225849
}
58235850

@@ -9205,13 +9232,13 @@ void demon_hunter_t::init_spells()
92059232
}
92069233
if ( talent.havoc.relentless_onslaught->ok() )
92079234
{
9208-
auto relentless_onslaught_chaos_strike = get_background_action<chaos_strike_t>( "chaos_strike_onslaught" );
9209-
relentless_onslaught_chaos_strike->from_onslaught = true;
9210-
active.relentless_onslaught = relentless_onslaught_chaos_strike;
9235+
auto cs = get_background_action<chaos_strike_t>( "chaos_strike_onslaught" );
9236+
cs->from_onslaught = true;
9237+
9238+
auto anni = get_background_action<annihilation_t>( "annihilation_onslaught" );
9239+
anni->from_onslaught = true;
92119240

9212-
auto relentless_onslaught_annihilation = get_background_action<annihilation_t>( "annihilation_onslaught" );
9213-
relentless_onslaught_annihilation->from_onslaught = true;
9214-
active.relentless_onslaught_annihilation = relentless_onslaught_annihilation;
9241+
active.relentless_onslaught = get_background_action<relentless_onslaught_t>( "relentless_onslaught", cs, anni );
92159242
}
92169243
if ( talent.havoc.inner_demon->ok() )
92179244
{

0 commit comments

Comments
 (0)