CommonLibSSE NG
EnchantmentItem.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/F/FormTypes.h"
4 #include "RE/M/MagicItem.h"
5 #include "RE/M/MagicSystem.h"
6 
7 namespace RE
8 {
9  class EnchantmentItem : public MagicItem
10  {
11  public:
12  inline static constexpr auto RTTI = RTTI_EnchantmentItem;
13  inline static constexpr auto VTABLE = VTABLE_EnchantmentItem;
14  inline static constexpr auto FORMTYPE = FormType::Enchantment;
15 
16  enum class EnchantmentFlag
17  {
18  kNone = 0,
19  kCostOverride = 1 << 0,
20  kFoodItem = 1 << 1,
21  kExtendDuration = 1 << 3
22  };
23 
24  struct RecordFlags
25  {
26  enum RecordFlag : std::uint32_t
27  {
28  kDeleted = 1 << 5,
29  kIgnored = 1 << 12
30  };
31  };
32 
33  class Data // ENIT
34  {
35  public:
36  // members
37  std::int32_t costOverride; // 00
40  std::int32_t chargeOverride; // 0C
43  float chargeTime; // 18
44  std::uint32_t pad1C; // 1C
47  };
48  static_assert(sizeof(Data) == 0x30);
49 
50  ~EnchantmentItem() override; // 00
51 
52  // override (MagicItem)
53  void InitializeData() override; // 04
54  void ClearData() override; // 05
55  void InitItemImpl() override; // 13
56  [[nodiscard]] MagicSystem::SpellType GetSpellType() const override; // 53 - { return data.spellType; }
57  void SetCastingType(MagicSystem::CastingType a_type) override; // 54 - { data.castingType = a_type; }
58  [[nodiscard]] MagicSystem::CastingType GetCastingType() const override; // 55 - { return data.castingType; }
59  void SetDelivery(MagicSystem::Delivery a_type) override; // 56 - { if (Unk_58()) { data.delivery = a_type; } }
60  [[nodiscard]] MagicSystem::Delivery GetDelivery() const override; // 57 - { return data.delivery; }
61  [[nodiscard]] float GetChargeTime() const override; // 64
62  [[nodiscard]] ActorValue GetAssociatedSkill() const override; // 66 - { return ActorValue::kEnchanting; }
63  [[nodiscard]] std::uint32_t GetChunkID() override; // 68 - { return 'ENIT'; }
64  void CopyMagicItemData(MagicItem* a_src) override; // 69
65  [[nodiscard]] const MagicItem::Data* GetData1() const override; // 6C - { return &data; }
66  [[nodiscard]] MagicItem::Data* GetData2() override; // 6D - { return &data; }
67  [[nodiscard]] std::uint32_t GetDataSize() const override; // 6E - { return 0x30; }
68  void InitFromChunk(TESFile* a_mod) override; // 6F
69  void InitChunk() override; // 70
70 
71  // members
72  Data data; // 90 - ENIT
73  };
74  static_assert(sizeof(EnchantmentItem) == 0xC0);
75 }
Definition: BGSListForm.h:11
Definition: EnchantmentItem.h:34
MagicSystem::SpellType spellType
Definition: EnchantmentItem.h:42
std::uint32_t pad1C
Definition: EnchantmentItem.h:44
std::int32_t costOverride
Definition: EnchantmentItem.h:37
EnchantmentItem * baseEnchantment
Definition: EnchantmentItem.h:45
MagicSystem::Delivery delivery
Definition: EnchantmentItem.h:41
std::int32_t chargeOverride
Definition: EnchantmentItem.h:40
BGSListForm * wornRestrictions
Definition: EnchantmentItem.h:46
MagicSystem::CastingType castingType
Definition: EnchantmentItem.h:39
stl::enumeration< EnchantmentFlag, std::uint32_t > flags
Definition: EnchantmentItem.h:38
float chargeTime
Definition: EnchantmentItem.h:43
Definition: EnchantmentItem.h:10
std::uint32_t GetDataSize() const override
void InitChunk() override
void CopyMagicItemData(MagicItem *a_src) override
EnchantmentFlag
Definition: EnchantmentItem.h:17
MagicItem::Data * GetData2() override
ActorValue GetAssociatedSkill() const override
static constexpr auto RTTI
Definition: EnchantmentItem.h:12
static constexpr auto VTABLE
Definition: EnchantmentItem.h:13
float GetChargeTime() const override
std::uint32_t GetChunkID() override
void InitItemImpl() override
void SetDelivery(MagicSystem::Delivery a_type) override
void InitFromChunk(TESFile *a_mod) override
~EnchantmentItem() override
MagicSystem::CastingType GetCastingType() const override
Data data
Definition: EnchantmentItem.h:72
const MagicItem::Data * GetData1() const override
void InitializeData() override
void ClearData() override
MagicSystem::Delivery GetDelivery() const override
MagicSystem::SpellType GetSpellType() const override
void SetCastingType(MagicSystem::CastingType a_type) override
static constexpr auto FORMTYPE
Definition: EnchantmentItem.h:14
Definition: MagicItem.h:58
Definition: MagicItem.h:30
Definition: TESFile.h:17
SpellType
Definition: MagicSystem.h:61
CastingType
Definition: MagicSystem.h:32
Delivery
Definition: MagicSystem.h:40
Definition: AbsorbEffect.h:6
constexpr std::array< REL::VariantID, 3 > VTABLE_EnchantmentItem
Definition: Offsets_VTABLE.h:33
ActorValue
Definition: ActorValues.h:6
constexpr REL::VariantID RTTI_EnchantmentItem(513878, 392265, 0x1ed76e0)
Definition: EnchantmentItem.h:25
RecordFlag
Definition: EnchantmentItem.h:27
@ kIgnored
Definition: EnchantmentItem.h:29
@ kDeleted
Definition: EnchantmentItem.h:28