From 161f92d0cf6982e605a7ec1be6eb19dc60951c45 Mon Sep 17 00:00:00 2001 From: Aki Date: Fri, 27 Jan 2023 22:37:21 +0100 Subject: Added damage per second to weapons tooltips --- universe/include/kurator/universe/TurretType.h | 1 + universe/src/TurretType.cpp | 7 +++++++ 2 files changed, 8 insertions(+) (limited to 'universe') diff --git a/universe/include/kurator/universe/TurretType.h b/universe/include/kurator/universe/TurretType.h index 0a0c5fd..c7ba5a3 100644 --- a/universe/include/kurator/universe/TurretType.h +++ b/universe/include/kurator/universe/TurretType.h @@ -21,6 +21,7 @@ struct TurretType double falloff_intensity = 0.2; double effective_damage(double distance) const; double effective_range() const; + double damage_per_second() const; }; diff --git a/universe/src/TurretType.cpp b/universe/src/TurretType.cpp index b6e006d..78887d7 100644 --- a/universe/src/TurretType.cpp +++ b/universe/src/TurretType.cpp @@ -28,5 +28,12 @@ TurretType::effective_range() const } +double +TurretType::damage_per_second() const +{ + return (base_damage * rounds) / (rounds * rate_of_fire + reload); +} + + } // namespace universe } // namespace kurator -- cgit v1.1