From 4e1f59b5c6689e38023f12daee7d5c6f3d4715e5 Mon Sep 17 00:00:00 2001 From: Aki Date: Tue, 28 Feb 2023 00:06:05 +0100 Subject: Turrets will now start shooting when they can deal 1 dmg point Previously they were shooting at 1% base damage range, meaning higher damage turrets were cut off earlier. --- universe/src/TurretType.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'universe/src/TurretType.cpp') diff --git a/universe/src/TurretType.cpp b/universe/src/TurretType.cpp index 0dc6be6..b64efd4 100644 --- a/universe/src/TurretType.cpp +++ b/universe/src/TurretType.cpp @@ -29,9 +29,10 @@ TurretType::range_modifier(const double distance) const double TurretType::effective_range() const { - const double target_falloff = std::sqrt(std::log2(0.01) / std::log2(falloff_intensity)); - const double one_percent_overflow = target_falloff * falloff_modifier * optimal_range; - return one_percent_overflow + optimal_range; + const double one_point = 1.0 / base_damage; + const double target_falloff = std::sqrt(std::log2(one_point) / std::log2(falloff_intensity)); + const double one_point_overflow = target_falloff * falloff_modifier * optimal_range; + return one_point_overflow + optimal_range; } -- cgit v1.1