-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathQuirrelDoc.h
More file actions
1499 lines (1104 loc) · 38.5 KB
/
Copy pathQuirrelDoc.h
File metadata and controls
1499 lines (1104 loc) · 38.5 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
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
//////////////////////////////////////////////
// QUIRREL DEFINITIONS
/////////////////////////////////////////////
/////////////////////////////////////////////
// Language Documentation : https://quirrel.io/doc/reference/language.html
/////////////////////////////////////////////
/////////////////////////////////////////////
// VS Code Extensions
/////////////////////////////////////////////
// https://marketplace.visualstudio.com/items?itemName=marcinbar.vscode-squirrel
// https://marketplace.visualstudio.com/items?itemName=mepsoid.vscode-s-quirrel
/////////////////////////////////////////////
// Stop VS Code from complaining (this is purely for nicer viewing of the file)
typedef const char* string;
typedef signed char int8;
typedef short int16;
typedef int int32;
typedef long long int64;
typedef unsigned char uint8;
typedef unsigned short uint16;
typedef unsigned int uint32;
typedef unsigned long long uint64;
typedef unsigned long long objectid;
typedef function;
typedef table;
template <typename Type>
struct Array
{
};
// forward
typedef class PlayerController;
typedef class Entity;
//////////////////////////////////////////////
// Math Classes
/////////////////////////////////////////////
class Vector2
{
float x, y;
Vector2(float x, float y);
float Length();
float LengthSq();
Vector2 Normalize();
float Dot(Vector2 Other);
};
class Vector3
{
float x, y, z;
Vector3(float x, float y, float z);
Vector4 ToVec4();
Quaternion ToQuat();
float Length();
float LengthSq();
Vector3 Normalize();
Vector3 Round(float Precision);
float Dot(Vector3 Other);
Vector3 Cross(Vector3 Other);
float Distance(Vector3 Other);
};
class Vector4
{
float x, y, z, w;
Vector4(float x, float y, float z, float w);
Vector3 ToVec3();
Quaternion ToQuat();
float Length();
float LengthSq();
Vector4 Normalize();
float Dot(Vector4 Other);
Vector4 Cross(Vector4 Other);
float Distance(Vector4 Other);
};
class Quaternion
{
float x, y, z, w;
Quaternion(float x, float y, float z, float w);
Vector3 ToVec3();
Vector4 ToVec4();
Vector3 Rotate(Vector3 Input);
Quaternion Conjugate();
Quaternion Inverse();
Quaternion Normalize();
};
class Color
{
float R, G, B, A;
Color(float R, float G, float B, float A);
/// @brief 255 RGB -> 1.0 RGB
static Color RGB(float R, float G, float B, float A);
/// @brief Returns the inverted color values
Color Invert();
Color Fade(Color To, float Factor);
/// @brief Returns a Random Color (from current time)
static Color Random();
/// @brief Returns a Random Color with a provided seed
static Color RandomS(uint32 Seed);
/// @brief Returns a Rainbow Color with a provided speed
static Color Rainbow(float Speed);
};
//////////////////////////////////////////////
// Utility Classes
/////////////////////////////////////////////
/// @brief Uses a seconds | 1.0 = Second or | 0.5 = Half a second
class Timer
{
/// @brief Creates a timer
/// @param StartNow should the timer start counting from creation time?
Timer(bool StartNow);
/// @brief Starts the timer.
void Start();
/// @brief Resets the timer.
void Reset();
/// @brief Gets the elapsed time in seconds.
float ElapsedTime();
/// @brief Checks if a specified duration has elapsed. (Resets timer if true)
bool HasElapsed(float time);
};
/// @brief You should know how to use this otherwise don't
class Pointer
{
/// @brief Read/Write a boolean value.
bool GetBool(uint64 offset);
void SetBool(uint64 offset, bool value);
/// @brief Read/Write an Int8.
int8 GetInt8(uint64 offset);
void SetInt8(uint64 offset, int8 value);
/// @brief Read/Write a Uint8.
uint8 GetUint8(uint64 offset);
void SetUint8(uint64 offset, uint8 value);
/// @brief Read/Write an Int16.
int16 GetInt16(uint64 offset);
void SetInt16(uint64 offset, int16 value);
/// @brief Read/Write a Uint16.
uint16 GetUint16(uint64 offset);
void SetUint16(uint64 offset, uint16 value);
/// @brief Read/Write an Int32.
int32 GetInt32(uint64 offset);
void SetInt32(uint64 offset, int32 value);
/// @brief Read/Write a Uint32.
uint32 GetUint32(uint64 offset);
void SetUint32(uint64 offset, uint32 value);
/// @brief Read/Write an Int64.
int64 GetInt64(uint64 offset);
void SetInt64(uint64 offset, int64 value);
/// @brief Read/Write a Uint64.
uint64 GetUint64(uint64 offset);
void SetUint64(uint64 offset, uint64 value);
/// @brief Read/Write a Float.
float GetFloat(uint64 offset);
void SetFloat(uint64 offset, float value);
/// @brief Read/Write a Double.
double GetDouble(uint64 offset);
void SetDouble(uint64 offset, double value);
/// @brief Read/Write a Vector2.
Vector2 GetVector2(uint64 offset);
void SetVector2(uint64 offset, Vector2 value);
/// @brief Read/Write a Vector3.
Vector3 GetVector3(uint64 offset);
void SetVector3(uint64 offset, Vector3 value);
/// @brief Read/Write a Vector4.
Vector4 GetVector4(uint64 offset);
void SetVector4(uint64 offset, Vector4 value);
/// @brief Read/Write a Quaternion.
Quaternion GetQuat(uint64 offset);
void SetQuat(uint64 offset, Quaternion value);
/// @brief Read a pointer.
Pointer* Read(uint64 offset);
};
//////////////////////////////////////////////
// Modules, Classes, Functions
/////////////////////////////////////////////
/* KeyNames
0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
- = , . ; / ` [ \ ] ' F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12
Backspace Capslock Ctrl Delete Down End Enter Esc Home Insert
RightAlt LeftAlt RightCtrl LeftCtrl RightMouse LeftMouse
MiddleMouse RightShift LeftShift NumLock Pageup Pagedown
Pause ScrollLock Shift Space Tab Up Mouse4 Mouse5
*/
/// @param MilliSeconds
/// @return did sleep
bool Sleep(uint32 MilliSeconds);
/// @brief Check if the key is was pressed.
/// @return Was the key pressed
bool IsKeyPressed(string KeyName);
/// @brief Check if the key is currently not being held.
/// @return Is the key not being held.
bool IsKeyUp(string KeyName);
/// @brief Check if the key is currently being held.
/// @return Is the key being held.
bool IsKeyDown(string KeyName);
/// @brief Registers a keybind
bool RegisterKeybind(string KeyName, function Callback);
/// @brief Registers a console command
/// @param Array<String> | Arguments
bool RegisterCommand(function Callback, string Name, string Arguments, string Description);
/// @return Heated Metal version string (Ex: 0.4.0)
string HMVersion();
/// @return Heated Metal version numbers.
uint32 HMMajor();
uint32 HMMinor();
uint32 HMPatch();
uint32 HMRevision();
uint32 HMRevisionPatch();
/////////////////////////////////////////////
// Modules
/// @return Is the module currently loaded?
bool IsModuleLoaded(string ModuleName);
/// @return Returns the defined 'Version' of a module
uint32 GetModuleVersion(string ModuleName);
/// @return Returns the defined 'VersionString' of a module
string GetModuleVersionString(string ModuleName);
/////////////////////////////////////////////
/// @brief Returns the current engine time. (Time from game start)
float EngineTime();
/// @brief Returns the current delta time.
float DeltaTime();
/// @brief Returns a random float from 0.f to {Max}.
float RandomFloat(float Max);
/// @brief Returns a random float from {Min} to {Max}.
float RandomFloatRange(float Min, float Max);
/// @brief Returns a random int from 0 to {Max}.
int64 RandomInt(int64 Max);
/// @brief Returns a random int from {Min} to {Max}.
int64 RandomIntRange(int64 Min, int64 Max);
/////////////////////////////////////////////
// Network
/// @brief Sends a table over the network (see AddCallback_NetworkTable)
/// @param string | Table name for callback
/// @param table | Table | Accepted Values : bool, int, float, string
/// @param PlayerController | Server only option (only sends the table to that player)
void SendNetworkTable(string Name, table Table, PlayerController Receiver /*Server Optional*/);
//////////////////////////////////////////////
// Renderer class
/////////////////////////////////////////////
class Renderer // SDK Native
{
/// @brief Returns the current display size as a Vector2.
Vector2 DisplaySize();
/// @brief Returns the current mouse display coordinates.
Vector2 MousePos();
/// @brief Returns direction vector from the specified screen coordinates
Vector3 ScreenToWorld(Vector2 Screen);
/// @brief Calculates alpha value based on distance.
float DistanceToAlpha(float Distance, float MaxDistance, float MinAlpha = 25.0, float MaxAlpha = 255.0);
/////////////////////////////////////////////
// 3D
/// @brief Draws a 3D text at the specified origin.
bool Text(string Text, Vector3 Origin, Color Color);
/// @brief Draws a 3D text at the specified origin.
bool TextScaled(string Text, Vector3 Origin, float FontSize, Color Color);
/// @brief Draws a 3D line from start to end with specified thickness.
bool Line(Vector3 StartOrigin, Vector3 EndOrigin, Color Color, float Thickness);
/// @brief Draws a 3D triangle.
bool Triangle(Vector3 Origin, Vector3 Point1, Vector3 Point2, Vector3 Point3, Vector3 Point, Color Color, float Thickness);
/// @brief Draws a 3D rectangle.
bool Rectangle(Vector3 Origin, Vector3 Angles, float Width, float Height, Color Color, float Thickness);
/// @brief Draws a 3D circle.
bool Circle(Vector3 Origin, Vector3 Angles, float Radius, int NumSegments, Color Color, float Thickness);
/// @brief Draws a 3D cylinder.
bool Cylinder(Vector3 Origin, Vector3 Angles, float Radius, float Height, int NumSegments, Color Color, float Thickness);
/// @brief Draws a 3D Sphere.
bool Sphere(Vector3 Origin, Vector3 Angles, float Radius, int NumSegments, Color Color, float Thickness);
/// @brief Draws a 3D cube.
bool Cube(Vector3 Origin, Vector3 Angles, float Size, Color Color, float Thickness);
/////////////////////////////////////////////
/// Window Elements
class Element
{
/// @brief Is this element being drawn?
bool Active;
/// @brief Is this element disabled?
bool Disabled;
};
class ElementText : Element
{
/// @brief Current text.
string Text;
/// @brief What color is the text.
Color Color;
};
class Button : Element
{
/// @brief How big is the button?
Vector2 Size;
};
class SliderInt : Element
{
/// @brief Current Value
const int32 Value;
/// @brief Slider Min/Max
int32 Min;
int32 Max;
};
class SliderFloat : Element
{
/// @brief Current Value
const float Value;
/// @brief Slider Min/Max
float Min;
float Max;
};
class Gui : Element
{
/// @brief Adds a tree node
Gui* Tree(string Name, bool OpenByDefault);
/// @brief Adds text
ElementText* Text(string Text);
/// @brief Adds a separator
Element* SameLine();
/// @brief Adds a separator
Element* Separator();
/// @brief Adds a text separator
ElementText* SeparatorText(string Text);
/// @brief Adds a button
Button* Button(string Name, function Callback);
/// @brief Adds a selectable
Element* Selectable(string Name, function Callback);
/// @brief Adds a toggle
/// @param bool | Changed Value
Element* Toggle(string Name, bool InitialValue, function Callback);
/// @brief Adds an int slider
/// @param int32 | Changed Value
SliderInt* SliderInt(string Name, int32 InitialValue, int32 Min, int32 Max, function Callback);
/// @brief Adds an float slider
/// @param float | Changed Value
SliderFloat* SliderFloat(string Name, float InitialValue, float Min, float Max, function Callback);
};
class Window : Gui
{
/// @brief Create a tab element.
Gui* Tab(string Name);
/////////////////////////////////////////////
/// @brief Background Alpha.
float Alpha = 1.0;
/// @brief Current window size.
Vector2 Size;
/// @brief Current window position.
Vector2 Position;
/////////////////////////////////////////////
/// @brief Should the window block input to the game?
bool BlockInput = true;
/// @brief Should the window auto resize?
bool AutoResize;
/// @brief Disable the title bar.
bool NoTitleBar;
/// @brief Disable the window from having a scroll bar
bool NoScrollBar;
/////////////////////////////////////////////
/// @details User Action
/// @brief Disable the window from being resized.
bool NoResize;
/// @details User Action
/// @brief Disable the window from being moved.
bool NoMove;
/// @details User Action
/// @brief Disable the window from being collapsed.
bool NoCollapse;
};
/////////////////////////////////////////////
/// Overlay Elements
class ElementOverlay : Element
{
/// @brief Is the Element filled?
bool Filled;
/// @brief Is the Element outlined?
bool Outlined;
/// @brief Is the Element centered?
bool Centered;
/// @brief Does the Element have a border?
bool Bordered;
/// @brief Element Thickness
float Thickness = 1.0;
/// @brief Element Color
Color Color;
};
class OverlayText : ElementOverlay
{
/// @brief What are we rendering?
string Text;
/// @brief How is the text?
float Scale = 1.0;
/// @brief Where is the text being drawn at?
Vector2 Position;
};
class OverlayLine : ElementOverlay
{
/// @brief Where does the line start at?
Vector2 Start;
/// @brief Where does the line end?
Vector2 End;
};
class OverlayCircle : ElementOverlay
{
/// @brief Where are we drawing the circle at?
Vector2 Position;
/// @brief How big is the circle?
float Radius = 1.0;
/// @brief How many segments does the circle have?
int Segments = 0;
};
class OverlayTriangle : ElementOverlay
{
/// @brief Where are we drawing the triangle edges at?
Vector2 Position1;
Vector2 Position2;
Vector2 Position3;
};
class OverlayRectangle : ElementOverlay
{
/// @brief Where are we drawing the Rectangle?
Vector2 Position;
/// @brief How big is the Rectangle?
Vector2 Size;
/// @brief How rounded are the edges?
float Rounding = 0.0;
};
class OverlayQuad : ElementOverlay
{
/// @brief Where are we drawing the Quad edges at?
Vector2 Position1;
Vector2 Position2;
Vector2 Position3;
Vector2 Position4;
};
class Overlay : Element
{
/// @brief Add text.
OverlayText* Text(string Text, Vector2 Position);
/// @brief Add a line.
OverlayLine* Line(Vector2 Start, Vector2 End);
/// @brief Add a circle.
OverlayCircle* Circle(Vector2 Position, float Radius, int Segments);
/// @brief Add a Rectangle
OverlayRectangle* Rectangle(Vector2 Position, Vector2 Size, float Rounding);
/// @brief Add a triangle
OverlayTriangle* Triangle(Vector2 Position1, Vector2 Position2, Vector2 Position3);
/// @brief Add a Quad
OverlayQuad* Quad(Vector2 Position1, Vector2 Position2, Vector2 Position3, Vector2 Position4);
};
/////////////////////////////////////////////
/// @brief Creates a window instance.
/// Use Window.Active = true to enable the window.
/// @param string | Window Name
/// @param Vector2 | Window Size
Window* CreateWindow(string Name, Vector2 Size);
/// @brief Creates a overlay instance.
/// Use Overlay.Active = true to enable the overlay.
Overlay* CreateOverlay();
};
/////////////////////////////////////////////
// Game class
/////////////////////////////////////////////
class Game // Native
{
// Only Derived
class ManagedObject
{
objectid ObjectID;
};
class Component : ManagedObject
{
/// @brief Returns the component name
const string Name;
/// @brief Owner Entity
const Entity* Entity;
/// @brief component state
bool Active;
};
class DamageComponent : Component
{
class DamageData
{
/// @brief Health threshold for low health.
int32 HealthLow;
/// @brief Health threshold for critical health.
int32 HealthCritical;
/// @brief DBNO health amount
int32 HealthDBNO;
/// @brief Max health
int32 HealthMax;
/// @brief How much extra health you can have
int32 HealthMaxExtra;
// How much fall damage to take
int32 FallDamage;
///////////////////////////////
/// DBNO
// Maximum revives (-1 for infinite)
int32 MaxRevives;
/// @brief Bleed out time (seconds)
int32 BleedoutTime;
/// @brief Bleed out pressure
float BleedoutPressure;
/// @brief Bleed out speed up
float BleedoutSpeedUp;
/// @brief Health percentage gain when revived
float RevivedHealth;
/// @brief Health percentage gain when revived via doc stim
float RevivedHealthDoc;
///////////////////////////////
/// Lethality (Damage Multipliers)
/// @brief Melee damage multiplier
float MeleeDamage;
/// @brief Explosion damage multiplier
float ExplosionDamage;
///////////////////////////////
/// Toggles
/// @brief if DBNO is enabled
bool DBNO;
/// @brief if extra health stacking is enabled
bool ExtraHealthStacking;
};
/// @brief Current health
int32 Health;
/// @brief DamageData Instance (Global Settings)
const DamageData *DamageData;
};
class WeaponComponent : Component
{
/// @brief Weapon data name (wip names most of the time)
const string Name;
/// @brief Is the weapon reloading?
const bool IsReloading;
/// @brief Current clip count
//uint32 Ammo;
/// @brief Current weapon rpm (how many bullets per second are we firing)
const float RPM;
class DamageWeaponData
{
/// @brief How much damage will the bullet deal to entities with a damage component?
uint32 Damage;
/// @brief How much damage to the environment will the bullet deal (Example: 0 the bullet will passthrough a single glass panel)
uint32 DamageEnv;
};
class AmmoWeaponData
{
/// @brief Should the clip remove ammo on firing a shot
bool InfiniteClip;
/// @brief Should the ammo reverse remove ammo on reload
bool InfiniteReserve;
/// @brief How fast will the weapon fire?
uint32 FireRate;
/// @brief How many bullet will the gun fire at once?
uint32 BulletCount;
/// @brief At what distance will the bullets be ignored?
float BulletReach;
/// @brief How much ammo does the clip have?
uint32 ClipCapacity;
/// @brief What kind of damage to walls does the bullet do? (eCaliberID)
uint32 Caliber;
};
class AccuracyWeaponData
{
/// @brief Base accuracy
float Base;
/// @brief Walk accuracy
float Walk;
/// @brief Crouch accuracy
float Crouch;
/// @brief Prone accuracy
float Prone;
/// @brief Aim accuracy
float Aim;
/// @brief Fire accuracy
float Fire;
/// @brief Fast recovery (Instant spread recovery)
bool FastRecovery;
};
class AnimationWeaponData
{
/// @brief Weapon draw speed
float Draw;
/// @brief Weapon holster speed
float Holster;
/// @brief Weapon aim speed during sprint
float SprintZoomIn;
/// @brief Weapon aim speed
float ZoomIn;
/// @brief Weapon de-aim speed
float ZoomOut;
/// @brief Weapon manual reload speed
float ReloadManual;
/// @brief Weapon automatic reload speed
float ReloadAuto;
};
/// @brief Returns the Damage Data instance for the weapon
const DamageWeaponData* DamageData;
/// @brief Returns the Ammo Data instance for the weapon
const AmmoWeaponData* AmmoData;
/// @brief Returns the Accuracy Data instance for the weapon
const AccuracyWeaponData* AccuracyData;
/// @brief Returns the Animation Data instance for the weapon
const AnimationWeaponData* AnimationData;
};
class PhysicComponent : Component
{
/// @brief What collision tag does this physic component use? (eCollisionTag)
uint32 CollisionTag;
};
class SpawnedGadgetComponent : Component
{
/// @brief Owner of this gadget
const PlayerController* Owner;
/// @brief Gadget ObjectID
const objectid GadgetID;
};
class Entity : ManagedObject
{
/// @brief Get the name of the entity
const string Name;
/// @brief Check if the entity still exists and is not unloaded
const bool IsValid;
/// @brief Was the entity created from quirrel?
const bool IsQuirrel;
/// @brief Is the entity a editor duplicate?
const bool IsEditor;
/// @brief Is the entity a local?
const bool IsLocal;
/// @brief DeActivate/ReActivate all of the components of an entity
/// Use this to temporarily Disable entities
bool Active;
/// @brief Hide all visuals
void SetIsHidden(bool IsHidden);
////////////////////////////////////////////////
/// @brief World Center Origin
const Vector3 Center;
/// @brief World Origin
Vector3 Origin;
/// @brief Angles
Vector3 Angles;
/// @brief Scale
Vector3 Scale;
////////////////////////////////////////////////
/// @brief entity Min/Max
const Vector3 Min;
const Vector3 Max;
/// @brief entity Up/Right/Forward vector
const Vector3 Right;
const Vector3 Forward;
const Vector3 Up;
/// @brief Gets the GLOBAL origin of the bone (returns entity origin if not found).
/// Enum can be found in the core module (eBone).
/// @param Bone | Index
Vector3 GetBoneOrigin(uint32 Bone);
////////////////////////////////////////////////
/// @brief Sets an outline of the entity (client side)
void SetOutline(Color Color);
////////////////////////////////////////////////
/// @brief Get a clone of this entity
/// @return Duplicated Entity
Entity* Duplicate();
/// @brief Get a clone of this entity with a seeded objectid
/// @return Duplicated Entity
Entity* DuplicateSeed(uint64 Seed);
/// @brief Get a clone of this entity as an editor entity
/// @return Duplicated Editor Entity (Saved in world file)
Entity* DuplicateEditor();
/// @brief Add or Remove the entity from the world
/// @return Has the entity been Added/Removed
/// !!!Duplicated entities are entirely removed!!!
bool AddToWorld();
bool RemoveFromWorld();
////////////////////////////////////////////////
/// @brief Victim takes damage by amount and type (attribution).
void GiveDamage(int32 Amount, uint32 DamageType, objectid VictimID /*Entity*/);
/// @brief Take damage by amount and type.
void TakeDamage(int32 Amount, uint32 DamageType);
////////////////////////////////////////////////
/// @brief Will make each client sync the entities component data (Host Only)
void SyncComponents();
/// @brief Does the entity have this component?
bool HasComponent(string Name);
/// @brief Get all components
Array<Component*> GetComponents();
/// @brief Get all components that have a matching name (Case sensitive)
Array<Component*> GetComponentsByName(string Name);
/// @brief Get a component by index
/// @return Returns null if the index is invalid
Component* GetComponentByIndex(uint32 Index);
////////////////////////////////////////////////
/// @brief Returns the Damage Component if the entity has one
const DamageComponent* DamageComponent;
/// @brief Returns the Weapon Component if the entity has one
/// Only returns on host and changes are updated every 5s
const WeaponComponent* WeaponComponent;
/// @brief Returns the Destruction Component if the entity has one
/// Disable this to disable destruction
const Component* DestructionComponent;
/// @brief Returns the Physics Component if the entity has one
/// Disable this to disable Collision
const PhysicComponent* PhysicComponent;
/// @brief Returns the Gadget Component if the entity has one
const SpawnedGadgetComponent* GadgetComponent;
};
class PlayerController
{
/// @brief Name of the player
const string Name;
/// @details Use eTeam
/// @brief Team of the player
const uint32 Team;
/// @details Use eAlliance
/// @brief Alliance of the player
const uint32 Alliance;
/// @brief PlayerID of the player
const uint64 PlayerID;
/// @brief Spectated player if spectating
const PlayerController* Spectator;
/// @brief Controlled entity
const Entity* Entity;
/// @brief Forward vector of where the player is looking
const Vector3 Forward;
/// @brief Velocity vector of where the entity is going
const Vector3 Velocity;
/// @brief Mobility ( 100 baseline ) how fast is the base speed? (Resets after item swap)
uint32 Mobility;
/// @brief Sets the players entity origin
void SetOrigin(Vector3 Origin);
//////////////////////////////////////////////////////////////////////
/// @brief Returns the damage component instance
const DamageComponent* DamageComponent;
//////////////////////////////////////////////////////////////////////
/// @brief Defined as eItemSlot in core module
enum ItemSlot
{
Primary,
Secondary,
Tertiary,
PrimaryGadget,
SecondaryGadget,
Character // Causes bugs use with caution
};