Esempio n. 1
0
void heal_t::tick( dot_t* d )
{
  if ( sim -> debug )
    log_t::output( sim, "%s ticks (%d of %d)", name(), d -> current_tick, d -> num_ticks );

  result = RESULT_HIT;

  player_tick();

  target_debuff( heal_target[0], HEAL_OVER_TIME );

  if ( tick_may_crit )
  {
    if ( rng[ RESULT_CRIT ] -> roll( crit_chance( 0 ) ) )
    {
      result = RESULT_CRIT;
    }
  }

  tick_dmg = calculate_tick_damage();

  assess_damage( heal_target[0], tick_dmg, HEAL_OVER_TIME, result );

  if ( callbacks ) action_callback_t::trigger( player -> tick_callbacks[ result ], this );

  stats -> add_tick( d -> time_to_tick );
}
Esempio n. 2
0
void action_t::tick()
{
  if ( sim -> debug ) log_t::output( sim, "%s ticks (%d of %d)", name(), current_tick, num_ticks );

  result = RESULT_HIT;

  // Older tests indicated that crit debuffs are calculated at the time of the cast, not the ticks.
  // It's possible that this has now changed, but would require testing to be certain.
  double save_target_crit = target_crit;

  target_debuff( DMG_OVER_TIME );

  target_crit = save_target_crit;

  if ( tick_may_crit )
  {
    int delta_level = sim -> target -> level - player -> level;
    
    if ( rng[ RESULT_CRIT ] -> roll( crit_chance( delta_level ) ) )
    {
      result = RESULT_CRIT;
      action_callback_t::trigger( player -> spell_result_callbacks[ RESULT_CRIT ], this );
      if ( channeled )
      {
        action_callback_t::trigger( player -> spell_direct_result_callbacks[ RESULT_CRIT ], this );
      }
    }
  }

  calculate_tick_damage();

  assess_damage( tick_dmg, DMG_OVER_TIME );

  action_callback_t::trigger( player -> tick_callbacks, this );

  update_stats( DMG_OVER_TIME );
}