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