CommonLibSSE (Parapets fork)
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/BSSimpleList.h"
6 #include "RE/B/BSSoundHandle.h"
7 #include "RE/C/CollisionLayers.h"
8 #include "RE/F/FormTypes.h"
9 #include "RE/I/ImpactResults.h"
10 #include "RE/M/MagicSystem.h"
11 #include "RE/N/NiSmartPointer.h"
12 #include "RE/T/TESObjectREFR.h"
13 
14 namespace RE
15 {
16  class bhkCollisionObject;
17  class bhkSimpleShapePhantom;
18  class CombatController;
19  class MagicItem;
20  class QueuedFile;
21 
22  class Projectile : public TESObjectREFR
23  {
24  public:
25  inline static constexpr auto RTTI = RTTI_Projectile;
26 
27  enum class Flags
28  {
29  kNoHitOutsideCombat = 1 << 19,
30  kProcessedImpacts = 1 << 22,
31  kIsDualCast = 1 << 28
32  };
33 
34  class LaunchData
35  {
36  public:
37  inline static constexpr auto RTTI = RTTI_Projectile__LaunchData;
38 
39  LaunchData() = default;
40 
41  // add
42  virtual ~LaunchData() = default; // 00
43 
45 
46  // members
48  NiPoint3 unk14; // 14
50  TESObjectREFR* shooter{ nullptr }; // 28
51  CombatController* combatController{ nullptr }; // 30
52  TESObjectWEAP* sourceWeapon{ nullptr }; // 38
53  TESAmmo* sourceAmmo{ nullptr }; // 40
54  float heading{ 0.0f }; // 48
55  float pitch{ 0.0f }; // 4C
56  std::uint64_t unk50{ 0 }; // 50
58  std::uint64_t unk60{ 0 }; // 60
59  TESObjectCELL* parentCell{ nullptr }; // 68
60  MagicItem* spell{ nullptr }; // 70
62  std::uint32_t pad7C; // 7C
63  EnchantmentItem* enchantment{ nullptr }; // 80
64  AlchemyItem* poison{ nullptr }; // 88
65  std::int32_t area{ 0 }; // 90
66  float power{ 1.0f }; // 94
67  float scale{ 1.0f }; // 98
68  bool unk9C{ false }; // 9C
69  bool unk9D{ false }; // 9D
70  bool unk9E{ true }; // 9E
71  bool unk9F{ false }; // 9F
72  bool useOrigin{ false }; // A0
73  bool unkA1{ false }; // A1
74  bool unkA2{ false }; // A2
75  std::uint8_t padA3; // A3
76  std::uint32_t padA4; // A4
77  };
78  static_assert(sizeof(LaunchData) == 0xA8);
79 
80  struct ImpactData
81  {
82  public:
86  std::uint32_t pad1C; // 1C
89  std::int32_t damageNodeIndex; // 30
91  std::uint64_t unk38; // 38
93  std::uint32_t unk44; // 44
94  std::uint8_t unk48; // 48
95  std::uint8_t unk49; // 49
96  std::uint16_t pad4A; // 4A
97  std::uint32_t pad4C; // 4C
98  };
99  static_assert(sizeof(ImpactData) == 0x50);
100 
101  ~Projectile() override; // 00
102 
103  // override (TESObjectREFR)
104  bool Load(TESFile* a_mod) override; // 06 - { return TESObjectREFR::Load(a_mod); }
105  void SaveGame(BGSSaveFormBuffer* a_buf) override; // 0E
106  void LoadGame(BGSLoadFormBuffer* a_buf) override; // 0F
107  void InitLoadGame(BGSLoadFormBuffer* a_buf) override; // 10
108  void FinishLoadGame(BGSLoadFormBuffer* a_buf) override; // 11
109  void Revert(BGSLoadFormBuffer* a_buf) override; // 12
110  bool GetAllowPromoteToPersistent() const override; // 47 - { return false; }
111  bool HasKeywordHelper(const BGSKeyword* a_keyword) const override; // 48
112  void SetActorCause(ActorCause* a_cause) override; // 50 - { actorCause = a_cause; }
113  ActorCause* GetActorCause() const override; // 51 - { return actorCause; }
115  bool DetachHavok(NiAVObject* a_obj3D) override; // 65
116  void InitHavok() override; // 66
117  NiAVObject* Load3D(bool a_backgroundLoading) override; // 6A
118  void Set3D(NiAVObject* a_object, bool a_queue3DTasks = true) override; // 6C
119  void MoveHavok(bool a_forceRec) override; // 85 - { return; }
120  void GetLinearVelocity(NiPoint3& a_velocity) const override; // 86
121  void Unk_8B(void) override; // 8B
122  Projectile* AsProjectile() override; // 8F - { return this; }
123  bool OnAddCellPerformQueueReference(TESObjectCELL& a_cell) const override; // 90 - { return false; }
124 
125  // add
126  virtual void Unk_A2(void); // A2 - { return 0; }
127  virtual void Unk_A3(void); // A3 - { return 0; }
128  virtual void Unk_A4(void); // A4 - { return 0; }
129  virtual void Unk_A5(void); // A5 - { return 0; }
130  virtual void Unk_A6(void); // A6 - { return 0; }
131  virtual void Unk_A7(void); // A7 - { return 0; }
132  virtual void Unk_A8(void); // A8 - { return; }
133  virtual void Unk_A9(void); // A9 - { return; }
134  virtual void Unk_AA(void); // AA
135  virtual void UpdateImpl(float a_delta) = 0; // AB
136  virtual void Unk_AC(void); // AC
137  virtual void Unk_AD(void); // AD
138  virtual void Unk_AE(void); // AE - { return 0; }
139  virtual void Unk_AF(void); // AF - { if (unk158) return 1.0; else return unk188; } - "float GetSpeed()"?
140  virtual void Unk_B0(void); // B0 - { return 1.0; }
141  virtual void Unk_B1(void); // B1 - { return 0; }
142  virtual void Unk_B2(void); // B2 - { return; }
143  virtual void Unk_B3(void); // B3
144  virtual bool IsNotGeneratedForm() const; // B4 - { return TESDataHandler::GetSingleton()->IsGeneratedFormID(formID) == 0; }
145  virtual void Unk_B5(void); // B5 - { void* var = unk40; if ((var->unk80 >> 17) & 1) return 1.0; else return var->unk84; }
146  virtual void Unk_B6(void); // B6
147  virtual void Unk_B7(void); // B7
148  virtual void Unk_B8(void); // B8 - { return 1; }
149  virtual void Unk_B9(void); // B9 - { return 0; }
150  virtual void Unk_BA(void); // BA - { return 0; }
151  virtual void Unk_BB(void); // BB
152  virtual void Unk_BC(void); // BC
153  virtual void Unk_BD(void); // BD
154  virtual void Unk_BE(void); // BE
155  virtual void Unk_BF(void); // BF - { return; }
156  virtual void Handle3DLoaded(); // C0 - { return; }
157  virtual void Unk_C1(void); // C1 - { return 0; }
158 
160 
161  void Kill();
162 
163  // members
165  float unk0A8; // 0A8
166  float unk0AC; // 0AC
167  std::uint64_t unk0B0; // 0B0
168  float unk0B8; // 0B8
169  float unk0BC; // 0BC
170  std::uint64_t unk0C0; // 0C0
171  float unk0C8; // 0C8
172  float unk0CC; // 0CC
173  std::uint64_t unk0D0; // 0D0
174  float unk0D8; // 0D8
175  float unk0DC; // 0DC
176  bhkSimpleShapePhantom* unk0E0; // 0E0 - smart ptr
177  mutable BSSpinLock unk0E8; // 0E8
178  NiPoint3 unk0F0; // 0F0
179  float unk0FC; // 0FC
180  float unk100; // 100
181  float unk104; // 104
182  void* unk108; // 108 - smart ptr
183  void* unk110; // 110 - smart ptr
189  std::uint32_t* unk140; // 140
192  MagicItem* spell; // 158
194  std::uint32_t pad164; // 164
197  std::uint64_t unk178; // 178
198  std::uint64_t unk180; // 180
199  float power; // 188
200  float unk18C; // 18C
201  float range; // 190
202  std::uint32_t unk194; // 194
203  float unk198; // 198
204  float unk19C; // 19C
205  std::uint64_t unk1A0; // 1A0
206  std::uint64_t unk1A8; // 1A8
209  float distanceMoved; // 1C0
210  std::uint32_t unk1C4; // 1C4
211  float scale; // 1C8
213  std::uint64_t unk1D0; // 1D0
214  };
215 #if !defined(SKYRIMVR) && !defined(SKYRIMSE_PRE_1_6_629)
216  static_assert(sizeof(Projectile) == 0x1E0);
217 #else
218  static_assert(sizeof(Projectile) == 0x1D8);
219 #endif
220 }
Definition: ActorCause.h:9
Definition: AlchemyItem.h:24
Definition: BGSExplosion.h:53
Definition: BGSKeyword.h:10
Definition: BGSMaterialType.h:11
Definition: BGSProjectile.h:79
Definition: BSSimpleList.h:10
Definition: BSAtomic.h:49
Definition: EffectSetting.h:24
Definition: EnchantmentItem.h:10
Definition: InventoryEntryData.h:14
Definition: MagicCaster.h:14
Definition: MagicItem.h:27
Definition: NiAVObject.h:45
Definition: NiPoint3.h:6
Definition: NiSmartPointer.h:9
Definition: Projectile.h:35
NiPoint3 unk14
Definition: Projectile.h:48
static constexpr auto RTTI
Definition: Projectile.h:37
TESObjectWEAP * sourceWeapon
Definition: Projectile.h:52
MagicItem * spell
Definition: Projectile.h:60
virtual ~LaunchData()=default
bool unk9E
Definition: Projectile.h:70
TESObjectREFR * desiredTarget
Definition: Projectile.h:57
TESAmmo * sourceAmmo
Definition: Projectile.h:53
NiPoint3 origin
Definition: Projectile.h:47
EnchantmentItem * enchantment
Definition: Projectile.h:63
std::uint64_t unk50
Definition: Projectile.h:56
std::uint32_t pad7C
Definition: Projectile.h:62
std::uint8_t padA3
Definition: Projectile.h:75
std::int32_t area
Definition: Projectile.h:65
bool useOrigin
Definition: Projectile.h:72
std::uint32_t padA4
Definition: Projectile.h:76
bool unkA2
Definition: Projectile.h:74
float power
Definition: Projectile.h:66
bool unkA1
Definition: Projectile.h:73
TESObjectREFR * shooter
Definition: Projectile.h:50
float scale
Definition: Projectile.h:67
MagicSystem::CastingSource castingSource
Definition: Projectile.h:61
float pitch
Definition: Projectile.h:55
CombatController * combatController
Definition: Projectile.h:51
BGSProjectile * projectile
Definition: Projectile.h:49
bool unk9D
Definition: Projectile.h:69
bool unk9F
Definition: Projectile.h:71
float heading
Definition: Projectile.h:54
TESObjectCELL * parentCell
Definition: Projectile.h:59
bool unk9C
Definition: Projectile.h:68
std::uint64_t unk60
Definition: Projectile.h:58
AlchemyItem * poison
Definition: Projectile.h:64
Definition: Projectile.h:23
NiPointer< ActorCause > actorCause
Definition: Projectile.h:184
BGSExplosion * explosion
Definition: Projectile.h:191
virtual void Unk_BF(void)
float unk19C
Definition: Projectile.h:204
~Projectile() override
virtual void Handle3DLoaded()
Flags
Definition: Projectile.h:28
NiAVObject * Load3D(bool a_backgroundLoading) override
virtual void Unk_A9(void)
ObjectRefHandle shooter
Definition: Projectile.h:185
void InitLoadGame(BGSLoadFormBuffer *a_buf) override
Projectile * AsProjectile() override
float unk198
Definition: Projectile.h:203
bool GetAllowPromoteToPersistent() const override
void * unk108
Definition: Projectile.h:182
std::uint64_t unk0B0
Definition: Projectile.h:167
NiPointer< QueuedFile > projectileDBFiles
Definition: Projectile.h:196
void * unk110
Definition: Projectile.h:183
std::uint64_t unk1D0
Definition: Projectile.h:213
ObjectRefHandle desiredTarget
Definition: Projectile.h:186
virtual void Unk_BD(void)
virtual void Unk_A4(void)
virtual void Unk_B2(void)
std::uint64_t unk1A8
Definition: Projectile.h:206
std::uint64_t unk1A0
Definition: Projectile.h:205
EffectSetting * avEffect
Definition: Projectile.h:195
void MoveHavok(bool a_forceRec) override
stl::enumeration< Flags, std::uint32_t > flags
Definition: Projectile.h:212
std::uint32_t * unk140
Definition: Projectile.h:189
float range
Definition: Projectile.h:201
void LoadGame(BGSLoadFormBuffer *a_buf) override
virtual void Unk_A7(void)
float unk0A8
Definition: Projectile.h:165
virtual void Unk_B5(void)
virtual bool IsNotGeneratedForm() const
static BSPointerHandle< Projectile > Launch(const LaunchData &a_data)
virtual void Unk_B3(void)
virtual void Unk_B9(void)
float distanceMoved
Definition: Projectile.h:209
std::uint64_t unk0C0
Definition: Projectile.h:170
std::uint64_t unk180
Definition: Projectile.h:198
void FinishLoadGame(BGSLoadFormBuffer *a_buf) override
float unk0FC
Definition: Projectile.h:179
float unk0BC
Definition: Projectile.h:169
ActorCause * GetActorCause() const override
float unk0B8
Definition: Projectile.h:168
bool Load(TESFile *a_mod) override
float unk18C
Definition: Projectile.h:200
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:181
virtual void Unk_BE(void)
std::uint32_t pad164
Definition: Projectile.h:194
float unk0D8
Definition: Projectile.h:174
std::uint32_t unk194
Definition: Projectile.h:202
static constexpr auto RTTI
Definition: Projectile.h:25
BSSoundHandle sndCountdown
Definition: Projectile.h:188
std::uint64_t unk178
Definition: Projectile.h:197
BSSimpleList< ImpactData * > impacts
Definition: Projectile.h:164
float unk0C8
Definition: Projectile.h:171
virtual void Unk_AD(void)
void SaveGame(BGSSaveFormBuffer *a_buf) override
NiPoint3 unk0F0
Definition: Projectile.h:178
float unk100
Definition: Projectile.h:180
BSSpinLock unk0E8
Definition: Projectile.h:177
virtual void Unk_AF(void)
virtual void Unk_AA(void)
bool OnAddCellPerformQueueReference(TESObjectCELL &a_cell) const override
bhkSimpleShapePhantom * unk0E0
Definition: Projectile.h:176
virtual void Unk_A6(void)
virtual void Unk_AE(void)
virtual void Unk_BC(void)
InventoryEntryData * unk148
Definition: Projectile.h:190
MagicSystem::CastingSource castingSource
Definition: Projectile.h:193
void SetActorCause(ActorCause *a_cause) override
float unk0CC
Definition: Projectile.h:172
MagicCaster * GetMagicCaster(MagicSystem::CastingSource a_source) override
void InitHavok() override
bool DetachHavok(NiAVObject *a_obj3D) override
BSSoundHandle sndHandle
Definition: Projectile.h:187
virtual void Unk_B7(void)
bool HasKeywordHelper(const BGSKeyword *a_keyword) const override
TESAmmo * ammoSource
Definition: Projectile.h:208
void GetLinearVelocity(NiPoint3 &a_velocity) const override
virtual void Unk_A2(void)
virtual void Unk_C1(void)
std::uint64_t unk0D0
Definition: Projectile.h:173
virtual void Unk_B1(void)
virtual void Unk_A8(void)
float unk0DC
Definition: Projectile.h:175
virtual void Unk_B8(void)
void Revert(BGSLoadFormBuffer *a_buf) override
virtual void Unk_A3(void)
std::uint32_t unk1C4
Definition: Projectile.h:210
virtual void Unk_B0(void)
virtual void UpdateImpl(float a_delta)=0
TESObjectWEAP * weaponSource
Definition: Projectile.h:207
virtual void Unk_A5(void)
float scale
Definition: Projectile.h:211
virtual void Unk_B6(void)
MagicItem * spell
Definition: Projectile.h:192
float power
Definition: Projectile.h:199
virtual void Unk_BA(void)
float unk0AC
Definition: Projectile.h:166
Definition: TESAmmo.h:50
Definition: TESFile.h:14
Definition: TESObjectCELL.h:102
Definition: TESObjectREFR.h:105
Definition: TESObjectWEAP.h:73
CastingSource
Definition: MagicSystem.h:21
Definition: AbsorbEffect.h:6
constexpr REL::ID RTTI_Projectile__LaunchData
Definition: Offsets_RTTI.h:5735
constexpr REL::ID RTTI_Projectile
Definition: Offsets_RTTI.h:5733
ImpactResult
Definition: ImpactResults.h:6
COL_LAYER
Definition: CollisionLayers.h:6
Definition: BSSoundHandle.h:10
Definition: Projectile.h:81
std::uint16_t pad4A
Definition: Projectile.h:96
std::uint32_t unk44
Definition: Projectile.h:93
std::uint32_t pad1C
Definition: Projectile.h:86
NiPointer< bhkCollisionObject > colObj
Definition: Projectile.h:87
ImpactResult impactResult
Definition: Projectile.h:92
NiPoint3 direction
Definition: Projectile.h:84
std::uint8_t unk49
Definition: Projectile.h:95
ObjectRefHandle collidee
Definition: Projectile.h:85
std::uint8_t unk48
Definition: Projectile.h:94
BGSMaterialType * materialType
Definition: Projectile.h:88
std::uint64_t unk38
Definition: Projectile.h:91
NiPoint3 targetPosition
Definition: Projectile.h:83
std::int32_t damageNodeIndex
Definition: Projectile.h:89
COL_LAYER collisionLayer
Definition: Projectile.h:90
std::uint32_t pad4C
Definition: Projectile.h:97