CommonLibSSE NG
GrenadeProjectile.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/F/FormTypes.h"
4 #include "RE/P/Projectile.h"
5 
6 namespace RE
7 {
8  struct BGSDecalGroup;
9 
11  {
12  public:
13  inline static constexpr auto RTTI = RTTI_GrenadeProjectile;
14  inline static constexpr auto VTABLE = VTABLE_GrenadeProjectile;
15  inline static constexpr auto FORMTYPE = FormType::ProjectileGrenade;
16 
17  struct RecordFlags
18  {
19  enum RecordFlag : std::uint32_t
20  {
21  };
22  };
23 
24  ~GrenadeProjectile() override; // 00
25 
26  // override (Projectile)
27  void SaveGame(BGSSaveFormBuffer* a_buf) override; // 0E
28  void LoadGame(BGSLoadFormBuffer* a_buf) override; // 0F
29  void InitLoadGame(BGSLoadFormBuffer* a_buf) override; // 10
30  void FinishLoadGame(BGSLoadFormBuffer* a_buf) override; // 11
31  void Revert(BGSLoadFormBuffer* a_buf) override; // 12
32 #ifndef SKYRIM_CROSS_VR
33  // Override functions past where Skyrim VR breaks compatibility.
34  [[nodiscard]] BGSDecalGroup* GetDecalGroup() const override; // 9F - { return decalGroup; }
35  bool IsGrenadeProjectile() override; // A3 - { return 1; }
36  void OnKill() override; // A8
37  void Process3D() override; // A9
38  void UpdateImpl(float a_delta) override; // AB
39  void Unk_AE(void) override; // AE
40  void ReportHavokDeactivation() override; // B2
41  bool TurnOff(Actor* a_owner, bool a_noDeactivateSound) override; // B3
42  [[nodiscard]] bool IsPermanent() const override;
43  bool TargetsWholeBody() override; // BA - { return 1; }
44  std::uint32_t GetCollisionGroup() override; // BB
45  void AddImpact(TESObjectREFR* a_ref, const NiPoint3& a_targetLoc, const NiPoint3& a_velocity, hkpCollidable* a_collidable, std::int32_t a_arg6, std::uint32_t a_arg7) override; // BD
46  void OnTriggerEnter() override; // BF - { flags |= 1 << 30; }
47  void Handle3DLoaded() override; // C0
48 #endif
49 
51  {
52 #define GRENADE_RUNTIME_DATA_CONTENT \
53  BGSDecalGroup* decalGroup; /* 1D8 */ \
54  bool collisionGroupReset; /* 1E0 */ \
55  std::uint8_t pad1E1; /* 1E1 */ \
56  std::uint16_t pad1E2; /* 1E2 */ \
57  std::uint32_t pad1E4; /* 1E4 */
58 
60  };
61 
62  [[nodiscard]] inline GRENADE_RUNTIME_DATA& GetGrenadeRuntimeData() noexcept
63  {
64  return REL::RelocateMemberIfNewer<GRENADE_RUNTIME_DATA>(SKSE::RUNTIME_SSE_1_6_629, this, 0x1D8, 0x1E0);
65  }
66 
67  [[nodiscard]] inline const GRENADE_RUNTIME_DATA& GetGrenadeRuntimeData() const noexcept
68  {
69  return REL::RelocateMemberIfNewer<GRENADE_RUNTIME_DATA>(SKSE::RUNTIME_SSE_1_6_629, this, 0x1D8, 0x1E0);
70  }
71 
72  // members
73 #ifndef ENABLE_SKYRIM_AE
75 #endif
76  };
77 #ifndef ENABLE_SKYRIM_AE
78  static_assert(sizeof(GrenadeProjectile) == 0x1E8);
79 #endif
80 }
81 #undef GRENADE_RUNTIME_DATA_CONTENT
#define GRENADE_RUNTIME_DATA_CONTENT
Definition: GrenadeProjectile.h:52
Definition: Actor.h:135
Definition: BGSLoadFormBuffer.h:11
Definition: BGSSaveFormBuffer.h:8
Definition: GrenadeProjectile.h:11
void SaveGame(BGSSaveFormBuffer *a_buf) override
void InitLoadGame(BGSLoadFormBuffer *a_buf) override
const GRENADE_RUNTIME_DATA & GetGrenadeRuntimeData() const noexcept
Definition: GrenadeProjectile.h:67
void LoadGame(BGSLoadFormBuffer *a_buf) override
GRENADE_RUNTIME_DATA & GetGrenadeRuntimeData() noexcept
Definition: GrenadeProjectile.h:62
bool IsGrenadeProjectile() override
~GrenadeProjectile() override
void AddImpact(TESObjectREFR *a_ref, const NiPoint3 &a_targetLoc, const NiPoint3 &a_velocity, hkpCollidable *a_collidable, std::int32_t a_arg6, std::uint32_t a_arg7) override
void Process3D() override
std::uint32_t GetCollisionGroup() override
void OnKill() override
bool IsPermanent() const override
BGSDecalGroup * GetDecalGroup() const override
bool TargetsWholeBody() override
bool TurnOff(Actor *a_owner, bool a_noDeactivateSound) override
void UpdateImpl(float a_delta) override
static constexpr auto RTTI
Definition: GrenadeProjectile.h:13
void FinishLoadGame(BGSLoadFormBuffer *a_buf) override
void ReportHavokDeactivation() override
static constexpr auto VTABLE
Definition: GrenadeProjectile.h:14
void Revert(BGSLoadFormBuffer *a_buf) override
void Unk_AE(void) override
void OnTriggerEnter() override
void Handle3DLoaded() override
static constexpr auto FORMTYPE
Definition: GrenadeProjectile.h:15
Definition: NiPoint3.h:6
Definition: Projectile.h:30
Definition: TESObjectREFR.h:113
Definition: hkpCollidable.h:13
Definition: AbsorbEffect.h:6
constexpr std::array< REL::VariantID, 4 > VTABLE_GrenadeProjectile
Definition: Offsets_VTABLE.h:2782
constexpr REL::VariantID RTTI_GrenadeProjectile(687506, 395356, 0x1f1b3a0)
constexpr REL::Version RUNTIME_SSE_1_6_629(1, 6, 629, 0)
Definition: BGSDecalGroup.h:61
Definition: GrenadeProjectile.h:51
Definition: GrenadeProjectile.h:18
RecordFlag
Definition: GrenadeProjectile.h:20