forked from Phobos-developers/Phobos
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBody.h
More file actions
94 lines (72 loc) · 2.68 KB
/
Body.h
File metadata and controls
94 lines (72 loc) · 2.68 KB
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
#pragma once
#include <TechnoClass.h>
#include <AnimClass.h>
#include <Helpers/Macro.h>
#include <Utilities/Container.h>
#include <Utilities/TemplateDef.h>
#include <New/Entity/ShieldClass.h>
#include <New/Entity/LaserTrailClass.h>
class BulletClass;
class TechnoExt
{
public:
using base_type = TechnoClass;
class ExtData final : public Extension<TechnoClass>
{
public:
Valueable<BulletClass*> InterceptedBullet;
std::unique_ptr<ShieldClass> Shield;
ValueableVector<std::unique_ptr<LaserTrailClass>> LaserTrails;
Valueable<bool> ReceiveDamage;
Valueable<bool> LastKillWasTeamTarget;
TimerStruct PassengerDeletionTimer;
Valueable<int> PassengerDeletionCountDown;
Valueable<ShieldTypeClass*> CurrentShieldType;
ExtData(TechnoClass* OwnerObject) : Extension<TechnoClass>(OwnerObject)
, InterceptedBullet { nullptr }
, Shield {}
, LaserTrails {}
, ReceiveDamage { false }
, LastKillWasTeamTarget { false }
, PassengerDeletionTimer {}
, PassengerDeletionCountDown { -1 }
, CurrentShieldType {}
{ }
virtual ~ExtData() = default;
virtual void InvalidatePointer(void* ptr, bool bRemoved) override
{
this->Shield->InvalidatePointer(ptr);
}
virtual void LoadFromStream(PhobosStreamReader& Stm) override;
virtual void SaveToStream(PhobosStreamWriter& Stm) override;
private:
template <typename T>
void Serialize(T& Stm);
};
class ExtContainer final : public Container<TechnoExt>
{
public:
ExtContainer();
~ExtContainer();
virtual void InvalidatePointer(void* ptr, bool bRemoved) override;
};
static ExtContainer ExtMap;
static bool LoadGlobals(PhobosStreamReader& Stm);
static bool SaveGlobals(PhobosStreamWriter& Stm);
static bool IsActive(TechnoClass* pThis);
static bool IsHarvesting(TechnoClass* pThis);
static bool HasAvailableDock(TechnoClass* pThis);
static void InitializeLaserTrails(TechnoClass* pThis);
static void InitializeShield(TechnoClass* pThis);
static CoordStruct GetFLHAbsoluteCoords(TechnoClass* pThis, CoordStruct flh, bool turretFLH = false);
static CoordStruct GetBurstFLH(TechnoClass* pThis, int weaponIndex, bool& FLHFound);
static void FireWeaponAtSelf(TechnoClass* pThis, WeaponTypeClass* pWeaponType);
static void TransferMindControlOnDeploy(TechnoClass* pTechnoFrom, TechnoClass* pTechnoTo);
static void ApplyMindControlRangeLimit(TechnoClass* pThis);
static void ApplyInterceptor(TechnoClass* pThis);
static void ApplyPowered_KillSpawns(TechnoClass* pThis);
static void ApplySpawn_LimitRange(TechnoClass* pThis);
static void ObjectKilledBy(TechnoClass* pThis, TechnoClass* pKiller);
static void EatPassengers(TechnoClass* pThis);
static bool CanFireNoAmmoWeapon(TechnoClass* pThis, int weaponIndex);
};