Skip to content

Commit

Permalink
[Warlock] Infernal Machine (simulationcraft#9106)
Browse files Browse the repository at this point in the history
  • Loading branch information
Azevara authored Jul 25, 2024
1 parent 806d09e commit 3bf6781
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
20 changes: 13 additions & 7 deletions engine/class_modules/warlock/sc_warlock_actions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,41 +158,47 @@ using namespace helpers;

if ( diabolist() && triggers.diabolic_ritual )
{
timespan_t adjustment = -timespan_t::from_seconds( p()->hero.diabolic_ritual->effectN( 1 ).base_value() );
timespan_t adjustment = -timespan_t::from_seconds( p()->hero.diabolic_ritual->effectN( 1 ).base_value() ) * shards_used;

if ( demonology() && p()->hero.infernal_machine.ok() && p()->warlock_pet_list.demonic_tyrants.n_active_pets() > 0 )
adjustment += -p()->hero.infernal_machine->effectN( 1 ).time_value();

if ( destruction() && p()->hero.infernal_machine.ok() && p()->warlock_pet_list.infernals.n_active_pets() > 0 )
adjustment += -p()->hero.infernal_machine->effectN( 1 ).time_value();

switch( p()->diabolic_ritual )
{
case 0:
if ( p()->buffs.ritual_overlord->check() )
{
p()->buffs.ritual_overlord->extend_duration( p(), adjustment * shards_used );
p()->buffs.ritual_overlord->extend_duration( p(), adjustment );
}
else
{
p()->buffs.ritual_overlord->trigger();
make_event( sim, 1_ms, [ this, shards_used, adjustment ] { p()->buffs.ritual_overlord->extend_duration( p(), adjustment * shards_used ); } );
make_event( sim, 1_ms, [ this, adjustment ] { p()->buffs.ritual_overlord->extend_duration( p(), adjustment ); } );
}
break;
case 1:
if ( p()->buffs.ritual_mother->check() )
{
p()->buffs.ritual_mother->extend_duration( p(), adjustment * shards_used );
p()->buffs.ritual_mother->extend_duration( p(), adjustment );
}
else
{
p()->buffs.ritual_mother->trigger();
make_event( sim, 1_ms, [ this, shards_used, adjustment ] { p()->buffs.ritual_mother->extend_duration( p(), adjustment * shards_used ); } );
make_event( sim, 1_ms, [ this, adjustment ] { p()->buffs.ritual_mother->extend_duration( p(), adjustment ); } );
}
break;
case 2:
if ( p()->buffs.ritual_pit_lord->check() )
{
p()->buffs.ritual_pit_lord->extend_duration( p(), adjustment * shards_used );
p()->buffs.ritual_pit_lord->extend_duration( p(), adjustment );
}
else
{
p()->buffs.ritual_pit_lord->trigger();
make_event( sim, 1_ms, [ this, shards_used, adjustment ] { p()->buffs.ritual_pit_lord->extend_duration( p(), adjustment * shards_used ); } );
make_event( sim, 1_ms, [ this, adjustment ] { p()->buffs.ritual_pit_lord->extend_duration( p(), adjustment ); } );
}
break;
default:
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 @@ -500,6 +500,8 @@ namespace warlock

hero.cruelty_of_kerxan = find_talent_spell( talent_tree::HERO, "Cruelty of Kerxan" ); // Should be ID 429902

hero.infernal_machine = find_talent_spell( talent_tree::HERO, "Infernal Machine" ); // Should be ID 429917

warlock_pet_list.overlords.set_default_duration( hero.summon_overlord->duration() );
warlock_pet_list.mothers.set_default_duration( hero.summon_mother->duration() );
warlock_pet_list.pit_lords.set_default_duration( hero.summon_pit_lord->duration() );
Expand Down

0 comments on commit 3bf6781

Please sign in to comment.