Skip to content

Commit 93db123

Browse files
committed
Merge branch 'main' of https://github.com/libxse/commonlibf4 into dev/havok
2 parents 2e82782 + de5a57b commit 93db123

23 files changed

Lines changed: 264 additions & 18 deletions

include/RE/A/AIFormulas.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,12 @@ namespace RE
1010
static REL::Relocation<func_t> func{ ID::AIFormulas::GetBarterValue };
1111
return func(a_baseValue, a_charisma, a_selling, a_refTarget);
1212
}
13+
14+
inline std::uint32_t ComputePickpocketSuccess(float a_thiefSkill, float a_targetSkill, std::int32_t a_valueStolen, float a_weightStolen, Actor* a_thief, Actor* a_target, TESForm* a_itemPickpocketing, bool a_placingItem)
15+
{
16+
using func_t = decltype(&AIFormulas::ComputePickpocketSuccess);
17+
static REL::Relocation<func_t> func{ ID::AIFormulas::ComputePickpocketSuccess };
18+
return func(a_thiefSkill, a_targetSkill, a_valueStolen, a_weightStolen, a_thief, a_target, a_itemPickpocketing, a_placingItem);
19+
}
1320
}
1421
}

include/RE/A/AIProcess.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,13 @@ namespace RE
170170
return func(this);
171171
}
172172

173+
float GetActorLightLevel()
174+
{
175+
using func_t = decltype(&AIProcess::GetActorLightLevel);
176+
static REL::Relocation<func_t> func{ ID::AIProcess::GetActorLightLevel };
177+
return func(this);
178+
}
179+
173180
// members
174181
MiddleLowProcessData* middleLow; // 00
175182
MiddleHighProcessData* middleHigh; // 08

include/RE/A/Actor.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ namespace RE
4848
class CastPowerItem;
4949
class CombatController;
5050
class CombatGroup;
51+
class DetectionData;
52+
class HitData;
5153
class MovementControllerNPC;
5254
class MovementMessageActorCollision;
5355
class MovementMessageNewPath;
@@ -599,6 +601,20 @@ namespace RE
599601
return func(this, a_instance, a_moveActor, a_update3D);
600602
}
601603

604+
void CalculateDetectionFormula(Actor* a_target, DetectionData* a_detectionData)
605+
{
606+
using func_t = decltype(&Actor::CalculateDetectionFormula);
607+
static REL::Relocation<func_t> func{ ID::Actor::CalculateDetectionFormula };
608+
return func(this, a_target, a_detectionData);
609+
}
610+
611+
void DoHitMe(const HitData* a_data)
612+
{
613+
using func_t = decltype(&Actor::DoHitMe);
614+
static REL::Relocation<func_t> func{ ID::Actor::DoHitMe };
615+
return func(this, a_data);
616+
}
617+
602618
// members
603619
NiTFlags<std::uint32_t, Actor> niFlags; // 2D0
604620
float updateTargetTimer; // 2D4

include/RE/B/BGSColorForm.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ namespace RE
1515
static constexpr auto VTABLE{ VTABLE::BGSColorForm };
1616
static constexpr auto FORM_ID{ ENUM_FORM_ID::kCLFM };
1717

18+
enum class Flags : std::int32_t
19+
{
20+
kPlayable = 0x1,
21+
kRemappingIndex = 0x2
22+
};
23+
1824
// members
1925
union
2026
{

include/RE/C/CombatFormulas.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,12 @@ namespace RE
5555
static REL::Relocation<func_t> func{ ID::CombatFormulas::CalcScopeSteadyActionPointDrain };
5656
return func(a_actor, a_deltaSec);
5757
}
58+
59+
[[nodiscard]] inline float CalcResistedPercentage(const ActorValueInfo* a_resistance, float a_damage, float a_resistancePoints)
60+
{
61+
using func_t = decltype(&CombatFormulas::CalcResistedPercentage);
62+
static REL::Relocation<func_t> func{ ID::CombatFormulas::CalcResistedPercentage };
63+
return func(a_resistance, a_damage, a_resistancePoints);
64+
}
5865
}
5966
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#pragma once
2+
3+
namespace RE
4+
{
5+
enum class DETECTION_FORMULA_TYPE : std::uint32_t
6+
{
7+
kFormula = 0x0,
8+
kRange = 0x1,
9+
kVisual_Range = 0x2,
10+
kSound_Range = 0x3,
11+
};
12+
}

include/RE/D/DETECTION_TYPE.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#pragma once
2+
3+
namespace RE
4+
{
5+
enum class DETECTION_TYPE
6+
{
7+
kNormal = 0,
8+
kProjectile = 1,
9+
kEvent = 2,
10+
kTotal = 3
11+
};
12+
}

include/RE/D/DetectionData.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#pragma once
2+
3+
#include "RE/D/DetectionFormulaData.h"
4+
#include "RE/D/DetectionLevels.h"
5+
#include "RE/N/NiPoint.h"
6+
7+
namespace RE
8+
{
9+
enum class DETECTION_TYPE;
10+
11+
class DetectionData :
12+
public DetectionFormulaData // 00
13+
{
14+
public:
15+
// members
16+
NiPoint3 detectedLocation; // 74
17+
DetectionLevels detectionLevel; // 80
18+
DETECTION_TYPE detectionType; // 84
19+
};
20+
static_assert(sizeof(DetectionData) == 0x88);
21+
}
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#pragma once
2+
3+
#include "RE/A/ACTOR_LOS_LOCATION.h"
4+
#include "RE/A/AITimeStamp.h"
5+
6+
namespace RE
7+
{
8+
class DetectionFormulaData
9+
{
10+
public:
11+
// members
12+
ACTOR_LOS_LOCATION losLocation; // 00
13+
AITimeStamp timeStamp; // 04
14+
std::uint32_t ambush; // 08
15+
std::uint32_t targetRaceSize; // 0C
16+
std::uint32_t targetActionSound; // 10
17+
float lightLevel; // 14
18+
float modifiedLightLevel; // 18
19+
float visualDetectionDistance; // 1C
20+
float soundDetectionDistance; // 20
21+
float perception; // 24
22+
float basePerception; // 28
23+
float blindness; // 2C
24+
float deafness; // 30
25+
float targetDistance; // 34
26+
float targetAngle; // 38
27+
float targetVerticalAngle; // 3C
28+
float targetAgility; // 40
29+
float targetSneakSkill; // 44
30+
float targetBaseStealth; // 48
31+
float targetEquippedWeight; // 4C
32+
float targetMovementNoiseMult; // 50
33+
float targetStealth; // 54
34+
float targetVisibility; // 58
35+
float visualDetectionLevel; // 5C
36+
float soundDetectionLevel; // 60
37+
bool LOS; // 64
38+
bool LOS360; // 65
39+
bool exterior; // 66
40+
bool alert; // 67
41+
bool sleeping; // 68
42+
bool nightEye; // 69
43+
bool targetMoving; // 6A
44+
bool targetRunning; // 6B
45+
bool targetSneaking; // 6C
46+
bool targetInvisible; // 6D
47+
bool targetInCover; // 6E
48+
bool targetObserved; // 6F
49+
bool combatTarget; // 70
50+
bool flying; // 71
51+
};
52+
static_assert(sizeof(DetectionFormulaData) == 0x74);
53+
}

include/RE/D/DialogueMenu.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ namespace RE
2121
// Members
2222
std::unique_ptr<BSGFxShaderFXTarget> dialogueButtonOBJs[4];
2323
std::unique_ptr<BSGFxShaderFXTarget> speechChallengeAnimObj;
24-
BSTValueEventSink<HUDPerkVaultBoySwfDisplayEvent> CurrentVBPerk;
25-
BSTValueEventSource<ShowingDialogueSpeechChallengeAnim> ShowingSpeechChallenge;
24+
BSTValueEventSink<HUDPerkVaultBoySwfDisplayEvent> currentVBPerk;
25+
BSTValueEventSource<ShowingDialogueSpeechChallengeAnim> showingSpeechChallenge;
2626
BSTSmartPointer<BSInputEnableLayer> inputLayer;
27-
UserEvents::INPUT_CONTEXT_ID CurrentContext;
28-
bool IsLookingAtPlayer;
29-
bool AreButtonsShown;
27+
UserEvents::INPUT_CONTEXT_ID currentContext;
28+
bool isLookingAtPlayer;
29+
bool areButtonsShown;
3030
};
3131
static_assert(sizeof(DialogueMenu) == 0x168);
3232
}

0 commit comments

Comments
 (0)