CommonLibVR
TESRace.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/A/ActorValues.h"
7 #include "RE/B/BGSHeadPart.h"
8 #include "RE/B/BGSKeywordForm.h"
9 #include "RE/B/BGSSkinForm.h"
10 #include "RE/B/BGSTextureModel.h"
11 #include "RE/B/BSFixedString.h"
12 #include "RE/B/BSTArray.h"
13 #include "RE/B/BipedObjects.h"
14 #include "RE/F/FormTypes.h"
15 #include "RE/N/NiPoint3.h"
16 #include "RE/S/Sexes.h"
17 #include "RE/T/TESDescription.h"
18 #include "RE/T/TESForm.h"
19 #include "RE/T/TESFullName.h"
20 #include "RE/T/TESModel.h"
21 #include "RE/T/TESSpellList.h"
22 #include "RE/T/TESTexture.h"
23 
24 namespace RE
25 {
26  class AttackAnimationArrayMap;
27 
29 
30  namespace BSResource
31  {
32  struct ID;
33  }
34 
35  enum class RACE_SIZE
36  {
37  kSmall = 0,
38  kMedium = 1,
39  kLarge = 2,
40  kExtraLarge = 3
41  };
42 
43  struct RACE_DATA
44  {
45  public:
46  enum
47  {
48  kNumSkillBoosts = 7
49  };
50 
51  enum class Flag
52  {
53  kNone = 0,
54  kPlayable = 1 << 0,
55  kFaceGenHead = 1 << 1,
56  kChild = 1 << 2,
57  kTiltFrontBack = 1 << 3,
58  kTiltLeftRight = 1 << 4,
59  kNoShadow = 1 << 5,
60  kSwims = 1 << 6,
61  kFlies = 1 << 7,
62  kWalks = 1 << 8,
63  kImmobile = 1 << 9,
64  kNotPushable = 1 << 10,
65  kNoCombatInWater = 1 << 11,
66  kNoRotatingToHeadTrack = 1 << 12,
67  kDontShowBloodSpray = 1 << 13,
68  kDontShowBloodDecal = 1 << 14,
69  kUseHeadTrackAnims = 1 << 15,
70  kSpellsAlignWithMagicNode = 1 << 16,
72  kAllowRagdollCollision = 1 << 18,
73  kRegenHPInCombat = 1 << 19,
74  kCantOpenDoors = 1 << 20,
75  kAllowPCDialogue = 1 << 21,
76  kNoKnockdowns = 1 << 22,
77  kAllowPickpocket = 1 << 23,
78  kAlwaysUseProxyController = 1 << 24,
79  kDontShowWeaponBlood = 1 << 25,
80  kOverlayHeadPartList = 1 << 26,
81  kOverrideHeadPartList = 1 << 27,
82  kCanPickupItems = 1 << 28,
84  kCanDualWield = 1 << 30,
85  kAvoidsRoads = 1 << 31,
86  };
87 
88  enum class Flag2
89  {
90  kNone = 0,
91  kUseAdvancedAvoidance = 1 << 0,
92  kNonHostile = 1 << 1,
93  kAllowMountedCombat = 1 << 4
94  };
95 
96  struct SkillBoost
97  {
98  public:
99  // members
101  std::uint8_t bonus; // 1
102  };
103  static_assert(sizeof(SkillBoost) == 0x2);
104 
105  // members
107  std::uint16_t pad0E; // 0E
108  float height[SEXES::kTotal]; // 10
109  float weight[SEXES::kTotal]; // 18
111  float startingHealth; // 24
112  float startingMagicka; // 28
113  float startingStamina; // 2C
114  float baseCarryWeight; // 30
115  float baseMass; // 34
116  float accelerate; // 38
117  float decelerate; // 3C
121  float injuredHealthPercent; // 4C
123  float healthRegen; // 54
124  float magickaRegen; // 58
125  float staminaRegen; // 5C
126  float unarmedDamage; // 60
127  float unarmedReach; // 64
129  float aimAngleTolerance; // 6C
130  float flightRadius; // 70
131  float angleAccelerate; // 74
132  float angleTolerance; // 78
137  };
138  static_assert(sizeof(RACE_DATA) == 0xA4);
139 
140  class TESRace :
141  public TESForm, // 000
142  public TESFullName, // 020
143  public TESDescription, // 030
144  public TESSpellList, // 040
145  public BGSSkinForm, // 050
146  public BGSBipedObjectForm, // 060
147  public BGSKeywordForm, // 070
148  public BGSAttackDataForm // 088
149  {
150  public:
151  inline static constexpr auto RTTI = RTTI_TESRace;
152  inline static constexpr auto VTABLE = VTABLE_TESRace;
153  inline static constexpr auto FORMTYPE = FormType::Race;
154 
155  enum class EquipmentFlag
156  {
157  kNone = 0,
158  kHandToHandMelee = 1 << 0,
159  kOneHandSword = 1 << 1,
160  kOneHandDagger = 1 << 2,
161  kOneHandAxe = 1 << 3,
162  kOneHandMace = 1 << 4,
163  kTwoHandSword = 1 << 5,
164  kTwoHandAxe = 1 << 6,
165  kBow = 1 << 7,
166  kStaff = 1 << 8,
167  kSpell = 1 << 9,
168  kShield = 1 << 10,
169  kTorch = 1 << 11,
170  kCrossbow = 1 << 12
171  };
172 
173  struct RecordFlags
174  {
175  enum RecordFlag : std::uint32_t
176  {
177  kDeleted = 1 << 5,
178  kIgnored = 1 << 12,
179  kCritter = 1 << 19 // ?
180  };
181  };
182 
184  {
185  enum
186  {
187  kWalk = 0,
193  kTotal
194  };
195  };
196 
198  {
199  enum
200  {
201  kNose = 0,
205 
207  };
208 
209  struct Morph
210  {
211  public:
212  // members
213  std::uint32_t morphFlags; // 00
214  std::uint32_t unk04; // 04
215  std::uint32_t unk08; // 08
216  std::uint32_t unk0C; // 0C
217  std::uint32_t unk10; // 10
218  std::uint32_t unk14; // 14
219  std::uint32_t unk18; // 18
220  std::uint32_t unk1C; // 1C
221  };
222  static_assert(sizeof(Morph) == 0x20);
223 
224  struct TintAsset
225  {
226  public:
227  struct TintLayer
228  {
229  public:
230  enum class SkinTone
231  {
232  kNone = 0,
233  kLipColor = 1,
234  kCheekColor = 2,
235  kEyeliner = 3,
236  kEyeSocketUpper = 4,
237  kEyeSocketLower = 5,
238  kSkinTone = 6,
239  kPaint = 7,
240  kLaughLines = 8,
241  kCheekColorLower = 9,
242  kNose = 10,
243  kChin = 11,
244  kNeck = 12,
245  kForehead = 13,
246  kDirt = 14,
247  };
248 
249  // members
250  std::uint16_t index; // 00 - TINI
252  std::uint8_t pad03; // 03
253  std::uint32_t pad04; // 04
254  TESTexture file; // 08 - TINT
256  };
257  static_assert(sizeof(TintLayer) == 0x20);
258 
259  struct Presets
260  {
261  public:
262  // members
266  };
267  static_assert(sizeof(Presets) == 0x48);
268 
269  // members
272  };
273  static_assert(sizeof(TintAsset) == 0x68);
274 
275  // members
277  std::uint32_t numFlagsSet[kNumVariants]; // 80
281  BSTArray<TESNPC*>* presetNPCs; // A8 - RPRM / RPRF
285  };
286  static_assert(sizeof(FaceRelatedData) == 0xC8);
287 
288  struct UnkData
289  {
290  public:
291  // members
293  std::uint32_t numUnkHashes1; // 08
294  std::uint32_t pad0C; // 0C
295  std::uint32_t numUnkHashes2; // 10
296  std::uint32_t pad14; // 14
297  };
298  static_assert(sizeof(UnkData) == 0x18);
299 
300  ~TESRace() override; // 00
301 
302  // override (TESForm)
303  void InitializeData() override; // 04
304  void ClearData() override; // 05
305  bool Load(TESFile* a_mod) override; // 06
306  void InitItemImpl() override; // 13
307  bool GetPlayable() const override; // 19
308  const char* GetFormEditorID() const override; // 32 - { return formEditorID.c_str(); }
309  bool SetFormEditorID(const char* a_str) override; // 33 - { formEditorID = a_str; }
310 
311  [[nodiscard]] bool AllowsPCDialogue() const;
312  [[nodiscard]] bool AllowsPickpocket() const;
314  [[nodiscard]] bool IsChildRace() const;
315 
316  // members
317  TESModel skeletonModels[SEXES::kTotal]; // 098 - ANAM
318  RACE_DATA data; // 0E8
319  float clampFaceGeoValue; // 18C - PNAM
320  float clampFaceGeoValue2; // 18C - UNAM
321  std::uint32_t pad194; // 194
322  BGSTextureModel bodyTextureModels[SEXES::kTotal]; // 198
323  BGSBehaviorGraphModel behaviorGraphs[SEXES::kTotal]; // 1E8
324  BSFixedString rootBehaviorGraphNames[SEXES::kTotal]; // 238
326  BGSVoiceType* defaultVoiceTypes[SEXES::kTotal]; // 258 - VTCK
328  TESObjectARMO* decapitateArmors[SEXES::kTotal]; // 270 - DNAM
329  UnkData unk280; // 280
330  UnkData unk298; // 298
331  std::uint64_t unk2B0; // 2B0
332  std::uint64_t unk2B8; // 2B8
333  std::uint64_t unk2C0; // 2C0
334  std::uint64_t unk2C8; // 2C8
339  BGSArtObject* dismemberBlood; // 2F8 - NAM7
342  BSFixedString bipedObjectNameA[BIPED_OBJECTS::kEditorTotal]; // 310 - NAME
344  stl::enumeration<EquipmentFlag, std::uint32_t> validEquipTypes; // 428 - VNAM - bits 13+ are always set
345  std::uint32_t unk42C; // 42C - TESModel::unk24
347  TESRace* morphRace; // 438 - NAM8
348  TESRace* armorParentRace; // 440 - RNAM
349  UnkData unk448; // 448
351  BGSMovementType* baseMoveTypes[MovementTypes::kTotal]; // 478 - WKMV / RNMV / WMMV / FLMV / SNMV / SPMV
352  FaceRelatedData* faceRelatedData[SEXES::kTotal]; // 4A8
353  private:
354  KEEP_FOR_RE()
355  };
356  static_assert(sizeof(TESRace) == 0x4B8);
357 }
#define KEEP_FOR_RE()
Definition: PCH.h:713
Definition: AttackAnimationArrayMap.h:13
Definition: BGSArtObject.h:12
Definition: BGSAttackDataForm.h:11
Definition: BGSBehaviorGraphModel.h:8
Definition: BGSBipedObjectForm.h:61
Definition: BGSBodyPartData.h:85
Definition: BGSColorForm.h:13
Definition: BGSEquipSlot.h:10
Definition: BGSHeadPart.h:17
HeadPartType
Definition: BGSHeadPart.h:34
Definition: BGSImpactDataSet.h:13
Definition: BGSKeywordForm.h:12
Definition: BGSMaterialType.h:12
Definition: BGSMovementType.h:11
Definition: BGSSkinForm.h:10
Definition: BGSSoundDescriptorForm.h:14
Definition: BGSTextureModel.h:8
Definition: BGSTextureSet.h:16
Definition: BGSVoiceType.h:25
Definition: BSTArray.h:378
Definition: NiPoint3.h:6
Definition: TESDescription.h:12
Definition: TESFile.h:17
Definition: TESForm.h:40
Definition: TESFullName.h:9
Definition: TESModel.h:16
Definition: TESObjectARMO.h:37
Definition: TESRace.h:149
std::uint64_t unk2B8
Definition: TESRace.h:332
AttackAnimationArrayMap * attackAnimationArrayMap[SEXES::kTotal]
Definition: TESRace.h:335
~TESRace() override
FaceRelatedData * faceRelatedData[SEXES::kTotal]
Definition: TESRace.h:352
BGSArtObject * dismemberBlood
Definition: TESRace.h:339
BSFixedString behaviorGraphProjectNames[SEXES::kTotal]
Definition: TESRace.h:325
TESObjectARMO * decapitateArmors[SEXES::kTotal]
Definition: TESRace.h:328
std::uint32_t unk42C
Definition: TESRace.h:345
bool SetFormEditorID(const char *a_str) override
bool GetPlayable() const override
BSTArray< BSFixedString > phonemeTargets
Definition: TESRace.h:350
std::uint64_t unk2C8
Definition: TESRace.h:334
bool AllowsPickpocket() const
static constexpr auto FORMTYPE
Definition: TESRace.h:153
BSTArray< BGSEquipSlot * > equipSlots
Definition: TESRace.h:343
BGSBodyPartData * bodyPartData
Definition: TESRace.h:327
BSFixedString bipedObjectNameA[BIPED_OBJECTS::kEditorTotal]
Definition: TESRace.h:342
bool AllowsPCDialogue() const
float clampFaceGeoValue
Definition: TESRace.h:319
std::uint64_t unk2C0
Definition: TESRace.h:333
BGSVoiceType * defaultVoiceTypes[SEXES::kTotal]
Definition: TESRace.h:326
bool Load(TESFile *a_mod) override
EquipmentFlag
Definition: TESRace.h:156
TESRace * armorParentRace
Definition: TESRace.h:348
UnkData unk448
Definition: TESRace.h:349
std::uint32_t pad194
Definition: TESRace.h:321
bool IsChildRace() const
UnkData unk280
Definition: TESRace.h:329
void ClearData() override
void InitializeData() override
BGSMaterialType * bloodImpactMaterial
Definition: TESRace.h:337
BGSSoundDescriptorForm * corpseCloseSound
Definition: TESRace.h:341
TESRace * morphRace
Definition: TESRace.h:347
float clampFaceGeoValue2
Definition: TESRace.h:320
BGSMovementType * baseMoveTypes[MovementTypes::kTotal]
Definition: TESRace.h:351
BGSSoundDescriptorForm * corpseOpenSound
Definition: TESRace.h:340
static constexpr auto VTABLE
Definition: TESRace.h:152
stl::enumeration< EquipmentFlag, std::uint32_t > validEquipTypes
Definition: TESRace.h:344
BGSTextureModel bodyTextureModels[SEXES::kTotal]
Definition: TESRace.h:322
BSFixedString formEditorID
Definition: TESRace.h:336
RACE_DATA data
Definition: TESRace.h:318
std::uint64_t unk2B0
Definition: TESRace.h:331
BGSBehaviorGraphModel behaviorGraphs[SEXES::kTotal]
Definition: TESRace.h:323
BGSEquipSlot * unarmedEquipSlot
Definition: TESRace.h:346
static constexpr auto RTTI
Definition: TESRace.h:151
BGSHeadPart * GetHeadPartByType(HeadPartType a_type, SEX a_sex) const
void InitItemImpl() override
BGSImpactDataSet * impactDataSet
Definition: TESRace.h:338
TESModel skeletonModels[SEXES::kTotal]
Definition: TESRace.h:317
UnkData unk298
Definition: TESRace.h:330
BSFixedString rootBehaviorGraphNames[SEXES::kTotal]
Definition: TESRace.h:324
const char * GetFormEditorID() const override
Definition: TESSpellList.h:13
Definition: TESTexture.h:10
Definition: AbsorbEffect.h:6
constexpr REL::ID RTTI_TESRace(static_cast< std::uint64_t >(513954))
constexpr std::array< REL::ID, 8 > VTABLE_TESRace
Definition: Offsets_VTABLE.h:12881
RACE_SIZE
Definition: TESRace.h:36
Definition: ID.h:10
Definition: TESRace.h:97
stl::enumeration< ActorValue, std::uint8_t > skill
Definition: TESRace.h:100
std::uint8_t bonus
Definition: TESRace.h:101
Definition: TESRace.h:44
stl::enumeration< BIPED_OBJECT, std::uint32_t > bodyObject
Definition: TESRace.h:128
float accelerate
Definition: TESRace.h:116
Flag
Definition: TESRace.h:52
NiPoint3 mountCameraOffset
Definition: TESRace.h:136
float injuredHealthPercent
Definition: TESRace.h:121
float startingStamina
Definition: TESRace.h:113
float baseMass
Definition: TESRace.h:115
float height[SEXES::kTotal]
Definition: TESRace.h:108
float angleTolerance
Definition: TESRace.h:132
float unarmedReach
Definition: TESRace.h:127
SkillBoost skillBoosts[kNumSkillBoosts]
Definition: TESRace.h:103
float weight[SEXES::kTotal]
Definition: TESRace.h:109
float startingMagicka
Definition: TESRace.h:112
NiPoint3 dismountOffset
Definition: TESRace.h:135
stl::enumeration< Flag2, std::uint32_t > flags2
Definition: TESRace.h:133
stl::enumeration< RACE_SIZE, std::uint32_t > raceSize
Definition: TESRace.h:118
stl::enumeration< BIPED_OBJECT, std::uint32_t > headObject
Definition: TESRace.h:119
stl::enumeration< BIPED_OBJECT, std::uint32_t > shieldObject
Definition: TESRace.h:122
float unarmedDamage
Definition: TESRace.h:126
float baseCarryWeight
Definition: TESRace.h:114
float staminaRegen
Definition: TESRace.h:125
float startingHealth
Definition: TESRace.h:111
NiPoint3 mountOffset
Definition: TESRace.h:134
float aimAngleTolerance
Definition: TESRace.h:129
stl::enumeration< BIPED_OBJECT, std::uint32_t > hairObject
Definition: TESRace.h:120
float flightRadius
Definition: TESRace.h:130
float healthRegen
Definition: TESRace.h:123
stl::enumeration< Flag, std::uint32_t > flags
Definition: TESRace.h:110
float angleAccelerate
Definition: TESRace.h:131
@ kNumSkillBoosts
Definition: TESRace.h:48
float magickaRegen
Definition: TESRace.h:124
Flag2
Definition: TESRace.h:89
float decelerate
Definition: TESRace.h:117
std::uint16_t pad0E
Definition: TESRace.h:107
SEX
Definition: Sexes.h:8
Definition: TESRace.h:210
std::uint32_t morphFlags
Definition: TESRace.h:213
std::uint32_t unk18
Definition: TESRace.h:219
std::uint32_t unk0C
Definition: TESRace.h:216
std::uint32_t unk08
Definition: TESRace.h:215
std::uint32_t unk04
Definition: TESRace.h:214
std::uint32_t unk14
Definition: TESRace.h:218
std::uint32_t unk1C
Definition: TESRace.h:220
std::uint32_t unk10
Definition: TESRace.h:217
BSTArray< std::uint16_t > indices
Definition: TESRace.h:265
BSTArray< BGSColorForm * > colors
Definition: TESRace.h:263
BSTArray< float > defaultValues
Definition: TESRace.h:264
std::uint16_t index
Definition: TESRace.h:250
TESTexture file
Definition: TESRace.h:254
std::uint32_t pad04
Definition: TESRace.h:253
BGSColorForm * presetDefault
Definition: TESRace.h:255
std::uint8_t pad03
Definition: TESRace.h:252
stl::enumeration< SkinTone, std::uint8_t > skinTone
Definition: TESRace.h:251
TintLayer texture
Definition: TESRace.h:267
Presets presets
Definition: TESRace.h:271
Definition: TESRace.h:198
BSTArray< BGSTextureSet * > * faceDetailsTextureSets
Definition: TESRace.h:279
BGSTextureSet * defaultFaceDetailsTextureSet
Definition: TESRace.h:280
BSTArray< TintAsset * > * tintMasks
Definition: TESRace.h:278
BSTArray< BGSHeadPart * > * headParts
Definition: TESRace.h:284
BSTArray< BGSColorForm * > * availableHairColors
Definition: TESRace.h:282
BGSColorForm * defaultHairColor
Definition: TESRace.h:283
Morph availableMorphs[kNumVariants]
Definition: TESRace.h:273
BSTArray< TESNPC * > * presetNPCs
Definition: TESRace.h:281
std::uint32_t numFlagsSet[kNumVariants]
Definition: TESRace.h:277
@ kLips
Definition: TESRace.h:204
@ kNose
Definition: TESRace.h:201
@ kNumVariants
Definition: TESRace.h:206
@ kBrows
Definition: TESRace.h:202
@ kEyes
Definition: TESRace.h:203
Definition: TESRace.h:184
@ kWalk
Definition: TESRace.h:187
@ kSprint
Definition: TESRace.h:192
@ kRun
Definition: TESRace.h:188
@ kTotal
Definition: TESRace.h:193
@ kSneak
Definition: TESRace.h:191
@ kFly
Definition: TESRace.h:190
@ kSwim
Definition: TESRace.h:189
Definition: TESRace.h:174
RecordFlag
Definition: TESRace.h:176
@ kCritter
Definition: TESRace.h:179
@ kDeleted
Definition: TESRace.h:177
@ kIgnored
Definition: TESRace.h:178
Definition: TESRace.h:289
std::uint32_t pad0C
Definition: TESRace.h:294
std::uint32_t numUnkHashes2
Definition: TESRace.h:295
BSResource::ID ** unkHashes
Definition: TESRace.h:292
std::uint32_t numUnkHashes1
Definition: TESRace.h:293
std::uint32_t pad14
Definition: TESRace.h:296