CommonLibSSE NG
AlchemyItem.h
Go to the documentation of this file.
1 #pragma once
2 
4 #include "RE/B/BGSEquipType.h"
5 #include "RE/B/BGSMessageIcon.h"
7 #include "RE/F/FormTypes.h"
8 #include "RE/M/MagicItem.h"
9 #include "RE/T/TESIcon.h"
11 #include "RE/T/TESWeightForm.h"
12 
13 namespace RE
14 {
15  class AlchemyItem :
16  public MagicItem, // 000
17  public TESModelTextureSwap, // 090
18  public TESIcon, // 0C8
19  public BGSMessageIcon, // 0D8
20  public TESWeightForm, // 0F0
21  public BGSEquipType, // 100
22  public BGSDestructibleObjectForm, // 110
23  public BGSPickupPutdownSounds // 120
24  {
25  public:
26  inline static constexpr auto RTTI = RTTI_AlchemyItem;
27  inline static constexpr auto VTABLE = VTABLE_AlchemyItem;
28  inline static constexpr auto FORMTYPE = FormType::AlchemyItem;
29 
30  enum class AlchemyFlag
31  {
32  kNone = 0,
33  kCostOverride = 1 << 0,
34  kFoodItem = 1 << 1,
35  kExtendDuration = 1 << 3,
36  kMedicine = 1 << 16,
37  kPoison = 1 << 17
38  };
39 
40  struct RecordFlags
41  {
42  enum RecordFlag : std::uint32_t
43  {
44  kDeleted = 1 << 5,
45  kIgnored = 1 << 12,
46  kMedicine = 1 << 29
47  };
48  };
49 
50  class Data // ENIT
51  {
52  public:
53  std::int32_t costOverride; // 00
56  float addictionChance; // 10
57  std::uint32_t pad14; // 14
59  };
60  static_assert(sizeof(Data) == 0x20);
61 
62  ~AlchemyItem() override; // 00
63 
64  // override (MagicItem)
65  void InitializeData() override; // 04
66  void ClearData() override; // 05
67  void InitItemImpl() override; // 13
68  [[nodiscard]] MagicSystem::SpellType GetSpellType() const override; // 53 - { return MagicType::kAlchemy; }
69  [[nodiscard]] MagicSystem::CastingType GetCastingType() const override; // 55 - { return CastType::kFireAndForget; }
70  [[nodiscard]] MagicSystem::Delivery GetDelivery() const override; // 57 - { return TargetType::kSelf; }
71  [[nodiscard]] bool IsFood() const override; // 5D - { return ((GetData()->flags) & 2) && !IsPoison(); }
72  [[nodiscard]] bool IsPoison() const override; // 61 - { return ((GetData()->flags) >> 17) & 1; }
73  [[nodiscard]] bool IsMedicine() const override; // 62 - { return ((GetData()->flags) >> 8) >> 8; }
74  [[nodiscard]] ActorValue GetAssociatedSkill() const override; // 66 - { return ActorValue::kConfidence; }
75  [[nodiscard]] std::uint32_t GetChunkID() override; // 68 - { return 'ENIT'; }
76  void CopyMagicItemData(MagicItem* a_src) override; // 69
77  void LoadMagicItemChunk(TESFile* a_mod, std::uint32_t a_chunkID) override; // 6A
78  [[nodiscard]] const MagicItem::Data* GetData1() const override; // 6C - { return &effectData; }
79  [[nodiscard]] MagicItem::Data* GetData2() override; // 6D - { return &effectData; }
80  [[nodiscard]] std::uint32_t GetDataSize() const override; // 6E - { return 0x20; }
81  void InitFromChunk(TESFile* a_mod) override; // 6F
82  void InitChunk() override; // 70
83 
84  // override (BGSKeywordForm)
85  [[nodiscard]] BGSKeyword* GetDefaultKeyword() const override; // 05
86 
87  // members
88  Data data; // 138 - ENIT
90  };
91  static_assert(sizeof(AlchemyItem) == 0x168);
92 }
Definition: AlchemyItem.h:51
std::int32_t costOverride
Definition: AlchemyItem.h:53
SpellItem * addictionItem
Definition: AlchemyItem.h:55
std::uint32_t pad14
Definition: AlchemyItem.h:57
BGSSoundDescriptorForm * consumptionSound
Definition: AlchemyItem.h:58
stl::enumeration< AlchemyFlag, std::uint32_t > flags
Definition: AlchemyItem.h:54
float addictionChance
Definition: AlchemyItem.h:56
Definition: AlchemyItem.h:24
bool IsMedicine() const override
void CopyMagicItemData(MagicItem *a_src) override
static constexpr auto VTABLE
Definition: AlchemyItem.h:27
AlchemyFlag
Definition: AlchemyItem.h:31
void LoadMagicItemChunk(TESFile *a_mod, std::uint32_t a_chunkID) override
TESIcon messageIcon
Definition: AlchemyItem.h:89
static constexpr auto RTTI
Definition: AlchemyItem.h:26
std::uint32_t GetDataSize() const override
MagicSystem::Delivery GetDelivery() const override
BGSKeyword * GetDefaultKeyword() const override
void InitItemImpl() override
~AlchemyItem() override
bool IsPoison() const override
ActorValue GetAssociatedSkill() const override
void InitFromChunk(TESFile *a_mod) override
bool IsFood() const override
Data data
Definition: AlchemyItem.h:88
void ClearData() override
std::uint32_t GetChunkID() override
MagicSystem::SpellType GetSpellType() const override
MagicSystem::CastingType GetCastingType() const override
static constexpr auto FORMTYPE
Definition: AlchemyItem.h:28
void InitializeData() override
MagicItem::Data * GetData2() override
void InitChunk() override
const MagicItem::Data * GetData1() const override
Definition: BGSDestructibleObjectForm.h:61
Definition: BGSEquipType.h:9
Definition: BGSKeyword.h:10
Definition: BGSMessageIcon.h:9
Definition: BGSPickupPutdownSounds.h:10
Definition: BGSSoundDescriptorForm.h:14
Definition: MagicItem.h:58
Definition: MagicItem.h:30
Definition: SpellItem.h:16
Definition: TESFile.h:17
Definition: TESIcon.h:8
Definition: TESModelTextureSwap.h:10
Definition: TESWeightForm.h:8
SpellType
Definition: MagicSystem.h:61
CastingType
Definition: MagicSystem.h:32
Delivery
Definition: MagicSystem.h:40
Definition: AbsorbEffect.h:6
ActorValue
Definition: ActorValues.h:6
constexpr std::array< REL::VariantID, 10 > VTABLE_AlchemyItem
Definition: Offsets_VTABLE.h:11
constexpr REL::VariantID RTTI_AlchemyItem(513850, 392218, 0x1ed6d60)
Definition: AlchemyItem.h:41
RecordFlag
Definition: AlchemyItem.h:43
@ kIgnored
Definition: AlchemyItem.h:45
@ kMedicine
Definition: AlchemyItem.h:46
@ kDeleted
Definition: AlchemyItem.h:44