This commit is contained in:
Aaron Kimbrell
2023-10-09 15:20:56 -05:00
committed by GitHub
parent ad003634f4
commit 570c597148
2 changed files with 22 additions and 19 deletions

View File

@@ -17,7 +17,7 @@ class Entity;
* here.
*/
struct Effect {
Effect() { scale = 1.0f; }
Effect() { priority = 1.0f; }
/**
* The ID of the effect
@@ -35,9 +35,9 @@ struct Effect {
std::u16string type = u"";
/**
* How scaled (enlarged) the effect is
* The importantness of the effect
*/
float scale = 1.0f;
float priority = 1.0f;
/**
* Some related entity that casted the effect
@@ -69,9 +69,10 @@ public:
* @param effectId the ID of the effect
* @param name the name of the effect
* @param type the type of the effect
* @param priority the priority of the effect
* @return if successful, the effect that was created
*/
Effect* AddEffect(int32_t effectId, const std::string& name, const std::u16string& type);
Effect* AddEffect(int32_t effectId, const std::string& name, const std::u16string& type, const float priority);
/**
* Removes an effect for this entity
@@ -109,15 +110,15 @@ public:
* if it has the animation assigned to its group. If it does, the animation is echo'd
* down to all clients to be played and the duration of the played animation is returned.
* If the animation did not exist or the function was called in an invalid state, 0 is returned.
*
*
* The logic here matches the exact client logic.
*
*
* @param self The entity that wants to play an animation
* @param animation The animation_type (animationID in the client) to be played.
* @param sendAnimation Whether or not to echo the animation down to all clients.
* @param priority The priority of the animation. Only used if sendAnimation is true.
* @param scale The scale of the animation. Only used if sendAnimation is true.
*
*
* @return The duration of the animation that was played.
*/
static float DoAnimation(Entity* self, const std::string& animation, bool sendAnimation, float priority = 0.0f, float scale = 1.0f);