engine/calculators/source/StoneCalculator.cpp
// Calculate the chance that this creature gets petrified.
Calculate the chance that this creature gets petrified.
Calculate the chance that this creature gets petrified .
int StoneCalculator::calculate_pct_chance_effect(CreaturePtr creature) const
{
  int pct_chance = BASE_STONE_PCT_CHANCE;
  if (creature)
  {
    int health_bonus = creature->get_health().get_current() / BASE_STONE_CHANCE_HEALTH_MODIFIER;
    double shadow_multiplier = std::max<double>(0.0, creature->get_resistances().get_resistance_value(DamageType::DAMAGE_TYPE_SHADOW));
    pct_chance -= health_bonus;
    pct_chance = static_cast<int>(pct_chance * shadow_multiplier);
  }
  return pct_chance;
}
int StoneCalculator :: calculate_pct_chance_effect ( CreaturePtr creature ) const { int pct_chance = BASE_STONE_PCT_CHANCE ; if ( creature ) { int health_bonus = creature -> get_health ( ) . get_current ( ) / BASE_STONE_CHANCE_HEALTH_MODIFIER ; double shadow_multiplier = std :: max < double > ( 0.0 , creature -> get_resistances ( ) . get_resistance_value ( DamageType :: DAMAGE_TYPE_SHADOW ) ) ; pct_chance -= health_bonus ; pct_chance = static_cast < int > ( pct_chance * shadow_multiplier ) ; } return pct_chance ; }
Calculate the chance that this creature gets petrified.
Calculate the chance that this creature gets petrified .