Skip to content

Commit 84c9034

Browse files
authored
feat: Functions and IDs. (#39)
* feat: `TESObjectARMO` function `Protects` declared. * feat: 2 function declarations. * chore: Update a few IDs.
1 parent 41442d8 commit 84c9034

4 files changed

Lines changed: 32 additions & 3 deletions

File tree

include/RE/B/BGSInventoryItem.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,13 @@ namespace RE
219219
return func(this);
220220
}
221221

222+
bool IsEquipped(std::uint32_t a_stackID)
223+
{
224+
using func_t = decltype(&BGSInventoryItem::IsEquipped);
225+
static REL::Relocation<func_t> func{ ID::BGSInventoryItem::IsEquipped };
226+
return func(this, a_stackID);
227+
}
228+
222229
// members
223230
TESBoundObject* object; // 00
224231
BSTSmartPointer<Stack> stackData; // 08

include/RE/C/CombatFormulas.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,12 @@ namespace RE
3434
static REL::Relocation<func_t> func{ ID::CombatFormulas::GetWeaponDisplayRateOfFire };
3535
return func(a_weapon, a_data);
3636
}
37+
38+
[[nodiscard]] inline float CalcTargetedLimbDamage(Actor* a_target, const BGSBodyPart* a_bodyPart, float a_physicalDamage, BSTArray<BSTTuple<TESForm*, BGSTypedFormValuePair::SharedVal>, BSTArrayHeapAllocator>* a_damageTypes)
39+
{
40+
using func_t = decltype(&CombatFormulas::CalcTargetedLimbDamage);
41+
static REL::Relocation<func_t> func{ ID::CombatFormulas::CalcWeaponDamage };
42+
return func(a_target, a_bodyPart, a_physicalDamage, a_damageTypes);
43+
}
3744
}
3845
}

include/RE/IDs.h

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ namespace RE::ID
185185
inline constexpr REL::ID GetInventoryValue{ 2194099 };
186186
inline constexpr REL::ID GetExtraDataAt{ 2194092 };
187187
inline constexpr REL::ID MergeStacks{ 2194109 };
188+
inline constexpr REL::ID IsEquipped{ 2194086 };
188189
}
189190

190191
namespace BGSInventoryList
@@ -726,9 +727,11 @@ namespace RE::ID
726727
namespace CombatFormulas
727728
{
728729
inline constexpr REL::ID GetWeaponDisplayAccuracy{ 2209049 };
729-
inline constexpr REL::ID GetWeaponDisplayDamage{ 1431014 };
730-
inline constexpr REL::ID GetWeaponDisplayRange{ 1324037 };
731-
inline constexpr REL::ID GetWeaponDisplayRateOfFire{ 1403591 };
730+
inline constexpr REL::ID GetWeaponDisplayDamage{ 2209046 };
731+
inline constexpr REL::ID GetWeaponDisplayRange{ 2209047 };
732+
inline constexpr REL::ID GetWeaponDisplayRateOfFire{ 2209048 };
733+
inline constexpr REL::ID CalcTargetedLimbDamage{ 2209033 };
734+
inline constexpr REL::ID CalcWeaponDamage{ 2209001 };
732735
}
733736

734737
namespace CombatUtilities
@@ -1720,6 +1723,11 @@ namespace RE::ID
17201723
inline constexpr REL::ID SetHairColor{ 2207426 };
17211724
}
17221725

1726+
namespace TESObjectARMO
1727+
{
1728+
inline constexpr REL::ID Protects{ 2198535 };
1729+
}
1730+
17231731
namespace TESObjectCELL
17241732
{
17251733
inline constexpr REL::ID GetbhkWorld{ 2200260 };

include/RE/T/TESObjectARMO.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,13 @@ namespace RE
7575
};
7676
static_assert(sizeof(ArmorAddon) == 0x10);
7777

78+
bool Protects(const ActorValueInfo* a_condition, bool a_only)
79+
{
80+
using func_t = decltype(&TESObjectARMO::Protects);
81+
static REL::Relocation<func_t> func{ ID::TESObjectARMO::Protects };
82+
return func(this, a_condition, a_only);
83+
}
84+
7885
// members
7986
InstanceData armorData; // 250
8087
BSTArray<ArmorAddon> modelArray; // 2A8

0 commit comments

Comments
 (0)