CommonLibSSE (powerof3)
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  virtual ~AlchemyItem(); // 00
63 
64  // override (MagicItem)
65  virtual void InitializeData() override; // 04
66  virtual void ClearData() override; // 05
67  virtual void InitItemImpl() override; // 13
68  virtual MagicSystem::SpellType GetSpellType() const override; // 53 - { return MagicType::kAlchemy; }
69  virtual MagicSystem::CastingType GetCastingType() const override; // 55 - { return CastType::kFireAndForget; }
70  virtual MagicSystem::Delivery GetDelivery() const override; // 57 - { return TargetType::kSelf; }
71  virtual bool IsFood() const override; // 5D - { return ((GetData()->flags) & 2) && !IsPoison(); }
72  virtual bool IsPoison() const override; // 61 - { return ((GetData()->flags) >> 17) & 1; }
73  virtual bool IsMedicine() const override; // 62 - { return ((GetData()->flags) >> 8) >> 8; }
74  virtual ActorValue GetAssociatedSkill() const override; // 66 - { return ActorValue::kConfidence; }
75  virtual std::uint32_t GetChunkID() override; // 68 - { return 'ENIT'; }
76  virtual void CopyMagicItemData(MagicItem* a_src) override; // 69
77  virtual void LoadMagicItemChunk(TESFile* a_mod, std::uint32_t a_chunkID) override; // 6A
78  virtual const MagicItem::Data* GetData1() const override; // 6C - { return &effectData; }
79  virtual MagicItem::Data* GetData2() override; // 6D - { return &effectData; }
80  virtual std::uint32_t GetDataSize() const override; // 6E - { return 0x20; }
81  virtual void InitFromChunk(TESFile* a_mod) override; // 6F
82  virtual void InitChunk() override; // 70
83 
84  // override (BGSKeywordForm)
85  virtual 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
REX::EnumSet< AlchemyFlag, std::uint32_t > flags
Definition: AlchemyItem.h:54
float addictionChance
Definition: AlchemyItem.h:56
Definition: AlchemyItem.h:24
virtual void CopyMagicItemData(MagicItem *a_src) override
virtual BGSKeyword * GetDefaultKeyword() const override
static constexpr auto VTABLE
Definition: AlchemyItem.h:27
virtual void InitFromChunk(TESFile *a_mod) override
AlchemyFlag
Definition: AlchemyItem.h:31
virtual void InitItemImpl() override
virtual void InitChunk() override
TESIcon messageIcon
Definition: AlchemyItem.h:89
virtual std::uint32_t GetDataSize() const override
static constexpr auto RTTI
Definition: AlchemyItem.h:26
virtual MagicSystem::CastingType GetCastingType() const override
virtual void ClearData() override
virtual bool IsPoison() const override
virtual std::uint32_t GetChunkID() override
virtual void InitializeData() override
virtual MagicItem::Data * GetData2() override
virtual void LoadMagicItemChunk(TESFile *a_mod, std::uint32_t a_chunkID) override
virtual ~AlchemyItem()
Data data
Definition: AlchemyItem.h:88
virtual ActorValue GetAssociatedSkill() const override
virtual const MagicItem::Data * GetData1() const override
virtual MagicSystem::SpellType GetSpellType() const override
virtual bool IsMedicine() const override
virtual bool IsFood() const override
static constexpr auto FORMTYPE
Definition: AlchemyItem.h:28
virtual MagicSystem::Delivery GetDelivery() 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:59
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:64
CastingType
Definition: MagicSystem.h:35
Delivery
Definition: MagicSystem.h:43
Definition: AbsorbEffect.h:6
constexpr std::array< REL::ID, 10 > VTABLE_AlchemyItem
Definition: Offsets_VTABLE.h:7394
ActorValue
Definition: ActorValues.h:6
constexpr REL::ID RTTI_AlchemyItem(static_cast< std::uint64_t >(513850))
Definition: AlchemyItem.h:41
RecordFlag
Definition: AlchemyItem.h:43
@ kIgnored
Definition: AlchemyItem.h:45
@ kMedicine
Definition: AlchemyItem.h:46
@ kDeleted
Definition: AlchemyItem.h:44