diff options
-rw-r--r-- | kurator/src/ScenarioEditor.cpp | 3 | ||||
-rw-r--r-- | universe/include/kurator/universe/TurretType.h | 1 | ||||
-rw-r--r-- | universe/src/TurretType.cpp | 7 |
3 files changed, 10 insertions, 1 deletions
diff --git a/kurator/src/ScenarioEditor.cpp b/kurator/src/ScenarioEditor.cpp index b573d54..b9d3ada 100644 --- a/kurator/src/ScenarioEditor.cpp +++ b/kurator/src/ScenarioEditor.cpp @@ -154,7 +154,8 @@ loadout_editor(std::shared_ptr<universe::Repository> repo, campaign::Loadout& lo } if (ImGui::IsItemHovered()) { ImGui::BeginTooltip(); - ImGui::Text("Damage: %.0f", type.base_damage); + ImGui::Text("Base Damage: %.0f", type.base_damage); + ImGui::Text("DPS: %.1f", type.damage_per_second()); ImGui::Text("RoF: %.1fs", type.rate_of_fire); ImGui::Text("Reload: %.1fs", type.reload); ImGui::Text("Rounds: %d", type.rounds); 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 |