2019-07-25 22:46:10 +10:00
|
|
|
#ifndef SAPPHIRE_EFFECTRESULT_H
|
|
|
|
#define SAPPHIRE_EFFECTRESULT_H
|
|
|
|
|
|
|
|
#include <ForwardsZone.h>
|
|
|
|
#include <Common.h>
|
|
|
|
|
|
|
|
namespace Sapphire::World::Action
|
|
|
|
{
|
|
|
|
/*!
|
|
|
|
* @brief A container for the computed result of an effect on a single actor. Used to apply damage/healing dealt
|
|
|
|
* at a later point in time.
|
|
|
|
*/
|
|
|
|
class EffectResult
|
|
|
|
{
|
|
|
|
public:
|
2019-07-27 13:59:35 +10:00
|
|
|
explicit EffectResult( Entity::CharaPtr target, uint64_t delayMs );
|
2019-07-25 22:46:10 +10:00
|
|
|
|
|
|
|
void damage( uint32_t amount, Common::ActionHitSeverityType severity );
|
|
|
|
void heal( uint32_t amount, Common::ActionHitSeverityType severity );
|
|
|
|
|
|
|
|
Entity::CharaPtr getTarget() const;
|
|
|
|
|
|
|
|
uint32_t getValue() const;
|
|
|
|
|
2019-07-27 13:59:35 +10:00
|
|
|
uint64_t getDelay();
|
|
|
|
|
2019-07-27 00:37:40 +10:00
|
|
|
void setParam( uint8_t param );
|
|
|
|
|
2019-07-25 22:46:10 +10:00
|
|
|
Common::EffectEntry buildEffectEntry() const;
|
|
|
|
|
2019-07-27 13:59:35 +10:00
|
|
|
void execute();
|
|
|
|
|
2019-07-25 22:46:10 +10:00
|
|
|
private:
|
2019-07-27 13:59:35 +10:00
|
|
|
uint64_t m_delayMs;
|
2019-07-25 22:46:10 +10:00
|
|
|
|
|
|
|
Entity::CharaPtr m_target;
|
|
|
|
|
|
|
|
Common::ActionHitSeverityType m_severity;
|
|
|
|
Common::ActionEffectType m_type;
|
|
|
|
|
|
|
|
uint32_t m_value;
|
2019-07-27 00:37:40 +10:00
|
|
|
uint8_t m_param;
|
2019-07-25 22:46:10 +10:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif //SAPPHIRE_EFFECTRESULT_H
|