-
Notifications
You must be signed in to change notification settings - Fork 1
/
InfantryClass.h
96 lines (77 loc) · 2.58 KB
/
InfantryClass.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
/*
Infantry
*/
#pragma once
#include <FootClass.h>
#include <InfantryTypeClass.h>
class NOVTABLE InfantryClass : public FootClass
{
public:
static const AbstractType AbsID = AbstractType::Infantry;
//Static
static DynamicVectorClass<InfantryClass*>* const Array;
//IPersist
virtual HRESULT __stdcall GetClassID(CLSID* pClassID) R0;
//Destructor
virtual ~InfantryClass() RX;
//AbstractClass
virtual AbstractType WhatAmI() const RT(AbstractType);
virtual int Size() const R0;
//ObjectClass
virtual InfantryTypeClass* GetType() const override
{ return this->Type; }
//TechnoClass
virtual InfantryTypeClass* GetTechnoType() const override
{ return this->Type; }
//InfantryClass
virtual bool IsDeployed() const R0;
virtual bool PlayAnim(Sequence index, bool force = false, bool randomStartFrame = false) R0;
//non virtual
void UpdateSequence()
{ JMP_THIS(0x520AE0); }
//Ares WC added
bool UnderDeployState() const
{
auto sequenceAnim = this->SequenceAnim;
/*return sequenceAnim == Sequence::Deploy
|| sequenceAnim == Sequence::Deployed
|| sequenceAnim == Sequence::DeployedFire
|| sequenceAnim == Sequence::DeployedIdle; */
//bellow is faster
return sequenceAnim >= Sequence::Deploy && sequenceAnim <= Sequence::DeployedIdle;
}
bool PlayAnim(int index, bool force = false, bool randomStartFrame = false)
{
return this->PlayAnim(static_cast<Sequence>(index), force, randomStartFrame);
}
//InfantryClass::Update()->UpdatePanic()
void UpdatePanic()
{ JMP_THIS(0x5200B0); }
//end
//Constructor
InfantryClass(InfantryTypeClass* pType, HouseClass* pOwner) noexcept
: InfantryClass(noinit_t())
{ JMP_THIS(0x517A50); }
protected:
explicit __forceinline InfantryClass(noinit_t) noexcept
: FootClass(noinit_t())
{ }
//===========================================================================
//===== Properties ==========================================================
//===========================================================================
public:
InfantryTypeClass* Type;
Sequence SequenceAnim; //which is currently playing
TimerStruct unknown_Timer_6C8;
DWORD PanicDurationLeft; // set in ReceiveDamage on panicky units
bool PermanentBerzerk; // set by script action, not cleared anywhere
bool Technician;
bool unknown_bool_6DA;
bool Crawling;
bool unknown_bool_6DC;
bool unknown_bool_6DD;
DWORD unknown_6E0;
bool ShouldDeploy;
BOOL IsOnLand;//int unknown_int_6E8; used for enter/leave water sound play
PROTECTED_PROPERTY(DWORD, unused_6EC); //??
};