CommonLibSSE (powerof3)
BGSRelationship.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/F/FormTypes.h"
4 #include "RE/T/TESForm.h"
5 
6 namespace RE
7 {
8  class BGSRelationship : public TESForm
9  {
10  public:
11  inline static constexpr auto RTTI = RTTI_BGSRelationship;
12  inline static constexpr auto VTABLE = VTABLE_BGSRelationship;
13  inline static constexpr auto FORMTYPE = FormType::Relationship;
14 
15  enum class RELATIONSHIP_LEVEL
16  {
17  kLover = 0,
18  kAlly = 1,
19  kConfidant = 2,
20  kFriend = 3,
21  kAcquaintance = 4,
22  kRival = 5,
23  kFoe = 6,
24  kEnemy = 7,
25  kArchnemesis = 8
26  };
27 
28  enum class Flag
29  {
30  kNone = 0,
31  kSecret = 1 << 7
32  };
33 
34  struct ChangeFlags
35  {
36  enum ChangeFlag : std::uint32_t
37  {
38  kRelationshipData = 1 << 1
39  };
40  };
41 
42  struct RecordFlags
43  {
44  enum RecordFlag : std::uint32_t
45  {
46  kDeleted = 1 << 5,
47  kSecret = 1 << 6,
48  kIgnored = 1 << 12
49  };
50  };
51 
52  ~BGSRelationship() override; // 00
53 
54  // override (TESForm)
55  void InitializeData() override; // 04
56  bool Load(TESFile* a_mod) override; // 06
57  void SaveGame(BGSSaveFormBuffer* a_buf) override; // 0E
58  void LoadGame(BGSLoadFormBuffer* a_buf) override; // 0F
59  void InitLoadGame(BGSLoadFormBuffer* a_buf) override; // 10
60  void InitItemImpl() override; // 13
61 
62  static BGSRelationship* GetRelationship(TESNPC* a_npc1, TESNPC* a_npc2)
63  {
64  using func_t = decltype(&BGSRelationship::GetRelationship);
65  static REL::Relocation<func_t> func{ RELOCATION_ID(23632, 24084) };
66  return func(a_npc1, a_npc2);
67  }
68 
69  // members
70  TESNPC* npc1; // 20 - DATA~
71  TESNPC* npc2; // 28
74  std::uint8_t unk39; // 39
75  std::uint8_t unk3A; // 3A
77  std::uint32_t pad3C; // 3C - ~DATA
78  };
79  static_assert(sizeof(BGSRelationship) == 0x40);
80 }
#define RELOCATION_ID(SE, AE)
Definition: PCH.h:505
Definition: Relocation.h:210
Definition: BGSAssociationType.h:10
Definition: BGSLoadFormBuffer.h:11
Definition: BGSRelationship.h:9
std::uint8_t unk3A
Definition: BGSRelationship.h:75
BGSAssociationType * assocType
Definition: BGSRelationship.h:72
~BGSRelationship() override
static constexpr auto FORMTYPE
Definition: BGSRelationship.h:13
std::uint8_t unk39
Definition: BGSRelationship.h:74
void InitItemImpl() override
std::uint32_t pad3C
Definition: BGSRelationship.h:77
static constexpr auto VTABLE
Definition: BGSRelationship.h:12
REX::EnumSet< Flag, std::uint8_t > flags
Definition: BGSRelationship.h:76
bool Load(TESFile *a_mod) override
TESNPC * npc2
Definition: BGSRelationship.h:71
void InitializeData() override
Flag
Definition: BGSRelationship.h:29
static BGSRelationship * GetRelationship(TESNPC *a_npc1, TESNPC *a_npc2)
Definition: BGSRelationship.h:62
void InitLoadGame(BGSLoadFormBuffer *a_buf) override
void LoadGame(BGSLoadFormBuffer *a_buf) override
void SaveGame(BGSSaveFormBuffer *a_buf) override
REX::EnumSet< RELATIONSHIP_LEVEL, std::uint8_t > level
Definition: BGSRelationship.h:73
RELATIONSHIP_LEVEL
Definition: BGSRelationship.h:16
static constexpr auto RTTI
Definition: BGSRelationship.h:11
TESNPC * npc1
Definition: BGSRelationship.h:70
Definition: BGSSaveFormBuffer.h:8
Definition: TESFile.h:17
Definition: TESForm.h:36
Definition: TESNPC.h:36
Definition: AbsorbEffect.h:6
constexpr REL::ID RTTI_BGSRelationship(static_cast< std::uint64_t >(685399))
constexpr std::array< REL::ID, 1 > VTABLE_BGSRelationship
Definition: Offsets_VTABLE.h:8845
Definition: BGSRelationship.h:35
ChangeFlag
Definition: BGSRelationship.h:37
@ kRelationshipData
Definition: BGSRelationship.h:38
Definition: BGSRelationship.h:43
RecordFlag
Definition: BGSRelationship.h:45
@ kSecret
Definition: BGSRelationship.h:47
@ kIgnored
Definition: BGSRelationship.h:48
@ kDeleted
Definition: BGSRelationship.h:46