forked from Phobos-developers/YRpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CaptureManagerClass.h
96 lines (77 loc) · 2.62 KB
/
CaptureManagerClass.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/*
CaptureManager - used for mind control.
*/
#pragma once
#include <AbstractClass.h>
class HouseClass;
class TechnoClass;
struct ControlNode
{
explicit ControlNode() noexcept { }
TechnoClass* Unit;
HouseClass* OriginalOwner;
DECLARE_PROPERTY(CDTimerClass, LinkDrawTimer);
};
class NOVTABLE CaptureManagerClass : public AbstractClass
{
public:
static const AbstractType AbsID = AbstractType::CaptureManager;
//Static
static constexpr constant_ptr<DynamicVectorClass<CaptureManagerClass*>, 0x89E0F0u> const Array{};
//IPersist
virtual HRESULT __stdcall GetClassID(CLSID* pClassID) R0;
//IPersistStream
virtual HRESULT __stdcall Load(IStream* pStm) R0;
virtual HRESULT __stdcall Save(IStream* pStm, BOOL fClearDirty) R0;
//Destructor
virtual ~CaptureManagerClass() RX;
//AbstractClass
virtual AbstractType WhatAmI() const RT(AbstractType);
virtual int Size() const R0;
//non-virtual
bool CaptureUnit(TechnoClass* pUnit)
{ JMP_THIS(0x471D40); }
bool FreeUnit(TechnoClass* pUnit)
{ JMP_THIS(0x471FF0); }
void FreeAll()
{ JMP_THIS(0x472140); }
int NumControlNodes() const
{ return ControlNodes.Count; }
bool CanCapture(TechnoClass *Target) const
{ JMP_THIS(0x471C90); }
bool CannotControlAnyMore() const
{ JMP_THIS(0x4722A0); }
bool IsControllingSomething() const
{ JMP_THIS(0x4722C0); }
bool IsOverloading(bool *wasDamageApplied) const
{ JMP_THIS(0x4726C0); }
void HandleOverload()
{ JMP_THIS(0x471A50); }
bool NeedsToDrawLinks() const
{ JMP_THIS(0x472640); }
bool DrawLinks()
{ JMP_THIS(0x472160); }
void DecideUnitFate(TechnoClass *Unit)
{ JMP_THIS(0x4723B0); }
HouseClass* GetOriginalOwner(TechnoClass *Unit) const
{ JMP_THIS(0x4722F0); }
//Constructor
CaptureManagerClass(TechnoClass* pOwner, int nMaxControlNodes, bool bInfiniteControl) noexcept
: CaptureManagerClass(noinit_t())
{ JMP_THIS(0x4717D0); }
protected:
explicit __forceinline CaptureManagerClass(noinit_t) noexcept
: AbstractClass(noinit_t())
{ }
//===========================================================================
//===== Properties ==========================================================
//===========================================================================
public:
DynamicVectorClass<ControlNode*> ControlNodes;
int MaxControlNodes;
bool InfiniteMindControl;
bool OverloadDeathSoundPlayed; // Has the mind control death sound played already?
int OverloadPipState; // Used to create the red overloading pip by returning true in IsOverloading's wasDamageApplied for 10 frames.
TechnoClass* Owner;
int OverloadDamageDelay; // Decremented every frame. If it reaches zero, OverloadDamage is applied.
};