forked from id-Software/Enemy-Territory
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbg_public.h
2421 lines (2000 loc) · 68.3 KB
/
bg_public.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
/*
===========================================================================
Wolfenstein: Enemy Territory GPL Source Code
Copyright (C) 1999-2010 id Software LLC, a ZeniMax Media company.
This file is part of the Wolfenstein: Enemy Territory GPL Source Code (Wolf ET Source Code).
Wolf ET Source Code is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Wolf ET Source Code 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 Wolf ET Source Code. If not, see <http://www.gnu.org/licenses/>.
In addition, the Wolf: ET Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Wolf ET Source Code. If not, please request a copy in writing from id Software at the address below.
If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
===========================================================================
*/
/*
* name: bg_public.h
*
* desc: definitions shared by both the server game and client game modules
*
*/
// because games can change separately from the main system version, we need a
// second version that must match between game and cgame
#ifndef __BG_PUBLIC_H__
#define __BG_PUBLIC_H__
#define GAME_VERSION "Enemy Territory"
#if defined( _DEBUG )
#define GAME_VERSION_DATED GAME_VERSION
#else
#define GAME_VERSION_DATED ( GAME_VERSION ", " Q3_VERSION )
#endif
//bani
#ifdef __GNUC__
#define _attribute( x ) __attribute__( x )
#else
#define _attribute( x )
#endif
//#define SAVEGAME_SUPPORT // uncomment to enable savegames
// enabling this requires you to run extractfuncs.bat as well before compiling qagame
#define SPRINTTIME 20000.0f
#define DEBUG_BOT_RETREATBEHAVIOR 1
#define DEFAULT_GRAVITY 800
#define FORCE_LIMBO_HEALTH -75 // JPW NERVE
#define GIB_HEALTH -175 // JPW NERVE
#define ARMOR_PROTECTION 0.66
#define HOLDBREATHTIME 12000
#define MAX_ITEMS 256
#define RANK_TIED_FLAG 0x4000
//#define DEFAULT_SHOTGUN_SPREAD 700
//#define DEFAULT_SHOTGUN_COUNT 11
//#define ITEM_RADIUS 15 // item sizes are needed for client side pickup detection
#define ITEM_RADIUS 10 // Rafael changed the radius so that the items would fit in the 3 new containers
// RF, zombie getup
//#define TIMER_RESPAWN (38*(1000/15)+100)
//#define LIGHTNING_RANGE 600
//#define TESLA_RANGE 800
#define FLAMETHROWER_RANGE 2500 // DHM - Nerve :: multiplayer range, was 850 in SP
//#define ZOMBIE_FLAME_RADIUS 300
// RF, AI effects
//#define PORTAL_ZOMBIE_SPAWNTIME 3000
//#define PORTAL_FEMZOMBIE_SPAWNTIME 3000
#define SCORE_NOT_PRESENT -9999 // for the CS_SCORES[12] when only one player is present
#define VOTE_TIME 30000 // 30 seconds before vote times out
// Ridah, disabled these
//#define MINS_Z -24
//#define DEFAULT_VIEWHEIGHT 26
//#define CROUCH_VIEWHEIGHT 12
// done.
// Rafael
// note to self: Corky test
//#define DEFAULT_VIEWHEIGHT 26
//#define CROUCH_VIEWHEIGHT 12
#define DEFAULT_VIEWHEIGHT 40
#define CROUCH_VIEWHEIGHT 16
#define DEAD_VIEWHEIGHT -16
#define PRONE_VIEWHEIGHT -8
extern vec3_t playerlegsProneMins;
extern vec3_t playerlegsProneMaxs;
#define MAX_COMMANDMAP_LAYERS 4
#define DEFAULT_MODEL "multi"
#define DEFAULT_HEAD "default" // technically the default head skin. this means "head_default.skin" for the head
// RF, on fire effects
#define FIRE_FLASH_TIME 2000
#define FIRE_FLASH_FADEIN_TIME 1000
#define LIGHTNING_FLASH_TIME 150
#define AAGUN_DAMAGE 25
#define AAGUN_SPREAD 10
// NOTE: use this value, and THEN the cl_input.c scales to tweak the feel
#define MG42_IDLEYAWSPEED 80.0 // degrees per second (while returning to base)
#define MG42_SPREAD_MP 100
#define MG42_DAMAGE_MP 20
#define MG42_RATE_OF_FIRE_MP 66
#define MG42_DAMAGE_SP 40
#define MG42_RATE_OF_FIRE_SP 100
#define AAGUN_RATE_OF_FIRE 100
#define MG42_YAWSPEED 300.f // degrees per second
#define SAY_ALL 0
#define SAY_TEAM 1
#define SAY_BUDDY 2
#define SAY_TEAMNL 3
// RF, client damage identifiers
// Arnout: different entity states
typedef enum {
STATE_DEFAULT, // ent is linked, can be used and is solid
STATE_INVISIBLE, // ent is unlinked, can't be used, doesn't think and is not solid
STATE_UNDERCONSTRUCTION // ent is being constructed
} entState_t;
typedef enum {
SELECT_BUDDY_ALL = 0,
SELECT_BUDDY_1,
SELECT_BUDDY_2,
SELECT_BUDDY_3,
SELECT_BUDDY_4,
SELECT_BUDDY_5,
SELECT_BUDDY_6,
SELECT_BUDDY_LAST // must be the last one in the enum
} SelectBuddyFlag;
// START - TAT 10/21/2002
// New icon based bot action command system
typedef enum
{
BOT_ACTION_ATTACK = 0,
BOT_ACTION_COVER, // 1
BOT_ACTION_MOUNTGUN, // 2
BOT_ACTION_OPENDOOR, // 3
BOT_ACTION_USEDYNAMITE, // 4
BOT_ACTION_DISARM, // 5
BOT_ACTION_CONSTRUCT, // 6
BOT_ACTION_REPAIR, // 7
BOT_ACTION_REVIVE, // 8
BOT_ACTION_GETDISGUISE, // 9
BOT_ACTION_HEAL, // 10
BOT_ACTION_AMMO, // 11
BOT_ACTION_GRENADELAUNCH, // 12
BOT_ACTION_PICKUPITEM, // 13
BOT_ACTION_PANZERFAUST, // 14
BOT_ACTION_FLAMETHROW, // 15
BOT_ACTION_MG42, // 16
BOT_ACTION_MOUNTEDATTACK, // 17 -- attack when mounted on mg42
BOT_ACTION_KNIFEATTACK, // 18
BOT_ACTION_LOCKPICK, // 19
BOT_ACTION_MAXENTITY,
// None of these need an entity...
BOT_ACTION_RECON = BOT_ACTION_MAXENTITY, // 20
BOT_ACTION_SMOKEBOMB, // 21
BOT_ACTION_FINDMINES, // 22
BOT_ACTION_PLANTMINE, // 23
BOT_ACTION_ARTILLERY, // 24
BOT_ACTION_AIRSTRIKE, // 25
BOT_ACTION_MOVETOLOC, // 26
// NOTE: if this gets bigger than 32 items, need to make botMenuIcons bigger
BOT_ACTION_MAX
} botAction_t;
// END - TAT 10/21/2002
// RF
#define MAX_TAGCONNECTS 64
// (SA) zoom sway values
#define ZOOM_PITCH_AMPLITUDE 0.13f
#define ZOOM_PITCH_FREQUENCY 0.24f
#define ZOOM_PITCH_MIN_AMPLITUDE 0.1f // minimum amount of sway even if completely settled on target
#define ZOOM_YAW_AMPLITUDE 0.7f
#define ZOOM_YAW_FREQUENCY 0.12f
#define ZOOM_YAW_MIN_AMPLITUDE 0.2f
// DHM - Nerve
#define MAX_OBJECTIVES 8
#define MAX_OID_TRIGGERS 18
// dhm
#define MAX_GAMETYPES 16
typedef struct {
const char *mapName;
const char *mapLoadName;
const char *imageName;
int typeBits;
int cinematic;
// Gordon: FIXME: remove
const char *opponentName;
int teamMembers;
int timeToBeat[MAX_GAMETYPES];
qhandle_t levelShot;
qboolean active;
// NERVE - SMF
int Timelimit;
int AxisRespawnTime;
int AlliedRespawnTime;
// -NERVE - SMF
vec2_t mappos;
const char *briefing;
const char *lmsbriefing;
const char *objectives;
} mapInfo;
// Campaign saves
// rain - 128 -> 512, campaigns are commonplace
#define MAX_CAMPAIGNS 512
// START Mad Doc - TDF
// changed this from 6 to 10
#define MAX_MAPS_PER_CAMPAIGN 10
// END Mad Doc - TDF
#define CPS_IDENT ( ( 'S' << 24 ) + ( 'P' << 16 ) + ( 'C' << 8 ) + 'I' )
#define CPS_VERSION 1
typedef struct {
int mapnameHash;
} cpsMap_t;
typedef struct {
int shortnameHash;
int progress;
cpsMap_t maps[MAX_MAPS_PER_CAMPAIGN];
} cpsCampaign_t;
typedef struct {
int ident;
int version;
int numCampaigns;
int profileHash;
} cpsHeader_t;
typedef struct {
cpsHeader_t header;
cpsCampaign_t campaigns[MAX_CAMPAIGNS];
} cpsFile_t;
qboolean BG_LoadCampaignSave( const char *filename, cpsFile_t *file, const char *profile );
qboolean BG_StoreCampaignSave( const char *filename, cpsFile_t *file, const char *profile );
typedef struct {
const char *campaignShortName;
const char *campaignName;
const char *campaignDescription;
const char *nextCampaignShortName;
const char *maps;
int mapCount;
mapInfo *mapInfos[MAX_MAPS_PER_CAMPAIGN];
vec2_t mapTC[2];
cpsCampaign_t *cpsCampaign; // if this campaign was found in the campaignsave, more detailed info can be found here
const char *campaignShotName;
int campaignCinematic;
qhandle_t campaignShot;
qboolean unlocked;
int progress;
qboolean initial;
int order;
int typeBits;
} campaignInfo_t;
// Random reinforcement seed settings
#define MAX_REINFSEEDS 8
#define REINF_RANGE 16 // (0 to n-1 second offset)
#define REINF_BLUEDELT 3 // Allies shift offset
#define REINF_REDDELT 2 // Axis shift offset
extern const unsigned int aReinfSeeds[MAX_REINFSEEDS];
// Client flags for server processing
#define CGF_AUTORELOAD 0x01
#define CGF_STATSDUMP 0x02
#define CGF_AUTOACTIVATE 0x04
#define CGF_PREDICTITEMS 0x08
#define MAX_MOTDLINES 6
// Multiview settings
#define MAX_MVCLIENTS 32
#define MV_SCOREUPDATE_INTERVAL 5000 // in msec
#define MAX_CHARACTERS 16
//
// config strings are a general means of communicating variable length strings
// from the server to all connected clients.
//
// CS_SERVERINFO and CS_SYSTEMINFO are defined in q_shared.h
#define CS_MUSIC 2
#define CS_MESSAGE 3 // from the map worldspawn's message field
#define CS_MOTD 4 // g_motd string for server message of the day
#define CS_WARMUP 5 // server time when the match will be restarted
#define CS_VOTE_TIME 6
#define CS_VOTE_STRING 7
#define CS_VOTE_YES 8
#define CS_VOTE_NO 9
#define CS_GAME_VERSION 10
#define CS_LEVEL_START_TIME 11 // so the timer only shows the current level
#define CS_INTERMISSION 12 // when 1, intermission will start in a second or two
#define CS_MULTI_INFO 13
#define CS_MULTI_MAPWINNER 14
#define CS_MULTI_OBJECTIVE 15
//
#define CS_SCREENFADE 17 // Ridah, used to tell clients to fade their screen to black/normal
#define CS_FOGVARS 18 //----(SA) used for saving the current state/settings of the fog
#define CS_SKYBOXORG 19 // this is where we should view the skybox from
#define CS_TARGETEFFECT 20 //----(SA)
#define CS_WOLFINFO 21 // NERVE - SMF
#define CS_FIRSTBLOOD 22 // Team that has first blood
#define CS_ROUNDSCORES1 23 // Axis round wins
#define CS_ROUNDSCORES2 24 // Allied round wins
#define CS_MAIN_AXIS_OBJECTIVE 25 // Most important current objective
#define CS_MAIN_ALLIES_OBJECTIVE 26 // Most important current objective
#define CS_MUSIC_QUEUE 27
#define CS_SCRIPT_MOVER_NAMES 28
#define CS_CONSTRUCTION_NAMES 29
#define CS_VERSIONINFO 30 // Versioning info for demo playback compatibility
#define CS_REINFSEEDS 31 // Reinforcement seeds
#define CS_SERVERTOGGLES 32 // Shows current enable/disabled settings (for voting UI)
#define CS_GLOBALFOGVARS 33
#define CS_AXIS_MAPS_XP 34
#define CS_ALLIED_MAPS_XP 35
#define CS_INTERMISSION_START_TIME 36 //
#define CS_ENDGAME_STATS 37
#define CS_CHARGETIMES 38
#define CS_FILTERCAMS 39
#define CS_MODELS 64
#define CS_SOUNDS ( CS_MODELS + MAX_MODELS )
#define CS_SHADERS ( CS_SOUNDS + MAX_SOUNDS )
#define CS_SHADERSTATE ( CS_SHADERS + MAX_CS_SHADERS ) // Gordon: this MUST be after CS_SHADERS
#define CS_SKINS ( CS_SHADERSTATE + 1 )
#define CS_CHARACTERS ( CS_SKINS + MAX_CS_SKINS )
#define CS_PLAYERS ( CS_CHARACTERS + MAX_CHARACTERS )
#define CS_MULTI_SPAWNTARGETS ( CS_PLAYERS + MAX_CLIENTS )
#define CS_OID_TRIGGERS ( CS_MULTI_SPAWNTARGETS + MAX_MULTI_SPAWNTARGETS )
#define CS_OID_DATA ( CS_OID_TRIGGERS + MAX_OID_TRIGGERS )
#define CS_DLIGHTS ( CS_OID_DATA + MAX_OID_TRIGGERS )
#define CS_SPLINES ( CS_DLIGHTS + MAX_DLIGHT_CONFIGSTRINGS )
#define CS_TAGCONNECTS ( CS_SPLINES + MAX_SPLINE_CONFIGSTRINGS )
#define CS_FIRETEAMS ( CS_TAGCONNECTS + MAX_TAGCONNECTS )
#define CS_CUSTMOTD ( CS_FIRETEAMS + MAX_FIRETEAMS )
#define CS_STRINGS ( CS_CUSTMOTD + MAX_MOTDLINES )
#define CS_MAX ( CS_STRINGS + MAX_CSSTRINGS )
#if ( CS_MAX ) > MAX_CONFIGSTRINGS
#error overflow: (CS_MAX) > MAX_CONFIGSTRINGS
#endif
//#ifndef GAMETYPES
//#define GAMETYPES
typedef enum {
GT_SINGLE_PLAYER,
GT_COOP,
GT_WOLF,
GT_WOLF_STOPWATCH,
GT_WOLF_CAMPAIGN, // Exactly the same as GT_WOLF, but uses campaign roulation (multiple maps form one virtual map)
GT_WOLF_LMS,
GT_MAX_GAME_TYPE
} gametype_t;
//#define GAMETYPES
// Rafael gameskill
/*typedef enum {
GSKILL_EASY = 1,
GSKILL_MEDIUM,
GSKILL_MEDIUMHARD, // normal default level
GSKILL_HARD,
GSKILL_VERYHARD,
GSKILL_MAX // must always be last
} gameskill_t;*/
//#endif // ifndef GAMETYPES
typedef enum { GENDER_MALE, GENDER_FEMALE, GENDER_NEUTER } gender_t;
/*
===================================================================================
PMOVE MODULE
The pmove code takes a player_state_t and a usercmd_t and generates a new player_state_t
and some other output data. Used for local prediction on the client game and true
movement on the server game.
===================================================================================
*/
typedef enum {
PM_NORMAL, // can accelerate and turn
PM_NOCLIP, // noclip movement
PM_SPECTATOR, // still run into walls
PM_DEAD, // no acceleration or turning, but free falling
PM_FREEZE, // stuck in place with no control
PM_INTERMISSION // no movement or status bar
} pmtype_t;
typedef enum {
WEAPON_READY,
WEAPON_RAISING,
WEAPON_RAISING_TORELOAD,
WEAPON_DROPPING,
WEAPON_DROPPING_TORELOAD,
WEAPON_READYING, // getting from 'ready' to 'firing'
WEAPON_RELAXING, // weapon is ready, but since not firing, it's on it's way to a "relaxed" stance
WEAPON_FIRING,
WEAPON_FIRINGALT,
WEAPON_RELOADING, //----(SA) added
} weaponstate_t;
typedef enum {
WSTATE_IDLE,
WSTATE_SWITCH,
WSTATE_FIRE,
WSTATE_RELOAD
} weaponstateCompact_t;
// pmove->pm_flags (sent as max 16 bits in msg.c)
#define PMF_DUCKED 1
#define PMF_JUMP_HELD 2
#define PMF_LADDER 4 // player is on a ladder
#define PMF_BACKWARDS_JUMP 8 // go into backwards land
#define PMF_BACKWARDS_RUN 16 // coast down to backwards run
#define PMF_TIME_LAND 32 // pm_time is time before rejump
#define PMF_TIME_KNOCKBACK 64 // pm_time is an air-accelerate only time
#define PMF_TIME_WATERJUMP 256 // pm_time is waterjump
#define PMF_RESPAWNED 512 // clear after attack and jump buttons come up
//#define PMF_PRONE_BIPOD 1024 // prone with a bipod set
#define PMF_FLAILING 2048
#define PMF_FOLLOW 4096 // spectate following another player
#define PMF_TIME_LOAD 8192 // hold for this time after a load game, and prevent large thinks
#define PMF_LIMBO 16384 // JPW NERVE limbo state, pm_time is time until reinforce
#define PMF_TIME_LOCKPLAYER 32768 // DHM - Nerve :: Lock all movement and view changes
#define PMF_ALL_TIMES ( PMF_TIME_WATERJUMP | PMF_TIME_LAND | PMF_TIME_KNOCKBACK | PMF_TIME_LOCKPLAYER /*|PMF_TIME_LOAD*/ )
typedef struct {
qboolean bAutoReload; // do we predict autoreload of weapons
int jumpTime; // used in MP to prevent jump accel
int weapAnimTimer; // don't change low priority animations until this runs out //----(SA) added
int silencedSideArm; // Gordon: Keep track of whether the luger/colt is silenced "in holster", prolly want to do this for the kar98 etc too
int sprintTime;
int airleft;
// Arnout: MG42 aiming
float varc, harc;
vec3_t centerangles;
int dtmove; // doubletap move
int dodgeTime;
int proneTime; // time a go-prone or stop-prone move starts, to sync the animation to
int proneGroundTime; // time a prone player last had ground under him
float proneLegsOffset; // offset legs bounding box
vec3_t mountedWeaponAngles; // mortar, mg42 (prone), etc
int weapRecoilTime; // Arnout: time at which a weapon that has a recoil kickback has been fired last
int weapRecoilDuration;
float weapRecoilYaw;
float weapRecoilPitch;
int lastRecoilDeltaTime;
qboolean releasedFire;
} pmoveExt_t; // data used both in client and server - store it here
// instead of playerstate to prevent different engine versions of playerstate between XP and MP
#define MAXTOUCH 32
typedef struct {
// state (in / out)
playerState_t *ps;
pmoveExt_t *pmext;
struct bg_character_s *character;
// command (in)
usercmd_t cmd, oldcmd;
int tracemask; // collide against these types of surfaces
int debugLevel; // if set, diagnostic output will be printed
qboolean noFootsteps; // if the game is setup for no footsteps by the server
qboolean noWeapClips; // if the game is setup for no weapon clips by the server
qboolean gauntletHit; // true if a gauntlet attack would actually hit something
// NERVE - SMF (in)
int gametype;
int ltChargeTime;
int soldierChargeTime;
int engineerChargeTime;
int medicChargeTime;
// -NERVE - SMF
int covertopsChargeTime;
// results (out)
int numtouch;
int touchents[MAXTOUCH];
vec3_t mins, maxs; // bounding box size
int watertype;
int waterlevel;
float xyspeed;
int *skill; // player skills
#ifdef SAVEGAME_SUPPORT
qboolean reloading;
#endif // SAVEGAME_SUPPORT
#ifdef GAMEDLL // the whole stamina thing is only in qagame
qboolean leadership; // within 512 units of a player with level 5 Signals skill (that player has to be in PVS as well to make sue we can predict it)
#endif // GAMEDLL
// for fixed msec Pmove
int pmove_fixed;
int pmove_msec;
// callbacks to test the world
// these will be different functions during game and cgame
void ( *trace )( trace_t *results, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int passEntityNum, int contentMask );
int ( *pointcontents )( const vec3_t point, int passEntityNum );
} pmove_t;
// if a full pmove isn't done on the client, you can just update the angles
void PM_UpdateViewAngles( playerState_t * ps, pmoveExt_t * pmext, usercmd_t * cmd, void( trace ) ( trace_t * results, const vec3_t start, const vec3_t mins, const vec3_t maxs, const vec3_t end, int passEntityNum, int contentMask ), int tracemask );
int Pmove( pmove_t *pmove );
//===================================================================================
#define PC_SOLDIER 0 // shoot stuff
#define PC_MEDIC 1 // heal stuff
#define PC_ENGINEER 2 // build stuff
#define PC_FIELDOPS 3 // bomb stuff
#define PC_COVERTOPS 4 // sneak about ;o
#define NUM_PLAYER_CLASSES 5
// JPW NERVE
#define MAX_WEAPS_IN_BANK_MP 12
#define MAX_WEAP_BANKS_MP 10
// jpw
// player_state->stats[] indexes
typedef enum {
STAT_HEALTH,
STAT_KEYS, // 16 bit fields
STAT_DEAD_YAW, // look this direction when dead (FIXME: get rid of?)
STAT_CLIENTS_READY, // bit mask of clients wishing to exit the intermission (FIXME: configstring?)
STAT_MAX_HEALTH, // health / armor limit, changable by handicap
STAT_PLAYER_CLASS, // DHM - Nerve :: player class in multiplayer
STAT_CAPTUREHOLD_RED, // JPW NERVE - red team score
STAT_CAPTUREHOLD_BLUE, // JPW NERVE - blue team score
STAT_XP, // Gordon: "realtime" version of xp that doesnt need to go thru the scoreboard
} statIndex_t;
// player_state->persistant[] indexes
// these fields are the only part of player_state that isn't
// cleared on respawn
typedef enum {
PERS_SCORE, // !!! MUST NOT CHANGE, SERVER AND GAME BOTH REFERENCE !!!
PERS_HITS, // total points damage inflicted so damage beeps can sound on change
PERS_RANK,
PERS_TEAM,
PERS_SPAWN_COUNT, // incremented every respawn
PERS_ATTACKER, // clientnum of last damage inflicter
PERS_KILLED, // count of the number of times you died
// these were added for single player awards tracking
PERS_RESPAWNS_LEFT, // DHM - Nerve :: number of remaining respawns
PERS_RESPAWNS_PENALTY, // how many respawns you have to sit through before respawning again
PERS_REVIVE_COUNT,
PERS_BLEH_2,
PERS_BLEH_3,
// Rafael - mg42 // (SA) I don't understand these here. can someone explain?
PERS_HWEAPON_USE,
// Rafael wolfkick
PERS_WOLFKICK
} persEnum_t;
// entityState_t->eFlags
#define EF_DEAD 0x00000001 // don't draw a foe marker over players with EF_DEAD
#define EF_NONSOLID_BMODEL 0x00000002 // bmodel is visible, but not solid
#define EF_FORCE_END_FRAME EF_NONSOLID_BMODEL // force client to end of current animation (after loading a savegame)
#define EF_TELEPORT_BIT 0x00000004 // toggled every time the origin abruptly changes
#define EF_READY 0x00000008 // player is ready
#define EF_CROUCHING 0x00000010 // player is crouching
#define EF_MG42_ACTIVE 0x00000020 // currently using an MG42
#define EF_NODRAW 0x00000040 // may have an event, but no model (unspawned items)
#define EF_FIRING 0x00000080 // for lightning gun
#define EF_INHERITSHADER EF_FIRING // some ents will never use EF_FIRING, hijack it for "USESHADER"
#define EF_SPINNING 0x00000100 // (SA) added for level editor control of spinning pickup items
#define EF_BREATH EF_SPINNING // Characters will not have EF_SPINNING set, hijack for drawing character breath
#define EF_TALK 0x00000200 // draw a talk balloon
#define EF_CONNECTION 0x00000400 // draw a connection trouble sprite
#define EF_SMOKINGBLACK 0x00000800 // JPW NERVE -- like EF_SMOKING only darker & bigger
#define EF_HEADSHOT 0x00001000 // last hit to player was head shot (Gordon: NOTE: not last hit, but has BEEN shot in the head since respawn)
#define EF_SMOKING 0x00002000 // DHM - Nerve :: ET_GENERAL ents will emit smoke if set // JPW switched to this after my code change
#define EF_OVERHEATING ( EF_SMOKING | EF_SMOKINGBLACK ) // ydnar: light smoke/steam effect
#define EF_VOTED 0x00004000 // already cast a vote
#define EF_TAGCONNECT 0x00008000 // connected to another entity via tag
#define EF_MOUNTEDTANK EF_TAGCONNECT // Gordon: duplicated for clarity
#define EF_SPARE3 0x00010000 // Gordon: freed
#define EF_PATH_LINK 0x00020000 // Gordon: linking trains together
#define EF_ZOOMING 0x00040000 // client is zooming
#define EF_PRONE 0x00080000 // player is prone
#define EF_PRONE_MOVING 0x00100000 // player is prone and moving
#define EF_VIEWING_CAMERA 0x00200000 // player is viewing a camera
#define EF_AAGUN_ACTIVE 0x00400000 // Gordon: player is manning an AA gun
#define EF_SPARE0 0x00800000 // Gordon: freed
// !! NOTE: only place flags that don't need to go to the client beyond 0x00800000
#define EF_SPARE1 0x01000000 // Gordon: freed
#define EF_SPARE2 0x02000000 // Gordon: freed
#define EF_BOUNCE 0x04000000 // for missiles
#define EF_BOUNCE_HALF 0x08000000 // for missiles
#define EF_MOVER_STOP 0x10000000 // will push otherwise // (SA) moved down to make space for one more client flag
#define EF_MOVER_BLOCKED 0x20000000 // mover was blocked dont lerp on the client // xkan, moved down to make space for client flag
#define BG_PlayerMounted( eFlags ) ( ( eFlags & EF_MG42_ACTIVE ) || ( eFlags & EF_MOUNTEDTANK ) || ( eFlags & EF_AAGUN_ACTIVE ) )
// !! NOTE: only place flags that don't need to go to the client beyond 0x00800000
typedef enum {
PW_NONE,
// (SA) for Wolf
PW_INVULNERABLE,
PW_FIRE, //----(SA)
PW_ELECTRIC, //----(SA)
PW_BREATHER, //----(SA)
PW_NOFATIGUE, //----(SA)
PW_REDFLAG,
PW_BLUEFLAG,
PW_OPS_DISGUISED,
PW_OPS_CLASS_1,
PW_OPS_CLASS_2,
PW_OPS_CLASS_3,
PW_ADRENALINE,
PW_BLACKOUT = 14, // OSP - spec blackouts. FIXME: we don't need 32bits here...relocate
PW_MVCLIENTLIST = 15, // OSP - MV client info.. need a full 32 bits
PW_NUM_POWERUPS
} powerup_t;
typedef enum {
//----(SA) These will probably all change to INV_n to get the word 'key' out of the game.
// id and DM don't want references to 'keys' in the game.
// I'll change to 'INV' as the item becomes 'permanent' and not a test item.
KEY_NONE,
KEY_1, // skull
KEY_2, // chalice
KEY_3, // eye
KEY_4, // field radio
KEY_5, // satchel charge
INV_BINOCS, // binoculars
KEY_7,
KEY_8,
KEY_9,
KEY_10,
KEY_11,
KEY_12,
KEY_13,
KEY_14,
KEY_15,
KEY_16,
KEY_LOCKED_PICKABLE, // Mad Doc - TDF: ent can be unlocked with the WP_LOCKPICK.
KEY_NUM_KEYS
} wkey_t; // conflicts with types.h
typedef enum {
HI_NONE,
// HI_TELEPORTER,
HI_MEDKIT,
// new for Wolf
HI_WINE,
HI_SKULL,
HI_WATER,
HI_ELECTRIC,
HI_FIRE,
HI_STAMINA,
HI_BOOK1, //----(SA) added
HI_BOOK2, //----(SA) added
HI_BOOK3, //----(SA) added
HI_11,
HI_12,
HI_13,
HI_14,
// HI_15, // ?
HI_NUM_HOLDABLE
} holdable_t;
#ifdef KITS
// START Mad Doc - TDF
// for kits dropped by allied bots in SP
typeef enum {
KIT_SOLDIER,
KIT_MEDIC,
KIT_ENGINEER,
KIT_LT,
KIT_COVERTOPS
} kit_t;
// END Mad Doc - TDF
#endif
// NOTE: we can only use up to 15 in the client-server stream
// SA NOTE: should be 31 now (I added 1 bit in msg.c)
// RF NOTE: if this changes, please update etmain\botfiles\inv.h
typedef enum {
WP_NONE, // 0
WP_KNIFE, // 1
WP_LUGER, // 2
WP_MP40, // 3
WP_GRENADE_LAUNCHER, // 4
WP_PANZERFAUST, // 5
WP_FLAMETHROWER, // 6
WP_COLT, // 7 // equivalent american weapon to german luger
WP_THOMPSON, // 8 // equivalent american weapon to german mp40
WP_GRENADE_PINEAPPLE, // 9
WP_STEN, // 10 // silenced sten sub-machinegun
WP_MEDIC_SYRINGE, // 11 // JPW NERVE -- broken out from CLASS_SPECIAL per Id request
WP_AMMO, // 12 // JPW NERVE likewise
WP_ARTY, // 13
WP_SILENCER, // 14 // used to be sp5
WP_DYNAMITE, // 15
WP_SMOKETRAIL, // 16
WP_MAPMORTAR, // 17
VERYBIGEXPLOSION, // 18 // explosion effect for airplanes
WP_MEDKIT, // 19
WP_BINOCULARS, // 20
WP_PLIERS, // 21
WP_SMOKE_MARKER, // 22 // Arnout: changed name to cause less confusion
WP_KAR98, // 23 // WolfXP weapons
WP_CARBINE, // 24
WP_GARAND, // 25
WP_LANDMINE, // 26
WP_SATCHEL, // 27
WP_SATCHEL_DET, // 28
WP_TRIPMINE, // 29
WP_SMOKE_BOMB, // 30
WP_MOBILE_MG42, // 31
WP_K43, // 32
WP_FG42, // 33
WP_DUMMY_MG42, // 34 // Gordon: for storing heat on mounted mg42s...
WP_MORTAR, // 35
WP_LOCKPICK, // 36 // Mad Doc - TDF lockpick
WP_AKIMBO_COLT, // 37
WP_AKIMBO_LUGER, // 38
// Gordon: ONLY secondaries below this mark, as they are checked >= WP_GPG40 && < WP_NUM_WEAPONS
WP_GPG40, // 39
WP_M7, // 40
WP_SILENCED_COLT, // 41
WP_GARAND_SCOPE, // 42
WP_K43_SCOPE, // 43
WP_FG42SCOPE, // 44
WP_MORTAR_SET, // 45
WP_MEDIC_ADRENALINE, // 46
WP_AKIMBO_SILENCEDCOLT, // 47
WP_AKIMBO_SILENCEDLUGER, // 48
WP_MOBILE_MG42_SET, // 49
WP_NUM_WEAPONS // WolfMP: 32 WolfXP: 50
// NOTE: this cannot be larger than 64 for AI/player weapons!
} weapon_t;
// JPW NERVE moved from cg_weapons (now used in g_active) for drop command, actual array in bg_misc.c
extern int weapBanksMultiPlayer[MAX_WEAP_BANKS_MP][MAX_WEAPS_IN_BANK_MP];
// jpw
// TAT 10/4/2002
// Using one unified list for which weapons can received ammo
// This is used both by the ammo pack code and by the bot code to determine if reloads are needed
extern int reloadableWeapons[];
typedef struct {
int kills, teamkills, killedby;
} weaponStats_t;
typedef enum {
HR_HEAD,
HR_ARMS,
HR_BODY,
HR_LEGS,
HR_NUM_HITREGIONS,
} hitRegion_t;
typedef enum {
SK_BATTLE_SENSE,
SK_EXPLOSIVES_AND_CONSTRUCTION,
SK_FIRST_AID,
SK_SIGNALS,
SK_LIGHT_WEAPONS,
SK_HEAVY_WEAPONS,
SK_MILITARY_INTELLIGENCE_AND_SCOPED_WEAPONS,
SK_NUM_SKILLS
} skillType_t;
extern const char* skillNames[SK_NUM_SKILLS];
extern const char* skillNamesLine1[SK_NUM_SKILLS];
extern const char* skillNamesLine2[SK_NUM_SKILLS];
extern const char* medalNames[SK_NUM_SKILLS];
#define NUM_SKILL_LEVELS 5
extern const int skillLevels[NUM_SKILL_LEVELS];
typedef struct {
weaponStats_t weaponStats[WP_NUM_WEAPONS];
int suicides;
int hitRegions[HR_NUM_HITREGIONS];
int objectiveStats[MAX_OBJECTIVES];
} playerStats_t;
typedef struct ammotable_s {
int maxammo; //
int uses; //
int maxclip; //
int defaultStartingAmmo; // Mad Doc - TDF
int defaultStartingClip; // Mad Doc - TDF
int reloadTime; //
int fireDelayTime; //
int nextShotTime; //
//----(SA) added
int maxHeat; // max active firing time before weapon 'overheats' (at which point the weapon will fail)
int coolRate; // how fast the weapon cools down. (per second)
//----(SA) end
int mod; // means of death
} ammotable_t;
// Lookup table to find ammo table entry
extern ammotable_t *GetAmmoTableData( int ammoIndex );
extern int weapAlts[]; // defined in bg_misc.c
//----(SA)
// for routines that need to check if a WP_ is </=/> a given set of weapons
#define WP_BEGINSECONDARY WP_GPG40
#define WP_LASTSECONDARY WP_SILENCED_COLT
#define WEAPS_ONE_HANDED ( ( 1 << WP_KNIFE ) | ( 1 << WP_LUGER ) | ( 1 << WP_COLT ) | ( 1 << WP_SILENCER ) | ( 1 << WP_SILENCED_COLT ) | ( 1 << WP_GRENADE_LAUNCHER ) | ( 1 << WP_GRENADE_PINEAPPLE ) )
// TTimo
// NOTE: what about WP_VENOM and other XP weapons?
// rain - #81 - added added akimbo weapons and deployed MG42
#define IS_AUTORELOAD_WEAPON( weapon ) \
( \
weapon == WP_LUGER || weapon == WP_COLT || weapon == WP_MP40 || \
weapon == WP_THOMPSON || weapon == WP_STEN || \
weapon == WP_KAR98 || weapon == WP_CARBINE || weapon == WP_GARAND_SCOPE || \
weapon == WP_FG42 || weapon == WP_K43 || weapon == WP_MOBILE_MG42 || \
weapon == WP_SILENCED_COLT || weapon == WP_SILENCER || \
weapon == WP_GARAND || weapon == WP_K43_SCOPE || weapon == WP_FG42SCOPE || \
BG_IsAkimboWeapon( weapon ) || weapon == WP_MOBILE_MG42_SET \
)
// entityState_t->event values
// entity events are for effects that take place reletive
// to an existing entities origin. Very network efficient.
// two bits at the top of the entityState->event field
// will be incremented with each change in the event so
// that an identical event started twice in a row can
// be distinguished. And off the value with ~EV_EVENT_BITS
// to retrieve the actual event number
#define EV_EVENT_BIT1 0x00000100
#define EV_EVENT_BIT2 0x00000200
#define EV_EVENT_BITS ( EV_EVENT_BIT1 | EV_EVENT_BIT2 )
typedef enum {
EV_NONE,
EV_FOOTSTEP,
EV_FOOTSTEP_METAL,
EV_FOOTSTEP_WOOD,
EV_FOOTSTEP_GRASS,
EV_FOOTSTEP_GRAVEL,
EV_FOOTSTEP_ROOF,
EV_FOOTSTEP_SNOW,
EV_FOOTSTEP_CARPET,
EV_FOOTSPLASH,
EV_FOOTWADE,
EV_SWIM,
EV_STEP_4,
EV_STEP_8,
EV_STEP_12,
EV_STEP_16,
EV_FALL_SHORT,
EV_FALL_MEDIUM,
EV_FALL_FAR,
EV_FALL_NDIE,
EV_FALL_DMG_10,
EV_FALL_DMG_15,
EV_FALL_DMG_25,
EV_FALL_DMG_50,
EV_JUMP,
EV_WATER_TOUCH, // foot touches
EV_WATER_LEAVE, // foot leaves
EV_WATER_UNDER, // head touches
EV_WATER_CLEAR, // head leaves
EV_ITEM_PICKUP, // normal item pickups are predictable
EV_ITEM_PICKUP_QUIET, // (SA) same, but don't play the default pickup sound as it was specified in the ent
EV_GLOBAL_ITEM_PICKUP, // powerup / team sounds are broadcast to everyone
EV_NOAMMO,
EV_WEAPONSWITCHED,
EV_EMPTYCLIP,
EV_FILL_CLIP,
EV_MG42_FIXED, // JPW NERVE
EV_WEAP_OVERHEAT,
EV_CHANGE_WEAPON,
EV_CHANGE_WEAPON_2,
EV_FIRE_WEAPON,
EV_FIRE_WEAPONB,
EV_FIRE_WEAPON_LASTSHOT,