forked from eternalcodes/EternalJK
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathg_local.h
2085 lines (1715 loc) · 63.9 KB
/
g_local.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
/*
===========================================================================
Copyright (C) 1999 - 2005, Id Software, Inc.
Copyright (C) 2000 - 2013, Raven Software, Inc.
Copyright (C) 2001 - 2013, Activision, Inc.
Copyright (C) 2005 - 2015, ioquake3 contributors
Copyright (C) 2013 - 2015, OpenJK contributors
This file is part of the OpenJK source code.
OpenJK is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License version 2 as
published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>.
===========================================================================
*/
#pragma once
// g_local.h -- local definitions for game module
#include "qcommon/q_shared.h"
#include "bg_public.h"
#include "bg_vehicles.h"
#include "g_public.h"
#include "qcommon/q_version.h"
typedef struct gentity_s gentity_t;
typedef struct gclient_s gclient_t;
//#define VEH_CONTROL_SCHEME_4
//npc stuff
#include "b_public.h"
extern int gPainMOD;
extern int gPainHitLoc;
extern vec3_t gPainPoint;
//==================================================================
// the "gameversion" client command will print this plus compile date
#define GAMEVERSION "japro"
#define SECURITY_LOG "security.log"
#define DUEL_LOG "duels.log" //duellog
#define RACE_LOG "races.log" //racelog
#if 1
#define FAIL_RACE_LOG "failedRaces.log" //racelog
#endif
#if _STATLOG
#define TEMP_STAT_LOG "currentStats.tmp" //racelog
#endif
#define PLAYER_LOG "players.log" //Name, IP, Guid
#define BODY_QUEUE_SIZE 8
#ifndef INFINITE
#define INFINITE 1000000
#endif
#define FRAMETIME 100 // msec
#define CARNAGE_REWARD_TIME 3000
#define REWARD_SPRITE_TIME 2000
#define INTERMISSION_DELAY_TIME 1000
#define SP_INTERMISSION_DELAY_TIME 5000
//primarily used by NPCs
#define START_TIME_LINK_ENTS FRAMETIME*1 // time-delay after map start at which all ents have been spawned, so can link them
#define START_TIME_FIND_LINKS FRAMETIME*2 // time-delay after map start at which you can find linked entities
#define START_TIME_MOVERS_SPAWNED FRAMETIME*2 // time-delay after map start at which all movers should be spawned
#define START_TIME_REMOVE_ENTS FRAMETIME*3 // time-delay after map start to remove temporary ents
#define START_TIME_NAV_CALC FRAMETIME*4 // time-delay after map start to connect waypoints and calc routes
#define START_TIME_FIND_WAYPOINT FRAMETIME*5 // time-delay after map start after which it's okay to try to find your best waypoint
// gentity->flags
#define FL_GODMODE 0x00000010
#define FL_NOTARGET 0x00000020
#define FL_TEAMSLAVE 0x00000400 // not the first on the team
#define FL_NO_KNOCKBACK 0x00000800
#define FL_DROPPED_ITEM 0x00001000
#define FL_NO_BOTS 0x00002000 // spawn point not for bot use
#define FL_NO_HUMANS 0x00004000 // spawn point just for bots
#define FL_FORCE_GESTURE 0x00008000 // force gesture on client
#define FL_INACTIVE 0x00010000 // inactive
#define FL_NAVGOAL 0x00020000 // for npc nav stuff
#define FL_DONT_SHOOT 0x00040000
#define FL_SHIELDED 0x00080000
#define FL_UNDYING 0x00100000 // takes damage down to 1, but never dies
//ex-eFlags -rww
#define FL_BOUNCE 0x00100000 // for missiles
#define FL_BOUNCE_HALF 0x00200000 // for missiles
#define FL_BOUNCE_SHRAPNEL 0x00400000 // special shrapnel flag
//vehicle game-local stuff -rww
#define FL_VEH_BOARDING 0x00800000 // special shrapnel flag
//breakable flags -rww
#define FL_DMG_BY_SABER_ONLY 0x01000000 //only take dmg from saber
#define FL_DMG_BY_HEAVY_WEAP_ONLY 0x02000000 //only take dmg from explosives
#define FL_BBRUSH 0x04000000 //I am a breakable brush
#ifndef FINAL_BUILD
#define DEBUG_SABER_BOX
#endif
// make sure this matches game/match.h for botlibs
#define EC "\x19"
#define MAX_G_SHARED_BUFFER_SIZE 8192
// used for communication with the engine
typedef union sharedBuffer_u {
char raw[MAX_G_SHARED_BUFFER_SIZE];
T_G_ICARUS_PLAYSOUND playSound;
T_G_ICARUS_SET set;
T_G_ICARUS_LERP2POS lerp2Pos;
T_G_ICARUS_LERP2ORIGIN lerp2Origin;
T_G_ICARUS_LERP2ANGLES lerp2Angles;
T_G_ICARUS_GETTAG getTag;
T_G_ICARUS_LERP2START lerp2Start;
T_G_ICARUS_LERP2END lerp2End;
T_G_ICARUS_USE use;
T_G_ICARUS_KILL kill;
T_G_ICARUS_REMOVE remove;
T_G_ICARUS_PLAY play;
T_G_ICARUS_GETFLOAT getFloat;
T_G_ICARUS_GETVECTOR getVector;
T_G_ICARUS_GETSTRING getString;
T_G_ICARUS_SOUNDINDEX soundIndex;
T_G_ICARUS_GETSETIDFORSTRING getSetIDForString;
} sharedBuffer_t;
extern sharedBuffer_t gSharedBuffer;
// movers are things like doors, plats, buttons, etc
typedef enum {
MOVER_POS1,
MOVER_POS2,
MOVER_1TO2,
MOVER_2TO1
} moverState_t;
#define SP_PODIUM_MODEL "models/mapobjects/podium/podium4.md3"
typedef enum
{
HL_NONE = 0,
HL_FOOT_RT,
HL_FOOT_LT,
HL_LEG_RT,
HL_LEG_LT,
HL_WAIST,
HL_BACK_RT,
HL_BACK_LT,
HL_BACK,
HL_CHEST_RT,
HL_CHEST_LT,
HL_CHEST,
HL_ARM_RT,
HL_ARM_LT,
HL_HAND_RT,
HL_HAND_LT,
HL_HEAD,
HL_GENERIC1,
HL_GENERIC2,
HL_GENERIC3,
HL_GENERIC4,
HL_GENERIC5,
HL_GENERIC6,
HL_MAX
} hitLocation_t;
//============================================================================
extern void *precachedKyle;
extern void *g2SaberInstance;
extern qboolean gEscaping;
extern int gEscapeTime;
#include "g_unlagged.h"//testunlagged
extern int dueltypes[MAX_CLIENTS];//JAPRO - Serverside - Fullforce Duels y is this extern
//JAPRO - Serverside - Tweak Weapons bitvalues
#define WT_DEMP2_RANDOM (1<<0)
#define WT_DEMP2_DAM (1<<1)
#define WT_DISRUPTOR_DAM (1<<2)
#define WT_BOWCASTER_SPRD (1<<3)
#define WT_REPEATER_ALT_DAM (1<<4)
#define WT_FLECHETTE_SPRD (1<<5)
#define WT_FLECHETTE_ALT_DAM (1<<6)
#define WT_FLECHETTE_ALT_SPRD (1<<7)
#define WT_CONC_ALT_DAM (1<<8)
#define WT_PROJECTILE_KNOCKBACK (1<<9)
#define WT_STUN_LG (1<<10)
#define WT_STUN_SHOCKLANCE (1<<11)
#define WT_PROJECTILE_GRAVITY (1<<12)
#define WT_CENTER_MUZZLEPOINT (1<<13)
#define WT_PSEUDORANDOM_FIRE (1<<14)
#define WT_EXPLOSIVE_HITBOX (1<<15)
#define WT_ROCKET_REDEEMER (1<<16)
#define WT_INFINITE_AMMO (1<<17)
#define WT_STUN_HEAL (1<<18)
#define WT_ANTI_VEHICLE (1<<19)
#define WT_ALLOW_GUNROLL (1<<20)
#define WT_FAST_WEAPONSWITCH (1<<21)
#define WT_IMPACT_NITRON (1<<22)
#define WT_STAKE_GUN (1<<23)
#define WT_FIX_MINEAMMO (1<<24)
#define WT_JK2_STYLE_ALT_TRIPMINE (1<<25)
#define WT_PROJ_SNIPER (1<<26)
#define WT_TRIBES (1<<27) //Move this into g_tribesmode surely..?
#define WT_SLOW_SNIPER (1<<28)
#define WT_SOLID_ROCKET (1<<29)
#define WT_NERFED_PISTOL (1<<30)
//wt_halt
//wt_hook
//wt proj barrier
//wt discord/tag
/*
//#define REDUCE_SABERBLOCK (1<<20) //s
#define ALLOW_GUNROLL (1<<21) //CLIENT
#define FAST_WEAPONSWITCH (1<<22)
//#define FIXED_SABERSWITCH (1<<23) //s
#define IMPACT_NITRON (1<<24)
#define STAKE_GUN (1<<25)
//#define REDUCE_SABERDROP (1<<26) //s
//#define ALLOW_ROLLCANCEL (1<<27) //s
//#define NO_MP_SABERLERP (1<<28) //s
#define FIX_MINEAMMO (1<<29)
#define JK2_STYLE_ALT_TRIPMINE (1<<30)
*/
//Force Tweaks
#define FT_NO_CROUCHATTACK_FP (1<<0)
#define FT_FIX_PROJ_PUSH (1<<1)
#define FT_PUSHPULLKD (1<<2)
#define FT_GRIPABSORB (1<<3)
#define FT_FORCECOMBO (1<<4)
#define FT_PULLSTRENGTH (1<<5)
#define FT_JK2GRIP (1<<6)
#define FT_FASTGRIP (1<<7)
#define FT_PUSHPULLITEMS (1<<8)
#define FT_FIXDRAINCOF (1<<9)
#define FT_JK2KNOCKDOWN (1<<10)
#define FT_JK2GETUPS (1<<11)
#define FT_JK2PULLROLL (1<<12)
#define FT_NODRAINABSORB (1<<13)
#define FT_GRIPDURINGROLL (1<<14)
#define FT_WEAKPULL (1<<15)
#define FT_NERFED_WEAPPULL (1<<16)
#define FT_WEAPON_PULLRESIST (1<<17)
#define FT_NORAGEFIRERATE (1<<18)
#define FT_BUFFMINDTRICK (1<<19)
#define FT_BUFFMELEE (1<<20) //not really a forcetweak but no room in weapon tweaks!
#define FT_DRAINDMGNERF (1<<21) //drain takes 3 instead of 4fp from enemy
#define FT_FIXGRIPPEDREGEN (1<<22) //lets you regen during a jump if you are caught and not holding jump (?)
#define FT_FIXLINEDRAIN (1<<23) //lets you regen during a jump if you are caught and not holding jump (?)
//Saber tweaks
#define ST_NO_MP_SABERLERP (1<<0)
#define ST_JK2_DMGSYSTEM (1<<1)
#define ST_REDUCE_SABERBLOCK (1<<2)
#define ST_REDUCE_SABERDROP (1<<3)
#define ST_ALLOW_ROLLCANCEL (1<<4) //CLIENT - also remove backwards run slowdown like jk2
#define ST_NO_REDCHAIN (1<<5)
#define ST_FIXED_SABERSWITCH (1<<6)
#define ST_EASYBACKSLASH (1<<7)
#define ST_JK2RDFA (1<<8)
#define ST_FIXYELLOWDFA (1<<9)
#define ST_SPINREDDFA (1<<10)
#define ST_SPINBACKSLASH (1<<11)
#define ST_JK2LUNGE (1<<12)
#define ST_REDDFAFIX (1<<13)
#define ST_REDDFANOFORCE (1<<14)
#define ST_EASIERBACKSLASH (1<<15) //no prediction yet
#define ST_SABERGUN (1<<16)
#define ST_FASTCYCLE (1<<17)
#define ST_NEWSPSABERDMG (1<<18)
#define ST_DUNESABER (1<<19)
#define ST_NEWSPSABERDMGCAP (1<<20)
//Saberstyles
#define SABERSTYLE_BLUE (1<<0)//no blue
#define SABERSTYLE_YELLOW (1<<1)//no yellow
#define SABERSTYLE_RED (1<<2) //no red
#define SABERSTYLE_DUAL (1<<3) //no duals
#define SABERSTYLE_STAFF (1<<4)//no staff
#define SABERSTYLE_DESANN (1<<5)// desann only
#define SABERSTYLE_TAVION (1<<6)//tavion only
//japro target_restrict restrictions
#define RESTRICT_FLAG_DISABLE (1<<0)
#define RESTRICT_FLAG_HASTE (1<<1)
#define RESTRICT_FLAG_FLAGS (1<<2)
#define RESTRICT_FLAG_JUMP (1<<3)
#define RESTRICT_FLAG_MOVESTYLE (1<<4)
#define RESTRICT_FLAG_YSAL (1<<5)
#define RESTRICT_FLAG_CROUCHJUMP (1<<6)
#define RESTRICT_FLAG_DOUBLEJUMP (1<<7)
#define RESTRICT_FLAG_ALLOWTELES (1<<8)
#define RESTRICT_FLAG_RESET (1<<9)
#define RESTRICT_FLAG_SUPERJUMP (1<<10)
//JAPRO - Serverside - Unlagged bitvalues
#define UNLAGGED_PROJ_NUDGE (1<<0)
#define UNLAGGED_HITSCAN (1<<1)
#define UNLAGGED_PUSHPULL (1<<2)
//JAPRO - Serverside - Voting bits
#define VOTE_GAMETYPE (1<<0)
#define VOTE_MAP (1<<1)
#define VOTE_KICK (1<<3)
#define VOTE_NEXTMAP (1<<4)
#define VOTE_TIMELIMIT (1<<5)
#define VOTE_FRAGLIMIT (1<<6)
#define VOTE_CAPTURELIMIT (1<<7)
//g_tweakVote TWEAKS
#define TV_ALLOW_SIEGESPECVOTE (1<<0)
#define TV_ALLOW_CTFTFFASPECVOTE (1<<1)
#define TV_CLEAR_SPEC_VOTES (1<<2)
#define TV_MAPLOADTIMEOUT (1<<3)
#define TV_FLOODPROTECTBYIP (1<<4)
#define TV_MAPCHANGELOCKOUT (1<<5)
#define TV_MAPCHANGEVOTEDELAY (1<<6)
#define TV_ALLOW_SPECVOTE (1<<7)
#define TV_SHOW_VOTES (1<<8)
#define TV_ONLY_COUNT_VOTERS (1<<9)
#define TV_FIX_GAMETYPEMAP (1<<10)
#define TV_IGNOREMAPARENAS (1<<11)
#define RS_TIMER_START (1<<0)
#define JAPRO_ACCOUNTFLAG_A_ADMINTELE (1<<0)
#define JAPRO_ACCOUNTFLAG_A_FREEZE (1<<1)
#define JAPRO_ACCOUNTFLAG_A_TELEMARK (1<<2)
#define JAPRO_ACCOUNTFLAG_A_ADMINBAN (1<<3)
#define JAPRO_ACCOUNTFLAG_A_ADMINKICK (1<<4)
#define JAPRO_ACCOUNTFLAG_A_NPC (1<<5)
#define JAPRO_ACCOUNTFLAG_A_NOCLIP (1<<6)
#define JAPRO_ACCOUNTFLAG_A_GRANTADMIN (1<<7)
#define JAPRO_ACCOUNTFLAG_A_CHANGEMAP (1<<8)
#define JAPRO_ACCOUNTFLAG_A_CSPRINT (1<<9)
#define JAPRO_ACCOUNTFLAG_A_FORCETEAM (1<<10)
#define JAPRO_ACCOUNTFLAG_A_LOCKTEAM (1<<11)
#define JAPRO_ACCOUNTFLAG_A_VSTR (1<<12)
#define JAPRO_ACCOUNTFLAG_A_SEEIP (1<<13)
#define JAPRO_ACCOUNTFLAG_A_RENAME (1<<14)
#define JAPRO_ACCOUNTFLAG_A_LISTMAPS (1<<15)
#define JAPRO_ACCOUNTFLAG_A_WHOIS (1<<16)
#define JAPRO_ACCOUNTFLAG_A_LOOKUP (1<<17)
#define JAPRO_ACCOUNTFLAG_A_NOFOLLOW (1<<18)
#define JAPRO_ACCOUNTFLAG_A_SEEHIDDEN (1<<19)
#define JAPRO_ACCOUNTFLAG_A_CALLVOTE (1<<20)
#define JAPRO_ACCOUNTFLAG_A_KILLVOTE (1<<21)
#define JAPRO_ACCOUNTFLAG_A_READAMSAY (1<<22)
#define JAPRO_MAX_ADMIN_BITS 22
#define JAPRO_ACCOUNTFLAG_IPLOCK (1<<23)
#define JAPRO_ACCOUNTFLAG_TRUSTED (1<<24)
#define JAPRO_ACCOUNTFLAG_NORACE (1<<25)
#define JAPRO_ACCOUNTFLAG_NODUEL (1<<26)
#define JAPRO_ACCOUNTFLAG_ALLCOSMETICS (1<<27)
#define JAPRO_ACCOUNTFLAG_ENTITY (1<<28)
#define JAPRO_ACCOUNTFLAG_DATABASE (1<<29)
#define JAPRO_ACCOUNTTEAMFLAG_OWNER (1<<0)
#define JAPRO_ACCOUNTTEAMFLAG_PENDING (1<<1)
#define JAPRO_TEAMFLAG_PRIVATE (1<<0)
void G_StoreTrail( gentity_t *ent );
void G_ResetTrail( gentity_t *ent );
void G_TimeShiftClient( gentity_t *ent, int time, qboolean timeshiftAnims );
void G_TimeShiftAllClients( int time, gentity_t *skip, qboolean timeshiftAnims );
void G_UnTimeShiftClient( gentity_t *ent, qboolean timeshiftAnims );
void G_UnTimeShiftAllClients( gentity_t *skip, qboolean timeshiftAnims );
void G_PredictPlayerStepSlideMove( gentity_t *ent, float frametime );
//NT - client origin trails
#define NUM_CLIENT_TRAILS 10
typedef struct { //Should this store their g2 anim? for proper g2 sync?
vec3_t mins, maxs;
vec3_t currentOrigin;//, currentAngles; //Well r.currentAngles are never actually used by clients in this game?
int time, leveltime, torsoAnim, torsoTimer, legsAnim, legsTimer;
float realAngle; //Only the [YAW] is ever used for hit detection
} clientTrail_t;
//JAPRO - Serverside - Emote bitrates
typedef enum {
E_BEG,
E_BEG2,
E_BREAKDANCE,
E_CHEER,
E_COWER,
E_DANCE,
E_HUG,
E_NOISY,
E_POINT,
E_RAGE,
E_SIT,
E_SURRENDER,
E_SMACK,
E_TAUNT,
E_VICTORY,
E_JAWARUN,
E_BERNIE,
E_SLEEP,
E_SABERFLIP,
E_SLAP,
E_SIGNAL,
E_BASEDUEL,
// E_SHEEV,//Group them all here, running out of space in this :s
E_ALL
} emote_type_t;
struct gentity_s {
//rww - entstate must be first, to correspond with the bg shared entity structure
entityState_t s; // communicated by server to clients
playerState_t *playerState; //ptr to playerstate if applicable (for bg ents)
Vehicle_t *m_pVehicle; //vehicle data
void *ghoul2; //g2 instance
int localAnimIndex; //index locally (game/cgame) to anim data for this skel
vec3_t modelScale; //needed for g2 collision
//From here up must be the same as centity_t/bgEntity_t
entityShared_t r; // shared by both the server system and game
//rww - these are shared icarus things. They must be in this order as well in relation to the entityshared structure.
int taskID[NUM_TIDS];
parms_t *parms;
char *behaviorSet[NUM_BSETS];
char *script_targetname;
int delayScriptTime;
char *fullName;
//rww - targetname and classname are now shared as well. ICARUS needs access to them.
char *targetname;
char *classname; // set in QuakeEd
//rww - and yet more things to share. This is because the nav code is in the exe because it's all C++.
int waypoint; //Set once per frame, if you've moved, and if someone asks
int lastWaypoint; //To make sure you don't double-back
int lastValidWaypoint; //ALWAYS valid -used for tracking someone you lost
int noWaypointTime; //Debouncer - so don't keep checking every waypoint in existance every frame that you can't find one
int combatPoint;
int failedWaypoints[MAX_FAILED_NODES];
int failedWaypointCheckTime;
int next_roff_time; //rww - npc's need to know when they're getting roff'd
// DO NOT MODIFY ANYTHING ABOVE THIS, THE SERVER
// EXPECTS THE FIELDS IN THAT ORDER!
//================================
struct gclient_s *client; // NULL if not a client
gNPC_t *NPC;//Only allocated if the entity becomes an NPC
int cantHitEnemyCounter;//HACK - Makes them look for another enemy on the same team if the one they're after can't be hit
qboolean noLumbar; //see note in cg_local.h
qboolean inuse;
int lockCount; //used by NPCs
int spawnflags; // set in QuakeEd
int teamnodmg; // damage will be ignored if it comes from this team
char *roffname; // set in QuakeEd
char *rofftarget; // set in QuakeEd
char *healingclass; //set in quakeed
char *healingsound; //set in quakeed
int healingrate; //set in quakeed
int healingDebounce; //debounce for generic object healing shiz
char *ownername;
int objective;
int side;
int passThroughNum; // set to index to pass through (+1) for missiles
int aimDebounceTime;
int painDebounceTime;
int attackDebounceTime;
int alliedTeam; // only useable by this team, never target this team
int roffid; // if roffname != NULL then set on spawn
qboolean neverFree; // if true, FreeEntity will only unlink
// bodyque uses this
int flags; // FL_* variables
char *model;
char *model2;
int freetime; // level.time when the object was freed
int eventTime; // events will be cleared EVENT_VALID_MSEC after set
qboolean freeAfterEvent;
qboolean unlinkAfterEvent;
qboolean physicsObject; // if true, it can be pushed by movers and fall off edges
// all game items are physicsObjects,
float physicsBounce; // 1.0 = continuous bounce, 0.0 = no bounce
int clipmask; // brushes with this content value will be collided against
// when moving. items and corpses do not collide against
// players, for instance
//Only used by NPC_spawners
char *NPC_type;
char *NPC_targetname;
char *NPC_target;
// movers
moverState_t moverState;
int soundPos1;
int sound1to2;
int sound2to1;
int soundPos2;
int soundLoop;
gentity_t *parent;
gentity_t *nextTrain;
gentity_t *prevTrain;
vec3_t pos1, pos2;
//for npc's
vec3_t pos3;
char *message;
int timestamp; // body queue sinking, etc
float angle; // set in editor, -1 = up, -2 = down
char *target;
char *target2;
char *target3; //For multiple targets, not used for firing/triggering/using, though, only for path branches
char *target4; //For multiple targets, not used for firing/triggering/using, though, only for path branches
char *target5; //mainly added for siege items
char *target6; //mainly added for siege items
char *team;
char *targetShaderName;
char *targetShaderNewName;
gentity_t *target_ent;
char *closetarget;
char *opentarget;
char *paintarget;
char *goaltarget;
char *idealclass;
float radius;
int maxHealth; //used as a base for crosshair health display
float speed;
vec3_t movedir;
float mass;
int setTime;
//Think Functions
int nextthink;
void (*think)(gentity_t *self);
void (*reached)(gentity_t *self); // movers call this when hitting endpoint
void (*blocked)(gentity_t *self, gentity_t *other);
void (*touch)(gentity_t *self, gentity_t *other, trace_t *trace);
void (*use)(gentity_t *self, gentity_t *other, gentity_t *activator);
void (*pain)(gentity_t *self, gentity_t *attacker, int damage);
void (*die)(gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int damage, int mod);
int pain_debounce_time;
int fly_sound_debounce_time; // wind tunnel
int last_move_time;
//Health and damage fields
int health;
qboolean takedamage;
material_t material;
int damage;
int dflags;
int splashDamage; // quad will increase this without increasing radius
int splashRadius;
int methodOfDeath;
int splashMethodOfDeath;
int locationDamage[HL_MAX]; // Damage accumulated on different body locations
int count;
int bounceCount;
qboolean alt_fire;
gentity_t *chain;
gentity_t *enemy;
gentity_t *lastEnemy;
gentity_t *activator;
gentity_t *teamchain; // next entity in team
gentity_t *teammaster; // master of the team
int watertype;
int waterlevel;
int noise_index;
int awesomenoise_index;//japro
int worldrecordnoise_index;//japro
int courseID;
int speakerEntity;
// timing variables
float wait;
float random;
int delay;
//generic values used by various entities for different purposes.
int genericValue1;
int genericValue2;
int genericValue3;
int genericValue4;
int genericValue5;
int genericValue6;
int genericValue7;
int genericValue8;
int genericValue9;
int genericValue10;
int genericValue11;
int genericValue12;
int genericValue13;
int genericValue14;
int genericValue15;
char *soundSet;
qboolean isSaberEntity;
int damageRedirect; //if entity takes damage, redirect to..
int damageRedirectTo; //this entity number
vec3_t epVelocity;
float epGravFactor;
gitem_t *item; // for bonus items
vec3_t origOrigin; //japro pushpullitems
qboolean spawnedBefore; //japro pushpullitems
qboolean raceModeShooter;
// OpenJK add
int useDebounceTime; // for cultist_destroyer
qboolean isLogical; // Determines if this ent is logical or not
};
#define DAMAGEREDIRECT_HEAD 1
#define DAMAGEREDIRECT_RLEG 2
#define DAMAGEREDIRECT_LLEG 3
typedef enum {
CON_DISCONNECTED,
CON_CONNECTING,
CON_CONNECTED
} clientConnected_t;
typedef enum {
SPECTATOR_NOT,
SPECTATOR_FREE,
SPECTATOR_FOLLOW,
SPECTATOR_SCOREBOARD
} spectatorState_t;
typedef enum {
TEAM_BEGIN, // Beginning a team game, spawn at base
TEAM_ACTIVE // Now actively playing
} playerTeamStateState_t;
typedef struct playerTeamState_s {
playerTeamStateState_t state;
int location;
int captures;
int basedefense;
int carrierdefense;
int flagrecovery;
int fragcarrier;
int assists;
float lasthurtcarrier;
float lastreturnedflag;
float flagsince;
float lastfraggedcarrier;
} playerTeamState_t;
// the auto following clients don't follow a specific client
// number, but instead follow the first two active players
#define FOLLOW_ACTIVE1 -1
#define FOLLOW_ACTIVE2 -2
// client data that stays across multiple levels or tournament restarts
// this is achieved by writing all the data to cvar strings at game shutdown
// time and reading them back at connection time. Anything added here
// MUST be dealt with in G_InitSessionData() / G_ReadSessionData() / G_WriteSessionData()
typedef struct clientSession_s {
team_t sessionTeam;
int spectatorNum; // for determining next-in-line to play
spectatorState_t spectatorState;
int spectatorClient; // for chasecam and follow mode
int wins, losses; // tournament stats
int selectedFP; // check against this, if doesn't match value in playerstate then update userinfo
int saberLevel; // similar to above method, but for current saber attack level
int setForce; // set to true once player is given the chance to set force powers
int updateUITime; // only update userinfo for FP/SL if < level.time
qboolean teamLeader; // true when this client is a team leader
char siegeClass[64];
int duelTeam;
int siegeDesiredTeam;
char IP[NET_ADDRSTRMAXLEN];
//[JAPRO - Serverside - All - Ignore - Start]
unsigned int ignore; // contains bits of all clients to be ignored, 0 - no one ignored, 0xFFFFFFFF - ignore all
qboolean sawMOTD; // japro has the client been shown the MOTD?
qboolean raceMode;
int movementStyle;
int accountFlags;
char clanpass[32];//Japro - Serverside Clanpass
int sayteammod;//0 = normal, 1 = clan, 2 = admin
//[JAPRO - Serverside - All - Ignore - End]
} clientSession_t;
// playerstate mGameFlags
#define PSG_VOTED (1<<0) // already cast a vote
#define PSG_TEAMVOTED (1<<1) // already cast a team vote
//
#define MAX_NETNAME 36
#define MAX_VOTE_COUNT 3
typedef struct {//JAPRO - Serverside - Stats
int kills;
int teamKills;
int damageTaken;
int damageGiven;
int teamDamageGiven;
int duelDamageGiven;
int startTimeFlag;//could be float?
float displacementFlag;
float topSpeedFlag;
int displacementFlagSamples;
int startTime;//For timers that are not flags
int coopStarted;//For coop tracking ugh
int startLevelTime;//For timers that are not flags
float displacement;
int displacementSamples;
float topSpeed;
int lastCheckpointTime;//For checkpoint floodprotect
int lastResetTime;
int teamHealGiven;
int teamEnergizeGiven;
int enemyDrainDamage;
int teamDrainDamage;
float racetime;
int kothTime;
short lowestHP;
int checkpoints;
int courseID;
} stats_t;
// client data that stays across multiple respawns, but is cleared
// on each level change or team change at ClientBegin()
typedef struct clientPersistant_s {
clientConnected_t connected;
usercmd_t cmd; // we would lose angles if not persistant
usercmd_t lastCmd; //eh
qboolean localClient; // true if "ip" info key is "localhost"
qboolean initialSpawn; // the first spawn should be at a cool location
qboolean predictItemPickup; // based on cg_predictItems userinfo
qboolean pmoveFixed; //
char netname[MAX_NETNAME];
char netname_nocolor[MAX_NETNAME];
int netnameTime; // Last time the name was changed
int maxHealth; // for handicapping
int enterTime; // level.time the client entered the game
playerTeamState_t teamState; // status in teamplay games
qboolean teamInfo; // send team overlay updates?
int connectTime;
qboolean isJAPRO;//JAPRO - Serverside - Add Clientside Version
qboolean JAWARUN;//JAPRO - Serverside - Add Clientside Version
qboolean centerMuzzle;//JAPRO - Serverside - Check if client wants to center muzzlepoint.
qboolean noDamageNumbers;//Japro
qboolean noDuelTele;
qboolean amfreeze;//JAPRO - Serverside - Admin - Amfreeze admin cmd
vec3_t telemarkOrigin;//JAPRO - Serverside - Admin - Telemark storage
float telemarkAngle;//JAPRO - Serverside - Admin - Telemark storage
float telemarkPitchAngle;//JAPRO - Serverside - Admin - Telemark storage
vec3_t respawnLocation;//JAPRO - Serverside - Admin - Telemark storage
float respawnAngle;
//char clanpass[MAX_QPATH];//Japro - Serverside Clanpass
//int sayteammod;//0 = normal, 1 = clan, 2 = admin
int lastChatTime;//godchat fuck idk why im doing this
int rate;
int snaps;
int timenudge;
int maxFPS;
int maxPackets;
qboolean thirdPerson;
int thirdPersonRange;
int thirdPersonVertOffset;
short cameraSettings; //Hold this here to network to player.. damn
//int aimSamples[64];//japro anti yawspeed?
//int aimCount;
qboolean chatting;
//qboolean raceMode; //move this to session data
qboolean onlyBhop;
qboolean noRoll;
qboolean noCartwheel;
int startLag;
//int movementStyle; //move this to session data
char saber1[MAX_QPATH], saber2[MAX_QPATH];
int vote, teamvote; // 0 = none, 1 = yes, 2 = no
char guid[33];
char userName[16];
char lastUserName[16];//To stop duel stats abuse
int duelStartTime;
qboolean backwardsRocket;
qboolean noFollow;
qboolean practice;
qboolean haste;
qboolean validPlugin;
qboolean recordingDemo;//japro autodemo for defrag... :S
qboolean keepDemo;//japro autodemo for defrag... :S
qboolean showChatCP;
qboolean showCenterCP;
qboolean showConsoleCP;
int demoStoppedTime;
int stopRecordingTime;
char oldDemoName[16];
char demoName[MAX_QPATH];
unsigned int unlocks;
short tribesClass;
short activeCapRoute;
stats_t stats;
} clientPersistant_t;
typedef struct renderInfo_s
{
//In whole degrees, How far to let the different model parts yaw and pitch
int headYawRangeLeft;
int headYawRangeRight;
int headPitchRangeUp;
int headPitchRangeDown;
int torsoYawRangeLeft;
int torsoYawRangeRight;
int torsoPitchRangeUp;
int torsoPitchRangeDown;
int legsFrame;
int torsoFrame;
float legsFpsMod;
float torsoFpsMod;
//Fields to apply to entire model set, individual model's equivalents will modify this value
vec3_t customRGB;//Red Green Blue, 0 = don't apply
int customAlpha;//Alpha to apply, 0 = none?
//RF?
int renderFlags;
//
vec3_t muzzlePoint;
vec3_t muzzleDir;
vec3_t muzzlePointOld;
vec3_t muzzleDirOld;
//vec3_t muzzlePointNext; // Muzzle point one server frame in the future!
//vec3_t muzzleDirNext;
int mPCalcTime;//Last time muzzle point was calced
//
float lockYaw;//
//
vec3_t headPoint;//Where your tag_head is
vec3_t headAngles;//where the tag_head in the torso is pointing
vec3_t handRPoint;//where your right hand is
vec3_t handLPoint;//where your left hand is
vec3_t crotchPoint;//Where your crotch is
vec3_t footRPoint;//where your right hand is
vec3_t footLPoint;//where your left hand is
vec3_t torsoPoint;//Where your chest is
vec3_t torsoAngles;//Where the chest is pointing
vec3_t eyePoint;//Where your eyes are
vec3_t eyeAngles;//Where your eyes face
int lookTarget;//Which ent to look at with lookAngles
lookMode_t lookMode;
int lookTargetClearTime;//Time to clear the lookTarget
int lastVoiceVolume;//Last frame's voice volume
vec3_t lastHeadAngles;//Last headAngles, NOT actual facing of head model
vec3_t headBobAngles;//headAngle offsets
vec3_t targetHeadBobAngles;//head bob angles will try to get to targetHeadBobAngles
int lookingDebounceTime;//When we can stop using head looking angle behavior
float legsYaw;//yaw angle your legs are actually rendering at
//for tracking legitimate bolt indecies
void *lastG2; //if it doesn't match ent->ghoul2, the bolts are considered invalid.
int headBolt;
int handRBolt;
int handLBolt;
int torsoBolt;
int crotchBolt;
int footRBolt;
int footLBolt;
int motionBolt;
int boltValidityTime;
} renderInfo_t;
typedef enum {
GENCMD_DELAY_SABER,
GENCMD_DELAY_SABERSWITCH,
GENCMD_DELAY_TAUNT,
GENCMD_DELAY_EMOTE,
GENCMD_DELAY_DUEL,
GENCMD_DELAY_HEAL,
GENCMD_DELAY_SPEED,
GENCMD_DELAY_TRICK,
GENCMD_DELAY_RAGE,
GENCMD_DELAY_PROTECT,
GENCMD_DELAY_ABSORB,
GENCMD_DELAY_SEEING,
GENCMD_DELAY_BINOCS,
GENCMD_DELAY_ZOOM,
GENCMD_DELAY_JETPACK,
GENCMD_DELAY_EWEB,
GENCMD_DELAY_CLOAK,
MAX_GENCMD_DELAYS
} genCmdType_t;
// this structure is cleared on each ClientSpawn(),
// except for 'client->pers' and 'client->sess'
struct gclient_s {
// ps MUST be the first element, because the server expects it
playerState_t ps; // communicated by server to clients
// the rest of the structure is private to game
clientPersistant_t pers;
clientSession_t sess;
saberInfo_t saber[MAX_SABERS];
void *weaponGhoul2[MAX_SABERS];
int tossableItemDebounce;
int bodyGrabTime;
int bodyGrabIndex;
int pushEffectTime;
int invulnerableTimer;
int saberCycleQueue;