engine/calculators/source/StatisticsCalculators.cpp
// Calculate the current value of a statistic.
//
// Currently, this only considers values as part of modifiers on
// the creature.
Calculate the current value of a statistic.
Currently, this only considers values as part of modifiers on
the creature.
Calculate the current value of a statistic . Currently this only considers values as part of modifiers on the creature .
int StatisticsCalculator::calculate_current(CreaturePtr creature) const
{
  int current = 0;
  if (creature != nullptr)
  {
    current = get_base_statistic_value(creature);
    int value_multiplier = get_value_multiplier();
    int equipment_val = get_equipment_value(creature);
    int modifier_val = get_modifier_value(creature);
    float burden_multiplier = get_burden_multiplier(creature);
    current += (equipment_val * value_multiplier);
    current += (modifier_val * value_multiplier);
    current = static_cast<int>(current * burden_multiplier);
    current = std::max(current, 1);
  }
  return current;
}
int StatisticsCalculator :: calculate_current ( CreaturePtr creature ) const { int current = 0 ; if ( creature != nullptr ) { current = get_base_statistic_value ( creature ) ; int value_multiplier = get_value_multiplier ( ) ; int equipment_val = get_equipment_value ( creature ) ; int modifier_val = get_modifier_value ( creature ) ; float burden_multiplier = get_burden_multiplier ( creature ) ; current += ( equipment_val * value_multiplier ) ; current += ( modifier_val * value_multiplier ) ; current = static_cast < int > ( current * burden_multiplier ) ; current = std :: max ( current , 1 ) ; } return current ; }
Calculate the current value of a statistic.
Calculate the current value of a statistic .