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 FORMTYPE = FormType::AlchemyItem;
28 
29  enum class AlchemyFlag
30  {
31  kNone = 0,
32  kCostOverride = 1 << 0,
33  kFoodItem = 1 << 1,
34  kExtendDuration = 1 << 3,
35  kMedicine = 1 << 16,
36  kPoison = 1 << 17
37  };
38 
39  struct RecordFlags
40  {
41  enum RecordFlag : std::uint32_t
42  {
43  kDeleted = 1 << 5,
44  kIgnored = 1 << 12,
45  kMedicine = 1 << 29
46  };
47  };
48 
49  class Data // ENIT
50  {
51  public:
52  std::int32_t costOverride; // 00
55  float addictionChance; // 10
56  std::uint32_t pad14; // 14
58  };
59  static_assert(sizeof(Data) == 0x20);
60 
61  virtual ~AlchemyItem(); // 00
62 
63  // override (MagicItem)
64  virtual void InitializeData() override; // 04
65  virtual void ClearData() override; // 05
66  virtual void InitItemImpl() override; // 13
67  virtual MagicSystem::SpellType GetSpellType() const override; // 53 - { return MagicType::kAlchemy; }
68  virtual MagicSystem::CastingType GetCastingType() const override; // 55 - { return CastType::kFireAndForget; }
69  virtual MagicSystem::Delivery GetDelivery() const override; // 57 - { return TargetType::kSelf; }
70  virtual bool IsFood() const override; // 5D - { return ((GetData()->flags) & 2) && !IsPoison(); }
71  virtual bool IsPoison() const override; // 61 - { return ((GetData()->flags) >> 17) & 1; }
72  virtual bool IsMedicine() const override; // 62 - { return ((GetData()->flags) >> 8) >> 8; }
73  virtual ActorValue GetAssociatedSkill() const override; // 66 - { return ActorValue::kConfidence; }
74  virtual std::uint32_t GetChunkID() override; // 68 - { return 'ENIT'; }
75  virtual void CopyMagicItemData(MagicItem* a_src) override; // 69
76  virtual void LoadMagicItemChunk(TESFile* a_mod, std::uint32_t a_chunkID) override; // 6A
77  virtual const MagicItem::Data* GetData1() const override; // 6C - { return &effectData; }
78  virtual MagicItem::Data* GetData2() override; // 6D - { return &effectData; }
79  virtual std::uint32_t GetDataSize() const override; // 6E - { return 0x20; }
80  virtual void InitFromChunk(TESFile* a_mod) override; // 6F
81  virtual void InitChunk() override; // 70
82 
83  // override (BGSKeywordForm)
84  virtual BGSKeyword* GetDefaultKeyword() const override; // 05
85 
86  // members
87  Data data; // 138 - ENIT
89  };
90  static_assert(sizeof(AlchemyItem) == 0x168);
91 }
Definition: AlchemyItem.h:50
std::int32_t costOverride
Definition: AlchemyItem.h:52
SpellItem * addictionItem
Definition: AlchemyItem.h:54
std::uint32_t pad14
Definition: AlchemyItem.h:56
BGSSoundDescriptorForm * consumptionSound
Definition: AlchemyItem.h:57
stl::enumeration< AlchemyFlag, std::uint32_t > flags
Definition: AlchemyItem.h:53
float addictionChance
Definition: AlchemyItem.h:55
Definition: AlchemyItem.h:24
virtual void CopyMagicItemData(MagicItem *a_src) override
virtual BGSKeyword * GetDefaultKeyword() const override
virtual void InitFromChunk(TESFile *a_mod) override
AlchemyFlag
Definition: AlchemyItem.h:30
virtual void InitItemImpl() override
virtual void InitChunk() override
TESIcon messageIcon
Definition: AlchemyItem.h:88
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:87
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:27
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:55
Definition: MagicItem.h:27
Definition: SpellItem.h:16
Definition: TESFile.h:14
Definition: TESIcon.h:8
Definition: TESModelTextureSwap.h:10
Definition: TESWeightForm.h:8
SpellType
Definition: MagicSystem.h:56
CastingType
Definition: MagicSystem.h:29
Delivery
Definition: MagicSystem.h:37
Definition: AbsorbEffect.h:6
constexpr REL::ID RTTI_AlchemyItem
Definition: Offsets_RTTI.h:68
ActorValue
Definition: ActorValues.h:6
Definition: AlchemyItem.h:40
RecordFlag
Definition: AlchemyItem.h:42
@ kIgnored
Definition: AlchemyItem.h:44
@ kMedicine
Definition: AlchemyItem.h:45
@ kDeleted
Definition: AlchemyItem.h:43