CommonLibVR
BGSProjectile.h
Go to the documentation of this file.
1 #pragma once
2 
4 #include "RE/B/BGSPreloadable.h"
5 #include "RE/F/FormTypes.h"
6 #include "RE/S/SoundLevels.h"
7 #include "RE/T/TESBoundObject.h"
8 #include "RE/T/TESFullName.h"
9 #include "RE/T/TESModel.h"
10 
11 namespace RE
12 {
13  struct BGSProjectileData // DATA
14  {
15  public:
16  enum class BGSProjectileFlags
17  {
18  kNone = 0,
19  kHitScan = 1 << 0,
20  kExplosion = 1 << 1,
21  kExplosionAltTrigger = 1 << 2,
22  kMuzzleFlash = 1 << 3,
23  kCanTurnOff = 1 << 5,
24  kCanPickUp = 1 << 6,
25  kSupersonic = 1 << 7,
26  kPinsLimbs = 1 << 8,
27  kPassSMTransparent = 1 << 9,
29  kContinuousUpdate = 1 << 11
30  };
31 
32  enum class Type
33  {
34  kMissile = 1 << 0,
35  kGrenade = 1 << 1,
36  kBeam = 1 << 2,
37  kFlamethrower = 1 << 3,
38  kCone = 1 << 4,
39  kBarrier = 1 << 5,
40  kArrow = 1 << 6
41  };
42 
43  // members
46  float gravity; // 04
47  float speed; // 08
48  float range; // 0C
51  float tracerChance; // 20
52  float explosionProximity; // 24
53  float explosionTimer; // 28
54  std::uint32_t pad2C; // 2C
57  float muzzleFlashDuration; // 40
58  float fadeOutTime; // 44
59  float force; // 48
60  std::uint32_t pad4C; // 4C
64  float coneSpread; // 68
65  float collisionRadius; // 6C
66  float lifetime; // 70
67  float relaunchInterval; // 74
70  };
71  static_assert(sizeof(BGSProjectileData) == 0x88);
72 
73  class BGSProjectile :
74  public TESBoundObject, // 000
75  public TESFullName, // 030
76  public TESModel, // 040
77  public BGSPreloadable, // 068
78  public BGSDestructibleObjectForm // 070
79  {
80  public:
81  inline static constexpr auto RTTI = RTTI_BGSProjectile;
82  inline static constexpr auto VTABLE = VTABLE_BGSProjectile;
83  inline static constexpr auto FORMTYPE = FormType::Projectile;
84 
85  struct RecordFlags
86  {
87  enum RecordFlag : std::uint32_t
88  {
89  kDeleted = 1 << 5,
90  kIgnored = 1 << 12
91  };
92  };
93 
94  ~BGSProjectile() override; // 00
95 
96  // override (TESBoundObject)
97  void InitializeData() override; // 04
98  void ClearData() override; // 05
99  bool Load(TESFile* a_mod) override; // 06
100  void InitItemImpl() override; // 13
101  bool Activate(TESObjectREFR* a_targetRef, TESObjectREFR* a_activatorRef, std::uint8_t a_arg3, TESBoundObject* a_object, std::int32_t a_targetCount) override; // 37
102  NiAVObject* Clone3D(TESObjectREFR* a_ref, bool a_arg3) override; // 40
103  void UnClone3D(TESObjectREFR* a_ref) override; // 41
104  bool GetActivateText(TESObjectREFR* a_activator, BSString& a_dst) override; // 4C
105 
106  [[nodiscard]] constexpr bool IsMissile() const noexcept { return data.types.all(BGSProjectileData::Type::kMissile); }
107  [[nodiscard]] constexpr bool IsGrenade() const noexcept { return data.types.all(BGSProjectileData::Type::kGrenade); }
108  [[nodiscard]] constexpr bool IsBeam() const noexcept { return data.types.all(BGSProjectileData::Type::kBeam); }
109  [[nodiscard]] constexpr bool IsFlamethrower() const noexcept { return data.types.all(BGSProjectileData::Type::kFlamethrower); }
110  [[nodiscard]] constexpr bool IsCone() const noexcept { return data.types.all(BGSProjectileData::Type::kCone); }
111  [[nodiscard]] constexpr bool IsBarrier() const noexcept { return data.types.all(BGSProjectileData::Type::kBarrier); }
112  [[nodiscard]] constexpr bool IsArrow() const noexcept { return data.types.all(BGSProjectileData::Type::kArrow); }
113 
114  // members
115  BGSProjectileData data; // 080 - DATA
117  SOUND_LEVEL soundLevel; // 130 - VNAM
118  std::uint32_t pad134; // 134
119  private:
120  KEEP_FOR_RE()
121  };
122  static_assert(sizeof(BGSProjectile) == 0x138);
123 }
#define KEEP_FOR_RE()
Definition: PCH.h:713
Definition: BGSCollisionLayer.h:15
Definition: BGSDestructibleObjectForm.h:61
Definition: BGSExplosion.h:53
Definition: BGSPreloadable.h:8
Definition: BGSProjectile.h:79
void UnClone3D(TESObjectREFR *a_ref) override
bool GetActivateText(TESObjectREFR *a_activator, BSString &a_dst) override
constexpr bool IsFlamethrower() const noexcept
Definition: BGSProjectile.h:109
static constexpr auto FORMTYPE
Definition: BGSProjectile.h:83
constexpr bool IsCone() const noexcept
Definition: BGSProjectile.h:110
bool Load(TESFile *a_mod) override
NiAVObject * Clone3D(TESObjectREFR *a_ref, bool a_arg3) override
BGSProjectileData data
Definition: BGSProjectile.h:115
constexpr bool IsArrow() const noexcept
Definition: BGSProjectile.h:112
constexpr bool IsGrenade() const noexcept
Definition: BGSProjectile.h:107
static constexpr auto RTTI
Definition: BGSProjectile.h:81
~BGSProjectile() override
void ClearData() override
void InitializeData() override
constexpr bool IsBarrier() const noexcept
Definition: BGSProjectile.h:111
TESModel muzzleFlashModel
Definition: BGSProjectile.h:116
void InitItemImpl() override
bool Activate(TESObjectREFR *a_targetRef, TESObjectREFR *a_activatorRef, std::uint8_t a_arg3, TESBoundObject *a_object, std::int32_t a_targetCount) override
std::uint32_t pad134
Definition: BGSProjectile.h:118
SOUND_LEVEL soundLevel
Definition: BGSProjectile.h:117
static constexpr auto VTABLE
Definition: BGSProjectile.h:82
constexpr bool IsBeam() const noexcept
Definition: BGSProjectile.h:108
constexpr bool IsMissile() const noexcept
Definition: BGSProjectile.h:106
Definition: BGSSoundDescriptorForm.h:14
Definition: BGSTextureSet.h:16
Definition: NiAVObject.h:57
Definition: TESBoundObject.h:26
Definition: TESFile.h:17
Definition: TESFullName.h:9
Definition: TESModel.h:16
Definition: TESObjectLIGH.h:68
Definition: TESObjectREFR.h:113
Definition: TESObjectWEAP.h:79
constexpr bool all(Args... a_args) const noexcept requires(std
Definition: PCH.h:290
Definition: AbsorbEffect.h:6
SOUND_LEVEL
Definition: SoundLevels.h:6
constexpr std::array< REL::ID, 5 > VTABLE_BGSProjectile
Definition: Offsets_VTABLE.h:8832
constexpr REL::ID RTTI_BGSProjectile(static_cast< std::uint64_t >(513868))
Definition: BGSProjectile.h:14
Type
Definition: BGSProjectile.h:33
BGSCollisionLayer * collisionLayer
Definition: BGSProjectile.h:69
BGSSoundDescriptorForm * deactivateSound
Definition: BGSProjectile.h:62
float explosionProximity
Definition: BGSProjectile.h:52
float relaunchInterval
Definition: BGSProjectile.h:67
std::uint32_t pad4C
Definition: BGSProjectile.h:60
BGSProjectileFlags
Definition: BGSProjectile.h:17
float tracerChance
Definition: BGSProjectile.h:51
BGSSoundDescriptorForm * countdownSound
Definition: BGSProjectile.h:61
float collisionRadius
Definition: BGSProjectile.h:65
std::uint32_t pad2C
Definition: BGSProjectile.h:54
float force
Definition: BGSProjectile.h:59
BGSTextureSet * decalData
Definition: BGSProjectile.h:68
float muzzleFlashDuration
Definition: BGSProjectile.h:57
float gravity
Definition: BGSProjectile.h:46
TESObjectLIGH * light
Definition: BGSProjectile.h:49
stl::enumeration< BGSProjectileFlags, std::uint16_t > flags
Definition: BGSProjectile.h:44
BGSExplosion * explosionType
Definition: BGSProjectile.h:55
stl::enumeration< Type, std::uint16_t > types
Definition: BGSProjectile.h:45
float fadeOutTime
Definition: BGSProjectile.h:58
float lifetime
Definition: BGSProjectile.h:66
TESObjectLIGH * muzzleFlashLight
Definition: BGSProjectile.h:50
float speed
Definition: BGSProjectile.h:47
TESObjectWEAP * defaultWeaponSource
Definition: BGSProjectile.h:63
float range
Definition: BGSProjectile.h:48
float coneSpread
Definition: BGSProjectile.h:64
float explosionTimer
Definition: BGSProjectile.h:53
BGSSoundDescriptorForm * activeSoundLoop
Definition: BGSProjectile.h:56
Definition: BGSProjectile.h:86
RecordFlag
Definition: BGSProjectile.h:88
@ kIgnored
Definition: BGSProjectile.h:90
@ kDeleted
Definition: BGSProjectile.h:89