Switch to smart pointer implementation for damage numbers to handle damage combo'ing quick attack displays.

This commit is contained in:
2023-07-25 19:48:24 -05:00
parent 9585baf5c6
commit a0916cfe9b
9 changed files with 49 additions and 19 deletions
+3
View File
@@ -7,6 +7,7 @@
#include "Class.h"
#include "Buff.h"
#include "Pathfinding.h"
#include "DamageNumber.h"
struct CastInfo{
std::string name;
@@ -48,6 +49,8 @@ struct Player{
std::vector<Buff>buffList;
CastInfo castInfo={"",0};
vf2d movementVelocity={};//This tells us if the player is moving (mostly controlled by user input) since their velocity is not used for regular movement.
float lastHitTimer=0; //When this is greater than zero, if we get hit again it adds to our displayed combo number.
std::shared_ptr<DamageNumber>damageNumberPtr;
protected:
const float ATTACK_COOLDOWN=0.35f;
const float MAGIC_ATTACK_COOLDOWN=0.85f;