-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdefs.pqc
647 lines (515 loc) · 16.7 KB
/
defs.pqc
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
//clan stuff
#define clan_progs
#define fte_rankings // comment this out if not running fte server or dont want rankings enabled
#define new_solid // rocket hitting invisible wall fix (may be buggy, comment this out if it is..)
#define WEAP_SNIPER_RIFLE_MAX_TIME 3 // PZ - Randomer's charge-up fix
#define WEAP_SNIPER_RIFLE_MIN_DAMG 50 //
#define WEAP_SNIPER_RIFLE_MAX_DAMG 400 //
#define PC_SPY_MAXSPEED 320
#define TL_ANY_SOLID 0
#define TL_BSP_ONLY 1 // will hit BSP only
//menus
#define MENU_CLAN_PREMATCH 45
/*
==============================================================================
SOURCE FOR GLOBALVARS_T C STRUCTURE
==============================================================================
*/
//
// system globals
//
entity self;
entity other;
entity world;
float time;
float frametime;
entity newmis; // if this is set, the entity that just
// run created a new missile that should
// be simulated immediately
float force_retouch; // force all entities to touch triggers
// next frame. this is needed because
// non-moving things don't normally scan
// for triggers, and when a trigger is
// created (like a teleport trigger), it
// needs to catch everything.
// decremented each frame, so set to 2
// to guarantee everything is touched
string mapname;
float serverflags; // propagated from level to level, used to
// keep track of completed episodes
float total_secrets;
float total_monsters;
float found_secrets; // number of secrets found
float killed_monsters; // number of monsters killed
// spawnparms are used to encode information about clients across server
// level changes
float parm1, parm2, parm3, parm4, parm5, parm6, parm7, parm8, parm9, parm10, parm11, parm12, parm13, parm14, parm15, parm16;
//
// global variables set by built in functions
//
vector v_forward, v_up, v_right; // set by makevectors()
// set by traceline / tracebox
float trace_allsolid;
float trace_startsolid;
float trace_fraction;
vector trace_endpos;
vector trace_plane_normal;
float trace_plane_dist;
entity trace_ent;
float trace_inopen;
float trace_inwater;
entity msg_entity; // destination of single entity writes
//
// required prog functions
//
void() main; // only for testing
void() StartFrame;
void() PlayerPreThink;
void() PlayerPostThink;
void() ClientKill;
void() ClientConnect;
void() PutClientInServer; // call after setting the parm1... parms
void() ClientDisconnect;
void() SetNewParms; // called when a client first connects to
// a server. sets parms so they can be
// saved off for restarts
void() SetChangeParms; // call to set parms for self so they can
// be saved for a level transition
//================================================
void end_sys_globals; // flag for structure dumping
//================================================
/*
==============================================================================
SOURCE FOR ENTVARS_T C STRUCTURE
==============================================================================
*/
//
// system fields (*** = do not set in prog code, maintained by C code)
//
.float modelindex; // *** model index in the precached list
.vector absmin, absmax; // *** origin + mins / maxs
.float ltime; // local time for entity
.float lastruntime; // *** to allow entities to run out of sequence
.float movetype;
.float solid;
.vector origin; // ***
.vector oldorigin; // ***
.vector velocity;
.vector angles;
.vector avelocity;
.string classname; // spawn function
.string model;
.float frame;
.float skin;
.float effects;
.vector mins, maxs; // bounding box extents reletive to origin
.vector size; // maxs - mins
.void() touch;
.void() use;
.void() think;
.void() blocked; // for doors or plats, called when can't push other
.float nextthink;
.entity groundentity;
// stats
.float health;
.float frags;
.float weapon; // one of the IT_SHOTGUN, etc flags
.string weaponmodel;
.float weaponframe;
.float currentammo;
.float ammo_shells, ammo_nails, ammo_rockets, ammo_cells;
.float items; // bit flags
.float takedamage;
.entity chain;
.float deadflag;
.vector view_ofs; // add to origin to get eye point
.float button0; // fire
.float button1; // use
.float button2; // jump
.float impulse; // weapon changes
.float fixangle;
.vector v_angle; // view / targeting angle for players
.string netname;
.entity enemy;
.float flags;
.float colormap;
.float team;
.float max_health; // players maximum health is stored here
.float teleport_time; // don't back up
.float armortype; // save this fraction of incoming damage
.float armorvalue;
.float waterlevel; // 0 = not in, 1 = feet, 2 = wast, 3 = eyes
.float watertype; // a contents value
.float ideal_yaw;
.float yaw_speed;
.entity aiment;
.entity goalentity; // a movetarget or an enemy
.float spawnflags;
.string target;
.string targetname;
// damage is accumulated through a frame. and sent as one single
// message, so the super shotgun doesn't generate huge messages
.float dmg_take;
.float dmg_save;
.entity dmg_inflictor;
.entity owner; // who launched a missile
.vector movedir; // mostly for doors, but also used for waterjump
.string message; // trigger messages
.float sounds; // either a cd track number or sound number
.string noise, noise1, noise2, noise3; // contains names of wavs to play
//================================================
void end_sys_fields; // flag for structure dumping
//================================================
/*
==============================================================================
VARS NOT REFERENCED BY C CODE
==============================================================================
*/
float movedist /* = 0 */;
string string_null /* = "" */;
//float empty_float /* = 0 */;
entity activator;
entity damage_attacker;
float framecount /* = 0 */;
float skill /* = 0 */;
float teamplay /* = 0 */;
float timelimit /* = 0 */;
float fraglimit /* = 0 */;
float deathmatch /* = 0 */;
//.string wad;
.string map;
.float worldtype;
.string killtarget;
.float light_lev;
.float style;
.void() th_stand;
.void() th_walk;
.void() th_run;
.void() th_missile;
.void() th_melee;
.void(entity attacker, float damage) th_pain;
.void() th_die;
.entity oldenemy;
.float speed;
.float lefty;
.float search_time;
.float attack_state;
.float walkframe;
.float attack_finished;
.float pain_finished;
.float invincible_finished;
.float invisible_finished;
.float super_damage_finished;
.float radsuit_finished;
.float invincible_time;
.float invincible_sound;
.float invisible_time;
.float invisible_sound;
.float super_time;
.float super_sound;
.float rad_time;
.float fly_sound;
.float axhitme;
.float show_hostile;
.float jump_flag;
.float swim_flag;
.float air_finished;
.float bubble_count;
.string deathtype;
.string mdl;
.vector mangle;
.float t_length;
.float t_width;
.vector dest;
.vector dest1;
.vector dest2;
.float wait;
.float delay;
.entity trigger_field;
.string noise4;
.float pausetime;
.entity movetarget;
.float aflag;
.float dmg;
.float cnt;
.void() think1;
.vector finaldest;
.vector finalangle;
.float count;
.float lip;
.float state;
.vector pos1;
.vector pos2;
.float height;
.float waitmin;
.float waitmax;
.float distance;
.float volume;
void (vector ang) makevectors = #1;
void (entity e, vector o) setorigin = #2;
void (entity e, string m) setmodel = #3;
void (entity e, vector min, vector max) setsize = #4;
//comperr void () break = #6;
float () random = #7;
void (entity e, float chan, string samp, float vol, float atten) sound = #8;
vector (vector v) normalize = #9;
void (string e) error = #10;
void (string e) objerror = #11;
float (vector v) vlen = #12;
float (vector v) vectoyaw = #13;
entity () spawn = #14;
void (entity e) remove = #15;
void (vector v1, vector v2, float nomonsters, entity forent) traceline = #16;
entity () checkclient = #17;
entity (entity start, .string fld, string match) find = #18;
string (string s) precache_sound = #19;
string (string s) precache_model = #20;
void (entity client, string s) stuffcmd = #21;
entity (vector org, float rad) findradius = #22;
// pablo.
// --->
void(...) bprint = #23;
void(...) sprint = #24;
void(...) bprint2 = #23;
void(...) sprint2 = #24;
void(...) bprint3 = #23;
void(...) sprint3 = #24;
void(...) bprint4 = #23;
void(...) sprint4 = #24;
void(...) bprint5 = #23;
void(...) sprint5 = #24;
void(...) bprint6 = #23;
void(...) sprint6 = #24;
void(...) bprint7 = #23;
void(...) sprint7 = #24;
void(...) bprint8 = #23;
/*
void (string s) bprint = #23;
void (entity client, string s) sprint = #24;
void (string s) bprint2 = #23;
void (entity client, string s) sprint2 = #24;
void (string s) bprint3 = #23;
void (entity client, string s) sprint3 = #24;
void (string s) bprint4 = #23;
void (entity client, string s) sprint4 = #24;
void (string s) bprint5 = #23;
void (entity client, string s) sprint5 = #24;
void (string s) bprint6 = #23;
void (entity client, string s) sprint6 = #24;
void (string s) bprint7 = #23;
void (entity client, string s) sprint7 = #24;
void (string s) bprint8 = #23;
*/
// <---
void (string s) dprint = #25;
string (float f) ftos = #26;
string (vector v) vtos = #27;
void () coredump = #28;
void () traceon = #29;
void () traceoff = #30;
void (entity e) eprint = #31;
float (float yaw, float dist) walkmove = #32;
// ---> pablo. this is wierd. :/
//float (float yaw, float dist) droptofloor = #34;
float () droptofloor = #34;
// <---
void (float style, string value) lightstyle = #35;
float (float v) rint = #36;
float (float v) floor = #37;
float (float v) ceil = #38;
float (entity e) checkbottom = #40;
float (vector v) pointcontents = #41;
float (float f) fabs = #43;
vector (entity e, float speed) aim = #44;
float (string s) cvar = #45;
void (string s) localcmd = #46;
entity (entity e) nextent = #47;
void (vector o, vector d, float color, float count) particle = #48;
void () ChangeYaw = #49;
vector (vector v) vectoangles = #51;
void (float to, float f) WriteByte = #52;
void (float to, float f) WriteChar = #53;
void (float to, float f) WriteShort = #54;
void (float to, float f) WriteLong = #55;
void (float to, float f) WriteCoord = #56;
void (float to, float f) WriteAngle = #57;
void (float to, string s) WriteString = #58;
void (float to, entity s) WriteEntity = #59;
void (float step) movetogoal = #67;
string (string s) precache_file = #68;
void (entity e) makestatic = #69;
void (string s) changelevel = #70;
void (string var, string val) cvar_set = #72;
// pablo. simple.
//void (entity client, string s, ...) CenterPrint = #73;
void(...) centerprint = #73;
//
void (vector pos, string samp, float vol, float atten) ambientsound = #74;
string (string s) precache_model2 = #75;
string (string s) precache_sound2 = #76;
string (string s) precache_file2 = #77;
void (entity e) setspawnparms = #78;
void(entity killer, entity killee) logfrag = #79;
string(entity e, string key) infokey = #80;
float(string s) stof = #81;
void (vector pos, float to) multicast = #82;
.float autoid;
.float autodiscard;
.float discard_max;
/* old ideas - ignore pls :)
// exp vars (float is global, .float is self?)
.float shotgun_exp;
.float shotgun_level
void () shotgun_exp_gain;
// VOTE SYSTEM HOPEFUL
void () megatf_votemap;*/
void () TeamFortress_Discard;
float medicarmorheal;
void () lay;
void () unlay;
void () lay =
{
setsize (self, '-16 -16 -24', '16 16 8');
};
void () unlay =
{
setsize (self, '-16 -16 -24', '16 16 32');
};
//votemap code
float num_players;
float num_votes;
float votestarted;
.float has_voted;
.float vote_wait;
void (string put) votemap_start;
void () voteyes;
string themap;
.float startedvote;
// Parems for prozac servers ONLY
float(string st) validatefile = #91;
float prozacmethod;
string prozacmap;
float(string mapstr) validatemap;
string pmap_backup;
void(entity e, string s) clientcommand = #440;
float(string s) tokenize = #441;
string(float n) argv = #442;
//fer stuff!
.float num_kills;
.float fertracker;
.float off_hook;
float spycam;
.string oldweaponmodel;
void () Cam;
void () DetpackDisarm;
float drop1;
float drop2;
float drop3;
void (entity _p_1912) camera_die;
void () camera_expire;
void () activatecam;
void () LookThroughCam;
//Server Message Display
// serverinfo/localinfo svmsg1 - time amount between displaying message 1
// serverinfo/localinfo svmsg2 - time amount between displaying message 2
// serverinfo/localinfo message1 - what msg1 displays (IE serverinfo message1 "hi everybody!")
// serverinfo/localinfo message2 - what msg2 displays
void () messagetimer;
void () pre_messagetimer2;
void () messagetimer2;
void () display_message;
void () display_message2;
float msg1time;
float msg2time;
float msg1first;
float msg2first;
#ifndef tf29ents
float haltloop1;
float haltloop2;
#endif
// the delay between displaying messages 1 and 2 - constrolled by serverinfo/localinfo svmsg_delay -
// just a little trick so you dont have to set msg1tiemr and msg2time to different intervals.
// This is optional however, and if the server doesn't find "svmsg_delay" it will continue messages as normal.
float msgdelay;
// PM code!
.float userid;
float globaluserid;
.float cooldown;
// scout disarm fix
float olddisarm;
void () DetpackDisarm;
//Centerprint4.. wtf..
void (entity client, string s, ...) CenterPrint4 = #73;
//stats_dl
.float stats_on;
void (float _p_2445) Stats_Hit;
void (float _p_2420) Stats_Fired;
// 11.11.04 defs
float spyjumpoption;
float quadscore;
float sr_dropgrens;
float sr_airmirv;
.float spy_regjump;
float engbat;
//so players cant "discard" the server to death on certain maps
.float discard_next;
//vector for original origin of objects
.vector orig_origin;
//For FTE/EZQuake/Fuhquake servers
void () pm_list;
float true = 1;
float false = 0;
//float canusenew;
float(string pattern, float caseinsensitive, float quiet) search_begin = #444;
void(float handle) search_end = #445;
string(float handle, float num) search_getfilename = #447;
// Server Fix Function
string(string s1, string s2, ...) qsg_strcat = #82;
string(string s1, string s2, ...) cpqwsv_strcat = #84;
string(string s1, string s2, ...) mvdsv_strcat = #89;
string(string s1, string s2, ...) frik_strcat = #115;
float(string s) checkextension = #99;
void () testfunct;
// prozac Get UserID Function
float(entity client) getuid = #83;
#ifdef clan_progs
// RANK FEATURES (FTE only)
float Ranks_Updated; // tells us if the global ranks have been updated already (once per map)
.string rank_name; // file name where stats are stored in -- thisw is assigned to the player's netname on join
.float global_rank;
.float global_frags;
.float global_fers;
.float global_dths;
.float global_caps;
void () Rank_UpdateStatsGlobal;
// Rank stuff
void (entity rank_ent) Rank_FindStats;
void (entity rank_ent) Rank_UpdateStats;
void (entity rank_ent, float addscore) Rank_AddFrags;
void (entity rank_ent, float addscore) Rank_AddFers;
void (entity rank_ent, float addscore) Rank_AddDeaths;
float num_players_ready;
float clan_prematch;
.float is_ready;
#endif
//moved from rankings.pqc:
string(string s) strzone = #118;
void(string s) strunzone = #119;
float MSG_BROADCAST = 0;
float oldconc; // toggle for using old (tf 2.9) style conc (localinfo/serverinfo oldconc 1 or on)
#ifdef tf29ents
// TF 2.9 stuff
#define TFLAG_FIRSTENTRY 256 // Used to determine the first time toggleflags is set
#define TFLAG_CLASS_PERSIST 1 // Persistent Classes Bit
float flagem_checked;
#endif
.float jet_time; // defines jetjump immune-to-pushback time (pushback from sentryguns)
#define mtf_Ver "10.12.14" // insert MegaTF version here
#define mtf_Website "\shttps://github.com/quaketf\s"
//strcat for combining two strings, strlen to getting the length of a string.
//substring Ex: substring("Abraham Lincoln", 1, 3) == "bra", stov = string to vector
//From FrikaC's file access tutorial
float(string s) strlen = #114;
string(string s1, string s2) strcat = #115;
string(string s, float start, float length) substring = #116;
vector(string s) stov = #117;