Skip to content

Commit

Permalink
Adjust Whispers in the Dark, should be no change to output
Browse files Browse the repository at this point in the history
  • Loading branch information
navv1234 committed Jan 15, 2017
1 parent 1ab6859 commit 6f0e791
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 49 deletions.
41 changes: 19 additions & 22 deletions engine/player/sc_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1004,8 +1004,6 @@ void player_t::init_base_stats()

base.spell_power_multiplier = 1.0;
base.attack_power_multiplier = 1.0;
base.spell_speed_multiplier = 1.0;
base.attack_speed_multiplier = 1.0;

if ( ( meta_gem == META_EMBER_PRIMAL ) || ( meta_gem == META_EMBER_SHADOWSPIRIT ) || ( meta_gem == META_EMBER_SKYFIRE ) || ( meta_gem == META_EMBER_SKYFLARE ) )
{
Expand Down Expand Up @@ -2718,7 +2716,7 @@ void player_t::create_buffs()
.add_invalidate( CACHE_INTELLECT );

// Legendary meta haste buff
buffs.tempus_repit = buff_creator_t( this, "tempus_repit", find_spell( 137590 ) ).add_invalidate( CACHE_HASTE ).activated( false );
buffs.tempus_repit = haste_buff_creator_t( this, "tempus_repit", find_spell( 137590 ) ).add_invalidate( CACHE_SPELL_SPEED ).activated( false );

buffs.darkflight = buff_creator_t( this, "darkflight", find_racial_spell( "darkflight" ) );

Expand Down Expand Up @@ -2893,18 +2891,9 @@ double player_t::composite_melee_speed() const
h *= 1.0 / ( 1.0 + buffs.fel_winds -> value() );
}

h *= composite_attack_speed_multiplier();

return h;
}

// player_t::composite_attack_speed_multiplier() const

double player_t::composite_attack_speed_multiplier() const
{
return current.attack_speed_multiplier;
}

// player_t::composite_attack_power =========================================

double player_t::composite_melee_attack_power() const
Expand Down Expand Up @@ -3140,9 +3129,6 @@ double player_t::composite_spell_haste() const
if ( buffs.berserking -> up() )
h *= 1.0 / ( 1.0 + buffs.berserking -> data().effectN( 1 ).percent() );

if ( buffs.tempus_repit -> up() )
h *= 1.0 / ( 1.0 + buffs.tempus_repit -> data().effectN( 1 ).percent() );

h *= 1.0 / ( 1.0 + racials.nimble_fingers -> effectN( 1 ).percent() );
h *= 1.0 / ( 1.0 + racials.time_is_money -> effectN( 1 ).percent() );

Expand All @@ -3158,16 +3144,27 @@ double player_t::composite_spell_haste() const

double player_t::composite_spell_speed() const
{
double h = cache.spell_haste();
auto speed = cache.spell_haste();

if ( ! is_pet() && ! is_enemy() )
{
if ( buffs.tempus_repit -> up() )
{
speed *= 1.0 / ( 1.0 + buffs.tempus_repit -> data().effectN( 1 ).percent() );
}

h *= composite_spell_speed_multiplier();
if ( buffs.nefarious_pact )
{
speed *= 1.0 / ( 1.0 + buffs.nefarious_pact -> stack_value() );
}

return h;
}
if ( buffs.devils_due )
{
speed *= 1.0 / ( 1.0 + buffs.devils_due -> stack_value() );
}
}

double player_t::composite_spell_speed_multiplier() const
{
return current.spell_speed_multiplier;
return speed;
}

// player_t::composite_spell_power ==========================================
Expand Down
33 changes: 11 additions & 22 deletions engine/player/sc_unique_gear_x7.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1349,34 +1349,23 @@ void item::whispers_in_the_dark( special_effect_t& effect )
auto bad_buff_data = effect.player -> find_spell( 225776 );
auto bad_amount = bad_buff_data -> effectN( 1 ).average( effect.item ) / 100.0;

buff_t* bad_buff = buff_creator_t( effect.player, "devils_due", bad_buff_data, effect.item )
.stack_change_callback( [ bad_amount ]( buff_t* buff, int old_, int ) {
if ( old_ == 0 )
haste_buff_t* bad_buff = haste_buff_creator_t( effect.player, "devils_due", bad_buff_data, effect.item )
.add_invalidate( CACHE_SPELL_SPEED )
.default_value( bad_amount );

haste_buff_t* good_buff = haste_buff_creator_t( effect.player, "nefarious_pact", good_buff_data, effect.item )
.add_invalidate( CACHE_SPELL_SPEED )
.default_value( good_amount )
.stack_change_callback( [ bad_buff ]( buff_t*, int old_, int ) {
if ( old_ == 1 )
{
buff -> player -> current.spell_speed_multiplier *= 1 - bad_amount;
}
else
{
buff -> player -> current.spell_speed_multiplier /= 1 - bad_amount;
}
buff -> player -> invalidate_cache( CACHE_HASTE );
} );

buff_t* good_buff = buff_creator_t( effect.player, "nefarious_pact", good_buff_data, effect.item )
.stack_change_callback( [ good_amount, bad_buff ]( buff_t* buff, int old_, int ) {
if ( old_ == 0 )
{
buff -> player -> current.spell_speed_multiplier /= 1 + good_amount;
buff -> player -> invalidate_cache( CACHE_HASTE );
}
else
{
buff -> player -> current.spell_speed_multiplier *= 1 + good_amount;
bad_buff -> trigger();
}
} );

effect.custom_buff = good_buff;
effect.player -> buffs.nefarious_pact = good_buff;
effect.player -> buffs.devils_due = bad_buff;

new dbc_proc_callback_t( effect.item, effect );
}
Expand Down
8 changes: 3 additions & 5 deletions engine/simulationcraft.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3634,7 +3634,6 @@ struct player_t : public actor_t

std::array<double, ATTRIBUTE_MAX> attribute_multiplier;
double spell_power_multiplier, attack_power_multiplier, armor_multiplier;
double spell_speed_multiplier, attack_speed_multiplier;
position_e position;
}
base, // Base values, from some database or overridden by user
Expand Down Expand Up @@ -3877,7 +3876,7 @@ struct player_t : public actor_t

// Legendary meta stuff
buff_t* courageous_primal_diamond_lucidity;
buff_t* tempus_repit;
haste_buff_t* tempus_repit;
buff_t* fortitude;

buff_t* archmages_greater_incandescence_str;
Expand All @@ -3903,6 +3902,8 @@ struct player_t : public actor_t

// 7.1
buff_t* temptation; // Ring that goes on a 5 minute cd if you use it too much.
haste_buff_t* nefarious_pact; // Whispers in the dark good buff
haste_buff_t* devils_due; // Whispers in the dark bad buff

// 6.2 trinket proxy buffs
buff_t* naarus_discipline; // Priest-Discipline Boss 13 T18 trinket
Expand Down Expand Up @@ -4099,9 +4100,6 @@ struct player_t : public actor_t
virtual double composite_attack_power_multiplier() const;
virtual double composite_spell_power_multiplier() const;

virtual double composite_attack_speed_multiplier() const;
virtual double composite_spell_speed_multiplier() const;

virtual double matching_gear_multiplier( attribute_e /* attr */ ) const { return 0; }

virtual double composite_player_multiplier ( school_e ) const;
Expand Down

0 comments on commit 6f0e791

Please sign in to comment.