Skip to content

Commit

Permalink
feat!: TESNPC and related classes RE (#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
powerof3 authored Oct 3, 2023
1 parent 6130cb4 commit 99efd6c
Show file tree
Hide file tree
Showing 25 changed files with 554 additions and 69 deletions.
17 changes: 17 additions & 0 deletions CommonLibSF/include/RE/B/BGSAttachParentArray.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#pragma once

#include "RE/B/BGSTypedKeywordValueArray.h"

namespace RE
{
class BGSAttachParentArray :
public BaseFormComponent, // 00
public BGSTypedKeywordValueArray<KeywordType::kAttachPoint> // 08
{
public:
SF_RTTI_VTABLE(BGSAttachParentArray);

~BGSAttachParentArray() override;
};
static_assert(sizeof(BGSAttachParentArray) == 0x18);
}
2 changes: 1 addition & 1 deletion CommonLibSF/include/RE/B/BGSAttackDataForm.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace RE
public:
SF_RTTI_VTABLE(BGSAttackDataForm);

virtual ~BGSAttackDataForm(); // 00
~BGSAttackDataForm() override; // 00

// members
NiPointer<BGSAttackDataMap> attackDataMap; // 08
Expand Down
2 changes: 2 additions & 0 deletions CommonLibSF/include/RE/B/BGSDestructibleObjectForm.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ namespace RE
public:
SF_RTTI_VTABLE(BGSDestructibleObjectForm);

~BGSDestructibleObjectForm() override;

// members
DestructibleObjectData* data; // 08
};
Expand Down
2 changes: 2 additions & 0 deletions CommonLibSF/include/RE/B/BGSForcedLocRefType.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ namespace RE
public:
SF_RTTI_VTABLE(BGSForcedLocRefType);

~BGSForcedLocRefType() override;

// members
std::uint64_t unk08; // 08
std::uint64_t unk10; // 10
Expand Down
2 changes: 2 additions & 0 deletions CommonLibSF/include/RE/B/BGSKeywordForm.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ namespace RE
public:
SF_RTTI_VTABLE(BGSKeywordForm);

~BGSKeywordForm() override;

// members
std::uint32_t unk10;
std::uint32_t unk14;
Expand Down
12 changes: 6 additions & 6 deletions CommonLibSF/include/RE/B/BGSMod.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#pragma once

#include "RE/B/BSFixedString.h"
#include "RE/B/BaseFormComponent.h"

namespace RE
Expand All @@ -8,23 +9,22 @@ namespace RE
{
namespace Template
{
class Items :
public BaseFormComponent // 00
class Items : public BaseFormComponent
{
public:
SF_RTTI_VTABLE(BGSMod__Template__Items);

virtual ~Items();
virtual ~Items() override;

// add
virtual void Unk_0B(); // 0B
virtual void Unk_0C(); // 0C
virtual void Unk_0D(); // 0D

// members
void* unk08; // 08
void* unk10; // 10
void* unk18; // 18
void* unk08; // 08
void* unk10; // 10
BSFixedString unk18; // 18
};
static_assert(sizeof(Items) == 0x20);
}
Expand Down
8 changes: 7 additions & 1 deletion CommonLibSF/include/RE/B/BGSNativeTerminalForm.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
#pragma once

#include "RE/B/BGSTerminal.h"
#include "RE/B/BaseFormComponent.h"

namespace RE
{
class BGSTerminal;

class BGSNativeTerminalForm : public BaseFormComponent
{
public:
SF_RTTI(BGSNativeTerminalForm);

~BGSNativeTerminalForm() override;

// members
BGSTerminal* terminal; // 08
};
static_assert(sizeof(BGSNativeTerminalForm) == 0x10);
Expand Down
7 changes: 5 additions & 2 deletions CommonLibSF/include/RE/B/BGSObjectPlacementDefaults.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@

namespace RE
{
class BGSObjectPlacementDefaults :
public BaseFormComponent
class BGSObjectPlacementDefaults : public BaseFormComponent
{
public:
SF_RTTI_VTABLE(BGSObjectPlacementDefaults);

~BGSObjectPlacementDefaults() override;

// members
std::uint64_t unk08; // 08
std::uint32_t unk10; // 10
Expand Down
18 changes: 10 additions & 8 deletions CommonLibSF/include/RE/B/BGSOverridePackCollection.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,17 @@ namespace RE
public:
SF_RTTI_VTABLE(BGSOverridePackCollection);

~BGSOverridePackCollection() override;

// members
BGSListForm* unk08;
BGSListForm* unk10;
BGSListForm* unk18;
BGSListForm* unk20;
BGSListForm* unk28;
BGSListForm* unk30;
BGSListForm* unk38;
BGSListForm* unk40;
BGSListForm* unk08; // 08
BGSListForm* unk10; // 10
BGSListForm* unk18; // 18
BGSListForm* unk20; // 20
BGSListForm* unk28; // 28
BGSListForm* unk30; // 30
BGSListForm* unk38; // 38
BGSListForm* unk40; // 40
};
static_assert(sizeof(BGSOverridePackCollection) == 0x48);
}
2 changes: 2 additions & 0 deletions CommonLibSF/include/RE/B/BGSPerkRankArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ namespace RE
public:
SF_RTTI(BGSPerkRankArray);

~BGSPerkRankArray() override;

// members
PerkRankData* perks; // 08
std::uint32_t perkCount; // 10
Expand Down
2 changes: 2 additions & 0 deletions CommonLibSF/include/RE/B/BGSPropertySheet.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ namespace RE
public:
SF_RTTI_VTABLE(BGSPropertySheet);

~BGSPropertySheet() override;

// members
std::uint64_t /* BSTArray<BSTTuple<TESForm*, BGSTypedFormValuePair::SharedVal>>* */ unk08;
};
Expand Down
2 changes: 2 additions & 0 deletions CommonLibSF/include/RE/B/BGSSkinForm.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ namespace RE
public:
SF_RTTI_VTABLE(BGSSkinForm);

~BGSSkinForm() override;

// members
TESObjectARMO* formSkin; // 08
};
Expand Down
65 changes: 65 additions & 0 deletions CommonLibSF/include/RE/B/BGSTypedKeywordValueArray.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#pragma once

#include "RE/B/BGSKeyword.h"

namespace RE
{
enum class KeywordType
{
kNone,
kComponentTechLevel,
kAttachPoint,
kComponentProperty,
kInstantiationFilter,
kModAssociation,
kSound,
kAnimArchetype,
kFunctionCall,
kRecipeFilter,
kAttractionType,
kDialogueSubtype,
kQuestTarget,
kAnimFlavor,
kAnimGender,
kAnimFaceArchetype,
kQuestGroup,
kAnimInjured,
kDispelEffect,

kTotal
};

template <KeywordType TYPE>
class BGSTypedKeywordValue
{
public:
// members
std::uint16_t keywordIndex; // 0
};

namespace detail
{
[[nodiscard]] BGSKeyword* BGSKeywordGetTypedKeywordByIndex(KeywordType a_type, std::uint16_t a_index);
}

template <KeywordType TYPE>
class BGSTypedKeywordValueArray
{
public:
[[nodiscard]] bool HasKeyword(BGSKeyword* a_keyword)
{
for (std::uint32_t i = 0; i < size; ++i) {
const auto kywd = detail::BGSKeywordGetTypedKeywordByIndex(TYPE, array[i].keywordIndex);
if (kywd == a_keyword) {
return true;
}
}
return false;
}

// members
BGSTypedKeywordValue<TYPE>* array; // 00
std::uint32_t size; // 08
};
static_assert(sizeof(BGSTypedKeywordValueArray<KeywordType::kNone>) == 0x10);
}
Loading

0 comments on commit 99efd6c

Please sign in to comment.