Skip to content

Commit

Permalink
[Death Knight] Fix Portal to the Underworld damage
Browse files Browse the repository at this point in the history
  • Loading branch information
navv1234 committed Jul 24, 2017
1 parent 9b89931 commit c283f3e
Showing 1 changed file with 45 additions and 36 deletions.
81 changes: 45 additions & 36 deletions engine/class_modules/sc_death_knight.cpp
Expand Up @@ -503,6 +503,7 @@ struct death_knight_t : public player_t {
action_t* pestilence; // Armies of the Damned
action_t* t20_2pc_unholy;
action_t* cold_heart;
action_t* dragged_to_helheim;
} active_spells;

// Gains
Expand Down Expand Up @@ -871,7 +872,7 @@ struct death_knight_t : public player_t {
}
return false;
} );

regen_type = REGEN_DYNAMIC;
}

Expand Down Expand Up @@ -955,6 +956,7 @@ struct death_knight_t : public player_t {
void trigger_t20_2pc_frost( double consumed );
void trigger_t20_4pc_frost( double consumed );
void trigger_t20_4pc_unholy( double consumed );
void trigger_portal_to_the_underworld( player_t* target );

// Actor is standing in their own Death and Decay or Defile
bool in_death_and_decay() const;
Expand Down Expand Up @@ -2150,36 +2152,13 @@ struct army_pet_t : public base_ghoul_pet_t
}
};

struct dragged_to_helheim_t : public pet_spell_t<army_pet_t>
{
dragged_to_helheim_t( army_pet_t* player ) :
super( player, "dragged_to_helheim", player -> find_spell( 218321 ) )
{
background = true;
aoe = -1;
}

// Uses owner's attack power .. probably. The damage in game is not very self-explanatory.
// Technically this is wrong, but we have no action-specific composite attack power multiplier,
// so just multiply it in here. The ghoul itself will never have an attack power multiplier so
// there's no possibility of breakage.
double composite_attack_power() const override
{ return p() -> o() -> cache.attack_power() * p() -> o() -> composite_attack_power_multiplier(); }
};

dragged_to_helheim_t* despawn_explosion;

army_pet_t( death_knight_t* owner, const std::string& name ) :
base_ghoul_pet_t( owner, name, true ), despawn_explosion( nullptr )
base_ghoul_pet_t( owner, name, true )
{ }

void dismiss( bool expired ) override
{
if ( expired && despawn_explosion )
{
despawn_explosion -> execute();
}

o() -> trigger_portal_to_the_underworld( target );
pet_t::dismiss( expired );
}

Expand All @@ -2201,16 +2180,6 @@ struct army_pet_t : public base_ghoul_pet_t
def -> add_action( "Claw" );
}

bool create_actions() override
{
if ( o() -> artifact.portal_to_the_underworld.rank() )
{
despawn_explosion = new dragged_to_helheim_t( this );
}

return base_ghoul_pet_t::create_actions();
}

action_t* create_action( const std::string& name, const std::string& options_str ) override
{
if ( name == "claw" ) return new army_claw_t( this, options_str );
Expand Down Expand Up @@ -3299,6 +3268,30 @@ struct necrobomb_t : public death_knight_spell_t
}
};


// Dragged to Helheim =======================================================

struct dragged_to_helheim_t : public death_knight_spell_t
{
dragged_to_helheim_t( death_knight_t* p ) :
death_knight_spell_t( "dragged_to_helheim", p, p -> find_spell( 218321 ) )
{
aoe = -1;
background = true;
callbacks = false;
}

double composite_target_multiplier( player_t* target ) const
{
double m = death_knight_spell_t::composite_target_multiplier( target );

// Dragged to Helheim does not benefit from the Death debuff of AotD ghouls
m /= 1.0 + td( target ) -> debuff.death -> check_stack_value();

return m;
}
};

// Pestilence ===============================================================

struct pestilence_t : public death_knight_spell_t
Expand Down Expand Up @@ -6845,6 +6838,17 @@ void death_knight_t::trigger_t20_4pc_frost( double consumed )
}
}

void death_knight_t::trigger_portal_to_the_underworld( player_t* target )
{
if ( ! artifact.portal_to_the_underworld.rank() )
{
return;
}

active_spells.dragged_to_helheim -> set_target( target );
active_spells.dragged_to_helheim -> execute();
}

void death_knight_t::trigger_t20_4pc_unholy( double consumed )
{
if ( ! sets -> has_set_bonus( DEATH_KNIGHT_UNHOLY, T20, B4 ) )
Expand Down Expand Up @@ -7091,6 +7095,11 @@ bool death_knight_t::create_actions()
this, find_spell( 243122 ) );
}

if ( artifact.portal_to_the_underworld.rank() )
{
active_spells.dragged_to_helheim = new dragged_to_helheim_t( this );
}

return player_t::create_actions();
}

Expand Down

0 comments on commit c283f3e

Please sign in to comment.