CommonLibVR
CombatInventoryItem.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/A/ActorValues.h"
4 #include "RE/C/CombatObject.h"
5 
6 namespace RE
7 {
8  class BGSLoadGameBuffer;
9  class BGSSaveGameBuffer;
10  class CombatController;
11  class TESBoundObject;
12  class BGSEquipSlot;
13 
15  {
16  public:
17  // members
19  float value; // 04
20  };
21  static_assert(sizeof(CombatInventoryItemResource) == 0x8);
22 
24  {
25  public:
26  // members
28  std::uint32_t slot; // 0C
29  private:
30  KEEP_FOR_RE()
31  };
32  static_assert(sizeof(CombatInventoryItemSlot) == 0x10);
33 
35  {
36  public:
37  inline static constexpr auto RTTI = RTTI_CombatInventoryItem;
38  inline static constexpr auto VTABLE = VTABLE_CombatInventoryItem;
39 
40  enum class TYPE
41  {
42  kNone = 0,
43  kMelee,
44  kRanged,
45  kShield,
47  kMagic,
48  kShout,
49  kStaff,
50  kPotion,
51  kScroll,
52  kTorch
53  };
54 
55  enum class CATEGORY
56  {
57  kTotal = 7
58  };
59 
60  ~CombatInventoryItem() override; // 00
61 
62  // override (CombatObject)
63  void SaveGame(BGSSaveGameBuffer* a_buf) override; // 03
64  void LoadGame(BGSLoadGameBuffer* a_buf) override; // 04
65 
66  // add
67  virtual float GetMinRange(); // 05 - { return 0.0; }
68  virtual float GetMaxRange(); // 06 - { return 0.0; }
69  virtual float GetOptimalRange(); // 07 - { return 0.0; }
70  virtual float GetEquipRange(); // 08 - { return FLT_MAX; }
71  virtual TYPE GetType(); // 09
72  virtual TYPE GetEquipType(BGSEquipSlot a_slot); // 0A - { return GetType(); }
73  virtual CATEGORY GetCategory() = 0; // 0B
74  virtual float CalculateScore(CombatController* a_controller) = 0; // 0C
75  virtual CombatInventoryItem* Clone() = 0; // 0D
76  virtual bool CheckBusy(CombatController* a_controller); // 0E
77  virtual bool CheckShouldEquip(CombatController* a_controller); // 0F - { return !a_controller->state->isFleeing; }
78  virtual bool GetResource(CombatInventoryItemResource& a_resource); // 10
79  virtual void Equip(CombatController* a_controller); // 11
80  virtual void Unequip(CombatController* a_controller); // 12
81  virtual bool IsValid(); // 13 - { return item != nullptr; }
82  virtual void GetDescription(const char* a_dest, std::uint32_t a_size); // 14
83 
84  // members
85  TESForm* item; // 10
86  float itemScore; // 18
87  std::uint32_t unk1C; // 1C
89  private:
90  KEEP_FOR_RE()
91  };
92  static_assert(sizeof(CombatInventoryItem) == 0x30);
93 }
#define KEEP_FOR_RE()
Definition: PCH.h:713
Definition: BGSEquipSlot.h:10
Definition: BGSLoadGameBuffer.h:6
Definition: BGSSaveGameBuffer.h:10
Definition: CombatController.h:23
Definition: CombatInventoryItem.h:24
BGSEquipSlot * equipSlot
Definition: CombatInventoryItem.h:27
std::uint32_t slot
Definition: CombatInventoryItem.h:28
Definition: CombatInventoryItem.h:35
virtual CombatInventoryItem * Clone()=0
virtual float GetMinRange()
virtual bool IsValid()
virtual bool CheckShouldEquip(CombatController *a_controller)
void SaveGame(BGSSaveGameBuffer *a_buf) override
virtual void Equip(CombatController *a_controller)
static constexpr auto VTABLE
Definition: CombatInventoryItem.h:38
virtual float GetEquipRange()
std::uint32_t unk1C
Definition: CombatInventoryItem.h:87
CombatInventoryItemSlot itemSlot
Definition: CombatInventoryItem.h:88
static constexpr auto RTTI
Definition: CombatInventoryItem.h:37
virtual float GetMaxRange()
virtual void GetDescription(const char *a_dest, std::uint32_t a_size)
float itemScore
Definition: CombatInventoryItem.h:86
virtual bool GetResource(CombatInventoryItemResource &a_resource)
virtual TYPE GetType()
CATEGORY
Definition: CombatInventoryItem.h:56
virtual CATEGORY GetCategory()=0
virtual TYPE GetEquipType(BGSEquipSlot a_slot)
virtual void Unequip(CombatController *a_controller)
virtual float CalculateScore(CombatController *a_controller)=0
virtual bool CheckBusy(CombatController *a_controller)
void LoadGame(BGSLoadGameBuffer *a_buf) override
TESForm * item
Definition: CombatInventoryItem.h:85
TYPE
Definition: CombatInventoryItem.h:41
virtual float GetOptimalRange()
~CombatInventoryItem() override
Definition: CombatObject.h:11
Definition: TESForm.h:40
Definition: AbsorbEffect.h:6
ActorValue
Definition: ActorValues.h:6
constexpr std::array< REL::ID, 1 > VTABLE_CombatInventoryItem
Definition: Offsets_VTABLE.h:10961
constexpr REL::ID RTTI_CombatInventoryItem(static_cast< std::uint64_t >(687590))
Definition: CombatInventoryItem.h:15
float value
Definition: CombatInventoryItem.h:19
ActorValue actorValue
Definition: CombatInventoryItem.h:18