Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 32 additions & 11 deletions engine/class_modules/priest/sc_priest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ struct power_infusion_t final : public priest_spell_t
double power_infusion_magnitude;
power_infusion_t( priest_t& p, util::string_view options_str, util::string_view name )
: priest_spell_t( name, p, p.talents.power_infusion ),
power_infusion_magnitude( player->buffs.power_infusion->default_value )
power_infusion_magnitude( p.buffs.power_infusion->default_value )
{
parse_options( options_str );
harmful = false;
Expand All @@ -872,8 +872,8 @@ struct power_infusion_t final : public priest_spell_t
// Trigger PI on the actor only if casting on itself
if ( priest().options.self_power_infusion || priest().talents.twins_of_the_sun_priestess.enabled() )
{
player->buffs.power_infusion->trigger( 1, power_infusion_magnitude, -1,
player->buffs.power_infusion->buff_duration() );
priest().buffs.power_infusion->trigger( 1, power_infusion_magnitude, -1,
priest().buffs.power_infusion->buff_duration() );
}
}
};
Expand Down Expand Up @@ -4245,14 +4245,35 @@ struct priest_module_t final : public module_t
}
void init( player_t* p ) const override
{
p->buffs.body_and_soul = make_buff( p, "body_and_soul", p->find_spell( 65081 ) );
p->buffs.angelic_feather = make_buff( p, "angelic_feather", p->find_spell( 121557 ) );
p->buffs.guardian_spirit = make_buff( p, "guardian_spirit", p->find_spell( 47788 ) )
->set_default_value_from_effect_type( A_MOD_HEALING_RECEIVED_PCT )
->set_cooldown( 0_ms ); // Let the ability handle the CD
p->buffs.pain_suppression = make_buff( p, "pain_suppression", p->find_spell( 33206 ) )
->set_default_value_from_effect_type( A_MOD_DAMAGE_PERCENT_TAKEN )
->set_cooldown( 0_ms ); // Let the ability handle the CD
if ( !p->is_pet() )
{
p->buffs.body_and_soul = make_buff( p, "body_and_soul", p->find_spell( 65081 ) );
p->buffs.angelic_feather = make_buff( p, "angelic_feather", p->find_spell( 121557 ) );
p->buffs.guardian_spirit = make_buff( p, "guardian_spirit", p->find_spell( 47788 ) )
->set_default_value_from_effect_type( A_MOD_HEALING_RECEIVED_PCT )
->set_cooldown( 0_ms ); // Let the ability handle the CD
p->buffs.pain_suppression = make_buff( p, "pain_suppression", p->find_spell( 33206 ) )
->set_default_value_from_effect_type( A_MOD_DAMAGE_PERCENT_TAKEN )
->set_cooldown( 0_ms ); // Let the ability handle the CD

auto pi_buff = make_buff( p, "power_infusion", p->find_spell( 10060 ) )
->set_pct_buff_type( STAT_PCT_BUFF_HASTE )
->set_default_value_from_effect_type( A_HASTE_ALL )
->set_cooldown( 0_ms );

if ( p->type == PRIEST )
{
debug_cast<priest_t*>( p )->buffs.power_infusion = pi_buff;
}

if ( !p->external_buffs.power_infusion.empty() )
{
p->register_combat_begin( [ pi_buff ]( player_t* p ) {
for ( auto t : p->external_buffs.power_infusion )
make_event( *p->sim, t, [ pi_buff ] { pi_buff->trigger(); } );
} );
}
}
}
void static_init() const override
{
Expand Down
1 change: 1 addition & 0 deletions engine/class_modules/priest/sc_priest.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ struct priest_t final : public player_t
absorb_buff_t* power_word_shield;
propagate_const<buff_t*> fade;
propagate_const<buff_t*> levitate;
propagate_const<buff_t*> power_infusion;

// Talents
propagate_const<buff_t*> twist_of_fate_heal_self_fake;
Expand Down
28 changes: 15 additions & 13 deletions engine/class_modules/priest/sc_priest_pets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,10 @@ namespace actions
*/
struct priest_pet_t : public pet_t
{
buff_t* power_infusion_buff;

priest_pet_t( sim_t* sim, priest_t& owner, util::string_view pet_name, bool guardian = false )
: pet_t( sim, &owner, pet_name, PET_NONE, guardian )
: pet_t( sim, &owner, pet_name, PET_NONE, guardian ), power_infusion_buff( nullptr )
{
}

Expand Down Expand Up @@ -114,18 +116,18 @@ struct priest_pet_t : public pet_t
{
pet_t::create_buffs();

buffs.power_infusion = make_buff( this, "power_infusion", find_spell( 10060 ) )
->set_default_value_from_effect( 1 )
->set_cooldown( 0_ms )
->add_invalidate( CACHE_HASTE );
power_infusion_buff = make_buff( this, "power_infusion", find_spell( 10060 ) )
->set_default_value_from_effect_type( A_HASTE_ALL )
->set_cooldown( 0_ms )
->add_invalidate( CACHE_HASTE );
}

double composite_melee_haste() const override
{
double h = pet_t::composite_melee_haste();

if ( buffs.power_infusion )
h *= 1.0 / ( 1.0 + buffs.power_infusion->check_value() );
if ( power_infusion_buff )
h *= 1.0 / ( 1.0 + power_infusion_buff->check_value() );

return h;
}
Expand All @@ -134,8 +136,8 @@ struct priest_pet_t : public pet_t
{
double h = pet_t::composite_spell_haste();

if ( buffs.power_infusion )
h *= 1.0 / ( 1.0 + buffs.power_infusion->check_value() );
if ( power_infusion_buff )
h *= 1.0 / ( 1.0 + power_infusion_buff->check_value() );

return h;
}
Expand All @@ -144,8 +146,8 @@ struct priest_pet_t : public pet_t
{
double h = pet_t::composite_melee_auto_attack_speed();

if ( buffs.power_infusion )
h *= 1.0 / ( 1.0 + buffs.power_infusion->check_value() );
if ( power_infusion_buff )
h *= 1.0 / ( 1.0 + power_infusion_buff->check_value() );

return h;
}
Expand All @@ -154,8 +156,8 @@ struct priest_pet_t : public pet_t
{
double h = pet_t::composite_spell_cast_speed();

if ( buffs.power_infusion )
h *= 1.0 / ( 1.0 + buffs.power_infusion->check_value() );
if ( power_infusion_buff )
h *= 1.0 / ( 1.0 + power_infusion_buff->check_value() );

return h;
}
Expand Down
6 changes: 3 additions & 3 deletions engine/class_modules/sc_druid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1322,7 +1322,7 @@ struct druid_t final : public parse_player_effects_t
parsed_assisted_combat_rule_t parse_assisted_combat_rule( const assisted_combat_rule_data_t&,
const assisted_combat_step_data_t& ) const override;
void init_base_stats() override;
void init_stats() override;
void init_initial_stats() override;
void init_rng() override;
void init_gains() override;
void init_procs() override;
Expand Down Expand Up @@ -10711,9 +10711,9 @@ void druid_t::init_base_stats()
ready_type = ready_e::READY_TRIGGER;
}

void druid_t::init_stats()
void druid_t::init_initial_stats()
{
player_t::init_stats();
player_t::init_initial_stats();

// enable CP & energy for cat form
if ( uses_cat_form() )
Expand Down
14 changes: 6 additions & 8 deletions engine/class_modules/sc_enemy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ struct enemy_t : public player_t
virtual std::string generate_action_list();
virtual void generate_heal_raid_event();
void init_action_list() override;
void init_stats() override;
void init_actions() override;
double resource_loss( resource_e, double, gain_t*, action_t* ) override;
void create_options() override;
pet_t* create_pet( util::string_view add_name, util::string_view pet_type = {} ) override;
Expand Down Expand Up @@ -1293,9 +1293,7 @@ void enemy_t::init_base_stats()
true_level = sim->max_player_level + 3;

// waiting_time override
waiting_time = timespan_t::from_seconds( 5.0 );
if ( waiting_time < timespan_t::from_seconds( 1.0 ) )
waiting_time = timespan_t::from_seconds( 1.0 );
waiting_time = 5_s;

base.attack_crit_chance = 0.05;

Expand Down Expand Up @@ -1645,13 +1643,13 @@ void enemy_t::init_action_list()
action_list_str = new_action_list_str;
}
}

player_t::init_action_list();
}

// Hack to get this executed after player_t::init_action_list.
void enemy_t::init_stats()
void enemy_t::init_actions()
{
player_t::init_stats();
player_t::init_actions();

// Small hack to increase waiting time for target without any actions
for ( size_t i = 0; i < action_list.size(); ++i )
Expand All @@ -1663,7 +1661,7 @@ void enemy_t::init_stats()
continue;
if ( action->name_str.find( "auto_attack" ) != std::string::npos )
continue;
waiting_time = timespan_t::from_seconds( 1.0 );
waiting_time = 1_s;
break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion engine/class_modules/sc_evoker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9264,7 +9264,7 @@ void evoker_t::init_finished()
{
if ( CT( p, "Power Infusion" ).ok() )
{
allied_major_cds[ p ] = p->buffs.power_infusion;
allied_major_cds[ p ] = buff_t::find( p, "power_infusion" );
}
else if ( ST( p, "Void Eruption" ).ok() )
{
Expand Down
29 changes: 27 additions & 2 deletions engine/class_modules/sc_warrior.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ struct warrior_t : public parse_player_effects_t
buff_t* into_the_fray;
buff_t* last_stand;
buff_t* martial_prowess;
buff_t* rallying_cry;
buff_t* ravager;
buff_t* recklessness;
buff_t* revenge;
Expand Down Expand Up @@ -6824,7 +6825,9 @@ struct rallying_cry_t : public warrior_spell_t
void execute() override
{
warrior_spell_t::execute();
player->buffs.rallying_cry->trigger();

assert( p()->buff.rallying_cry );
p()->buff.rallying_cry->trigger();
}
};

Expand Down Expand Up @@ -9403,7 +9406,29 @@ struct warrior_module_t : public module_t

void init( player_t* p ) const override
{
p->buffs.rallying_cry = make_buff<buffs::rallying_cry_t>( p );
if ( !p->is_pet() )
{
bool has_external_rallying = !p->external_buffs.rallying_cry.empty();
bool has_talent_rallying = p->type == WARRIOR && debug_cast<warrior_t*>( p )->talents.warrior.rallying_cry.ok();

if ( has_external_rallying || has_talent_rallying )
{
auto buff = make_buff<buffs::rallying_cry_t>( p );

if ( has_external_rallying )
{
p->register_combat_begin( [ buff ]( player_t* p ) {
for ( auto t : p->external_buffs.rallying_cry )
make_event( *p->sim, t, [ buff ] { buff->trigger(); } );
} );
}

if ( has_talent_rallying )
{
debug_cast<warrior_t*>( p )->buff.rallying_cry = buff;
}
}
}
}
void combat_begin( sim_t* ) const override
{
Expand Down
Loading