CommonLibVR
ActorMagicCaster.h
Go to the documentation of this file.
1 #pragma once
2 
4 #include "RE/B/BSTEvent.h"
5 #include "RE/M/MagicCaster.h"
8 
9 namespace RE
10 {
11  class BGSArtObject;
12  class BGSArtObjectCloneTask;
13  class BSLight;
14  class ReferenceEffectController;
15 
16  struct BSAnimationGraphEvent;
17 
19  public MagicCaster, // 00
21  public BSTEventSink<BSAnimationGraphEvent> // 60
22  {
23  public:
24  inline static constexpr auto RTTI = RTTI_ActorMagicCaster;
25  inline static constexpr auto VTABLE = VTABLE_ActorMagicCaster;
26 
27  using InterruptHandler_t = void(Actor*);
28 
29  enum class Flags
30  {
31  kNone = 0,
32  kDualCasting = 1 << 0,
33  kSkipCheckCast = 1 << 1,
34  kStartCloneTask = 1 << 2,
35  kCastingArtAttached = 1 << 3,
36  kCheckDeferredInterrupt = 1 << 4,
37  kDeferInterrupt = 1 << 5
38  };
39 
40  ~ActorMagicCaster() override; // 00
41 
42  // override (MagicCaster)
43  void RequestCastImpl() override; // 03
44  bool StartChargeImpl() override; // 04
45  void StartReadyImpl() override; // 05
46  void StartCastImpl() override; // 06
47  void FinishCastImpl() override; // 07 - { return; }
48  void InterruptCastImpl(bool a_depleteEnergy) override; // 08 - { return; }
49  void SpellCast(bool a_doCast, std::uint32_t a_arg2, MagicItem* a_spell) override; // 09 - { return; }
50  bool CheckCast(MagicItem* a_spell, bool a_dualCast, float* a_effectStrength, MagicSystem::CannotCastReason* a_reason, bool a_useBaseValueForCost) override; // 0A
51  TESObjectREFR* GetCasterStatsObject() const override; // 0B - { return actor; }
52  Actor* GetCasterAsActor() const override; // 0C - { return actor; }
53  NiNode* GetMagicNode() override; // 0E - { return magicNode; }
54  void ClearMagicNode() override; // 0F - { magicNode = 0; }
55  void SetCurrentSpellImpl(MagicItem* a_spell) override; // 10 - { return; }
56  void SelectSpellImpl() override; // 11 - { return; }
57  void DeselectSpellImpl() override; // 12 - { return; }
58  void SetSkipCheckCast() override; // 13 - { return; }
59  void SetCastingTimerForCharge() override; // 14
60  MagicSystem::CastingSource GetCastingSource() const override; // 15 - { return castingSource; }
61  bool GetIsDualCasting() const override; // 16 - { return flags & 1; }
62  void SetDualCasting(bool a_set) override; // 17
63  void SaveGame(BGSSaveGameBuffer* a_buf) override; // 18
64  void LoadGame(BGSLoadGameBuffer* a_buf) override; // 19
65  void FinishLoadGame(BGSLoadGameBuffer* a_buf) override; // 1A
66  void PrepareSound(MagicSystem::SoundID a_sound, MagicItem* a_spell) override; // 1B
67  void AdjustActiveEffect(ActiveEffect* a_activeEffect, float a_power, bool a_arg3) override; // 1C
68 
69  // add
70  virtual void Update(float a_delta); // 1D
71 
73  {
74  using func_t = decltype(&ActorMagicCaster::CheckAttachCastingArt);
75  static REL::Relocation<func_t> func{ RELOCATION_ID(33403, 34185) };
76  return func(this);
77  }
78 
79  // members
82  Actor* actor; // B8
83  NiNode* magicNode; // C0
89  float costCharged; // F0
92  private:
93  KEEP_FOR_RE()
94  };
95  static_assert(sizeof(ActorMagicCaster) == 0x100);
96 }
#define KEEP_FOR_RE()
Definition: PCH.h:713
#define RELOCATION_ID(SE, AE)
Definition: PCH.h:702
Definition: Relocation.h:210
Definition: ActiveEffect.h:27
Definition: ActorMagicCaster.h:22
void(Actor *) InterruptHandler_t
Definition: ActorMagicCaster.h:27
static constexpr auto RTTI
Definition: ActorMagicCaster.h:24
void InterruptCastImpl(bool a_depleteEnergy) override
void SpellCast(bool a_doCast, std::uint32_t a_arg2, MagicItem *a_spell) override
void SaveGame(BGSSaveGameBuffer *a_buf) override
void StartCastImpl() override
void RequestCastImpl() override
void LoadGame(BGSLoadGameBuffer *a_buf) override
Actor * GetCasterAsActor() const override
ReferenceEffectController * weaponEnchantmentController
Definition: ActorMagicCaster.h:88
bool GetIsDualCasting() const override
void FinishLoadGame(BGSLoadGameBuffer *a_buf) override
void PrepareSound(MagicSystem::SoundID a_sound, MagicItem *a_spell) override
NiNode * GetMagicNode() override
stl::enumeration< Flags, std::uint32_t > flags
Definition: ActorMagicCaster.h:91
void SetSkipCheckCast() override
static constexpr auto VTABLE
Definition: ActorMagicCaster.h:25
NiNode * magicNode
Definition: ActorMagicCaster.h:83
NiPointer< BGSArtObjectCloneTask > cloneTask
Definition: ActorMagicCaster.h:81
BGSLoadGameSubBuffer loadGameSubBuffer
Definition: ActorMagicCaster.h:86
bool CheckCast(MagicItem *a_spell, bool a_dualCast, float *a_effectStrength, MagicSystem::CannotCastReason *a_reason, bool a_useBaseValueForCost) override
float costCharged
Definition: ActorMagicCaster.h:89
bool StartChargeImpl() override
Flags
Definition: ActorMagicCaster.h:30
void SetDualCasting(bool a_set) override
void StartReadyImpl() override
void AdjustActiveEffect(ActiveEffect *a_activeEffect, float a_power, bool a_arg3) override
BGSArtObject * castingArt
Definition: ActorMagicCaster.h:87
NiPointer< BSLight > light
Definition: ActorMagicCaster.h:84
MagicSystem::CastingSource castingSource
Definition: ActorMagicCaster.h:90
void DeselectSpellImpl() override
void SetCurrentSpellImpl(MagicItem *a_spell) override
void ClearMagicNode() override
void SetCastingTimerForCharge() override
~ActorMagicCaster() override
RefAttachTechniqueInput castingArtData
Definition: ActorMagicCaster.h:80
void CheckAttachCastingArt()
Definition: ActorMagicCaster.h:72
virtual void Update(float a_delta)
InterruptHandler_t * interruptHandler
Definition: ActorMagicCaster.h:85
Actor * actor
Definition: ActorMagicCaster.h:82
void SelectSpellImpl() override
MagicSystem::CastingSource GetCastingSource() const override
void FinishCastImpl() override
TESObjectREFR * GetCasterStatsObject() const override
Definition: Actor.h:133
Definition: BGSArtObject.h:12
Definition: BGSLoadGameBuffer.h:6
Definition: BGSSaveGameBuffer.h:10
Definition: BSTEvent.h:143
Definition: MagicCaster.h:25
Definition: MagicItem.h:30
Definition: NiNode.h:12
Definition: RefAttachTechniqueInput.h:12
Definition: ReferenceEffectController.h:19
Definition: SimpleAnimationGraphManagerHolder.h:11
Definition: TESObjectREFR.h:113
SoundID
Definition: MagicSystem.h:54
CannotCastReason
Definition: MagicSystem.h:13
CastingSource
Definition: MagicSystem.h:27
Definition: AbsorbEffect.h:6
constexpr std::array< REL::ID, 3 > VTABLE_ActorMagicCaster
Definition: Offsets_VTABLE.h:7365
constexpr REL::ID RTTI_ActorMagicCaster(static_cast< std::uint64_t >(686479))
Definition: BGSLoadGameSubBuffer.h:14