engine/calculators/source/AlignmentCalculator.cpp
// Sacrificing on a co-aligned altar adjusts a creature's alignment slightly,
// drawing the alignment closer to the absolute value for the range.
Sacrificing on a co-aligned altar adjusts a creature's alignment slightly,
drawing the alignment closer to the absolute value for the range.
Sacrificing on a co - aligned altar adjusts a creature ' s alignment slightly drawing the alignment closer to the absolute value for the range .
int AlignmentCalculator::calculate_alignment_for_sacrifice_on_coaligned_altar(int current_alignment, const AlignmentRange altar_alignment_range)
{
  int new_alignment = current_alignment;
  int true_neutral = (Alignment::NEUTRAL_MIN + Alignment::NEUTRAL_MAX) / 2;
  switch (altar_alignment_range)
  {
    case AlignmentRange::ALIGNMENT_RANGE_EVIL:
      new_alignment -= BASE_ALIGNMENT_DELTA_COALIGNED;
      break;
    case AlignmentRange::ALIGNMENT_RANGE_GOOD:
      new_alignment += BASE_ALIGNMENT_DELTA_COALIGNED;
      break;
    case AlignmentRange::ALIGNMENT_RANGE_NEUTRAL:
      if (new_alignment > true_neutral)
      {
        new_alignment -= BASE_ALIGNMENT_DELTA_COALIGNED;
      }
      else if (new_alignment < true_neutral)
      {
        new_alignment += BASE_ALIGNMENT_DELTA_COALIGNED;
      }
      break;
    default:
      break;
  }
  return new_alignment;
}
int AlignmentCalculator :: calculate_alignment_for_sacrifice_on_coaligned_altar ( int current_alignment , const AlignmentRange altar_alignment_range ) { int new_alignment = current_alignment ; int true_neutral = ( Alignment :: NEUTRAL_MIN + Alignment :: NEUTRAL_MAX ) / 2 ; switch ( altar_alignment_range ) { case AlignmentRange :: ALIGNMENT_RANGE_EVIL : new_alignment -= BASE_ALIGNMENT_DELTA_COALIGNED ; break ; case AlignmentRange :: ALIGNMENT_RANGE_GOOD : new_alignment += BASE_ALIGNMENT_DELTA_COALIGNED ; break ; case AlignmentRange :: ALIGNMENT_RANGE_NEUTRAL : if ( new_alignment > true_neutral ) { new_alignment -= BASE_ALIGNMENT_DELTA_COALIGNED ; } else if ( new_alignment < true_neutral ) { new_alignment += BASE_ALIGNMENT_DELTA_COALIGNED ; } break ; default : break ; } return new_alignment ; }
Sacrificing on a co-aligned altar adjusts a creature's alignment slightly,
drawing the alignment closer to the absolute value for the range.
Sacrificing on a co - aligned altar adjusts a creature ' s alignment slightly drawing the alignment closer to the absolute value for the range .