Skip to content
Open
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
12 changes: 6 additions & 6 deletions include/RE/A/ActiveEffect.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ namespace RE
[[nodiscard]] Actor* GetTargetActor();

// members
ActiveEffectReferenceEffectController hitEffectController; // 0C
ActiveEffectReferenceEffectController hitEffectController; // 10
BSSoundHandle persistentSound; // 30
ActorHandle caster; // 38
NiPointer<NiNode> sourceNode; // 40
Expand All @@ -77,11 +77,11 @@ namespace RE
TESBoundObject* source; // 60
BSSimpleList<ReferenceEffect*>* hitEffects; // 68
MagicItem* displacementSpell; // 70
float elapsedSeconds; // 74
float duration; // 78
float magnitude; // 7C
REX::TEnumSet<Flags, std::uint32_t> flags; // 80
ConditionStatus conditionStatus; // 84
float elapsedSeconds; // 78
float duration; // 7C
float magnitude; // 80
REX::TEnumSet<Flags, std::uint32_t> flags; // 84
ConditionStatus conditionStatus; // 88
std::uint16_t uniqueID; // 8C
MagicSystem::CastingSource castingSource; // 90
};
Expand Down
24 changes: 24 additions & 0 deletions include/RE/A/Actor.h
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,20 @@ namespace RE
return func(this);
}

// The item health an attack reads for the weapon in a_equipIndex, off the
// stack's health extra data, 1.0 for a stack that has none and 0.0 when
// no equipped weapon matches.
//
// It looks up the equip slot without naming an item, which always gives
// the first slot, so it reads the first equipped weapon stack flagged
// kSlotIndex1 whatever a_equipIndex says.
[[nodiscard]] float GetEquippedItemHealth(BGSEquipIndex a_equipIndex) const
{
using func_t = decltype(&Actor::GetEquippedItemHealth);
static REL::Relocation<func_t> func{ ID::Actor::GetEquippedItemHealth };
return func(this, a_equipIndex);
}

bool GetGhost()
{
using func_t = decltype(&Actor::GetGhost);
Expand Down Expand Up @@ -476,6 +490,16 @@ namespace RE
return func(this, a_deltaTime, a_deltaPos, a_defer);
}

// What UseAmmo calls once the magazine in a_equipIndex runs dry. It
// releases the trigger of a gun in the middle of firing, which is what
// stops an automatic weapon at the last round.
void OnMagazineEmpty(BGSEquipIndex a_equipIndex)
{
using func_t = decltype(&Actor::OnMagazineEmpty);
static REL::Relocation<func_t> func{ ID::Actor::OnMagazineEmpty };
return func(this, a_equipIndex);
}

bool PerformAction(BGSAction* a_action, TESObjectREFR* a_target)
{
using func_t = decltype(&Actor::PerformAction);
Expand Down
49 changes: 49 additions & 0 deletions include/RE/A/ActorMagicCaster.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#pragma once

#include "RE/B/BSTEvent.h"
#include "RE/M/MagicCaster.h"
#include "RE/R/RefAttachTechniqueInput.h"
#include "RE/S/SimpleAnimationGraphManagerHolder.h"

namespace RE
{
class BSAnimationGraphEvent;

class __declspec(novtable) ActorMagicCaster :
public MagicCaster, // 00
public SimpleAnimationGraphManagerHolder, // 48
public BSTEventSink<BSAnimationGraphEvent> // 60
{
public:
static constexpr auto RTTI{ RTTI::ActorMagicCaster };
static constexpr auto VTABLE{ VTABLE::ActorMagicCaster };

~ActorMagicCaster() override; // 00

// override (MagicCaster)
bool CheckCast(MagicItem* a_spell, bool a_dualCast, float* a_effectiveness, MagicSystem::CannotCastReason* a_reason, bool a_arg5) override; // 0B
TESObjectREFR* GetCasterStatsObject() const override; // 0C
Actor* GetCasterAsActor() const override; // 0D
NiNode* GetMagicNode() override; // 0F
void ClearMagicNode() override; // 10
MagicSystem::CastingSource GetCastingSource() const override; // 16
bool GetIsDualCasting() const override; // 17
void SetDualCasting(bool a_dualCasting) override; // 18
void AdjustActiveEffect(ActiveEffect* a_effect, float a_power, bool a_hostileEffectivenessOnly) override; // 1D

// members
RefAttachTechniqueInput unk68; // 68
std::uint64_t unkB0; // B0
Actor* actor; // B8
NiNode* magicNode; // C0
std::uint64_t unkC8; // C8
std::uint64_t unkD0; // D0
std::uint64_t unkD8; // D8
std::uint64_t unkE0; // E0
std::uint64_t unkE8; // E8
std::uint32_t unkF0; // F0
MagicSystem::CastingSource castingSource; // F4
std::uint32_t flags; // F8
};
static_assert(sizeof(ActorMagicCaster) == 0x100);
}
16 changes: 16 additions & 0 deletions include/RE/B/BGSAudio.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ namespace RE
{
class BGSSoundDescriptorForm;
class BGSSoundOutput;
class NiAVObject;
class NiPoint3;

class BGSAudio
{
Expand All @@ -21,5 +23,19 @@ namespace RE
static REL::Relocation<func_t> func{ ID::BGSAudio::GetUIOutputModel };
return func();
}

// Plays a sound once. The last two arguments say where it plays from:
// a_objectToFollow the sound moves with this object
// a_position the sound stays at this point
// neither the sound plays from nowhere, like the click of
// an empty gun
// If both are given, the object wins. The game always adds 0x10 to
// a_usageFlags.
static void PlaySoundDescriptor(BGSSoundDescriptorForm* a_descriptor, std::uint32_t a_usageFlags, const NiPoint3* a_position, NiAVObject* a_objectToFollow)
{
using func_t = decltype(&BGSAudio::PlaySoundDescriptor);
static REL::Relocation<func_t> func{ ID::BGSAudio::PlaySoundDescriptor };
return func(a_descriptor, a_usageFlags, a_position, a_objectToFollow);
}
};
}
2 changes: 1 addition & 1 deletion include/RE/B/BGSComponent.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace RE

// members
TESObjectMISC* scrapItem; // 98
TESGlobal* modScrapScalar; // 90
TESGlobal* modScrapScalar; // A0
};
static_assert(sizeof(BGSComponent) == 0xA8);
}
5 changes: 2 additions & 3 deletions include/RE/B/BGSDefaultObjectManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ namespace RE

[[nodiscard]] static BGSDefaultObjectManager* GetSingleton()
{
using func_t = decltype(&BGSDefaultObjectManager::GetSingleton);
static REL::Relocation<func_t> func{ ID::BGSDefaultObjectManager::Singleton };
return func();
static REL::Relocation<BGSDefaultObjectManager*> singleton{ ID::BGSDefaultObjectManager::Singleton };
return singleton.get();
}

[[nodiscard]] TESForm* GetDefaultObject(DEFAULT_OBJECT a_obj) const noexcept
Expand Down
16 changes: 16 additions & 0 deletions include/RE/B/BGSInventoryList.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,22 @@ namespace RE
AddItem2(a_object, a_count, new ExtraDataList(), a_flags);
}

// Adds a copy of a_stack, a stack of a_object, to the list. It joins a
// stack of the same object whose extra data matches, which is how
// identical items come to share one stack and a count, and goes in as a
// stack of its own otherwise. a_oldCount and a_newCount, when given,
// receive the count of the stack it went into before and after.
//
// AddItem1 and AddItem2 add through it, and so does filling a list from a
// container, for each entry whose base form has an object template. All
// three hold the list's write lock.
void AddStack(TESBoundObject* a_object, BGSInventoryItem::Stack* a_stack, std::uint32_t* a_oldCount = nullptr, std::uint32_t* a_newCount = nullptr)
{
using func_t = decltype(&BGSInventoryList::AddStack);
static REL::Relocation<func_t> func{ ID::BGSInventoryList::AddStack };
return func(this, a_object, a_stack, a_oldCount, a_newCount);
}

inline void BuildFromContainer(const TESContainer* a_container)
{
using func_t = decltype(&BGSInventoryList::BuildFromContainer);
Expand Down
13 changes: 13 additions & 0 deletions include/RE/B/BGSLocalizedString.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,19 @@ namespace RE
};
static_assert(sizeof(BGSLocalizedStringDL) == 0x4);

class BGSLocalizedStringIL
{
public:
// Sets a_text to string a_id from a_file's .ILSTRINGS file, in the
// game's current language. An a_id of 0 gives an empty string.
static void LookupByID(BSFixedStringCS& a_text, const TESFile* a_file, std::uint32_t a_id)
{
using func_t = decltype(&BGSLocalizedStringIL::LookupByID);
static REL::Relocation<func_t> func{ ID::BGSLocalizedStringIL::LookupByID };
return func(a_text, a_file, a_id);
}
};

class BGSLocalizedString
{
public:
Expand Down
12 changes: 12 additions & 0 deletions include/RE/B/BipedAnim.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include "RE/B/BIPED_OBJECT.h"
#include "RE/B/BIPOBJECT.h"
#include "RE/B/BSFixedString.h"
#include "RE/B/BSIntrusiveRefCounted.h"
#include "RE/B/BSPointerHandle.h"

Expand Down Expand Up @@ -33,6 +34,17 @@ namespace RE
return root;
}

// Sets a whole number variable on the animation graph of the model in one
// biped slot. False when the slot has no graph or the graph refuses it.
// UseAmmo tells a gun's own graph how many rounds are left this way,
// through iWeaponCharge on kWeaponGun.
bool SetObjectGraphVariableInt(BIPED_OBJECT a_bipedObject, const BSFixedString& a_variable, std::int32_t a_value)
{
using func_t = decltype(&BipedAnim::SetObjectGraphVariableInt);
static REL::Relocation<func_t> func{ ID::BipedAnim::SetObjectGraphVariableInt };
return func(this, a_bipedObject, a_variable, a_value);
}

// members
NiNode* root; // 0008
BIPOBJECT object[std::to_underlying(BIPED_OBJECT::kTotal)]; // 0010
Expand Down
11 changes: 11 additions & 0 deletions include/RE/C/Console.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,17 @@ namespace RE
return func(a_command);
}

// Runs the commands ExecuteCommand has queued. ExecuteCommand only parses
// what was typed and puts it in a queue, and the game's update drains
// the queue through this, the ForEachRef form included, so everything a
// console command does happens inside this call and on its thread.
static void RunQueuedCommands()
{
using func_t = decltype(&Console::RunQueuedCommands);
static REL::Relocation<func_t> func{ ID::Console::RunQueuedCommands };
return func();
}

[[nodiscard]] static decltype(auto) GetCurrentPickIndex()
{
static REL::Relocation<std::int32_t*> currentPickIndex{ ID::Console::GetCurrentPickIndex };
Expand Down
13 changes: 13 additions & 0 deletions include/RE/E/Explosion.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,19 @@ namespace RE
return func(this);
}

// Deals the blast to each target FindTargets gathered that is not
// kProcessed yet, marks it so, and marks the explosion
// kTargetsProcessed. An actor is struck with a blow filled in from the
// explosion, unless the explosion is kNonHostile, and has the
// explosion's object effect cast on it. Anything else takes the blast's
// damage.
void ProcessTargets()
{
using func_t = decltype(&Explosion::ProcessTargets);
static REL::Relocation<func_t> func{ ID::Explosion::ProcessTargets };
return func(this);
}

// members
hknpClosestUniqueBodyIdHitCollector collector; // 110
void* explosionDBHandle; // 520 - TODO
Expand Down
20 changes: 20 additions & 0 deletions include/RE/E/ExtraMagicCaster.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#pragma once

#include "RE/B/BSExtraData.h"
#include "RE/M/MagicCaster.h"

namespace RE
{
class __declspec(novtable) ExtraMagicCaster :
public BSExtraData, // 00
public MagicCaster // 18
{
public:
static constexpr auto RTTI{ RTTI::ExtraMagicCaster };
static constexpr auto VTABLE{ VTABLE::ExtraMagicCaster };
static constexpr auto TYPE{ EXTRA_DATA_TYPE::kMagicCaster };

~ExtraMagicCaster() override; // 00
};
static_assert(sizeof(ExtraMagicCaster) == 0x60);
}
7 changes: 7 additions & 0 deletions include/RE/Fallout.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include "RE/A/ActorEquipManagerEvent.h"
#include "RE/A/ActorItemEquipped.h"
#include "RE/A/ActorKill.h"
#include "RE/A/ActorMagicCaster.h"
#include "RE/A/ActorMotionFeedbackData.h"
#include "RE/A/ActorMovementData.h"
#include "RE/A/ActorPackage.h"
Expand Down Expand Up @@ -701,6 +702,7 @@
#include "RE/E/ExtraLinkedRefChildren.h"
#include "RE/E/ExtraLocation.h"
#include "RE/E/ExtraLock.h"
#include "RE/E/ExtraMagicCaster.h"
#include "RE/E/ExtraMapMarker.h"
#include "RE/E/ExtraMaterialSwap.h"
#include "RE/E/ExtraOutfitItem.h"
Expand Down Expand Up @@ -753,6 +755,7 @@
#include "RE/G/GunStateData.h"
#include "RE/H/HUDColorTypes.h"
#include "RE/H/HUDCompassMarkerBase.h"
#include "RE/H/HUDComponentBase.h"
#include "RE/H/HUDMarkerData.h"
#include "RE/H/HUDMenu.h"
#include "RE/H/HUDMenuUtils.h"
Expand All @@ -764,6 +767,7 @@
#include "RE/H/HUDNotificationEvent.h"
#include "RE/H/HUDPerkVaultBoyData.h"
#include "RE/H/HUDPerkVaultBoySwfDisplayEvent.h"
#include "RE/H/HUDQuickContainerDataModel.h"
#include "RE/H/HUDSubtitleDisplayData.h"
#include "RE/H/HUDSubtitleDisplayEvent.h"
#include "RE/H/Hazard.h"
Expand Down Expand Up @@ -985,7 +989,9 @@
#include "RE/M/MENU_RENDER_CONTEXT.h"
#include "RE/M/MESSAGEBOX_BUTTON.h"
#include "RE/M/MOVABLE_STATIC_DATA.h"
#include "RE/M/MagicCaster.h"
#include "RE/M/MagicItem.h"
#include "RE/M/MagicSystem.h"
#include "RE/M/MagicTarget.h"
#include "RE/M/Main.h"
#include "RE/M/MainMenu.h"
Expand Down Expand Up @@ -1089,6 +1095,7 @@
#include "RE/N/NiTransform.h"
#include "RE/N/NiUpdateData.h"
#include "RE/N/NiVisibleArray.h"
#include "RE/N/NonActorMagicCaster.h"
#include "RE/N/NonMorphFaceManagement.h"
#include "RE/N/nsHUDNotifications.h"
#include "RE/N/nsHUDTypes.h"
Expand Down
12 changes: 12 additions & 0 deletions include/RE/G/GamePlayFormulas.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,18 @@ namespace RE
return func(a_itemHealth);
}

// Turns an item's base value into the price the player sees. While a
// barter screen is open every price the game works out comes through
// here with the trader's markup put on, from the player's Charisma.
// a_health only counts when the fHealthDataValue6 game setting is above
// 1.0, and Fallout4.esm does not define it.
inline float CalculateItemValue(float a_baseValue, float a_health)
{
using func_t = decltype(&GamePlayFormulas::CalculateItemValue);
static REL::Relocation<func_t> func{ ID::GamePlayFormulas::CalculateItemValue };
return func(a_baseValue, a_health);
}

inline float CalcSprintingActionPoints(float a_equippedWeight, float a_elapsedTime, float a_endurance)
{
using func_t = decltype(&GamePlayFormulas::CalcSprintingActionPoints);
Expand Down
31 changes: 31 additions & 0 deletions include/RE/H/HUDComponentBase.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#pragma once

#include "RE/B/BSGFxShaderFXTarget.h"
#include "RE/H/HUDModes.h"

namespace RE
{
// The base class of every element of the gameplay HUD, such as the ammo
// counter. HUDMenu keeps them in hudObjects.
class __declspec(novtable) HUDComponentBase :
public BSGFxShaderFXTarget // 00
{
public:
static constexpr auto RTTI{ RTTI::HUDComponentBase };
static constexpr auto VTABLE{ VTABLE::HUDComponentBase };

~HUDComponentBase() override; // 00

// members
std::uint64_t unkB0; // B0
std::uint64_t unkB8; // B8
bool unkC0; // C0
HUDModes hudModes; // C8
float unkE8; // E8
float unkEC; // EC
bool unkF0; // F0
bool unkF1; // F1
bool unkF2; // F2
};
static_assert(sizeof(HUDComponentBase) == 0xF8);
}
Loading