Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: TESLeveledList and related classes #228

Merged
merged 2 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions CommonLibSF/include/RE/B/BGSLevGenericBaseForm.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#pragma once

#include "RE/B/BGSForcedLocRefType.h"
#include "RE/B/BGSModelMaterialSwap.h"
#include "RE/T/TESBoundAnimObject.h"
#include "RE/T/TESLeveledList.h"

namespace RE
{
class BGSLevGenericBaseForm :
public TESBoundAnimObject, // 000
public TESLeveledList, // 118
public BGSModelMaterialSwap // 178
{
public:
SF_RTTI_VTABLE(BGSLevGenericBaseForm);
SF_FORMTYPE(LVLB);

~BGSLevGenericBaseForm() override; // 00
};
static_assert(sizeof(BGSLevGenericBaseForm) == 0x1A0);
}
23 changes: 23 additions & 0 deletions CommonLibSF/include/RE/B/BGSLevPackIn.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#pragma once

#include "RE/B/BGSForcedLocRefType.h"
#include "RE/B/BGSModelMaterialSwap.h"
#include "RE/T/TESBoundAnimObject.h"
#include "RE/T/TESLeveledList.h"

namespace RE
{
class BGSLevPackIn :
public TESBoundAnimObject, // 000
public TESLeveledList, // 118
public BGSModelMaterialSwap, // 178
public BGSForcedLocRefType // 1A0
{
public:
SF_RTTI_VTABLE(BGSLevPackIn);
SF_FORMTYPE(LVLP);

~BGSLevPackIn() override; // 00
};
static_assert(sizeof(BGSLevPackIn) == 0x1B8);
}
19 changes: 19 additions & 0 deletions CommonLibSF/include/RE/B/BGSLevSpaceCell.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#pragma once

#include "RE/T/TESForm.h"
#include "RE/T/TESLeveledList.h"

namespace RE
{
class BGSLevSpaceCell :
public TESForm, // 00
public TESLeveledList // 38
{
public:
SF_RTTI_VTABLE(BGSLevSpaceCell);
SF_FORMTYPE(LVSC);

~BGSLevSpaceCell() override; // 00
};
static_assert(sizeof(BGSLevSpaceCell) == 0x98);
}
24 changes: 24 additions & 0 deletions CommonLibSF/include/RE/T/TESImageSpaceModifiableForm.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#pragma once

#include "RE/B/BaseFormComponent.h"

namespace RE
{
class TESImageSpaceModifier;

class TESImageSpaceModifiableForm : public BaseFormComponent
{
public:
SF_RTTI_VTABLE(TESImageSpaceModifiableForm);

~TESImageSpaceModifiableForm() override; // 00

// override (BaseFormComponent)
const BSFixedString& GetFormComponentType() const override; // 01 - { return "TESImageSpaceModifiableForm_Component"; }
void InitializeDataComponent() override; // 02 - { return; }

// members
TESImageSpaceModifier* imageSpaceModifying; // 08 - MNAM
};
static_assert(sizeof(TESImageSpaceModifiableForm) == 0x10);
}
21 changes: 21 additions & 0 deletions CommonLibSF/include/RE/T/TESLevCharacter.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#pragma once

#include "RE/B/BGSModelMaterialSwap.h"
#include "RE/T/TESBoundAnimObject.h"
#include "RE/T/TESLeveledList.h"

namespace RE
{
class TESLevCharacter :
public TESBoundAnimObject, // 000
public TESLeveledList, // 118
public BGSModelMaterialSwap // 178
{
public:
SF_RTTI_VTABLE(TESLevCharacter);
SF_FORMTYPE(LVLN);

~TESLevCharacter() override; // 00
};
static_assert(sizeof(TESLevCharacter) == 0x1A0);
}
23 changes: 23 additions & 0 deletions CommonLibSF/include/RE/T/TESLevItem.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#pragma once

#include "RE/B/BGSForcedLocRefType.h"
#include "RE/B/BGSModelMaterialSwap.h"
#include "RE/T/TESBoundObject.h"
#include "RE/T/TESLeveledList.h"

namespace RE
{
class TESLevItem :
public TESBoundObject, // 000
public TESLeveledList, // 118
public BGSModelMaterialSwap, // 178
public BGSForcedLocRefType // 1A0
{
public:
SF_RTTI_VTABLE(TESLevItem);
SF_FORMTYPE(LVLI);

~TESLevItem() override; // 00
};
static_assert(sizeof(TESLevItem) == 0x1B8);
}
19 changes: 19 additions & 0 deletions CommonLibSF/include/RE/T/TESLevSpell.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#pragma once

#include "RE/T/TESBoundObject.h"
#include "RE/T/TESLeveledList.h"

namespace RE
{
class TESLevSpell :
public TESBoundObject, // 000
public TESLeveledList // 118
{
public:
SF_RTTI_VTABLE(TESLevSpell);
SF_FORMTYPE(LVSP);

~TESLevSpell() override; // 00
};
static_assert(sizeof(TESLevSpell) == 0x178);
}
77 changes: 77 additions & 0 deletions CommonLibSF/include/RE/T/TESLeveledList.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
#pragma once

#include "RE/B/BGSTypedFormValuePair.h"
#include "RE/B/BSTArray.h"
#include "RE/B/BSTTuple3.h"
#include "RE/B/BaseFormComponent.h"
#include "RE/F/FormTypes.h"
#include "RE/T/TESCondition.h"

namespace RE
{
class BGSCurveForm;
class BGSBiome;
class ContainerItemExtra;
class TESForm;
class TESGlobal;

struct LEVELED_OBJECT
{
public:
// members
TESForm* form; // 00
ContainerItemExtra* itemExtra; // 08
TESCondition* conditions; // 10
std::uint16_t count; // 18
std::uint16_t level; // 1A
std::uint8_t unk1C; // 1C
std::uint8_t unk1D; // 1D
};
static_assert(sizeof(LEVELED_OBJECT) == 0x20);

class TESLeveledList : public BaseFormComponent
{
public:
SF_RTTI_VTABLE(TESLeveledList);

enum Flag : std::uint8_t // LVLF
{
kCalculateFromAllLevelsLTOrEqPCLevel = 1 << 0,
kCalculateForEachItemInCount = 1 << 1,
kUseAll = 1 << 2,
kSpecialLoot = 1 << 3
};

~TESLeveledList() override; // 00

// override (BaseFormComponent)
const BSFixedString& GetFormComponentType() const override; // 01 - { return "TESLeveledList_Component"; }
void InitializeDataComponent() override; // 02

// add
virtual std::int32_t GetMaxLevelDifference(); // 0B
virtual bool GetCanHoldForm(TESForm* a_form); // 0C
virtual void Unk_0D(); // 0D
virtual void Unk_0E(); // 0E
virtual void Unk_0F(); // 0F
virtual bool GetCanContainFormsOfType(FormType a_type) const = 0; // 10

// members
TESCondition conditions; // 08
TESGlobal* chanceGlobal; // 10
BGSBiome* biome; // 20 ??
TESForm* unk28; // 28
BSTArray<BSTTuple3<TESForm*, BGSCurveForm, BGSTypedFormValuePair::SharedVal>>* keywordChances; // 30
LEVELED_OBJECT* leveledLists; // 38
LEVELED_OBJECT** scriptAddedLists; // 40
std::int8_t scriptListCount; // 48
std::uint32_t unk4C; // 4C
stl::enumeration<Flag, std::uint8_t> flags; // 50
std::uint8_t unk51; // 51
std::int8_t baseListCount; // 52
std::uint8_t unk53; // 53
std::uint8_t unk54; // 54
BSFixedString overrideName; // 58
};
static_assert(sizeof(TESLeveledList) == 0x60);
}