Skip to content

Commit

Permalink
[Warlock] Update Tormented Crescendo proc requirements (simulationcra…
Browse files Browse the repository at this point in the history
  • Loading branch information
Azevara authored Sep 7, 2024
1 parent b969a54 commit 43dbab3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 20 deletions.
2 changes: 1 addition & 1 deletion engine/class_modules/warlock/sc_warlock.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,7 @@ namespace helpers
virtual void execute() override;
};

bool crescendo_check( warlock_t* p );
bool crescendo_check( warlock_t* p, player_t* tar );
void nightfall_updater( warlock_t* p, dot_t* d );

void trigger_blackened_soul( warlock_t* p, bool malevolence );
Expand Down
35 changes: 16 additions & 19 deletions engine/class_modules/warlock/sc_warlock_actions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1014,7 +1014,7 @@ using namespace helpers;

if ( p()->talents.tormented_crescendo.ok() )
{
if ( crescendo_check( p() ) && rng().roll( p()->talents.tormented_crescendo->effectN( 1 ).percent() ) )
if ( crescendo_check( p(), s->target ) && rng().roll( p()->talents.tormented_crescendo->effectN( 1 ).percent() ) )
{
p()->procs.tormented_crescendo->occur();
p()->buffs.tormented_crescendo->trigger();
Expand Down Expand Up @@ -2095,7 +2095,7 @@ using namespace helpers;

if ( p()->talents.tormented_crescendo.ok() )
{
if ( crescendo_check( p() ) && rng().roll( p()->talents.tormented_crescendo->effectN( 2 ).percent() ) )
if ( crescendo_check( p(), d->target ) && rng().roll( p()->talents.tormented_crescendo->effectN( 2 ).percent() ) )
{
p()->procs.tormented_crescendo->occur();
p()->buffs.tormented_crescendo->trigger();
Expand Down Expand Up @@ -4405,28 +4405,25 @@ using namespace helpers;
}

// Checks whether Tormented Crescendo conditions are met
bool helpers::crescendo_check( warlock_t* p )
bool helpers::crescendo_check( warlock_t* p, player_t* tar )
{
bool agony = false;
bool corruption = false;
for ( const auto target : p->sim->target_non_sleeping_list )
{
warlock_td_t* td = p->get_target_data( target );
if ( !td )
continue;
if ( tar != p->ua_target )
return false;

agony = agony || td->dots_agony->is_ticking();

if ( p->hero.wither.ok() )
corruption = corruption || td->dots_wither->is_ticking();
else
corruption = corruption || td->dots_corruption->is_ticking();
bool valid = p->get_target_data( tar )->dots_unstable_affliction->is_ticking();

if ( agony && corruption )
break;
if ( p->hero.wither.ok() )
{
valid = valid && p->get_target_data( tar )->dots_wither->is_ticking();
}
else
{
valid = valid && p->get_target_data( tar )->dots_corruption->is_ticking();
}

valid = valid && p->get_target_data( tar )->dots_agony->is_ticking();

return agony && corruption && ( p->ua_target && p->get_target_data( p->ua_target )->dots_unstable_affliction->is_ticking() );
return valid;
}

void helpers::nightfall_updater( warlock_t* p, dot_t* d )
Expand Down

0 comments on commit 43dbab3

Please sign in to comment.