CommonLibSSE (powerof3)
TESAmmo.h
Go to the documentation of this file.
1 #pragma once
2 
4 #include "RE/B/BGSKeywordForm.h"
5 #include "RE/B/BGSMessageIcon.h"
7 #include "RE/F/FormTypes.h"
8 #include "RE/T/TESBoundObject.h"
9 #include "RE/T/TESDescription.h"
10 #include "RE/T/TESFullName.h"
11 #include "RE/T/TESIcon.h"
13 #include "RE/T/TESValueForm.h"
14 #include "RE/T/TESWeightForm.h"
15 
16 namespace RE
17 {
18  struct AMMO_DATA // DATA
19  {
20  public:
21  enum class Flag
22  {
23  kNone = 0,
25  kNonPlayable = 1 << 1,
26  kNonBolt = 1 << 2
27  };
28 
29  // members
32  std::uint8_t pa09; // 09
33  std::uint16_t pa0A; // 0A
34  float damage; // 0C
35  };
36  static_assert(sizeof(AMMO_DATA) == 0x10);
37 
38  class TESAmmo :
39  public TESBoundObject, // 000
40  public TESFullName, // 030
41  public TESModelTextureSwap, // 040
42  public TESIcon, // 078
43  public BGSMessageIcon, // 088
44  public TESValueForm, // 0A0
45  public TESWeightForm, // 0B0
46  public BGSDestructibleObjectForm, // 0C0
47  public BGSPickupPutdownSounds, // 0D0
48  public TESDescription, // 0E8
49  public BGSKeywordForm // 0F8
50  {
51  public:
52  inline static constexpr auto RTTI = RTTI_TESAmmo;
53  inline static constexpr auto FORMTYPE = FormType::Ammo;
54 
55  struct RecordFlags
56  {
57  enum RecordFlag : std::uint32_t
58  {
59  kNonPlayable = 1 << 2,
60  kDeleted = 1 << 5,
61  kIgnored = 1 << 12
62  };
63  };
64 
65  ~TESAmmo() override; // 00
66 
67  // override (TESBoundObject)
68  void InitializeData() override; // 04
69  bool Load(TESFile* a_mod) override; // 06
70  void SaveGame(BGSSaveFormBuffer* a_buf) override; // 0E
71  void LoadGame(BGSLoadFormBuffer* a_buf) override; // 0F
72  void InitItemImpl() override; // 13
73  bool GetPlayable() const override; // 19 - { return ~((data.flags >> 1) & 1); }
74  NiAVObject* Clone3D(TESObjectREFR* a_ref, bool a_arg3) override; // 40
75  void HandleRemoveItemFromContainer(TESObjectREFR* a_container) override; // 4E
76 
77  // override (BGSKeywordForm)
78  [[nodiscard]] BGSKeyword* GetDefaultKeyword() const override; // 05
79 
81  bool IsBolt();
82 
83  // members
84  AMMO_DATA data; // 110 - DATA
85  BSFixedString shortDesc; // 120 - ONAM
86  };
87  static_assert(sizeof(TESAmmo) == 0x128);
88 }
Definition: BGSDestructibleObjectForm.h:61
Definition: BGSKeywordForm.h:10
Definition: BGSKeyword.h:10
Definition: BGSMessageIcon.h:9
Definition: BGSPickupPutdownSounds.h:10
Definition: BGSProjectile.h:79
Definition: NiAVObject.h:45
Definition: TESAmmo.h:50
void InitItemImpl() override
bool GetPlayable() const override
static constexpr auto RTTI
Definition: TESAmmo.h:52
BSFixedString shortDesc
Definition: TESAmmo.h:85
void HandleRemoveItemFromContainer(TESObjectREFR *a_container) override
bool IgnoresNormalWeaponResistance()
void SaveGame(BGSSaveFormBuffer *a_buf) override
NiAVObject * Clone3D(TESObjectREFR *a_ref, bool a_arg3) override
void InitializeData() override
BGSKeyword * GetDefaultKeyword() const override
bool IsBolt()
static constexpr auto FORMTYPE
Definition: TESAmmo.h:53
~TESAmmo() override
AMMO_DATA data
Definition: TESAmmo.h:84
bool Load(TESFile *a_mod) override
void LoadGame(BGSLoadFormBuffer *a_buf) override
Definition: TESBoundObject.h:24
Definition: TESDescription.h:12
Definition: TESFile.h:14
Definition: TESFullName.h:9
Definition: TESIcon.h:8
Definition: TESModelTextureSwap.h:10
Definition: TESObjectREFR.h:103
Definition: TESValueForm.h:8
Definition: TESWeightForm.h:8
Definition: AbsorbEffect.h:6
constexpr REL::ID RTTI_TESAmmo
Definition: Offsets_RTTI.h:5970
Definition: TESAmmo.h:19
BGSProjectile * projectile
Definition: TESAmmo.h:30
Flag
Definition: TESAmmo.h:22
stl::enumeration< Flag, std::uint8_t > flags
Definition: TESAmmo.h:31
std::uint16_t pa0A
Definition: TESAmmo.h:33
float damage
Definition: TESAmmo.h:34
std::uint8_t pa09
Definition: TESAmmo.h:32
Definition: TESAmmo.h:56
RecordFlag
Definition: TESAmmo.h:58
@ kIgnored
Definition: TESAmmo.h:61
@ kDeleted
Definition: TESAmmo.h:60
@ kNonPlayable
Definition: TESAmmo.h:59