Initial work on attack fail handling.
All checks were successful
continuous-integration/drone/push Build is passing

Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
This commit is contained in:
2021-03-27 12:30:12 +01:00
parent 6ef8edc2df
commit 46307fe71f
5 changed files with 64 additions and 34 deletions

View File

@@ -12,6 +12,7 @@ namespace CreatureLib::Battling {
float _effectiveness = 1;
uint32_t _damage = 0;
uint8_t _type = 0;
bool _hasFailed = false;
public:
HitData() noexcept {}
@@ -21,12 +22,14 @@ namespace CreatureLib::Battling {
[[nodiscard]] inline float GetEffectiveness() const noexcept { return _effectiveness; }
[[nodiscard]] inline uint32_t GetDamage() const noexcept { return _damage; }
[[nodiscard]] inline uint8_t GetType() const noexcept { return _type; }
[[nodiscard]] inline bool HasFailed() const noexcept { return _hasFailed; }
inline void SetCritical(bool value) noexcept { _critical = value; }
inline void SetBasePower(uint8_t value) noexcept { _basePower = value; }
inline void SetEffectiveness(float value) noexcept { _effectiveness = value; }
inline void SetDamage(uint32_t value) noexcept { _damage = value; }
inline void SetType(uint8_t value) noexcept { _type = value; }
inline void Fail() noexcept { _hasFailed = true; }
};
private: