Fixes for effect.

This commit is contained in:
Deukhoofd 2020-04-21 12:31:53 +02:00
parent 0260f3688e
commit a54459cc57
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
4 changed files with 9 additions and 5 deletions

View File

@ -50,6 +50,7 @@ const DamageLibrary* BattleLibrary::GetDamageLibrary() const noexcept { return _
const MiscLibrary* BattleLibrary::GetMiscLibrary() const noexcept { return _miscLibrary; } const MiscLibrary* BattleLibrary::GetMiscLibrary() const noexcept { return _miscLibrary; }
Script* BattleLibrary::LoadScript(ScriptCategory category, const ConstString& scriptName) const { Script* BattleLibrary::LoadScript(ScriptCategory category,
const Arbutils::CaseInsensitiveConstString& scriptName) const {
return _scriptResolver->LoadScript(category, scriptName); return _scriptResolver->LoadScript(category, scriptName);
} }

View File

@ -39,7 +39,8 @@ namespace CreatureLib::Battling {
[[nodiscard]] const MiscLibrary* GetMiscLibrary() const noexcept; [[nodiscard]] const MiscLibrary* GetMiscLibrary() const noexcept;
[[nodiscard]] const ExperienceLibrary* GetExperienceLibrary() const noexcept { return _experienceLibrary; } [[nodiscard]] const ExperienceLibrary* GetExperienceLibrary() const noexcept { return _experienceLibrary; }
[[nodiscard]] Script* LoadScript(ScriptCategory category, const ConstString& scriptName) const; [[nodiscard]] Script* LoadScript(ScriptCategory category,
const Arbutils::CaseInsensitiveConstString& scriptName) const;
}; };
} }

View File

@ -38,7 +38,9 @@ namespace CreatureLib::Library {
inline uint8_t GetBaseUsages() const noexcept { return _baseUsages; } inline uint8_t GetBaseUsages() const noexcept { return _baseUsages; }
inline AttackTarget GetTarget() const noexcept { return _target; } inline AttackTarget GetTarget() const noexcept { return _target; }
inline int8_t GetPriority() const noexcept { return _priority; } inline int8_t GetPriority() const noexcept { return _priority; }
inline bool HasSecondaryEffect() const noexcept { return _effect != nullptr; } inline bool HasSecondaryEffect() const noexcept {
return _effect != nullptr && !_effect->GetEffectName().Empty();
}
inline const SecondaryEffect* GetSecondaryEffect() const noexcept { return _effect; } inline const SecondaryEffect* GetSecondaryEffect() const noexcept { return _effect; }
bool HasFlag(const ConstString& key) const noexcept; bool HasFlag(const ConstString& key) const noexcept;

View File

@ -15,7 +15,7 @@ namespace CreatureLib::Library {
List<EffectParameter*> _parameters; List<EffectParameter*> _parameters;
public: public:
SecondaryEffect() noexcept : _chance(0), _effectName(Arbutils::CaseInsensitiveConstString("")) {} SecondaryEffect() noexcept : _chance(0), _effectName() {}
SecondaryEffect(float chance, const Arbutils::CaseInsensitiveConstString& effectName, SecondaryEffect(float chance, const Arbutils::CaseInsensitiveConstString& effectName,
const List<EffectParameter*>& parameters) noexcept const List<EffectParameter*>& parameters) noexcept
: _chance(chance), _effectName(effectName), _parameters(parameters) {} : _chance(chance), _effectName(effectName), _parameters(parameters) {}