C++ formula deals with damage only