Skip to content

Commit

Permalink
[Warlock] Blackened Soul ICD hotfix (simulationcraft#9433)
Browse files Browse the repository at this point in the history
  • Loading branch information
Azevara authored Sep 7, 2024
1 parent d8cc282 commit e523fb0
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
1 change: 1 addition & 0 deletions engine/class_modules/warlock/sc_warlock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ warlock_t::warlock_t( sim_t* sim, util::string_view name, race_e r )
cooldowns.soul_fire = get_cooldown( "soul_fire" );
cooldowns.dimensional_rift = get_cooldown( "dimensional_rift" );
cooldowns.felstorm_icd = get_cooldown( "felstorm_icd" );
cooldowns.blackened_soul = get_cooldown( "blackened_soul_icd" );

resource_regeneration = regen_type::DYNAMIC;
regen_caches[ CACHE_HASTE ] = true;
Expand Down
1 change: 1 addition & 0 deletions engine/class_modules/warlock/sc_warlock.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,7 @@ struct warlock_t : public player_t
propagate_const<cooldown_t*> soul_fire;
propagate_const<cooldown_t*> dimensional_rift;
propagate_const<cooldown_t*> felstorm_icd; // Shared between Felstorm, Demonic Strength, and Guillotine TODO: Actually use this!
propagate_const<cooldown_t*> blackened_soul; // Internal cooldown on triggering stack increase to Wither
} cooldowns;

// Buffs
Expand Down
15 changes: 11 additions & 4 deletions engine/class_modules/warlock/sc_warlock_actions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4453,6 +4453,11 @@ using namespace helpers;

void helpers::trigger_blackened_soul( warlock_t* p, bool malevolence )
{
if ( !malevolence && p->cooldowns.blackened_soul->down() )
return;

bool stack_gained = false;

for ( const auto target : p->sim->target_non_sleeping_list )
{
warlock_td_t* tdata = p->get_target_data( target );
Expand All @@ -4463,18 +4468,18 @@ using namespace helpers;
continue;

tdata->dots_wither->increment( malevolence ? as<int>( p->hero.malevolence->effectN( 1 ).base_value() ) : 1 );
stack_gained = true;

if ( p->buffs.malevolence->check() && !malevolence )
tdata->dots_wither->increment( as<int>( p->hero.malevolence->effectN( 2 ).base_value() ) );

// TOCHECK: Chance for this effect is not in spell data!
if ( p->hero.bleakheart_tactics.ok() && p->rng().roll( p->rng_settings.bleakheart_tactics.setting_value ) )
if ( p->hero.bleakheart_tactics.ok() && !malevolence && p->rng().roll( p->rng_settings.bleakheart_tactics.setting_value ) )
{
tdata->dots_wither->increment( 1 );
p->procs.bleakheart_tactics->occur();
}

bool collapse = p->buffs.malevolence->check();
bool collapse = false; // 2024-09-06 Malevolence no longer initiates collapse automatically
collapse = collapse || ( p->hero.seeds_of_their_demise.ok() && target->health_percentage() <= p->hero.seeds_of_their_demise->effectN( 2 ).base_value() ) ;
collapse = collapse || ( p->hero.seeds_of_their_demise.ok() && tdata->dots_wither->current_stack() >= as<int>( p->hero.seeds_of_their_demise->effectN( 1 ).base_value() ) );

Expand All @@ -4484,14 +4489,16 @@ using namespace helpers;
}
else if ( p->rng().roll( p->rng_settings.blackened_soul.setting_value ) )
{
// TOCHECK: Chance for this effect is not in spell data!
tdata->debuffs_blackened_soul->trigger();
p->procs.blackened_soul->occur();
}

if ( malevolence )
p->proc_actions.malevolence->execute_on_target( target );
}

if ( stack_gained )
p->cooldowns.blackened_soul->start();
}

// Event for spawning Wild Imps for Demonology
Expand Down
2 changes: 2 additions & 0 deletions engine/class_modules/warlock/sc_warlock_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,8 @@ namespace warlock
hero.malevolence = find_talent_spell( talent_tree::HERO, "Malevolence" ); // Should be ID 430014
hero.malevolence_buff = find_spell( 442726 );
hero.malevolence_dmg = find_spell( 446285 );

cooldowns.blackened_soul->duration = 5_s; // TODO: Set using data once hotfix is in using hero.blackened_soul->internal_cooldown();
}

void warlock_t::init_spells_soul_harvester()
Expand Down

0 comments on commit e523fb0

Please sign in to comment.