CommonLibSSE (Parapets fork)
IngredientItem.h
Go to the documentation of this file.
1 #pragma once
2 
4 #include "RE/B/BGSEquipType.h"
6 #include "RE/F/FormTypes.h"
7 #include "RE/M/MagicItem.h"
8 #include "RE/T/TESIcon.h"
10 #include "RE/T/TESValueForm.h"
11 #include "RE/T/TESWeightForm.h"
12 
13 namespace RE
14 {
16  public MagicItem, // 000
17  public TESModelTextureSwap, // 090
18  public TESIcon, // 0C8
19  public TESWeightForm, // 0D8
20  public BGSEquipType, // 0E8
21  public BGSDestructibleObjectForm, // 0F8
22  public BGSPickupPutdownSounds, // 108
23  public TESValueForm // 120
24  {
25  public:
26  inline static constexpr auto RTTI = RTTI_IngredientItem;
27  inline static constexpr auto FORMTYPE = FormType::Ingredient;
28 
29  enum class IngredientFlag
30  {
31  kNone = 0,
32  kCostOverride = 1 << 0,
33  kFoodItem = 1 << 1,
34  kExtendDuration = 1 << 3,
35  kReferencesPersist = 1 << 8
36  };
37 
38  struct ChangeFlags
39  {
40  enum ChangeFlag : std::uint32_t
41  {
42  kIngredientUse = (std::uint32_t)1 << 31
43  };
44  };
45 
46  struct RecordFlags
47  {
48  enum RecordFlag : std::uint32_t
49  {
50  kDeleted = 1 << 5,
51  kIgnored = 1 << 12
52  };
53  };
54 
55  class Data // ENIT
56  {
57  public:
58  // members
59  std::int32_t costOverride; // 00
61  };
62  static_assert(sizeof(Data) == 0x8);
63 
64  struct GameData
65  {
66  public:
67  // members
68  std::uint16_t knownEffectFlags;
69  std::uint16_t playerUses;
70  };
71  static_assert(sizeof(GameData) == 0x4);
72 
73  ~IngredientItem() override; // 00
74 
75  // override (MagicItem)
76  void InitializeData() override; // 04
77  void ClearData() override; // 05
78  void SaveGame(BGSSaveFormBuffer* a_buf) override; // 0E
79  void LoadGame(BGSLoadFormBuffer* a_buf) override; // 0F
80  void Revert(BGSLoadFormBuffer* a_buf) override; // 12
81  void InitItemImpl() override; // 13
82  MagicSystem::SpellType GetSpellType() const override; // 53 - { return MagicSystem::SpellType::kIngredient; }
83  MagicSystem::CastingType GetCastingType() const override; // 55 - { return MagicSystem::CastingType::kFireAndForget; }
84  MagicSystem::Delivery GetDelivery() const override; // 57 - { return MagicSystem::Delivery::kSelf; }
85  bool IsFood() const override; // 5D - { return (GetData()->flags >> 1) & 1; }
86  bool GetSkillUsageData(SkillUsageData& a_data) const override; // 60
87  std::uint32_t GetMaxEffectCount() const override; // 65 - { return 4; }
88  ActorValue GetAssociatedSkill() const override; // 66 - { return ActorValue::kConfidence; }
89  std::uint32_t GetChunkID() override; // 68 - { return 'ENIT'; }
90  void CopyMagicItemData(MagicItem* a_src) override; // 69
91  void LoadMagicItemChunk(TESFile* a_mod, std::uint32_t a_chunkID) override; // 6A
92  const MagicItem::Data* GetData1() const override; // 6C - { return &effectData; }
93  MagicItem::Data* GetData2() override; // 6D - { return &effectData; }
94  std::uint32_t GetDataSize() const override; // 6E - { return 0x8; }
95  void InitFromChunk(TESFile* a_mod) override; // 6F
96  void InitChunk() override; // 70
97 
98  // override (BGSKeywordForm)
99  [[nodiscard]] BGSKeyword* GetDefaultKeyword() const override; // 05
100 
101  // members
102  Data data; // 130 - ENIT
104  std::uint32_t pad13C; // 13C
105  };
106  static_assert(sizeof(IngredientItem) == 0x140);
107 }
Definition: BGSDestructibleObjectForm.h:61
Definition: BGSEquipType.h:9
Definition: BGSKeyword.h:10
Definition: BGSPickupPutdownSounds.h:10
Definition: IngredientItem.h:56
stl::enumeration< IngredientFlag, std::uint32_t > flags
Definition: IngredientItem.h:60
std::int32_t costOverride
Definition: IngredientItem.h:59
Definition: IngredientItem.h:24
ActorValue GetAssociatedSkill() const override
static constexpr auto FORMTYPE
Definition: IngredientItem.h:27
bool IsFood() const override
bool GetSkillUsageData(SkillUsageData &a_data) const override
Data data
Definition: IngredientItem.h:102
std::uint32_t pad13C
Definition: IngredientItem.h:104
void ClearData() override
MagicSystem::CastingType GetCastingType() const override
void Revert(BGSLoadFormBuffer *a_buf) override
void InitChunk() override
MagicItem::Data * GetData2() override
MagicSystem::Delivery GetDelivery() const override
std::uint32_t GetChunkID() override
static constexpr auto RTTI
Definition: IngredientItem.h:26
MagicSystem::SpellType GetSpellType() const override
void CopyMagicItemData(MagicItem *a_src) override
void InitFromChunk(TESFile *a_mod) override
GameData gamedata
Definition: IngredientItem.h:103
void SaveGame(BGSSaveFormBuffer *a_buf) override
void InitializeData() override
~IngredientItem() override
void LoadMagicItemChunk(TESFile *a_mod, std::uint32_t a_chunkID) override
std::uint32_t GetDataSize() const override
const MagicItem::Data * GetData1() const override
BGSKeyword * GetDefaultKeyword() const override
void LoadGame(BGSLoadFormBuffer *a_buf) override
IngredientFlag
Definition: IngredientItem.h:30
void InitItemImpl() override
std::uint32_t GetMaxEffectCount() const override
Definition: MagicItem.h:55
Definition: MagicItem.h:27
Definition: TESFile.h:14
Definition: TESIcon.h:8
Definition: TESModelTextureSwap.h:10
Definition: TESValueForm.h:10
Definition: TESWeightForm.h:8
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_IngredientItem
Definition: Offsets_RTTI.h:5062
Definition: IngredientItem.h:39
ChangeFlag
Definition: IngredientItem.h:41
@ kIngredientUse
Definition: IngredientItem.h:42
Definition: IngredientItem.h:65
std::uint16_t playerUses
Definition: IngredientItem.h:69
std::uint16_t knownEffectFlags
Definition: IngredientItem.h:68
Definition: IngredientItem.h:47
RecordFlag
Definition: IngredientItem.h:49
@ kIgnored
Definition: IngredientItem.h:51
@ kDeleted
Definition: IngredientItem.h:50
Definition: MagicItem.h:41