Reworks attack scripts to handle effect chance and effect name through data files.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include <unordered_set>
|
||||
#include "AttackCategory.hpp"
|
||||
#include "AttackTarget.hpp"
|
||||
#include "SecondaryEffect.hpp"
|
||||
|
||||
using ConstString = Arbutils::CaseInsensitiveConstString;
|
||||
|
||||
@@ -20,11 +21,13 @@ namespace CreatureLib::Library {
|
||||
uint8_t _baseUsages;
|
||||
AttackTarget _target;
|
||||
int8_t _priority;
|
||||
SecondaryEffect _effect;
|
||||
std::unordered_set<uint32_t> _flags;
|
||||
|
||||
public:
|
||||
AttackData(const ConstString& name, uint8_t type, AttackCategory category, uint8_t power, uint8_t accuracy,
|
||||
uint8_t baseUsage, AttackTarget target, int8_t priority, std::unordered_set<uint32_t> flags);
|
||||
uint8_t baseUsage, AttackTarget target, int8_t priority, SecondaryEffect effect,
|
||||
std::unordered_set<uint32_t> flags);
|
||||
virtual ~AttackData() = default;
|
||||
|
||||
inline const ConstString& GetName() const noexcept { return _name; }
|
||||
@@ -35,6 +38,10 @@ namespace CreatureLib::Library {
|
||||
inline uint8_t GetBaseUsages() const noexcept { return _baseUsages; }
|
||||
inline AttackTarget GetTarget() const noexcept { return _target; }
|
||||
inline int8_t GetPriority() const noexcept { return _priority; }
|
||||
inline bool HasSecondaryEffect() const noexcept {
|
||||
return _effect.GetChance() != 0 && _effect.GetEffectName() != ""_cnc;
|
||||
}
|
||||
inline const SecondaryEffect& GetSecondaryEffect() const noexcept { return _effect; }
|
||||
|
||||
bool HasFlag(const ConstString& key) const noexcept;
|
||||
bool HasFlag(uint32_t keyHash) const noexcept;
|
||||
|
||||
Reference in New Issue
Block a user