CommonLibSSE (powerof3)
MagicCaster.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/B/BSPointerHandle.h"
4 #include "RE/B/BSSoundHandle.h"
5 #include "RE/B/BSTArray.h"
6 #include "RE/B/bhkPickData.h"
7 #include "RE/M/MagicSystem.h"
8 
9 namespace RE
10 {
11  class Actor;
12  class ActiveEffect;
13  class BGSSaveGameBuffer;
14  class BGSLoadGameBuffer;
15  class MagicItem;
16  class MagicTarget;
17  class NiNode;
18  class TESBoundObject;
19  class TESObjectCELL;
20  class TESObjectREFR;
21 
22  struct Effect;
23 
25  {
26  public:
27  inline static constexpr auto RTTI = RTTI_MagicCaster;
28  inline static constexpr auto VTABLE = VTABLE_MagicCaster;
29 
30  enum class State
31  {
32  kNone = 0,
33  kUnk01, // Start?
34  kUnk02, // StartCharge?
35  kReady,
36  kUnk04, // PreStart?
37  kCharging,
38  kCasting,
39  kUnk07, // Unknown
40  kUnk08, // Interrupt
41  kUnk09, // Interrupt/Deselect
42  };
43 
44  virtual ~MagicCaster(); // 00
45 
46  // add
47  virtual void CastSpellImmediate(MagicItem* a_spell, bool a_noHitEffectArt, TESObjectREFR* a_target, float a_effectiveness, bool a_hostileEffectivenessOnly, float a_magnitudeOverride, Actor* a_blameActor); // 01
48  virtual void FindTouchTarget(); // 02
49  virtual void RequestCastImpl(); // 03
50  virtual bool StartChargeImpl(); // 04
51  virtual void StartReadyImpl(); // 05
52  virtual void StartCastImpl(); // 06
53  virtual void FinishCastImpl(); // 07 - { return; }
54  virtual void InterruptCastImpl(bool a_depleteEnergy); // 08 - { return; }
55  virtual void SpellCast(bool a_doCast, std::uint32_t a_arg2, MagicItem* a_spell); // 09 - { return; }
56  virtual bool CheckCast(MagicItem* a_spell, bool a_dualCast, float* a_effectStrength, MagicSystem::CannotCastReason* a_reason, bool a_useBaseValueForCost); // 0A
57  virtual TESObjectREFR* GetCasterStatsObject() const; // 0B - { return 0; }
58  virtual Actor* GetCasterAsActor() const; // 0C - { return 0; }
59  virtual TESObjectREFR* GetCasterObjectReference(Actor** a_outCaster) const; // 0D
60  virtual NiNode* GetMagicNode(); // 0E - { return 0; }
61  virtual void ClearMagicNode(); // 0F - { return; }
62  virtual void SetCurrentSpellImpl(MagicItem* a_spell); // 10 - { return; }
63  virtual void SelectSpellImpl(); // 11 - { return; }
64  virtual void DeselectSpellImpl(); // 12 - { return; }
65  virtual void SetSkipCheckCast(); // 13 - { return; }
66  virtual void SetCastingTimerForCharge(); // 14
67  virtual MagicSystem::CastingSource GetCastingSource() const; // 15 - { return 0; }
68  virtual bool GetIsDualCasting() const; // 16 - { return 0; }
69  virtual void SetDualCasting(bool a_set); // 17 - { return; }
70  virtual void SaveGame(BGSSaveGameBuffer* a_buf); // 18
71  virtual void LoadGame(BGSLoadGameBuffer* a_buf); // 19
72  virtual void FinishLoadGame(BGSLoadGameBuffer* a_buf); // 1A
73  virtual void PrepareSound(MagicSystem::SoundID a_sound, MagicItem* a_spell); // 1B
74  virtual void AdjustActiveEffect(ActiveEffect* a_activeEffect, float a_power, bool a_arg3); // 1C
75 
76  MagicTarget* FindPickTarget(NiPoint3& a_targetLocation, TESObjectCELL** a_targetCell, bhkPickData& a_pickData);
77  bool FindTargets(float a_effectivenessMult, std::uint32_t& a_targetCount, TESBoundObject* a_source, bool a_loadCast, bool a_adjustOnlyHostileEffectiveness);
78  void FinishCast();
80  void InterruptCast(bool a_refund);
81  void PlayReleaseSound(MagicItem* a_item);
82  void SetCurrentSpell(MagicItem* a_item);
83  bool TestProjectilePlacement(const Effect& a_effect, const bhkPickData& a_pickData);
84  void UpdateImpl(float a_delta);
85 
86  // members
89  std::uint32_t pad24; // 24
92  float castingTimer; // 34
93  float currentSpellCost; // 38
94  float magnitudeOverride; // 3C
95  float nextTargetUpdate; // 40
96  float projectileTimer; // 44
97  };
98  static_assert(sizeof(MagicCaster) == 0x48);
99 }
Definition: ActiveEffect.h:27
Definition: Actor.h:133
Definition: BGSLoadGameBuffer.h:6
Definition: BGSSaveGameBuffer.h:10
Definition: BSTArray.h:378
Definition: MagicCaster.h:25
virtual bool GetIsDualCasting() const
MagicItem * currentSpell
Definition: MagicCaster.h:90
float currentSpellCost
Definition: MagicCaster.h:93
virtual void SaveGame(BGSSaveGameBuffer *a_buf)
BSTArray< BSSoundHandle > sounds
Definition: MagicCaster.h:87
virtual bool CheckCast(MagicItem *a_spell, bool a_dualCast, float *a_effectStrength, MagicSystem::CannotCastReason *a_reason, bool a_useBaseValueForCost)
bool FindTargets(float a_effectivenessMult, std::uint32_t &a_targetCount, TESBoundObject *a_source, bool a_loadCast, bool a_adjustOnlyHostileEffectiveness)
virtual void RequestCastImpl()
virtual void DeselectSpellImpl()
float GetCurrentSpellCost()
ObjectRefHandle desiredTarget
Definition: MagicCaster.h:88
virtual MagicSystem::CastingSource GetCastingSource() const
float magnitudeOverride
Definition: MagicCaster.h:94
virtual NiNode * GetMagicNode()
virtual void FinishCastImpl()
static constexpr auto VTABLE
Definition: MagicCaster.h:28
virtual void SpellCast(bool a_doCast, std::uint32_t a_arg2, MagicItem *a_spell)
virtual void SetDualCasting(bool a_set)
virtual void CastSpellImmediate(MagicItem *a_spell, bool a_noHitEffectArt, TESObjectREFR *a_target, float a_effectiveness, bool a_hostileEffectivenessOnly, float a_magnitudeOverride, Actor *a_blameActor)
virtual void ClearMagicNode()
virtual ~MagicCaster()
virtual TESObjectREFR * GetCasterObjectReference(Actor **a_outCaster) const
virtual void LoadGame(BGSLoadGameBuffer *a_buf)
virtual void AdjustActiveEffect(ActiveEffect *a_activeEffect, float a_power, bool a_arg3)
static constexpr auto RTTI
Definition: MagicCaster.h:27
virtual void FinishLoadGame(BGSLoadGameBuffer *a_buf)
void PlayReleaseSound(MagicItem *a_item)
virtual Actor * GetCasterAsActor() const
virtual void SetCurrentSpellImpl(MagicItem *a_spell)
virtual void SetCastingTimerForCharge()
float projectileTimer
Definition: MagicCaster.h:96
virtual bool StartChargeImpl()
virtual void SetSkipCheckCast()
virtual void StartReadyImpl()
virtual void StartCastImpl()
void SetCurrentSpell(MagicItem *a_item)
void UpdateImpl(float a_delta)
virtual void SelectSpellImpl()
std::uint32_t pad24
Definition: MagicCaster.h:89
float nextTargetUpdate
Definition: MagicCaster.h:95
MagicTarget * FindPickTarget(NiPoint3 &a_targetLocation, TESObjectCELL **a_targetCell, bhkPickData &a_pickData)
State
Definition: MagicCaster.h:31
void InterruptCast(bool a_refund)
virtual void InterruptCastImpl(bool a_depleteEnergy)
virtual TESObjectREFR * GetCasterStatsObject() const
REX::EnumSet< State, std::uint32_t > state
Definition: MagicCaster.h:91
bool TestProjectilePlacement(const Effect &a_effect, const bhkPickData &a_pickData)
float castingTimer
Definition: MagicCaster.h:92
virtual void PrepareSound(MagicSystem::SoundID a_sound, MagicItem *a_spell)
virtual void FindTouchTarget()
Definition: MagicItem.h:30
Definition: MagicTarget.h:25
Definition: NiNode.h:12
Definition: NiPoint3.h:6
Definition: TESBoundObject.h:24
Definition: TESObjectCELL.h:115
Definition: TESObjectREFR.h:114
SoundID
Definition: MagicSystem.h:54
CannotCastReason
Definition: MagicSystem.h:13
CastingSource
Definition: MagicSystem.h:27
Definition: AbsorbEffect.h:6
constexpr REL::ID RTTI_MagicCaster(static_cast< std::uint64_t >(513999))
constexpr std::array< REL::ID, 1 > VTABLE_MagicCaster
Definition: Offsets_VTABLE.h:11973
Definition: Effect.h:11
Definition: bhkPickData.h:11