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 ); }
void heal_t::calculate_result() { direct_dmg = 0; result = RESULT_NONE; if ( ! harmful ) return; result = RESULT_HIT; if ( may_crit ) { if ( rng[ RESULT_CRIT ] -> roll( crit_chance( 0 ) ) ) { result = RESULT_CRIT; } } if ( sim -> debug ) log_t::output( sim, "%s result for %s is %s", player -> name(), name(), util_t::result_type_string( result ) ); }
void spell_t::calculate_result() { int delta_level = target -> level - player -> level; direct_dmg = 0; result = RESULT_NONE; if ( ! harmful || ! may_hit ) return; if ( ( result == RESULT_NONE ) && may_miss ) { if ( rng[ RESULT_MISS ] -> roll( miss_chance( delta_level ) ) ) { result = RESULT_MISS; } } if ( ( result == RESULT_NONE ) && may_resist && binary ) { if ( rng[ RESULT_RESIST ] -> roll( resistance() ) ) { result = RESULT_RESIST; } } if ( result == RESULT_NONE ) { result = RESULT_HIT; if ( may_crit ) { if ( rng[ RESULT_CRIT ] -> roll( crit_chance( delta_level ) ) ) { result = RESULT_CRIT; } } } if ( sim -> debug ) log_t::output( sim, "%s result for %s is %s", player -> name(), name(), util_t::result_type_string( result ) ); }
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 ); }