F4MP/tiltedcode/Code/client/Games/Skyrim/Magic/EffectItem.cpp
Jous99 37b16f1547 code upload
codigo original de f4mp y tilted para referencias
2026-01-06 18:45:00 +01:00

43 lines
1.4 KiB
C++

#include "EffectItem.h"
#include <Games/Magic/MagicSystem.h>
#include <Forms/EffectSetting.h>
bool EffectItem::IsHealingEffect() const noexcept
{
return pEffectSetting->eArchetype == EffectArchetypes::ArchetypeID::kValueModifier && data.fMagnitude > 0.0f;
}
bool EffectItem::IsSummonEffect() const noexcept
{
return pEffectSetting->eArchetype == EffectArchetypes::ArchetypeID::kSummonCreature;
}
bool EffectItem::IsSlowEffect() const noexcept
{
return pEffectSetting->eArchetype == EffectArchetypes::ArchetypeID::kSlowTime;
}
bool EffectItem::IsInivisibilityEffect() const noexcept
{
return pEffectSetting->eArchetype == EffectArchetypes::ArchetypeID::kInvisibility;
}
bool EffectItem::IsWerewolfEffect() const noexcept
{
return pEffectSetting->eArchetype == EffectArchetypes::ArchetypeID::kWerewolf;
}
bool EffectItem::IsVampireLordEffect() const noexcept
{
return pEffectSetting->eArchetype == EffectArchetypes::ArchetypeID::kVampireLord;
}
bool EffectItem::IsNightVisionEffect() const noexcept
{
BGSKeyword* pMagicNightEye = Cast<BGSKeyword>(TESForm::GetById(0xad7c6));
if (pEffectSetting->keywordForm.count == 0)
spdlog::debug(__FUNCTION__ ": correcting BGSKeywordForm::Contains() bug for zero-keyword {:x}, {}", pEffectSetting->formID, pEffectSetting->fullName.value.AsAscii());
return pEffectSetting->keywordForm.count > 0 && pEffectSetting->keywordForm.Contains(pMagicNightEye);
}