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