Skip to content

Commit e258909

Browse files
committed
[Hunter] Withering Fire behavior, fix Double Tap
1 parent 810eff7 commit e258909

File tree

1 file changed

+20
-52
lines changed

1 file changed

+20
-52
lines changed

engine/class_modules/sc_hunter.cpp

+20-52
Original file line numberDiff line numberDiff line change
@@ -3895,10 +3895,7 @@ struct arcane_shot_t : public arcane_shot_base_t
38953895
if ( aspect_of_the_hydra )
38963896
{
38973897
auto tl = target_list();
3898-
if ( target_list().size() > 1 )
3899-
aspect_of_the_hydra->execute_on_target( tl[1] );
3900-
else
3901-
aspect_of_the_hydra->execute_on_target( target );
3898+
aspect_of_the_hydra->execute_on_target( tl[ tl.size() > 1 ? 1 : 0 ] );
39023899
}
39033900
}
39043901
};
@@ -4408,27 +4405,21 @@ struct black_arrow_t final : public black_arrow_base_t
44084405
withering_fire_t( util::string_view n, hunter_t* p ) : black_arrow_base_t( n, p, p->talents.withering_fire_black_arrow )
44094406
{
44104407
background = dual = true;
4411-
aoe = as<int>( p->talents.withering_fire->effectN( 3 ).base_value() );
44124408
}
44134409

44144410
// Ignore Kill Shot target count mods
44154411
int n_targets() const override
44164412
{
4417-
return aoe;
4418-
}
4419-
4420-
size_t available_targets( std::vector<player_t*>& tl ) const override
4421-
{
4422-
black_arrow_base_t::available_targets( tl );
4423-
4424-
// Cannot hit the original target.
4425-
range::erase_remove( tl, target );
4426-
4427-
return tl.size();
4413+
return 1;
44284414
}
44294415
};
44304416

4431-
withering_fire_t* withering_fire = nullptr;
4417+
struct
4418+
{
4419+
int count = 0;
4420+
withering_fire_t* action = nullptr;
4421+
} withering_fire;
4422+
44324423
double lower_health_threshold_pct;
44334424
double upper_health_threshold_pct;
44344425

@@ -4442,8 +4433,9 @@ struct black_arrow_t final : public black_arrow_base_t
44424433

44434434
if ( p->talents.withering_fire.ok() )
44444435
{
4445-
withering_fire = p->get_background_action<withering_fire_t>( "black_arrow_withering_fire" );
4446-
add_child( withering_fire );
4436+
withering_fire.count = as<int>( p->talents.withering_fire->effectN( 3 ).base_value() );
4437+
withering_fire.action = p->get_background_action<withering_fire_t>( "black_arrow_withering_fire" );
4438+
add_child( withering_fire.action );
44474439
}
44484440
}
44494441

@@ -4455,7 +4447,11 @@ struct black_arrow_t final : public black_arrow_base_t
44554447
p()->trigger_deathblow( target );
44564448

44574449
if ( p()->buffs.withering_fire->up() )
4458-
withering_fire->execute_on_target( target );
4450+
{
4451+
auto tl = target_list();
4452+
withering_fire.action->execute_on_target( tl[ tl.size() > 1 ? 1 : 0 ] );
4453+
withering_fire.action->execute_on_target( tl[ tl.size() > 2 ? 2 : 0 ] );
4454+
}
44594455
}
44604456

44614457
void impact( action_state_t* s ) override
@@ -4477,7 +4473,7 @@ struct black_arrow_t final : public black_arrow_base_t
44774473
( candidate_target->health_percentage() <= lower_health_threshold_pct ||
44784474
( p()->bugs && candidate_target->health_percentage() >= upper_health_threshold_pct ) ||
44794475
( p()->talents.the_bell_tolls.ok() && candidate_target->health_percentage() >= upper_health_threshold_pct ) ||
4480-
p()->buffs.deathblow->check() );
4476+
p()->buffs.deathblow->check() || p()->buffs.withering_fire->check() );
44814477
}
44824478
};
44834479

@@ -5353,10 +5349,7 @@ struct aimed_shot_t : public aimed_shot_base_t
53535349
if ( aspect_of_the_hydra )
53545350
{
53555351
auto tl = target_list();
5356-
if ( target_list().size() > 1 )
5357-
aspect_of_the_hydra->execute_on_target( tl[1] );
5358-
else
5359-
aspect_of_the_hydra->execute_on_target( target );
5352+
aspect_of_the_hydra->execute_on_target( tl[ tl.size() > 1 ? 1 : 0 ] );
53605353
}
53615354

53625355
if ( double_tap && p()->buffs.double_tap->up() )
@@ -5441,16 +5434,6 @@ struct aimed_shot_t : public aimed_shot_base_t
54415434

54425435
struct rapid_fire_t: public hunter_spell_t
54435436
{
5444-
struct state_data_t
5445-
{
5446-
bool double_tap = false;
5447-
5448-
friend void sc_format_to( const state_data_t& data, fmt::format_context::iterator out ) {
5449-
fmt::format_to( out, "double_tap={:d}", data.double_tap );
5450-
}
5451-
};
5452-
using state_t = hunter_action_state_t<state_data_t>;
5453-
54545437
struct rapid_fire_tick_t : public hunter_ranged_attack_t
54555438
{
54565439
const int trick_shots_targets;
@@ -5561,10 +5544,7 @@ struct rapid_fire_t: public hunter_spell_t
55615544
if ( aspect_of_the_hydra )
55625545
{
55635546
auto tl = target_list();
5564-
if ( target_list().size() > 1 )
5565-
aspect_of_the_hydra->execute_on_target( tl[1] );
5566-
else
5567-
aspect_of_the_hydra->execute_on_target( target );
5547+
aspect_of_the_hydra->execute_on_target( tl[ tl.size() > 1 ? 1 : 0 ] );
55685548
}
55695549
}
55705550

@@ -5583,7 +5563,7 @@ struct rapid_fire_t: public hunter_spell_t
55835563
double num_ticks = base_num_ticks - 1;
55845564

55855565
if ( p()->buffs.double_tap->check() )
5586-
num_ticks *= p()->talents.double_tap_buff->effectN( 3 ).percent();
5566+
num_ticks *= 1 + p()->talents.double_tap_buff->effectN( 3 ).percent();
55875567

55885568
timespan_t base_duration = num_ticks * tick_time( s );
55895569

@@ -5601,7 +5581,6 @@ struct rapid_fire_t: public hunter_spell_t
56015581

56025582
double energize_cast_regen( const action_state_t* ) const override
56035583
{
5604-
// XXX: Not exactly true for Nesingwary's / Trueshot because the buff can fall off mid-channel. Meh
56055584
return base_num_ticks * damage -> composite_energize_amount( nullptr );
56065585
}
56075586

@@ -5614,17 +5593,6 @@ struct rapid_fire_t: public hunter_spell_t
56145593

56155594
return m;
56165595
}
5617-
5618-
action_state_t* new_state() override
5619-
{
5620-
return new state_t( this, target );
5621-
}
5622-
5623-
void snapshot_state( action_state_t* s, result_amount_type type ) override
5624-
{
5625-
hunter_spell_t::snapshot_state( s, type );
5626-
debug_cast<state_t*>( s ) -> double_tap = p() -> buffs.double_tap -> up();
5627-
}
56285596
};
56295597

56305598
//==============================

0 commit comments

Comments
 (0)