CommonLibSSE (Parapets fork)
TESActorBaseData.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/B/BSTArray.h"
5 #include "RE/F/FactionRank.h"
6 
7 namespace RE
8 {
9  class BGSVoiceType;
10  class TESActorBase;
11  class TESFaction;
12  class TESForm;
13  class TESLevItem;
14  class TESNPC;
15 
17  {
18  public:
19  enum class Flag
20  {
21  kNone = 0,
22  kFemale = 1 << 0,
23  kEssential = 1 << 1,
24  kIsChargenFacePreset = 1 << 2,
25  kRespawn = 1 << 3,
26  kAutoCalcStats = 1 << 4,
27  kUnique = 1 << 5,
29  kPCLevelMult = 1 << 7,
30  kUsesTemplate = 1 << 8,
31  kProtected = 1 << 11,
32  kSummonable = 1 << 14,
33  kDoesntBleed = 1 << 16,
34  kBleedoutOverride = 1 << 18,
35  kOppositeGenderanims = 1 << 19,
36  kSimpleActor = 1 << 20,
37  kLoopedScript = 1 << 21, // ?
38  kLoopedAudio = 1 << 28, // ?
39  kIsGhost = 1 << 29,
40  kInvulnerable = 1 << 31
41  };
42 
43  enum class TEMPLATE_USE_FLAG
44  {
45  kNone = 0,
46  kTraits = 1 << 0,
47  kStats = 1 << 1,
48  kFactions = 1 << 2,
49  kSpells = 1 << 3,
50  kAIData = 1 << 4,
51  kAIPackages = 1 << 5,
52  kUnused = 1 << 6,
53  kBaseData = 1 << 7,
54  kInventory = 1 << 8,
55  kScript = 1 << 9,
56  kAIDefPackList = 1 << 10,
57  kAttackData = 1 << 11,
58  kKeywords = 1 << 12
59  };
60 
61  // members
63  std::int16_t magickaOffset; // 04
64  std::int16_t staminaOffset; // 06
65  std::uint16_t level; // 08
66  std::uint16_t calcLevelMin; // 0A
67  std::uint16_t calcLevelMax; // 0C
68  std::uint16_t speedMult; // 0E
69  std::uint16_t baseDisposition; // 10 - unused
71  std::int16_t healthOffset; // 14
72  std::int16_t bleedoutOverride; // 16
73  };
74  static_assert(sizeof(ACTOR_BASE_DATA) == 0x18);
75 
76  class TESActorBaseData : public BaseFormComponent // ACBS
77  {
78  public:
79  inline static constexpr auto RTTI = RTTI_TESActorBaseData;
80 
81  ~TESActorBaseData() override;
82 
83  // override (BaseFormComponent)
84  void InitializeDataComponent() override; // 01
85  void ClearDataComponent() override; // 02
86  void CopyComponent(BaseFormComponent* a_rhs) override; // 03
87 
88  // add
89  virtual void CopyFromTemplateForms(TESActorBase** a_templateForms); // 04 - { return; }
90  [[nodiscard]] virtual bool GetIsGhost() const; // 05 - { return (flags >> 29) & 1; }
91  [[nodiscard]] virtual bool GetInvulnerable() const; // 06 - { test flags, 80000000h; }
92  virtual void Unk_07(void); // 07 - { return 1; }
93  virtual BGSVoiceType* GetVoiceType(void); // 08 - { return voice; }
94 
95  [[nodiscard]] constexpr bool AffectsStealthMeter() const noexcept { return actorData.actorBaseFlags.none(ACTOR_BASE_DATA::Flag::kDoesntAffectStealthMeter); }
96  [[nodiscard]] constexpr bool Bleeds() const noexcept { return actorData.actorBaseFlags.none(ACTOR_BASE_DATA::Flag::kDoesntBleed); }
97  [[nodiscard]] constexpr bool IsEssential() const noexcept { return actorData.actorBaseFlags.all(ACTOR_BASE_DATA::Flag::kEssential); }
98  [[nodiscard]] constexpr bool IsFemale() const noexcept { return actorData.actorBaseFlags.all(ACTOR_BASE_DATA::Flag::kFemale); }
99  [[nodiscard]] inline bool IsGhost() const { return GetIsGhost(); }
100  [[nodiscard]] constexpr bool IsPreset() const noexcept { return actorData.actorBaseFlags.all(ACTOR_BASE_DATA::Flag::kIsChargenFacePreset); }
101  [[nodiscard]] constexpr bool IsProtected() const noexcept { return actorData.actorBaseFlags.all(ACTOR_BASE_DATA::Flag::kProtected); }
102  [[nodiscard]] constexpr bool IsSimpleActor() const noexcept { return actorData.actorBaseFlags.all(ACTOR_BASE_DATA::Flag::kSimpleActor); }
103  [[nodiscard]] constexpr bool IsSummonable() const noexcept { return actorData.actorBaseFlags.all(ACTOR_BASE_DATA::Flag::kSummonable); }
104  [[nodiscard]] constexpr bool IsUnique() const noexcept { return actorData.actorBaseFlags.all(ACTOR_BASE_DATA::Flag::kUnique); }
105  [[nodiscard]] inline bool IsInvulnerable() const { return GetInvulnerable(); }
106  [[nodiscard]] constexpr bool HasAutoCalcStats() const noexcept { return actorData.actorBaseFlags.all(ACTOR_BASE_DATA::Flag::kAutoCalcStats); }
107  [[nodiscard]] constexpr bool HasBleedoutOverride() const noexcept { return actorData.actorBaseFlags.all(ACTOR_BASE_DATA::Flag::kBleedoutOverride); }
108  [[nodiscard]] constexpr bool HasPCLevelMult() const noexcept { return actorData.actorBaseFlags.all(ACTOR_BASE_DATA::Flag::kPCLevelMult); }
109  [[nodiscard]] constexpr bool Respawns() const noexcept { return actorData.actorBaseFlags.all(ACTOR_BASE_DATA::Flag::kRespawn); }
110  [[nodiscard]] constexpr bool UsesOppositeGenderAnims() const noexcept { return actorData.actorBaseFlags.all(ACTOR_BASE_DATA::Flag::kOppositeGenderanims); }
111  [[nodiscard]] constexpr bool UsesTemplate() const noexcept { return actorData.actorBaseFlags.all(ACTOR_BASE_DATA::Flag::kUsesTemplate); }
112 
113  // members
115  TESLevItem* deathItem; // 20 - INAM
116  BGSVoiceType* voiceType; // 28 - VTCK
117  TESForm* baseTemplateForm; // 30 - TPLT
120  };
121  static_assert(sizeof(TESActorBaseData) == 0x58);
122 }
Definition: BGSVoiceType.h:25
Definition: BSTArray.h:377
Definition: BaseFormComponent.h:8
Definition: TESActorBaseData.h:77
TESLevItem * deathItem
Definition: TESActorBaseData.h:115
ACTOR_BASE_DATA actorData
Definition: TESActorBaseData.h:114
constexpr bool HasAutoCalcStats() const noexcept
Definition: TESActorBaseData.h:106
void CopyComponent(BaseFormComponent *a_rhs) override
TESForm ** templateForms
Definition: TESActorBaseData.h:118
constexpr bool UsesTemplate() const noexcept
Definition: TESActorBaseData.h:111
constexpr bool IsSummonable() const noexcept
Definition: TESActorBaseData.h:103
constexpr bool HasBleedoutOverride() const noexcept
Definition: TESActorBaseData.h:107
constexpr bool IsEssential() const noexcept
Definition: TESActorBaseData.h:97
constexpr bool IsPreset() const noexcept
Definition: TESActorBaseData.h:100
constexpr bool IsSimpleActor() const noexcept
Definition: TESActorBaseData.h:102
TESForm * baseTemplateForm
Definition: TESActorBaseData.h:117
virtual BGSVoiceType * GetVoiceType(void)
BGSVoiceType * voiceType
Definition: TESActorBaseData.h:116
static constexpr auto RTTI
Definition: TESActorBaseData.h:79
virtual bool GetIsGhost() const
constexpr bool Bleeds() const noexcept
Definition: TESActorBaseData.h:96
constexpr bool UsesOppositeGenderAnims() const noexcept
Definition: TESActorBaseData.h:110
virtual bool GetInvulnerable() const
~TESActorBaseData() override
bool IsInvulnerable() const
Definition: TESActorBaseData.h:105
constexpr bool IsUnique() const noexcept
Definition: TESActorBaseData.h:104
virtual void CopyFromTemplateForms(TESActorBase **a_templateForms)
constexpr bool Respawns() const noexcept
Definition: TESActorBaseData.h:109
virtual void Unk_07(void)
bool IsGhost() const
Definition: TESActorBaseData.h:99
constexpr bool HasPCLevelMult() const noexcept
Definition: TESActorBaseData.h:108
constexpr bool AffectsStealthMeter() const noexcept
Definition: TESActorBaseData.h:95
constexpr bool IsFemale() const noexcept
Definition: TESActorBaseData.h:98
constexpr bool IsProtected() const noexcept
Definition: TESActorBaseData.h:101
BSTArray< FACTION_RANK > factions
Definition: TESActorBaseData.h:119
void InitializeDataComponent() override
void ClearDataComponent() override
Definition: TESActorBase.h:32
Definition: TESForm.h:34
Definition: TESLevItem.h:12
constexpr bool none(Args... a_args) const noexcept requires(std
Definition: PCH.h:336
constexpr bool all(Args... a_args) const noexcept requires(std
Definition: PCH.h:329
Definition: AbsorbEffect.h:6
constexpr REL::ID RTTI_TESActorBaseData
Definition: Offsets_RTTI.h:5968
Definition: TESActorBaseData.h:17
stl::enumeration< TEMPLATE_USE_FLAG, std::uint16_t > templateUseFlags
Definition: TESActorBaseData.h:70
stl::enumeration< Flag, std::uint32_t > actorBaseFlags
Definition: TESActorBaseData.h:62
std::uint16_t baseDisposition
Definition: TESActorBaseData.h:69
std::int16_t healthOffset
Definition: TESActorBaseData.h:71
std::int16_t staminaOffset
Definition: TESActorBaseData.h:64
std::int16_t bleedoutOverride
Definition: TESActorBaseData.h:72
TEMPLATE_USE_FLAG
Definition: TESActorBaseData.h:44
std::uint16_t calcLevelMax
Definition: TESActorBaseData.h:67
std::uint16_t level
Definition: TESActorBaseData.h:65
std::uint16_t calcLevelMin
Definition: TESActorBaseData.h:66
Flag
Definition: TESActorBaseData.h:20
std::int16_t magickaOffset
Definition: TESActorBaseData.h:63
std::uint16_t speedMult
Definition: TESActorBaseData.h:68