CommonLibSSE NG
TESObjectDOOR.h
Go to the documentation of this file.
1 #pragma once
2 
5 #include "RE/B/BSTArray.h"
6 #include "RE/F/FormTypes.h"
8 #include "RE/T/TESFullName.h"
10 
11 namespace RE
12 {
13  class TESObjectDOOR :
14  public TESBoundAnimObject, // 00
15  public TESFullName, // 30
16  public TESModelTextureSwap, // 40
17  public BGSDestructibleObjectForm, // 78
18  public BGSOpenCloseForm // 88
19  {
20  public:
21  inline static constexpr auto RTTI = RTTI_TESObjectDOOR;
22  inline static constexpr auto VTABLE = VTABLE_TESObjectDOOR;
23  inline static constexpr auto FORMTYPE = FormType::Door;
24 
25  enum class Flag
26  {
27  kNone = 0,
28  kAutomatic = 1 << 1,
29  kHidden = 1 << 2,
30  kMinimalUse = 1 << 3,
31  kSliding = 1 << 4,
33  };
34 
35  struct ChangeFlags
36  {
37  enum ChangeFlag : std::uint32_t
38  {
39  kTeleportExtra = 1 << 17
40  };
41  };
42 
43  struct RecordFlags
44  {
45  enum RecordFlag : std::uint32_t
46  {
47  kDeleted = 1 << 5,
48  kIgnored = 1 << 12,
49  kHasDistantLOD = 1 << 15,
50  kRandomAnimStart = 1 << 16,
51  kIsMarker = 1 << 23
52  };
53  };
54 
55  ~TESObjectDOOR() override; // 00
56 
57  // override (TESBoundAnimObject)
58  void InitializeData() override; // 04
59  void ClearData() override; // 05
60  bool Load(TESFile* a_mod) override; // 06
61  void InitItemImpl() override; // 13
62  bool Activate(TESObjectREFR* a_targetRef, TESObjectREFR* a_activatorRef, std::uint8_t a_arg3, TESBoundObject* a_object, std::int32_t a_targetCount) override; // 37
63  NiAVObject* Clone3D(TESObjectREFR* a_ref) override; // 4A
64  bool GetActivateText(TESObjectREFR* a_activator, BSString& a_dst) override; // 4C
65  bool CalculateDoFavor(Actor* a_activator, bool a_arg2, TESObjectREFR* a_toActivate, float a_arg3) override; // 4D
66 
67  // override (BGSOpenCloseForm)
68  void HandleOpen(TESObjectREFR* a_target, TESObjectREFR* a_activator) override; // 01
69 
70  static void LinkRandomTeleportDoors(TESObjectREFR* a_door, TESObjectREFR* a_linkedDoor)
71  {
72  using func_t = decltype(&TESObjectDOOR::LinkRandomTeleportDoors);
73  REL::Relocation<func_t> func{ RELOCATION_ID(17539, 17944) };
74  return func(a_door, a_linkedDoor);
75  }
76 
77  // members
78  std::uint64_t unk90; // 90
83  std::uint8_t padB1; // B1
84  std::uint16_t padB2; // B2
85  std::uint32_t padB4; // B4
87  };
88  static_assert(sizeof(TESObjectDOOR) == 0xD0);
89 }
#define RELOCATION_ID(a_se, a_ae)
Definition: PCH.h:724
Definition: Relocation.h:204
Definition: Actor.h:135
Definition: BGSDestructibleObjectForm.h:61
Definition: BGSOpenCloseForm.h:9
Definition: BGSSoundDescriptorForm.h:14
Definition: BSTArray.h:377
Definition: NiAVObject.h:50
Definition: TESBoundAnimObject.h:8
Definition: TESBoundObject.h:24
Definition: TESFile.h:17
Definition: TESFullName.h:9
Definition: TESModelTextureSwap.h:10
Definition: TESObjectDOOR.h:19
void InitItemImpl() override
bool CalculateDoFavor(Actor *a_activator, bool a_arg2, TESObjectREFR *a_toActivate, float a_arg3) override
NiAVObject * Clone3D(TESObjectREFR *a_ref) override
~TESObjectDOOR() override
Flag
Definition: TESObjectDOOR.h:26
std::uint64_t unk90
Definition: TESObjectDOOR.h:78
stl::enumeration< Flag, std::uint8_t > flags
Definition: TESObjectDOOR.h:82
static constexpr auto FORMTYPE
Definition: TESObjectDOOR.h:23
void ClearData() override
bool Load(TESFile *a_mod) override
static constexpr auto VTABLE
Definition: TESObjectDOOR.h:22
std::uint16_t padB2
Definition: TESObjectDOOR.h:84
bool Activate(TESObjectREFR *a_targetRef, TESObjectREFR *a_activatorRef, std::uint8_t a_arg3, TESBoundObject *a_object, std::int32_t a_targetCount) override
std::uint8_t padB1
Definition: TESObjectDOOR.h:83
BGSSoundDescriptorForm * openSound
Definition: TESObjectDOOR.h:79
bool GetActivateText(TESObjectREFR *a_activator, BSString &a_dst) override
BGSSoundDescriptorForm * loopSound
Definition: TESObjectDOOR.h:81
void InitializeData() override
static void LinkRandomTeleportDoors(TESObjectREFR *a_door, TESObjectREFR *a_linkedDoor)
Definition: TESObjectDOOR.h:70
std::uint32_t padB4
Definition: TESObjectDOOR.h:85
BSTArray< TESForm * > randomTeleports
Definition: TESObjectDOOR.h:86
static constexpr auto RTTI
Definition: TESObjectDOOR.h:21
void HandleOpen(TESObjectREFR *a_target, TESObjectREFR *a_activator) override
BGSSoundDescriptorForm * closeSound
Definition: TESObjectDOOR.h:80
Definition: TESObjectREFR.h:113
Definition: AbsorbEffect.h:6
constexpr REL::VariantID RTTI_TESObjectDOOR(513922, 392545, 0x1edab60)
constexpr std::array< REL::VariantID, 5 > VTABLE_TESObjectDOOR
Definition: Offsets_VTABLE.h:542
Definition: TESObjectDOOR.h:36
ChangeFlag
Definition: TESObjectDOOR.h:38
@ kTeleportExtra
Definition: TESObjectDOOR.h:39
Definition: TESObjectDOOR.h:44
RecordFlag
Definition: TESObjectDOOR.h:46
@ kIsMarker
Definition: TESObjectDOOR.h:51
@ kDeleted
Definition: TESObjectDOOR.h:47
@ kRandomAnimStart
Definition: TESObjectDOOR.h:50
@ kHasDistantLOD
Definition: TESObjectDOOR.h:49
@ kIgnored
Definition: TESObjectDOOR.h:48