// Cobra Shot Attack ========================================================
struct cobra_shot_t : public hunter_attack_t
{
double focus_gain;
cobra_shot_t( player_t* player, const std::string& options_str ) :
hunter_attack_t( "cobra_shot", player, "Cobra Shot" )
{
hunter_t* p = player -> cast_hunter();
parse_options( NULL, options_str );
weapon = &( p -> ranged_weapon );
assert( weapon -> group() == WEAPON_RANGED );
direct_power_mod = 0.017; // hardcoded into tooltip
if ( p -> sets -> set ( SET_T11_4PC_MELEE ) -> ok() )
base_execute_time -= timespan_t::from_seconds( 0.2 );
focus_gain = p -> dbc.spell( 77443 ) -> effect1().base_value();
// Needs testing
if ( p -> set_bonus.tier13_2pc_melee() )
focus_gain *= 2.0;
}
virtual bool usable_moving()
{
hunter_t* p = player -> cast_hunter();
return p -> active_aspect == ASPECT_FOX;
}
void execute()
{
hunter_attack_t::execute();
if ( result_is_hit() )
{
hunter_t* p = player -> cast_hunter();
hunter_targetdata_t* td = targetdata() -> cast_hunter();
td -> dots_serpent_sting -> extend_duration( 2 );
double focus = focus_gain;
if ( p -> talents.termination -> rank() )
{
if ( target -> health_percentage() <= p -> talents.termination -> effect2().base_value() )
focus += p -> talents.termination -> effect1().resource( RESOURCE_FOCUS );
}
p -> resource_gain( RESOURCE_FOCUS, focus, p -> gains_cobra_shot );
}
}
virtual void impact( player_t* t, int impact_result, double travel_dmg )
{
hunter_attack_t::impact( t, impact_result, travel_dmg );
trigger_tier12_2pc_melee( this );
}
void player_buff()
{
hunter_t* p = player -> cast_hunter();
hunter_attack_t::player_buff();
if ( p -> talents.careful_aim -> rank() && target -> health_percentage() > p -> talents.careful_aim -> effect2().base_value() )
{
player_crit += p -> talents.careful_aim -> effect1().percent();
}
if ( p -> buffs_sniper_training -> up() )
player_multiplier *= 1.0 + p -> buffs_sniper_training -> effect1().percent();
}
};
[свернуть]