-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBaseEntity.h
3255 lines (3069 loc) · 102 KB
/
BaseEntity.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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#pragma once
#include "misc.h"
#include <string>
#include "NetVarManager.h"
#include "utlvectorsimple.h"
#include <vector>
#include "bone_accessor.h"
#include "Offsets.h"
#include "threadtools.h"
#include <unordered_map>
#include "ClientSideAnimationList.h"
#include "ClassIDS.h"
#include "Intersection.h"
#include "NetworkedVariables.h"
#include "CBaseHandle.h"
#include "IClientRenderable.h"
#include "UtlVector.hpp"
#include "UtlSortVector.h"
#include "utlsymbol.h"
class CGameTrace;
class C_BaseViewModel;
typedef CGameTrace trace_t;
class VarMapping_t;
class CParticleProperty;
#pragma pack(push, 1)
class CAttachmentData
{
public:
matrix3x4_t m_AttachmentToWorld;
QAngle m_angRotation; //0x30
Vector m_vOriginVelocity; //3C
int m_nLastFramecount;// : 31; //48
unsigned char m_bAnglesComputed;// : 1; //4C
char pad[3];
};
#pragma pack(pop)
enum eEntityType
{
none = -1,
player,
weapon,
item,
projectile,
c4,
plantedc4,
chicken
};
class CBaseHandle;
class INetChannelInfo;
class ICollideable;
class CBaseAnimating;
class CBaseCombatWeapon;
class C_AnimationLayer;
class C_AnimationLayerFromPacket;
struct StoredNetvars;
struct C_CSGOPlayerAnimState;
class CCSGOPlayerAnimState;
struct studiohdr_t;
class CStudioHdr;
enum PlayerAnimEvent_t;
class IPhysicsObject;
class CSphere;
class COBB;
class IClientVehicle;
class CPlayerrecord;
class CTickrecord;
struct datamap_t;
class CBaseEntity;
enum ParticleAttachment_t;
struct ParticleControlPoint_t
{
ParticleControlPoint_t()
{
iControlPoint = 0;
iAttachType = (ParticleAttachment_t)1/* PATTACH_ABSORIGIN_FOLLOW*/;
iAttachmentPoint = 0;
vecOriginOffset = { 0.0f,0.0f,0.0f };
}
int iControlPoint;
ParticleAttachment_t iAttachType;
int iAttachmentPoint;
Vector vecOriginOffset;
EHANDLE hEntity;
};
class CParticleSimulateIterator;
struct Particle;
class CParticleRenderIterator;
class CParticleSubTexture;
class CParticleSubTextureGroup;
class CEffectMaterial;
struct Particle
{
Particle *m_pPrev, *m_pNext;
// Which sub texture this particle uses (so we can get at the tcoord mins and maxs).
CParticleSubTexture *m_pSubTexture;
// If m_Pos isn't used to store the world position, then implement IParticleEffect::GetParticlePosition()
Vector m_Pos; // Position of the particle in world space
};
#if 0
class IParticleEffect
{
public:
virtual ~IParticleEffect() {}
virtual void Update(float fTimeDelta) {}
virtual void StartRender(VMatrix &effectMatrix) {}
virtual bool ShouldSimulate() const = 0;
virtual void SetShouldSimulate(bool bSim) = 0;
virtual void SimulateParticles(CParticleSimulateIterator *pIterator) = 0;
virtual void RenderParticles(CParticleRenderIterator *pIterator) = 0;
virtual void NotifyRemove() {}
virtual void NotifyDestroyParticle(Particle* pParticle) {}
virtual const Vector &GetSortOrigin() = 0;
virtual const Vector *GetParticlePosition(Particle *pParticle) { return &pParticle->m_Pos; }
virtual const char *GetEffectName() { return "???"; }
};
class CParticleEffectBinding : public CDefaultClientRenderable
{
friend class CParticleMgr;
friend class CParticleSimulateIterator;
friend class CNewParticleEffect;
public:
virtual const Vector& GetRenderOrigin(void);
virtual const QAngle& GetRenderAngles(void);
virtual const matrix3x4_t & RenderableToWorldTransform();
virtual void GetRenderBounds(Vector& mins, Vector& maxs);
virtual bool ShouldDraw(void);
virtual int DrawModel(int flags, const RenderableInstance_t &instance);
//private:
VMatrix m_LocalSpaceTransform;
bool m_bLocalSpaceTransformIdentity; // If this is true, then m_LocalSpaceTransform is assumed to be identity.
// Bounding box. Stored in WORLD space.
Vector m_Min;
Vector m_Max;
// paramter copies to detect changes
Vector m_LastMin;
Vector m_LastMax;
// The particle cull size
float m_flParticleCullRadius;
// Number of active particles.
unsigned short m_nActiveParticles;
// See CParticleMgr::m_FrameCode.
unsigned short m_FrameCode;
// For CParticleMgr's list index.
unsigned short m_ListIndex;
IParticleEffect *m_pSim;
CParticleMgr *m_pParticleMgr;
// Combination of the CParticleEffectBinding::FLAGS_ flags.
int m_Flags;
// Materials this effect is using.
enum { EFFECT_MATERIAL_HASH_SIZE = 8 };
CEffectMaterial *m_EffectMaterialHash[EFFECT_MATERIAL_HASH_SIZE];
// For faster iteration.
CUtlLinkedList<CEffectMaterial*, unsigned short> m_Materials;
// auto updates the bbox after N frames
unsigned short m_UpdateBBoxCounter;
};
class CParticleEffect : public IParticleEffect
{
DECLARE_CLASS_NOBASE(CParticleEffect);
friend class CRefCountAccessor;
public:
virtual void SetParticleCullRadius(float radius);
virtual void NotifyRemove(void);
virtual const Vector & GetSortOrigin();
virtual void NotifyDestroyParticle(Particle* pParticle);
virtual void Update(float flTimeDelta);
virtual bool ShouldSimulate() const { return m_bSimulate; }
virtual void SetShouldSimulate(bool bSim) { m_bSimulate = bSim; }
protected:
virtual ~CParticleEffect();
enum
{
FLAG_ALLOCATED = (1 << 1), // Most of the CParticleEffects are dynamically allocated but
// some are member variables of a class. If they're member variables.
FLAG_DONT_REMOVE = (1 << 2),
};
// Used to track down bugs.
char const *m_pDebugName;
CParticleEffectBinding m_ParticleEffect;
Vector m_vSortOrigin;
int m_Flags; // Combination of CParticleEffect::FLAG_
bool m_bSimulate;
int m_nToolParticleEffectId;
private:
int m_RefCount;
};
class CNewParticleEffect : public IParticleEffect, public CParticleCollection, public CDefaultClientRenderable
{
public:
DECLARE_CLASS_NOBASE(CNewParticleEffect);
//DECLARE_REFERENCED_CLASS(CNewParticleEffect);
public:
friend class CRefCountAccessor;
friend class CParticleSystemQuery;
// list management
CNewParticleEffect *m_pNext;
CNewParticleEffect *m_pPrev;
virtual int GetRenderFlags(void);
virtual bool ShouldDrawForSplitScreenUser(int nSlot);
virtual int DrawModel(int flags, const RenderableInstance_t &instance);
virtual void SimulateParticles(CParticleSimulateIterator *pIterator)
{
}
virtual void RenderParticles(CParticleRenderIterator *pIterator)
{
}
virtual void SetParticleCullRadius(float radius);
virtual void NotifyRemove(void);
virtual const Vector & GetSortOrigin(void);
// virtual void NotifyDestroyParticle( Particle* pParticle );
virtual void Update(float flTimeDelta);
virtual bool ShouldSimulate() const { return m_bSimulate; }
virtual void SetShouldSimulate(bool bSim) { m_bSimulate = bSim; }
virtual ~CNewParticleEffect();
protected:
// Used to track down bugs.
const char *m_pDebugName;
bool m_bDontRemove : 1;
bool m_bRemove : 1;
bool m_bDrawn : 1;
bool m_bNeedsBBoxUpdate : 1;
bool m_bIsFirstFrame : 1;
bool m_bAutoUpdateBBox : 1;
bool m_bAllocated : 1;
bool m_bSimulate : 1;
bool m_bRecord : 1;
bool m_bShouldPerformCullCheck : 1;
// if a particle system is created through the non-aggregation entry point, we can't aggregate into it
bool m_bDisableAggregation : 1;
int m_nToolParticleEffectId;
Vector m_vSortOrigin;
EHANDLE m_hOwner;
EHANDLE m_hControlPointOwners[MAX_PARTICLE_CONTROL_POINTS];
// holds the min/max bounds used to manage this thing in the client leaf system
Vector m_LastMin;
Vector m_LastMax;
int m_nSplitScreenUser; // -1 means don't care
Vector m_vecAggregationCenter; // origin for aggregation if aggregation enabled
private:
int m_RefCount; // When this goes to zero and the effect has no more active
// particles, (and it's dynamically allocated), it will delete itself.
matrix3x4a_t m_DrawModelMatrix;
};
#endif
#define MAX_PARTICLE_CONTROL_POINTS 64
class CNewParticleEffect;
class CParticleCollection
{
public:
CNewParticleEffect* ToNewParticleEffect() { return (CNewParticleEffect*)((uintptr_t)this - 16); }
CParticleCollection* GetChildren() { return (CParticleCollection*)*(uintptr_t*)((uintptr_t)this + 0x8C); }
CParticleCollection* GetNext() { return (CParticleCollection*)*(uintptr_t*)((uintptr_t)this + 0x70); }
Vector& GetPosition(int nWhichPoint) { return *(Vector*)(*(uintptr_t *)((uintptr_t)this + 0x68) + 96 * nWhichPoint); } //Located in CParticleCollection::SetControlPoint
Vector& GetOrigin() { return *(Vector*)((uintptr_t)this + 0xB0); }
int GetNumControlPointsAllocated() { return *(int*)((uintptr_t)this + 0x64); }
int GetHighestControlPoint() { return *(int*)((uintptr_t)this + 0xBC); }
void RenderChildren(const ColorRGBA& color);
};
class CNewParticleEffect
{
public:
CParticleCollection* ToParticleCollection() { return (CParticleCollection*)((uintptr_t)this + 16); }
EHANDLE& GetOwner() { return *(EHANDLE*)((uintptr_t)&GetSortOrigin() + sizeof(Vector)); }
EHANDLE *GetControlPointOwners() { return (EHANDLE*)((uintptr_t)&GetOwner() + sizeof(EHANDLE)); }; //MAX_PARTICLE_CONTROL_POINTS
Vector& GetSortOrigin() { return *(Vector*)((uintptr_t)this + 0x3B8); }; //m_vSortOrigin
Vector& GetRenderOrigin() { return GetSortOrigin(); };
Vector& GetLastMax() { return *(Vector*)((uintptr_t)this + 0x4D4); }
Vector& GetLastMin() { return *(Vector*)((uintptr_t)this + 0x4C8); }
Vector& GetMinBounds() { return *(Vector*)((uintptr_t)this + 0x0B4); }
Vector& GetMaxBounds() { return *(Vector*)((uintptr_t)this + 0x0C0); }
Vector& GetAggregationCenter() { return *(Vector*)((uintptr_t)this + 0x4E4); };
matrix3x4_t& GetDrawModelMatrix() { return *(matrix3x4_t*)((uintptr_t)this + 0x4F8); }
bool IsAggregationDisabled() { return *(bool*)((uintptr_t)this + 0x3AC); }; //note: game writes a dword to this
bool IsBoundsValid() { return *(bool*)((uintptr_t)this + 0x0B0); }
//const char* GetDebugName() { return (const char*)((uintptr_t)this + 0x3B1); } //AND BYTE PTR DS:[EDI+3B1],FB ?????
};
struct ParticleEffectList_t
{
ParticleEffectList_t()
{
pParticleEffect = NULL;
}
CUtlVector<ParticleControlPoint_t> pControlPoints;
/*CSmartPtr<CNewParticleEffect>*/ CNewParticleEffect* pParticleEffect;
};
class CParticleProperty
{
public:
CBaseEntity *m_pOuter;
CUtlVector<ParticleEffectList_t> m_ParticleEffects;
int m_iDormancyChangedAtFrame;
friend class CBaseEntity;
};
Vector MainViewOrigin(int nSlot);
extern bool* s_bEnableInvalidateBoneCache;
extern bool* bAllowBoneAccessForViewModels;
extern bool* bAllowBoneAccessForNormalModels;
extern unsigned long* g_iModelBoneCounter;
extern bool* g_bInThreadedBoneSetup;
extern bool (*ThreadInMainThread)(void);
extern DWORD AdrOf_SequenceDuration;
extern bool AllowSetupBonesToUpdateAttachments;
CBaseEntity* GetHudPlayer();
void __stdcall SurvivalCalcView(void* survivalgamerules, CBaseEntity* _Entity, Vector& eyeOrigin, QAngle& eyeAngles);
const CBaseEntity* EntityFromEntityHandle(const IHandleEntity* pConstHandleEntity);
CBaseEntity* EntityFromEntityHandle(IHandleEntity* pHandleEntity);
enum RenderableTranslucencyType_t;
extern RenderableTranslucencyType_t GetTranslucencyType(ClientRenderHandle_t handle);
extern DWORD oDoAnimationEvent;
extern DWORD oCSPlayerAnimState_Release;
class CEntIndexLessFunc
{
public:
bool Less(CBaseEntity * const & lhs, CBaseEntity * const & rhs, void *pContext);
};
class CPredictableList
{
public:
CBaseEntity *GetPredictable(int slot);
int GetPredictableCount(void) const;
protected:
void AddToPredictableList(CBaseEntity *add);
void RemoveFromPredictablesList(CBaseEntity *remove);
private:
CUtlSortVector< CBaseEntity *, CEntIndexLessFunc > m_Predictables;
friend class CBaseEntity;
};
__forceinline CBaseEntity *CPredictableList::GetPredictable(int slot)
{
return m_Predictables[slot];
}
__forceinline int CPredictableList::GetPredictableCount(void) const
{
return m_Predictables.Count();
}
extern CPredictableList *GetPredictables(int nSlot);
#define ENTCLIENTFLAG_DONTUSEIK 2
enum
{
EFL_KILLME = (1 << 0), // This entity is marked for death -- This allows the game to actually delete ents at a safe time
EFL_DORMANT = (1 << 1), // Entity is dormant, no updates to client
EFL_NOCLIP_ACTIVE = (1 << 2), // Lets us know when the noclip command is active.
EFL_SETTING_UP_BONES = (1 << 3), // Set while a model is setting up its bones.
EFL_KEEP_ON_RECREATE_ENTITIES = (1 << 4), // This is a special entity that should not be deleted when we restart entities only
EFL_HAS_PLAYER_CHILD = (1 << 4), // One of the child entities is a player.
EFL_DIRTY_SHADOWUPDATE = (1 << 5), // Client only- need shadow manager to update the shadow...
EFL_NOTIFY = (1 << 6), // Another entity is watching events on this entity (used by teleport)
// The default behavior in ShouldTransmit is to not send an entity if it doesn't
// have a model. Certain entities want to be sent anyway because all the drawing logic
// is in the client DLL. They can set this flag and the engine will transmit them even
// if they don't have a model.
EFL_FORCE_CHECK_TRANSMIT = (1 << 7),
EFL_BOT_FROZEN = (1 << 8), // This is set on bots that are frozen.
EFL_SERVER_ONLY = (1 << 9), // Non-networked entity.
EFL_NO_AUTO_EDICT_ATTACH = (1 << 10), // Don't attach the edict; we're doing it explicitly
// Some dirty bits with respect to abs computations
EFL_DIRTY_ABSTRANSFORM = (1 << 11),
EFL_DIRTY_ABSVELOCITY = (1 << 12),
EFL_DIRTY_ABSANGVELOCITY = (1 << 13),
EFL_DIRTY_SURROUNDING_COLLISION_BOUNDS = (1 << 14),
EFL_DIRTY_SPATIAL_PARTITION = (1 << 15),
// UNUSED = (1<<16),
EFL_IN_SKYBOX = (1 << 17), // This is set if the entity detects that it's in the skybox.
// This forces it to pass the "in PVS" for transmission.
EFL_USE_PARTITION_WHEN_NOT_SOLID = (1 << 18), // Entities with this flag set show up in the partition even when not solid
EFL_TOUCHING_FLUID = (1 << 19), // Used to determine if an entity is floating
// FIXME: Not really sure where I should add this...
EFL_IS_BEING_LIFTED_BY_BARNACLE = (1 << 20),
EFL_NO_ROTORWASH_PUSH = (1 << 21), // I shouldn't be pushed by the rotorwash
EFL_NO_THINK_FUNCTION = (1 << 22),
EFL_NO_GAME_PHYSICS_SIMULATION = (1 << 23),
EFL_CHECK_UNTOUCH = (1 << 24),
EFL_DONTBLOCKLOS = (1 << 25), // I shouldn't block NPC line-of-sight
EFL_DONTWALKON = (1 << 26), // NPC;s should not walk on this entity
EFL_NO_DISSOLVE = (1 << 27), // These guys shouldn't dissolve
EFL_NO_MEGAPHYSCANNON_RAGDOLL = (1 << 28), // Mega physcannon can't ragdoll these guys.
EFL_NO_WATER_VELOCITY_CHANGE = (1 << 29), // Don't adjust this entity's velocity when transitioning into water
EFL_NO_PHYSCANNON_INTERACTION = (1 << 30), // Physcannon can't pick these up or punt them
EFL_NO_DAMAGE_FORCES = (1 << 31), // Doesn't accept forces from physics damage
};
#define CNetworkQAngle(name) QAngle name;
#define CNetworkVector(name) Vector name;
#define CNetworkVar(type, name) type name;
#define CNetworkArray(type, name, count) type name[count];
struct localdata_t
{
CNetworkArray(unsigned char, m_chAreaBits, MAX_AREA_STATE_BYTES); // Area visibility flags.
CNetworkArray(unsigned char, m_chAreaPortalBits, MAX_AREA_PORTAL_STATE_BYTES); // Area portal visibility flags.
// BEGIN PREDICTION DATA COMPACTION (these fields are together to allow for faster copying in prediction system)
int m_nStepside;
int m_nOldButtons;
CNetworkVar(float, m_flFOVRate); // rate at which the FOV changes
CNetworkVar(int, m_iHideHUD); // bitfields containing sections of the HUD to hide
CNetworkVar(int, m_nDuckTimeMsecs_);
CNetworkVar(int, m_nDuckJumpTimeMsecs_);
CNetworkVar(int, m_nJumpTimeMsecs_);
CNetworkVar(float, m_flFallVelocity_);
float m_flOldFallVelocity;
CNetworkVar(float, m_flStepSize_);
CNetworkQAngle(m_viewPunchAngle_);
CNetworkQAngle(m_aimPunchAngle_); // auto-decaying view angle adjustment
CNetworkQAngle(m_aimPunchAngleVel_); // velocity of auto-decaying view angle adjustment
CNetworkVar(bool, m_bDucked_);
CNetworkVar(bool, m_bDucking_);
CNetworkVar(float, m_flLastDuckTime_);
CNetworkVar(bool, m_bInDuckJump_);
CNetworkVar(bool, m_bDrawViewmodel);
CNetworkVar(bool, m_bWearingSuit);
CNetworkVar(bool, m_bPoisoned);
CNetworkVar(bool, m_bAllowAutoMovement_);
// END PREDICTION DATA COMPACTION
bool m_bInLanding;
float m_flLandingTime;
// Base velocity that was passed in to server physics so
// client can predict conveyors correctly. Server zeroes it, so we need to store here, too.
Vector m_vecClientBaseVelocity;
};
class CPlayerLocalData
{
public:
virtual void NetworkStateChanged(void* pVar);
virtual void NetworkStateChanged();
localdata_t localdata;
};
typedef enum
{
GROUND = 0,
STUCK,
LADDER,
LADDER_WEDGE
} IntervalType_t;
enum
{
WL_NotInWater = 0,
WL_Feet,
WL_Waist,
WL_Eyes
};
// The various states the player can be in during the join game process.
enum CSPlayerState
{
// Happily running around in the game.
// You can't move though if CSGameRules()->IsFreezePeriod() returns true.
// This state can jump to a bunch of other states like STATE_PICKINGCLASS or STATE_DEATH_ANIM.
STATE_ACTIVE = 0,
// This is the state you're in when you first enter the server.
// It's switching between intro cameras every few seconds, and there's a level info
// screen up.
STATE_WELCOME, // Show the level intro screen.
// During these states, you can either be a new player waiting to join, or
// you can be a live player in the game who wants to change teams.
// Either way, you can't move while choosing team or class (or while any menu is up).
STATE_PICKINGTEAM, // Choosing team.
STATE_PICKINGCLASS, // Choosing class.
STATE_DEATH_ANIM, // Playing death anim, waiting for that to finish.
STATE_DEATH_WAIT_FOR_KEY, // Done playing death anim. Waiting for keypress to go into observer mode.
STATE_OBSERVER_MODE, // Noclipping around, watching players, etc.
NUM_PLAYER_STATES
};
// Spectator Movement modes
enum
{
OBS_MODE_NONE = 0, // not in spectator mode
OBS_MODE_DEATHCAM, // special mode for death cam animation
OBS_MODE_FREEZECAM, // zooms to a target, and freeze-frames on them
OBS_MODE_FIXED, // view from a fixed camera position
OBS_MODE_IN_EYE, // follow a player in first person view
OBS_MODE_CHASE, // follow a player in third person view
OBS_MODE_ROAMING, // free roaming
NUM_OBSERVER_MODES,
};
// edict->solid values
// NOTE: Some movetypes will cause collisions independent of SOLID_NOT/SOLID_TRIGGER when the entity moves
// SOLID only effects OTHER entities colliding with this one when they move - UGH!
// Solid type basically describes how the bounding volume of the object is represented
// NOTE: SOLID_BBOX MUST BE 2, and SOLID_VPHYSICS MUST BE 6
// NOTE: These numerical values are used in the FGD by the prop code (see prop_dynamic)
enum SolidType_t
{
SOLID_NONE = 0, // no solid model
SOLID_BSP = 1, // a BSP tree
SOLID_BBOX = 2, // an AABB
SOLID_OBB = 3, // an OBB (not implemented yet)
SOLID_OBB_YAW = 4, // an OBB, constrained so that it can only yaw
SOLID_CUSTOM = 5, // Always call into the entity for tests
SOLID_VPHYSICS = 6, // solid vphysics object, get vcollide from the model and collide with that
SOLID_LAST,
};
enum SolidFlags_t
{
FSOLID_CUSTOMRAYTEST = 0x0001, // Ignore solid type + always call into the entity for ray tests
FSOLID_CUSTOMBOXTEST = 0x0002, // Ignore solid type + always call into the entity for swept box tests
FSOLID_NOT_SOLID = 0x0004, // Are we currently not solid?
FSOLID_TRIGGER = 0x0008, // This is something may be collideable but fires touch functions
// even when it's not collideable (when the FSOLID_NOT_SOLID flag is set)
FSOLID_NOT_STANDABLE = 0x0010, // You can't stand on this
FSOLID_VOLUME_CONTENTS = 0x0020, // Contains volumetric contents (like water)
FSOLID_FORCE_WORLD_ALIGNED = 0x0040, // Forces the collision rep to be world-aligned even if it's SOLID_BSP or SOLID_VPHYSICS
FSOLID_USE_TRIGGER_BOUNDS = 0x0080, // Uses a special trigger bounds separate from the normal OBB
FSOLID_ROOT_PARENT_ALIGNED = 0x0100, // Collisions are defined in root parent's local coordinate space
FSOLID_TRIGGER_TOUCH_DEBRIS = 0x0200, // This trigger will touch debris objects
FSOLID_TRIGGER_TOUCH_PLAYER = 0x0400, // This trigger will touch only players
FSOLID_NOT_MOVEABLE = 0x0800, // Assume this object will not move
FSOLID_MAX_BITS = 12
};
//
// Enumerations for setting player animation.
//
enum PLAYER_ANIM
{
PLAYER_IDLE,
PLAYER_WALK,
PLAYER_JUMP,
PLAYER_SUPERJUMP,
PLAYER_DIE,
PLAYER_ATTACK1,
PLAYER_IN_VEHICLE,
// TF Player animations
PLAYER_RELOAD,
PLAYER_START_AIMING,
PLAYER_LEAVE_AIMING,
};
enum MoveType_t
{
MOVETYPE_NONE = 0,
MOVETYPE_ISOMETRIC,
MOVETYPE_WALK,
MOVETYPE_STEP,
MOVETYPE_FLY,
MOVETYPE_FLYGRAVITY,
MOVETYPE_VPHYSICS,
MOVETYPE_PUSH,
MOVETYPE_NOCLIP,
MOVETYPE_LADDER,
MOVETYPE_OBSERVER,
MOVETYPE_CUSTOM,
MOVETYPE_LAST = MOVETYPE_CUSTOM,
MOVETYPE_MAX_BITS = 4
};
enum SequenceNames : int
{
default = 0,
ragdoll = 1,
strafe = 2,
recrouch_generic = 3,
reposition = 4,
reposition_to_idle = 5,
reposition_to_crouchidle = 6,
lean = 7,
additive_posebreaker = 8,
additive_posebreaker_knife = 9,
rom = 10,
rom_skin = 11,
s_ladder_crouch_delta = 12,
ladder_climb = 13,
fall = 14,
jump = 15,
jump_moving = 16,
jump_crouch = 17,
jump_moving_crouch = 18,
land_light_crouch_moving = 19,
land_light = 20,
land_light_crouch = 21,
land_light_moving = 22,
land_heavy = 23,
land_heavy_crouch = 24,
move_c = 25,
move = 26,
move_knife_c = 27,
move_knife = 28,
move_grenade_c = 29,
move_grenade = 30,
move_c4_c = 31,
move_c4 = 32,
pistol_deploy = 33,
pistol_deploy_crouch = 34,
pistol_deploy_02 = 35,
pistol_deploy_03 = 36,
rifle_deploy = 37,
rifle_deploy_crouch = 38,
rifle_deploy_02 = 39,
rifle_deploy_03 = 40,
heavy_deploy = 41,
heavy_deploy_crouch = 42,
heavy_deploy_02 = 43,
heavy_deploy_03 = 44,
sniper_deploy = 45,
sniper_deploy_crouch = 46,
sniper_deploy_02 = 47,
sniper_deploy_03 = 48,
smg_deploy = 49,
smg_deploy_crouch = 50,
smg_deploy_02 = 51,
smg_deploy_03 = 52,
shotgun_deploy = 53,
shotgun_deploy_crouch = 54,
shotgun_deploy_02 = 55,
shotgun_deploy_03 = 56,
knife_deploy = 57,
knife_deploy_crouch = 58,
knife_deploy_02 = 59,
knife_deploy_03 = 60,
c4_deploy = 61,
c4_deploy_crouch = 62,
c4_deploy_02 = 63,
c4_deploy_03 = 64,
grenade_deploy = 65,
grenade_deploy_crouch = 66,
grenade_deploy_02 = 67,
grenade_deploy_03 = 68,
grenade_catch = 69,
grenade_catch_crouch = 70,
pistol_catch = 71,
pistol_catch_crouch = 72,
c4_catch = 73,
c4_catch_crouch = 74,
shotgun_catch = 75,
shotgun_catch_crouch = 76,
smg_catch = 77,
smg_catch_crouch = 78,
sniper_catch = 79,
sniper_catch_crouch = 80,
heavy_catch = 81,
heavy_catch_crouch = 82,
rifle_catch = 83,
rifle_catch_crouch = 84,
pistol_aim_idle = 85,
pistol_aim_walk = 86,
pistol_aim_run = 87,
pistol_aim_crouch_idle = 88,
pistol_aim_crouch_moving = 89,
pistol_aim = 90,
pistol_fire = 91,
pistol_fire_crouch = 92,
pistol_fire_alt = 93,
pistol_fire_alt_crouch = 94,
pistol_reload = 95,
pistol_reload_moving = 96,
pistol_reload_crouch = 97,
pistol_reload_crouch_moving = 98,
pistol_silencer_off = 99,
pistol_silencer_on = 100,
rifle_aim_idle = 101,
rifle_aim_walk = 102,
rifle_aim_run = 103,
rifle_aim_crouch_idle = 104,
rifle_aim_crouch_moving = 105,
rifle_aim = 106,
rifle_fire = 107,
rifle_fire_crouch = 108,
rifle_fire_alt = 109,
rifle_fire_alt_crouch = 110,
rifle_reload = 111,
rifle_reload_moving = 112,
rifle_reload_crouch = 113,
rifle_reload_crouch_moving = 114,
rifle_silencer_off = 115,
rifle_silencer_on = 116,
sniper_aim_idle = 117,
sniper_aim_walk = 118,
sniper_aim_run = 119,
sniper_aim_crouch_idle = 120,
sniper_aim_crouch_moving = 121,
sniper_aim = 122,
sniper_fire = 123,
sniper_fire_crouch = 124,
sniper_reload = 125,
sniper_reload_moving = 126,
sniper_reload_crouch = 127,
sniper_reload_crouch_moving = 128,
shotgun_aim_idle = 129,
shotgun_aim_walk = 130,
shotgun_aim_run = 131,
shotgun_aim_crouch_idle = 132,
shotgun_aim_crouch_moving = 133,
shotgun_aim = 134,
shotgun_fire = 135,
shotgun_fire_crouch = 136,
shotgun_reload_start = 137,
shotgun_reload_loop = 138,
shotgun_reload_end = 139,
shotgun_reload_start_crouch = 140,
shotgun_reload_loop_crouch = 141,
shotgun_reload_end_crouch = 142,
smg_aim_idle = 143,
smg_aim_walk = 144,
smg_aim_run = 145,
smg_aim_crouch_idle = 146,
smg_aim_crouch_moving = 147,
smg_aim = 148,
smg_fire = 149,
smg_fire_crouch = 150,
smg_reload = 151,
smg_reload_moving = 152,
smg_reload_crouch = 153,
smg_reload_crouch_moving = 154,
heavy_aim_idle = 155,
heavy_aim_walk = 156,
heavy_aim_run = 157,
heavy_aim_crouch_idle = 158,
heavy_aim_crouch_moving = 159,
heavy_aim = 160,
heavy_fire = 161,
heavy_fire_crouch = 162,
heavy_reload = 163,
heavy_reload_moving = 164,
heavy_reload_crouch = 165,
heavy_reload_crouch_moving = 166,
knife_aim_idle = 167,
knife_aim_walk = 168,
knife_aim_run = 169,
knife_aim_crouch_idle = 170,
knife_aim_crouch_moving = 171,
knife_aim = 172,
knife_fire_front = 173,
knife_fire_front_moving = 174,
knife_fire_front_crouch = 175,
knife_fire_front_crouch_moving = 176,
knife_fire_frontswing_a = 177,
knife_fire_frontswing_a_moving = 178,
knife_fire_frontswing_a_crouch = 179,
knife_fire_frontswing_a_crouch_moving = 180,
knife_fire_frontswing_b = 181,
knife_fire_frontswing_b_moving = 182,
knife_fire_frontswing_b_crouch = 183,
knife_fire_frontswing_b_crouch_moving = 184,
knife_fire_back = 185,
knife_fire_back_moving = 186,
knife_fire_back_crouch = 187,
knife_fire_back_crouch_moving = 188,
knife_fire_back_overhead = 189,
knife_fire_back_overhead_moving = 190,
knife_fire_back_overhead_crouch = 191,
knife_fire_back_overhead_crouch_moving = 192,
grenade_aim_idle = 193,
grenade_aim_walk = 194,
grenade_aim_run = 195,
grenade_aim_crouch_idle = 196,
grenade_aim_crouch_moving = 197,
grenade_aim = 198,
grenade_near_fire = 199,
grenade_near_fire_moving = 200,
grenade_near_fire_crouch = 201,
grenade_near_fire_crouch_moving = 202,
grenade_operate = 203,
grenade_fire = 204,
grenade_operate_moving = 205,
grenade_fire_moving = 206,
grenade_operate_crouch = 207,
grenade_fire_crouch = 208,
grenade_operate_crouch_moving = 209,
grenade_fire_crouch_moving = 210,
c4_aim_idle = 211,
c4_aim_walk = 212,
c4_aim_run = 213,
c4_aim_crouch_idle = 214,
c4_aim_crouch_moving = 215,
c4_aim = 216,
c4_defuse_aim_crouch = 217,
c4_defuse_aim_stand = 218,
s_defuse_crouch = 219,
c4_defusal = 220,
s_defuse_crouch_kit = 221,
c4_defusal_with_kit = 222,
c4_fire = 223,
flashed = 224,
flashed_crouch = 225,
flashed_knife = 226,
flashed_knife_crouch = 227,
death_pose_head = 228,
death_pose_head_crouch = 229,
death_pose_body = 230,
death_pose_body_crouch = 231,
deathpose_lowviolence = 232,
flinch_arm_left = 233,
flinch_arm_right = 234,
flinch_leg_left = 235,
flinch_leg_right = 236,
flinch_chest = 237,
flinch_chest_rear = 238,
flinch_chest_right = 239,
flinch_chest_left = 240,
flinch_head = 241,
flinch_head_rear = 242,
flinch_head_right = 243,
flinch_head_left = 244,
flinch_stomach = 245,
flinch_stomach_rear = 246,
flinch_stomach_right = 247,
flinch_stomach_left = 248,
flinch_molotov = 249,
move_w = 250,
move_r = 251,
move_knife_w = 252,
move_knife_r = 253,
move_grenade_w = 254,
move_grenade_r = 255,
move_c4_w = 256,
move_c4_r = 257,
pistol_silencer_off_crouch = 258,
pistol_silencer_on_crouch = 259,
rifle_silencer_off_crouch = 260,
rifle_silencer_on_crouch = 261,
surrender = 262,
parachute_dir = 263,
parachute = 264,
shield_deploy = 265,
shield_aim_idle = 266,
shield_aim_walk = 267,
shield_aim_run = 268,
shield_aim_crouch_idle = 269,
shield_aim_crouch_moving = 270,
shield_aim = 271,
shield_fire = 272,
shield_fire_crouch = 273
};
enum Activities : int
{
ACT_INVALID = -1,
ACT_RESET = 0,
ACT_IDLE = 1,
ACT_TRANSITION = 2,
ACT_COVER = 3,
ACT_COVER_MED = 4,
ACT_COVER_LOW = 5,
ACT_WALK = 6,
ACT_WALK_AIM = 7,
ACT_WALK_CROUCH = 8,
ACT_WALK_CROUCH_AIM = 9,
ACT_RUN = 10,
ACT_RUN_AIM = 11,
ACT_RUN_CROUCH = 12,
ACT_RUN_CROUCH_AIM = 13,
ACT_RUN_PROTECTED = 14,
ACT_SCRIPT_CUSTOM_MOVE = 15,
ACT_RANGE_ATTACK1 = 16,
ACT_RANGE_ATTACK2 = 17,
ACT_RANGE_ATTACK1_LOW = 18,
ACT_RANGE_ATTACK2_LOW = 19,
ACT_DIESIMPLE = 20,
ACT_DIEBACKWARD = 21,
ACT_DIEFORWARD = 22,
ACT_DIEVIOLENT = 23,
ACT_DIERAGDOLL = 24,
ACT_FLY = 25,
ACT_HOVER = 26,
ACT_GLIDE = 27,
ACT_SWIM = 28,
ACT_JUMP = 29,
ACT_HOP = 30,
ACT_LEAP = 31,
ACT_LAND = 32,
ACT_CLIMB_UP = 33,
ACT_CLIMB_DOWN = 34,
ACT_CLIMB_DISMOUNT = 35,
ACT_SHIPLADDER_UP = 36,
ACT_SHIPLADDER_DOWN = 37,
ACT_STRAFE_LEFT = 38,
ACT_STRAFE_RIGHT = 39,
ACT_ROLL_LEFT = 40,
ACT_ROLL_RIGHT = 41,
ACT_TURN_LEFT = 42,
ACT_TURN_RIGHT = 43,
ACT_CROUCH = 44,
ACT_CROUCHIDLE = 45,
ACT_STAND = 46,
ACT_USE = 47,
ACT_ALIEN_BURROW_IDLE = 48,
ACT_ALIEN_BURROW_OUT = 49,
ACT_SIGNAL1 = 50,
ACT_SIGNAL2 = 51,
ACT_SIGNAL3 = 52,
ACT_SIGNAL_ADVANCE = 53,
ACT_SIGNAL_FORWARD = 54,
ACT_SIGNAL_GROUP = 55,
ACT_SIGNAL_HALT = 56,
ACT_SIGNAL_LEFT = 57,
ACT_SIGNAL_RIGHT = 58,