CommonLibSSE (powerof3)
Projectile.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/B/BSAtomic.h"
4 #include "RE/B/BSPointerHandle.h"
5 #include "RE/B/BSSoundHandle.h"
6 #include "RE/B/BSTList.h"
7 #include "RE/F/FormTypes.h"
8 #include "RE/M/MagicSystem.h"
9 #include "RE/N/NiSmartPointer.h"
10 #include "RE/T/TESObjectREFR.h"
11 
12 namespace RE
13 {
14  class bhkCollisionObject;
15  class bhkSimpleShapePhantom;
16  class QueuedFile;
17 
18  class Projectile : public TESObjectREFR
19  {
20  public:
21  inline static constexpr auto RTTI = RTTI_Projectile;
22 
23  struct ImpactData
24  {
25  public:
26  // members
27  std::uint64_t unk00; // 00
28  std::uint64_t unk08; // 08
29  std::uint64_t unk10; // 10
32  std::uint64_t unk28; // 28
33  std::uint64_t unk30; // 30
34  std::uint64_t unk38; // 38
35  std::uint64_t unk40; // 40
36  std::uint64_t unk48; // 48
37  };
38  static_assert(sizeof(ImpactData) == 0x50);
39 
40  ~Projectile() override; // 00
41 
42  // override (TESObjectREFR)
43  bool Load(TESFile* a_mod) override; // 06 - { return TESObjectREFR::Load(a_mod); }
44  void SaveGame(BGSSaveFormBuffer* a_buf) override; // 0E
45  void LoadGame(BGSLoadFormBuffer* a_buf) override; // 0F
46  void InitLoadGame(BGSLoadFormBuffer* a_buf) override; // 10
47  void FinishLoadGame(BGSLoadFormBuffer* a_buf) override; // 11
48  void Revert(BGSLoadFormBuffer* a_buf) override; // 12
49  bool GetAllowPromoteToPersistent() const override; // 47 - { return false; }
50  bool HasKeywordHelper(const BGSKeyword* a_keyword) const override; // 48
51  void SetActorCause(ActorCause* a_cause) override; // 50 - { actorCause = a_cause; }
52  ActorCause* GetActorCause() const override; // 51 - { return actorCause; }
54  bool DetachHavok(NiAVObject* a_obj3D) override; // 65
55  void InitHavok() override; // 66
56  NiAVObject* Load3D(bool a_backgroundLoading) override; // 6A
57  void Set3D(NiAVObject* a_object, bool a_queue3DTasks = true) override; // 6C
58  void MoveHavok(bool a_forceRec) override; // 85 - { return; }
59  void GetLinearVelocity(NiPoint3& a_velocity) const override; // 86
60  void Unk_8B(void) override; // 8B
61  Projectile* AsProjectile() override; // 8F - { return this; }
62  bool OnAddCellPerformQueueReference(TESObjectCELL& a_cell) const override; // 90 - { return false; }
63 
64  // add
65  virtual void Unk_A2(void); // A2 - { return 0; }
66  virtual void Unk_A3(void); // A3 - { return 0; }
67  virtual void Unk_A4(void); // A4 - { return 0; }
68  virtual void Unk_A5(void); // A5 - { return 0; }
69  virtual void Unk_A6(void); // A6 - { return 0; }
70  virtual void Unk_A7(void); // A7 - { return 0; }
71  virtual void Unk_A8(void); // A8 - { return; }
72  virtual void Unk_A9(void); // A9 - { return; }
73  virtual void Unk_AA(void); // AA
74  virtual void UpdateImpl(float a_delta) = 0; // AB
75  virtual void Unk_AC(void); // AC
76  virtual void Unk_AD(void); // AD
77  virtual void Unk_AE(void); // AE - { return 0; }
78  virtual void Unk_AF(void); // AF - { if (unk158) return 1.0; else return unk188; } - "float GetSpeed()"?
79  virtual void Unk_B0(void); // B0 - { return 1.0; }
80  virtual void Unk_B1(void); // B1 - { return 0; }
81  virtual void Unk_B2(void); // B2 - { return; }
82  virtual void Unk_B3(void); // B3
83  virtual bool IsNotGeneratedForm() const; // B4 - { return TESDataHandler::GetSingleton()->IsGeneratedFormID(formID) == 0; }
84  virtual void Unk_B5(void); // B5 - { void* var = unk40; if ((var->unk80 >> 17) & 1) return 1.0; else return var->unk84; }
85  virtual void Unk_B6(void); // B6
86  virtual void Unk_B7(void); // B7
87  virtual void Unk_B8(void); // B8 - { return 1; }
88  virtual void Unk_B9(void); // B9 - { return 0; }
89  virtual void Unk_BA(void); // BA - { return 0; }
90  virtual void Unk_BB(void); // BB
91  virtual void Unk_BC(void); // BC
92  virtual void Unk_BD(void); // BD
93  virtual void Unk_BE(void); // BE
94  virtual void Unk_BF(void); // BF - { return; }
95  virtual void Handle3DLoaded(); // C0 - { return; }
96  virtual void Unk_C1(void); // C1 - { return 0; }
97 
98  // members
100  float unk0A8; // 0A8
101  float unk0AC; // 0AC
102  std::uint64_t unk0B0; // 0B0
103  float unk0B8; // 0B8
104  float unk0BC; // 0BC
105  std::uint64_t unk0C0; // 0C0
106  float unk0C8; // 0C8
107  float unk0CC; // 0CC
108  std::uint64_t unk0D0; // 0D0
109  float unk0D8; // 0D8
110  float unk0DC; // 0DC
111  bhkSimpleShapePhantom* unk0E0; // 0E0 - smart ptr
112  mutable BSSpinLock unk0E8; // 0E8
113  NiPoint3 unk0F0; // 0F0
114  float unk0FC; // 0FC
115  float unk100; // 100
116  float unk104; // 104
117  void* unk108; // 108 - smart ptr
118  void* unk110; // 110 - smart ptr
124  std::uint32_t* unk140; // 140
127  MagicItem* spell; // 158
129  std::uint32_t pad164; // 164
132  std::uint64_t unk178; // 178
133  std::uint64_t unk180; // 180
134  float unk188; // 188
135  float unk18C; // 18C
136  float range; // 190
137  std::uint32_t unk194; // 194
138  float unk198; // 198
139  float unk19C; // 19C
140  std::uint64_t unk1A0; // 1A0
141  std::uint64_t unk1A8; // 1A8
144  float distanceMoved; // 1C0
145  std::uint32_t unk1C4; // 1C4
146  std::uint32_t unk1C8; // 1C8
147  std::uint32_t flags; // 1CC
148  std::uint64_t unk1D0; // 1D0
149  };
150  static_assert(sizeof(Projectile) == 0x1E0);
151 }
Definition: ActorCause.h:9
Definition: BGSExplosion.h:53
Definition: BGSKeyword.h:10
Definition: BSTList.h:10
Definition: BSAtomic.h:49
Definition: EffectSetting.h:24
Definition: InventoryEntryData.h:14
Definition: MagicCaster.h:11
Definition: MagicItem.h:27
Definition: NiAVObject.h:45
Definition: NiPoint3.h:6
Definition: NiSmartPointer.h:9
Definition: Projectile.h:19
NiPointer< ActorCause > actorCause
Definition: Projectile.h:119
BGSExplosion * explosion
Definition: Projectile.h:126
virtual void Unk_BF(void)
float unk19C
Definition: Projectile.h:139
~Projectile() override
virtual void Handle3DLoaded()
NiAVObject * Load3D(bool a_backgroundLoading) override
virtual void Unk_A9(void)
ObjectRefHandle shooter
Definition: Projectile.h:120
void InitLoadGame(BGSLoadFormBuffer *a_buf) override
Projectile * AsProjectile() override
float unk198
Definition: Projectile.h:138
bool GetAllowPromoteToPersistent() const override
void * unk108
Definition: Projectile.h:117
std::uint64_t unk0B0
Definition: Projectile.h:102
NiPointer< QueuedFile > projectileDBFiles
Definition: Projectile.h:131
void * unk110
Definition: Projectile.h:118
std::uint64_t unk1D0
Definition: Projectile.h:148
std::uint32_t flags
Definition: Projectile.h:147
ObjectRefHandle desiredTarget
Definition: Projectile.h:121
virtual void Unk_BD(void)
virtual void Unk_A4(void)
virtual void Unk_B2(void)
std::uint64_t unk1A8
Definition: Projectile.h:141
std::uint64_t unk1A0
Definition: Projectile.h:140
EffectSetting * avEffect
Definition: Projectile.h:130
void MoveHavok(bool a_forceRec) override
std::uint32_t * unk140
Definition: Projectile.h:124
float range
Definition: Projectile.h:136
void LoadGame(BGSLoadFormBuffer *a_buf) override
virtual void Unk_A7(void)
float unk0A8
Definition: Projectile.h:100
virtual void Unk_B5(void)
virtual bool IsNotGeneratedForm() const
virtual void Unk_B3(void)
virtual void Unk_B9(void)
float distanceMoved
Definition: Projectile.h:144
std::uint64_t unk0C0
Definition: Projectile.h:105
std::uint64_t unk180
Definition: Projectile.h:133
void FinishLoadGame(BGSLoadFormBuffer *a_buf) override
float unk0FC
Definition: Projectile.h:114
float unk0BC
Definition: Projectile.h:104
ActorCause * GetActorCause() const override
float unk0B8
Definition: Projectile.h:103
bool Load(TESFile *a_mod) override
float unk18C
Definition: Projectile.h:135
void Set3D(NiAVObject *a_object, bool a_queue3DTasks=true) override
virtual void Unk_AC(void)
virtual void Unk_BB(void)
void Unk_8B(void) override
float unk104
Definition: Projectile.h:116
virtual void Unk_BE(void)
std::uint32_t pad164
Definition: Projectile.h:129
float unk0D8
Definition: Projectile.h:109
std::uint32_t unk194
Definition: Projectile.h:137
static constexpr auto RTTI
Definition: Projectile.h:21
BSSoundHandle sndCountdown
Definition: Projectile.h:123
std::uint64_t unk178
Definition: Projectile.h:132
BSSimpleList< ImpactData * > impacts
Definition: Projectile.h:99
float unk0C8
Definition: Projectile.h:106
virtual void Unk_AD(void)
void SaveGame(BGSSaveFormBuffer *a_buf) override
NiPoint3 unk0F0
Definition: Projectile.h:113
float unk100
Definition: Projectile.h:115
BSSpinLock unk0E8
Definition: Projectile.h:112
virtual void Unk_AF(void)
virtual void Unk_AA(void)
bool OnAddCellPerformQueueReference(TESObjectCELL &a_cell) const override
bhkSimpleShapePhantom * unk0E0
Definition: Projectile.h:111
virtual void Unk_A6(void)
virtual void Unk_AE(void)
virtual void Unk_BC(void)
InventoryEntryData * unk148
Definition: Projectile.h:125
float unk188
Definition: Projectile.h:134
MagicSystem::CastingSource castingSource
Definition: Projectile.h:128
void SetActorCause(ActorCause *a_cause) override
float unk0CC
Definition: Projectile.h:107
MagicCaster * GetMagicCaster(MagicSystem::CastingSource a_source) override
void InitHavok() override
bool DetachHavok(NiAVObject *a_obj3D) override
BSSoundHandle sndHandle
Definition: Projectile.h:122
virtual void Unk_B7(void)
bool HasKeywordHelper(const BGSKeyword *a_keyword) const override
TESAmmo * ammoSource
Definition: Projectile.h:143
std::uint32_t unk1C8
Definition: Projectile.h:146
void GetLinearVelocity(NiPoint3 &a_velocity) const override
virtual void Unk_A2(void)
virtual void Unk_C1(void)
std::uint64_t unk0D0
Definition: Projectile.h:108
virtual void Unk_B1(void)
virtual void Unk_A8(void)
float unk0DC
Definition: Projectile.h:110
virtual void Unk_B8(void)
void Revert(BGSLoadFormBuffer *a_buf) override
virtual void Unk_A3(void)
std::uint32_t unk1C4
Definition: Projectile.h:145
virtual void Unk_B0(void)
virtual void UpdateImpl(float a_delta)=0
TESObjectWEAP * weaponSource
Definition: Projectile.h:142
virtual void Unk_A5(void)
virtual void Unk_B6(void)
MagicItem * spell
Definition: Projectile.h:127
virtual void Unk_BA(void)
float unk0AC
Definition: Projectile.h:101
Definition: TESAmmo.h:50
Definition: TESFile.h:14
Definition: TESObjectCELL.h:102
Definition: TESObjectREFR.h:103
Definition: TESObjectWEAP.h:73
CastingSource
Definition: MagicSystem.h:21
Definition: AbsorbEffect.h:6
constexpr REL::ID RTTI_Projectile
Definition: Offsets_RTTI.h:5733
Definition: BSSoundHandle.h:10
Definition: Projectile.h:24
std::uint64_t unk08
Definition: Projectile.h:28
std::uint64_t unk28
Definition: Projectile.h:32
std::uint64_t unk00
Definition: Projectile.h:27
std::uint64_t unk10
Definition: Projectile.h:29
NiPointer< bhkCollisionObject > colObj
Definition: Projectile.h:31
std::uint64_t unk40
Definition: Projectile.h:35
ObjectRefHandle collidee
Definition: Projectile.h:30
std::uint64_t unk38
Definition: Projectile.h:34
std::uint64_t unk48
Definition: Projectile.h:36
std::uint64_t unk30
Definition: Projectile.h:33