Exemplo n.º 1
0
double heal_t::calculate_direct_amount( action_state_t* state ) const
{
  double pct_heal = composite_pct_heal( state );
  if ( pct_heal )
  {
    double amount = state -> target -> resources.max[ RESOURCE_HEALTH ] * pct_heal;

    // Record initial amount to state
    state -> result_raw = amount;

    if ( state -> result == RESULT_CRIT )
    {
      amount *= 1.0 + total_crit_bonus();
    }
    else if ( state -> result == RESULT_MULTISTRIKE )
    {
      amount *= composite_multistrike_multiplier( state );
    }
    else if ( state -> result == RESULT_MULTISTRIKE_CRIT )
    {
      amount *= composite_multistrike_multiplier( state ) * ( 1.0 + total_crit_bonus() );
    }

    amount *= state -> composite_da_multiplier();

    // Record total amount to state
    state -> result_total = amount;
    return amount;

  }

  return base_t::calculate_direct_amount( state );
}
Exemplo n.º 2
0
double action_t::calculate_tick_damage()
{
  tick_dmg = resisted_dmg = blocked_dmg = 0;

  if ( base_td == 0 ) base_td = base_td_init;

  if ( base_td == 0 ) return 0;

  tick_dmg  = base_td + total_power() * tick_power_mod;
  tick_dmg *= total_td_multiplier();

  double init_tick_dmg = tick_dmg;

  if ( result == RESULT_CRIT )
  {
    tick_dmg *= 1.0 + total_crit_bonus();
  }

  if ( ! binary )
  {
    resisted_dmg = resistance() * tick_dmg;
    tick_dmg -= resisted_dmg;
  }

  if ( sim -> debug )
  {
    log_t::output( sim, "%s dmg for %s: td=%.0f i_td=%.0f b_td=%.0f mod=%.2f power=%.0f b_mult=%.2f p_mult=%.2f t_mult=%.2f",
                   player -> name(), name(), tick_dmg, init_tick_dmg, base_td, tick_power_mod,
                   total_power(), base_multiplier * base_td_multiplier, player_multiplier, target_multiplier );
  }

  return tick_dmg;
}
Exemplo n.º 3
0
double heal_t::calculate_tick_damage()
{
  double dmg = 0;

  if ( base_td == 0 ) base_td = base_td_init;

  if ( base_td == 0 && tick_power_mod == 0 ) return 0;

  dmg  = floor( base_td + 0.5 ) + total_power() * tick_power_mod;
  dmg *= total_td_multiplier();

  double init_tick_dmg = dmg;

  if ( result == RESULT_CRIT )
  {
    dmg *= 1.0 + total_crit_bonus();
  }

  if ( ! sim -> average_range ) dmg = floor( dmg + sim -> real() );

  if ( sim -> debug )
  {
    log_t::output( sim, "%s heal for %s: td=%.0f i_td=%.0f b_td=%.0f mod=%.2f power=%.0f b_mult=%.2f p_mult=%.2f t_mult=%.2f",
                   player -> name(), name(), tick_dmg, init_tick_dmg, base_td, tick_power_mod,
                   total_power(), base_multiplier * base_td_multiplier, player_multiplier, target_multiplier );
  }

  return dmg;
}
Exemplo n.º 4
0
double heal_t::calculate_direct_damage()
{
  double dmg = sim -> range( base_dd_min, base_dd_max );

  if ( round_base_dmg ) dmg = floor( dmg + 0.5 );

  if ( dmg == 0 && weapon_multiplier == 0 && direct_power_mod == 0 ) return 0;

  double base_direct_dmg = dmg;

  dmg += base_dd_adder + player_dd_adder + target_dd_adder;

  dmg += direct_power_mod * total_power();
  dmg *= total_dd_multiplier();

  double init_direct_dmg = dmg;

  if ( result == RESULT_CRIT )
  {
    dmg *= 1.0 + total_crit_bonus();
  }

  if ( ! sim -> average_range ) dmg = floor( dmg + sim -> real() );

  if ( sim -> debug )
  {
    log_t::output( sim, "%s heal for %s: dd=%.0f i_dd=%.0f b_dd=%.0f mod=%.2f power=%.0f b_mult=%.2f p_mult=%.2f t_mult=%.2f",
                   player -> name(), name(), dmg, init_direct_dmg, base_direct_dmg, direct_power_mod,
                   total_power(), base_multiplier * base_dd_multiplier, player_multiplier, target_multiplier );
  }

  return dmg;
}
Exemplo n.º 5
0
double heal_t::calculate_tick_amount( action_state_t* state, double dmg_multiplier ) const
{
  if ( tick_pct_heal )
  {
    double amount = state -> target -> resources.max[ RESOURCE_HEALTH ] * tick_pct_heal;

    // Record initial amount to state
    state -> result_raw = amount;

    if ( state -> result == RESULT_CRIT )
    {
      amount *= 1.0 + total_crit_bonus();
    }
    else if ( state -> result == RESULT_MULTISTRIKE )
    {
      amount *= composite_multistrike_multiplier( state );
    }
    else if ( state -> result == RESULT_MULTISTRIKE_CRIT )
    {
      amount *= composite_multistrike_multiplier( state ) * ( 1.0 + total_crit_bonus() );
    }

    amount *= state -> composite_ta_multiplier();
    amount *= dmg_multiplier; // dot tick multiplier

    // Record total amount to state
    state -> result_total = amount;

    // replicate debug output of calculate_tick_amount
    if ( sim -> debug )
    {
      sim -> out_debug.printf( "%s amount for %s on %s: ta=%.0f pct=%.3f b_ta=%.0f bonus_ta=%.0f s_mod=%.2f s_power=%.0f a_mod=%.2f a_power=%.0f mult=%.2f",
        player -> name(), name(), target -> name(), amount,
        tick_pct_heal, base_ta( state ), bonus_ta( state ),
        spell_tick_power_coefficient( state ), state -> composite_spell_power(),
        attack_tick_power_coefficient( state ), state -> composite_attack_power(),
        state -> composite_ta_multiplier() );
    }

    return amount;
  }

  return base_t::calculate_tick_amount( state, dmg_multiplier );
}
Exemplo n.º 6
0
double action_t::calculate_direct_damage()
{
  direct_dmg = resisted_dmg = blocked_dmg = 0;

  double base_direct_dmg = sim -> range( base_dd_min, base_dd_max );

  if ( base_direct_dmg == 0 ) return 0;
  
  direct_dmg  = base_direct_dmg + base_dd_adder + player_dd_adder + target_dd_adder;
  if ( weapon_multiplier > 0 )
  {
    // x% weapon damage + Y
    // e.g. Obliterate, Shred, Backstab
    direct_dmg += calculate_weapon_damage();
    direct_dmg *= weapon_multiplier;
    
    // OH penalty
    if ( weapon && weapon -> slot == SLOT_OFF_HAND )
      direct_dmg *= 0.5;
  }
  direct_dmg += direct_power_mod * total_power();
  direct_dmg *= total_dd_multiplier();

  double init_direct_dmg = direct_dmg;

  if ( result == RESULT_GLANCE )
  {
    double delta_skill = ( sim -> target -> level - player -> level ) * 5.0;

    if ( delta_skill < 0.0 )
      delta_skill = 0.0;

    double max_glance = 1.3 - 0.03 * delta_skill;

    if ( max_glance > 0.99 ) 
      max_glance = 0.99;
    else if ( max_glance < 0.2 )
      max_glance = 0.20;

    double min_glance = 1.4 - 0.05 * delta_skill;

    if ( min_glance > 0.91 )
      min_glance = 0.91;
    else if ( min_glance < 0.01 )
      min_glance = 0.01;

    if ( min_glance > max_glance )
    {
      double temp = min_glance;
      min_glance = max_glance;
      max_glance = temp;
    }

    direct_dmg *= sim -> range( min_glance, max_glance ); // 0.75 against +3 targets.
  }
  else if ( result == RESULT_CRIT )
  {
    direct_dmg *= 1.0 + total_crit_bonus();
  }

  if ( ! binary )
  {
    resisted_dmg = resistance() * direct_dmg;
    direct_dmg -= resisted_dmg;
  }

  if ( result == RESULT_BLOCK )
  {
    blocked_dmg = sim -> target -> block_value;
    direct_dmg -= blocked_dmg;
    if ( direct_dmg < 0 ) direct_dmg = 0;
  }

  if ( sim -> debug )
  {
    log_t::output( sim, "%s dmg for %s: dd=%.0f i_dd=%.0f b_dd=%.0f mod=%.2f power=%.0f b_mult=%.2f p_mult=%.2f t_mult=%.2f",
                   player -> name(), name(), direct_dmg, init_direct_dmg, base_direct_dmg, direct_power_mod,
                   total_power(), base_multiplier * base_dd_multiplier, player_multiplier, target_multiplier );
  }

  return direct_dmg;
}