#include #include #include namespace kurator { namespace universe { double TurretType::effective_damage(const double distance) const { const auto overflow = distance - optimal_range; const auto falloff = std::max(0.0, overflow / optimal_range / falloff_modifier); return base_damage * std::round(std::pow(falloff_intensity, std::pow(falloff, 2)) * 1000) / 1000; } double TurretType::effective_range() const { const double target = std::log2(0.01) / std::log2(falloff_intensity); const double one_percent_falloff = target * falloff_modifier * optimal_range; return one_percent_falloff + optimal_range; } } // namespace universe } // namespace kurator