summaryrefslogtreecommitdiff
path: root/universe/src
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2023-02-28 00:06:05 +0100
committerAki <please@ignore.pl>2023-02-28 00:06:32 +0100
commit4e1f59b5c6689e38023f12daee7d5c6f3d4715e5 (patch)
tree38a06dbd1bfb596cb1cc1d1fceb9ec28e5b8f534 /universe/src
parent5f59cc347bcfd2236f01532511974078aacde980 (diff)
downloadkurator-4e1f59b5c6689e38023f12daee7d5c6f3d4715e5.zip
kurator-4e1f59b5c6689e38023f12daee7d5c6f3d4715e5.tar.gz
kurator-4e1f59b5c6689e38023f12daee7d5c6f3d4715e5.tar.bz2
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.
Diffstat (limited to 'universe/src')
-rw-r--r--universe/src/TurretType.cpp7
1 files changed, 4 insertions, 3 deletions
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;
}