// trigger_deep_wounds ======================================================
static void trigger_deep_wounds( action_t* a )
{
warrior_t* p = a -> player -> cast_warrior();
sim_t* sim = a -> sim;
if ( ! p -> talents.deep_wounds )
return;
// Every action HAS to have an weapon associated.
assert( a -> weapon != 0 );
struct deep_wounds_t : public warrior_attack_t
{
deep_wounds_t( warrior_t* p ) :
warrior_attack_t( "deep_wounds", p, SCHOOL_BLEED, TREE_ARMS )
{
background = true;
trigger_gcd = 0;
weapon_multiplier = p -> talents.deep_wounds * 0.16;
base_tick_time = 1.0;
num_ticks = 6;
reset(); // required since construction occurs after player_t::init()
id = 12868;
}
virtual void target_debuff( int dmg_type )
{
target_t* t = sim -> target;
warrior_attack_t::target_debuff( dmg_type );
// Deep Wounds doesn't benefit from Blood Frenzy or Savage Combat despite being a Bleed so disable it.
if ( t -> debuffs.blood_frenzy -> up() ||
t -> debuffs.savage_combat -> up() )
{
target_multiplier /= 1.04;
}
}
virtual double total_td_multiplier() SC_CONST
{
return target_multiplier;
}
virtual void tick()
{
warrior_attack_t::tick();
warrior_t* p = player -> cast_warrior();
p -> buffs_tier7_4pc_melee -> trigger();
p -> buffs_tier10_2pc_melee -> trigger();
}
};
if ( ! p -> active_deep_wounds ) p -> active_deep_wounds = new deep_wounds_t( p );
p -> active_deep_wounds -> weapon = a -> weapon;
p -> active_deep_wounds -> player_buff();
double deep_wounds_dmg = ( p -> active_deep_wounds -> calculate_weapon_damage() *
p -> active_deep_wounds -> weapon_multiplier *
p -> active_deep_wounds -> player_multiplier );
if ( a -> weapon -> slot == SLOT_OFF_HAND )
deep_wounds_dmg *= 0.5;
if ( p -> active_deep_wounds -> ticking )
{
int num_ticks = p -> active_deep_wounds -> num_ticks;
int remaining_ticks = num_ticks - p -> active_deep_wounds -> current_tick;
deep_wounds_dmg += p -> active_deep_wounds -> base_td * remaining_ticks;
}
// The Deep Wounds SPELL_AURA_APPLIED does not actually occur immediately.
// There is a short delay which can result in "munched" or "rolled" ticks.
if ( sim -> aura_delay == 0 )
{
// Do not model the delay, so no munch/roll, just defer.
if ( p -> active_deep_wounds -> ticking )
{
if ( sim -> log ) log_t::output( sim, "Player %s defers Deep Wounds.", p -> name() );
p -> procs_deferred_deep_wounds -> occur();
p -> active_deep_wounds -> cancel();
}
p -> active_deep_wounds -> base_td = deep_wounds_dmg / 6.0;
p -> active_deep_wounds -> schedule_tick();
trigger_blood_frenzy( p -> active_deep_wounds );
return;
}
struct deep_wounds_delay_t : public event_t
{
double deep_wounds_dmg;
deep_wounds_delay_t( sim_t* sim, player_t* p, double dmg ) : event_t( sim, p ), deep_wounds_dmg( dmg )
{
name = "Deep Wounds Delay";
sim -> add_event( this, sim -> gauss( sim -> aura_delay, sim -> aura_delay * 0.25 ) );
}
virtual void execute()
{
warrior_t* p = player -> cast_warrior();
if ( p -> active_deep_wounds -> ticking )
{
if ( sim -> log ) log_t::output( sim, "Player %s defers Deep Wounds.", p -> name() );
p -> procs_deferred_deep_wounds -> occur();
p -> active_deep_wounds -> cancel();
}
p -> active_deep_wounds -> base_td = deep_wounds_dmg / 6.0;
p -> active_deep_wounds -> schedule_tick();
trigger_blood_frenzy( p -> active_deep_wounds );
if ( p -> deep_wounds_delay_event == this ) p -> deep_wounds_delay_event = 0;
}
};
if ( p -> deep_wounds_delay_event )
{
// There is an SPELL_AURA_APPLIED already in the queue.
if ( sim -> log ) log_t::output( sim, "Player %s munches Deep Wounds.", p -> name() );
p -> procs_munched_deep_wounds -> occur();
}
p -> deep_wounds_delay_event = new ( sim ) deep_wounds_delay_t( sim, p, deep_wounds_dmg );
if ( p -> active_deep_wounds -> ticking )
{
if ( p -> active_deep_wounds -> tick_event -> occurs() <
p -> deep_wounds_delay_event -> occurs() )
{
// Deep Wounds will tick before SPELL_AURA_APPLIED occurs, which means that the current Deep Wounds will
// both tick -and- get rolled into the next Deep Wounds.
if ( sim -> log ) log_t::output( sim, "Player %s rolls Deep Wounds.", p -> name() );
p -> procs_rolled_deep_wounds -> occur();
}
}
}
[свернуть]