CommonLibSSE (Parapets fork)
Loading...
Searching...
No Matches
TESObjectBOOK.h
Go to the documentation of this file.
1#pragma once
2
3#include "RE/A/ActorValues.h"
8#include "RE/F/FormTypes.h"
10#include "RE/T/TESDescription.h"
11#include "RE/T/TESFullName.h"
12#include "RE/T/TESIcon.h"
14#include "RE/T/TESValueForm.h"
15#include "RE/T/TESWeightForm.h"
16
17namespace RE
18{
19 struct OBJ_BOOK // DATA
20 {
21 enum class Flag
22 {
23 kNone = 0,
24 kAdvancesActorValue = 1 << 0,
25 kCantTake = 1 << 1,
26 kTeachesSpell = 1 << 2, // takes priority over skill
27 kHasBeenRead = 1 << 3
28 };
29
30 enum class Type
31 {
32 kBookTome = 0x00,
33 kNoteScroll = static_cast<std::underlying_type_t<Type>>(-1),
34 };
35
36 union Teaches
37 {
40 };
41 static_assert(sizeof(Teaches) == 0x8);
42
43 [[nodiscard]] Flag GetSanitizedType() const;
44
45 // members
48 std::uint16_t pad02; // 02
49 std::uint32_t pad04; // 04
51 };
52 static_assert(sizeof(OBJ_BOOK) == 0x10);
53
55 public TESBoundObject, // 00
56 public TESFullName, // 30
57 public TESModelTextureSwap, // 40
58 public TESIcon, // 78
59 public TESValueForm, // 88
60 public TESWeightForm, // 98
61 public TESDescription, // A8
62 public BGSDestructibleObjectForm, // B8
63 public BGSMessageIcon, // C8
64 public BGSPickupPutdownSounds, // E0
65 public BGSKeywordForm // F8
66 {
67 public:
68 inline static constexpr auto RTTI = RTTI_TESObjectBOOK;
69 inline static constexpr auto FORMTYPE = FormType::Book;
70
72 {
73 enum ChangeFlag : std::uint32_t
74 {
75 kTeachesSkill = 1 << 5,
76 kRead = 1 << 6
77 };
78 };
79
81 {
82 enum RecordFlag : std::uint32_t
83 {
84 kDeleted = 1 << 5,
85 kIgnored = 1 << 12
86 };
87 };
88
89 ~TESObjectBOOK() override; // 00
90
91 // override (TESBoundObject)
92 void InitializeData() override; // 04
93 void ClearData() override; // 05 - { return TESForm::ClearData(); }
94 bool Load(TESFile* a_mod) override; // 06
95 void SaveGame(BGSSaveFormBuffer* a_buf) override; // 0E
96 void LoadGame(BGSLoadFormBuffer* a_buf) override; // 0F
97 void InitItemImpl() override; // 13
98 bool Activate(TESObjectREFR* a_targetRef, TESObjectREFR* a_activatorRef, std::uint8_t a_arg3, TESBoundObject* a_object, std::int32_t a_targetCount) override; // 37
99 bool GetActivateText(TESObjectREFR* a_activator, BSString& a_dst) override; // 4D
100
101 // override (BGSKeywordForm)
102 [[nodiscard]] BGSKeyword* GetDefaultKeyword() const override; // 05
103
104 [[nodiscard]] bool TeachesSkill() const;
105 [[nodiscard]] bool TeachesSpell() const;
106 [[nodiscard]] bool IsRead() const;
107 [[nodiscard]] bool CanBeTaken() const;
108 [[nodiscard]] bool IsBookTome() const;
109 [[nodiscard]] bool IsNoteScroll() const;
110 [[nodiscard]] ActorValue GetSkill() const;
112
113 // members
114 OBJ_BOOK data; // 110 - DATA
117 };
118 static_assert(sizeof(TESObjectBOOK) == 0x138);
119}
Definition: BGSDestructibleObjectForm.h:61
Definition: BGSKeywordForm.h:10
Definition: BGSKeyword.h:10
Definition: BGSMessageIcon.h:9
Definition: BGSPickupPutdownSounds.h:10
Definition: SpellItem.h:16
Definition: TESBoundObject.h:24
Definition: TESDescription.h:12
Definition: TESFile.h:14
Definition: TESFullName.h:9
Definition: TESIcon.h:8
Definition: TESModelTextureSwap.h:10
Definition: TESObjectBOOK.h:66
BGSKeyword * GetDefaultKeyword() const override
bool IsNoteScroll() const
static constexpr auto FORMTYPE
Definition: TESObjectBOOK.h:69
void InitItemImpl() override
static constexpr auto RTTI
Definition: TESObjectBOOK.h:68
bool IsBookTome() const
bool Load(TESFile *a_mod) override
ActorValue GetSkill() const
OBJ_BOOK data
Definition: TESObjectBOOK.h:114
bool Activate(TESObjectREFR *a_targetRef, TESObjectREFR *a_activatorRef, std::uint8_t a_arg3, TESBoundObject *a_object, std::int32_t a_targetCount) override
TESObjectSTAT * inventoryModel
Definition: TESObjectBOOK.h:115
bool IsRead() const
bool GetActivateText(TESObjectREFR *a_activator, BSString &a_dst) override
void ClearData() override
bool TeachesSpell() const
TESDescription itemCardDescription
Definition: TESObjectBOOK.h:116
bool CanBeTaken() const
void LoadGame(BGSLoadFormBuffer *a_buf) override
SpellItem * GetSpell()
void SaveGame(BGSSaveFormBuffer *a_buf) override
void InitializeData() override
~TESObjectBOOK() override
bool TeachesSkill() const
Definition: TESObjectREFR.h:105
Definition: TESObjectSTAT.h:29
Definition: TESValueForm.h:8
Definition: TESWeightForm.h:8
Definition: PCH.h:216
Definition: AbsorbEffect.h:6
ActorValue
Definition: ActorValues.h:6
constexpr REL::ID RTTI_TESObjectBOOK
Definition: Offsets_RTTI.h:6031
Definition: TESObjectBOOK.h:20
stl::enumeration< Type, std::uint8_t > type
Definition: TESObjectBOOK.h:47
std::uint32_t pad04
Definition: TESObjectBOOK.h:49
stl::enumeration< Flag, std::uint8_t > flags
Definition: TESObjectBOOK.h:46
Type
Definition: TESObjectBOOK.h:31
Teaches teaches
Definition: TESObjectBOOK.h:50
std::uint16_t pad02
Definition: TESObjectBOOK.h:48
Flag GetSanitizedType() const
Flag
Definition: TESObjectBOOK.h:22
Definition: TESObjectBOOK.h:72
ChangeFlag
Definition: TESObjectBOOK.h:74
@ kRead
Definition: TESObjectBOOK.h:76
@ kTeachesSkill
Definition: TESObjectBOOK.h:75
Definition: TESObjectBOOK.h:81
RecordFlag
Definition: TESObjectBOOK.h:83
@ kIgnored
Definition: TESObjectBOOK.h:85
@ kDeleted
Definition: TESObjectBOOK.h:84
Definition: TESObjectBOOK.h:37
ActorValue actorValueToAdvance
Definition: TESObjectBOOK.h:38
SpellItem * spell
Definition: TESObjectBOOK.h:39