engine/calculators/source/AlignmentCalculator.cpp
// Get the percent chance that an altar is converted.
Get the percent chance that an altar is converted.
Get the percent chance that an altar is converted .
int AlignmentCalculator::calculate_pct_chance_for_altar_conversion(ItemPtr item, const AlignmentRange current_alignment_range, const AlignmentRange altar_alignment_range)
{
  int pct_chance = 0;
  int numerator = 0;
  if (item)
  {
    numerator = item->get_value() * item->get_quantity();
    pct_chance = (numerator / 10);
    pct_chance = std::min<int>(pct_chance, 100);
    if (AlignmentUtils::are_alignments_opposites(current_alignment_range, altar_alignment_range))
    {
      pct_chance = static_cast<int>(pct_chance * 0.75);
    }
    pct_chance = std::max<int>(pct_chance, 1);
  }
  return pct_chance;
}
int AlignmentCalculator :: calculate_pct_chance_for_altar_conversion ( ItemPtr item , const AlignmentRange current_alignment_range , const AlignmentRange altar_alignment_range ) { int pct_chance = 0 ; int numerator = 0 ; if ( item ) { numerator = item -> get_value ( ) * item -> get_quantity ( ) ; pct_chance = ( numerator / 10 ) ; pct_chance = std :: min < int > ( pct_chance , 100 ) ; if ( AlignmentUtils :: are_alignments_opposites ( current_alignment_range , altar_alignment_range ) ) { pct_chance = static_cast < int > ( pct_chance * 0.75 ) ; } pct_chance = std :: max < int > ( pct_chance , 1 ) ; } return pct_chance ; }
Get the percent chance that an altar is converted.
Get the percent chance that an altar is converted .
// Harder to convert an altar of a more extreme alignment. // There's always a slim chance to convert an altar...