2 ==============================================================================
4 SOURCE FOR GLOBALVARS_T C STRUCTURE
5 MUST NOT BE MODIFIED, OR CRC ERRORS WILL APPEAR
7 ==============================================================================
19 float force_retouch; // force all entities to touch triggers
20 // next frame. this is needed because
21 // non-moving things don't normally scan
22 // for triggers, and when a trigger is
23 // created (like a teleport trigger), it
24 // needs to catch everything.
25 // decremented each frame, so set to 2
26 // to guarantee everything is touched
33 float serverflags; // propagated from level to level, used to
34 // keep track of completed episodes
39 float found_secrets; // number of secrets found
40 float killed_monsters; // number of monsters killed
43 // spawnparms are used to encode information about clients across server
45 float parm1, parm2, parm3, parm4, parm5, parm6, parm7, parm8, parm9, parm10, parm11, parm12, parm13, parm14, parm15, parm16;
48 // global variables set by built in functions
50 vector v_forward, v_up, v_right; // set by makevectors()
52 // set by traceline / tracebox
54 float trace_startsolid;
57 vector trace_plane_normal;
58 float trace_plane_dist;
63 entity msg_entity; // destination of single entity writes
66 // required prog functions
68 void() main; // only for testing
72 void() PlayerPreThink;
73 void() PlayerPostThink;
77 void() PutClientInServer; // call after setting the parm1... parms
78 void() ClientDisconnect;
80 void() SetNewParms; // called when a client first connects to
81 // a server. sets parms so they can be
82 // saved off for restarts
84 void() SetChangeParms; // call to set parms for self so they can
85 // be saved for a level transition
88 //================================================
89 void end_sys_globals; // flag for structure dumping
90 //================================================
93 ==============================================================================
95 SOURCE FOR ENTVARS_T C STRUCTURE
96 MUST NOT BE MODIFIED, OR CRC ERRORS WILL APPEAR
98 ==============================================================================
102 // system fields (*** = do not set in prog code, maintained by C code)
104 .float modelindex; // *** model index in the precached list
105 .vector absmin, absmax; // *** origin + mins / maxs
107 .float ltime; // local time for entity
111 .vector origin; // ***
112 .vector oldorigin; // ***
117 .vector punchangle; // temp angle adjust from damage or recoil
119 .string classname; // spawn function
125 .vector mins, maxs; // bounding box extents reletive to origin
126 .vector size; // maxs - mins
131 .void() blocked; // for doors or plats, called when can't push other
134 .entity groundentity;
139 .float weapon; // one of the IT_SHOTGUN, etc flags
143 .float ammo_shells, ammo_nails, ammo_rockets, ammo_cells;
145 .float items; // bit flags
151 .vector view_ofs; // add to origin to get eye point
154 .float button0; // fire
155 .float button1; // use
156 .float button2; // jump
158 .float impulse; // weapon changes
161 .vector v_angle; // view / targeting angle for players
162 .float idealpitch; // calculated pitch angle for lookup up slopes
174 .float max_health; // players maximum health is stored here
176 .float teleport_time; // don't back up
178 .float armortype; // save this fraction of incoming damage
181 .float waterlevel; // 0 = not in, 1 = feet, 2 = wast, 3 = eyes
182 .float watertype; // a contents value
189 .entity goalentity; // a movetarget or an enemy
196 // damage is accumulated through a frame. and sent as one single
197 // message, so the super shotgun doesn't generate huge messages
200 .entity dmg_inflictor;
202 .entity owner; // who launched a missile
203 .vector movedir; // mostly for doors, but also used for waterjump
205 .string message; // trigger messages
207 .float sounds; // either a cd track number or sound number
209 .string noise, noise1, noise2, noise3; // contains names of wavs to play
211 //================================================
212 void end_sys_fields; // flag for structure dumping
213 //================================================
216 ==============================================================================
220 ==============================================================================
234 float FL_CLIENT = 8; // set for all client edicts
235 float FL_INWATER = 16; // for enter / leave water splash
236 float FL_MONSTER = 32;
237 float FL_GODMODE = 64; // player cheat
238 float FL_NOTARGET = 128; // player cheat
239 float FL_ITEM = 256; // extra wide size for bonus items
240 float FL_ONGROUND = 512; // standing on something
241 float FL_PARTIALGROUND = 1024; // not all corners are valid
242 float FL_WATERJUMP = 2048; // player jumping out of water
243 float FL_JUMPRELEASED = 4096; // for jump debouncing
245 // edict.movetype values
246 float MOVETYPE_NONE = 0; // never moves
247 //float MOVETYPE_ANGLENOCLIP = 1;
248 //float MOVETYPE_ANGLECLIP = 2;
249 float MOVETYPE_WALK = 3; // players only
250 float MOVETYPE_STEP = 4; // discrete, not real time unless fall
251 float MOVETYPE_FLY = 5;
252 float MOVETYPE_TOSS = 6; // gravity
253 float MOVETYPE_PUSH = 7; // no clip to world, push and crush
254 float MOVETYPE_NOCLIP = 8;
255 float MOVETYPE_FLYMISSILE = 9; // fly with extra size against monsters
256 float MOVETYPE_BOUNCE = 10;
257 float MOVETYPE_BOUNCEMISSILE = 11; // bounce with extra size
259 // edict.solid values
260 float SOLID_NOT = 0; // no interaction with other objects
261 float SOLID_TRIGGER = 1; // touch on edge, but not blocking
262 float SOLID_BBOX = 2; // touch on edge, block
263 float SOLID_SLIDEBOX = 3; // touch on edge, but not an onground
264 float SOLID_BSP = 4; // bsp clip, touch on edge, block
267 float RANGE_MELEE = 0;
268 float RANGE_NEAR = 1;
275 float DEAD_DYING = 1;
277 float DEAD_RESPAWNABLE = 3;
278 float DEAD_RESPAWNING = 4; // dead, waiting for buttons to be released
283 float DAMAGE_YES = 1;
284 float DAMAGE_AIM = 2;
288 float IT_SHOTGUN = 1;
289 float IT_SUPER_SHOTGUN = 2;
290 float IT_NAILGUN = 4;
291 float IT_SUPER_NAILGUN = 8;
292 float IT_GRENADE_LAUNCHER = 16;
293 float IT_ROCKET_LAUNCHER = 32;
294 float IT_LIGHTNING = 64;
295 float IT_EXTRA_WEAPON = 128;
297 float IT_SHELLS = 256;
298 float IT_NAILS = 512;
299 float IT_ROCKETS = 1024;
300 float IT_CELLS = 2048;
302 float IT_ARMOR1 = 8192;
303 float IT_ARMOR2 = 16384;
304 float IT_ARMOR3 = 32768;
305 float IT_SUPERHEALTH = 65536;
307 float IT_KEY1 = 131072;
308 float IT_KEY2 = 262144;
310 float IT_INVISIBILITY = 524288;
311 float IT_INVULNERABILITY = 1048576;
312 float IT_SUIT = 2097152;
313 float IT_QUAD = 4194304;
315 // point content values
317 float CONTENT_EMPTY = -1;
318 float CONTENT_SOLID = -2;
319 float CONTENT_WATER = -3;
320 float CONTENT_SLIME = -4;
321 float CONTENT_LAVA = -5;
322 float CONTENT_SKY = -6;
325 float STATE_BOTTOM = 1;
327 float STATE_DOWN = 3;
329 vector VEC_ORIGIN = '0 0 0';
330 vector VEC_HULL_MIN = '-16 -16 -24';
331 vector VEC_HULL_MAX = '16 16 32';
333 vector VEC_HULL2_MIN = '-32 -32 -24';
334 vector VEC_HULL2_MAX = '32 32 64';
337 float SVC_TEMPENTITY = 23;
338 float SVC_KILLEDMONSTER = 27;
339 float SVC_FOUNDSECRET = 28;
340 float SVC_INTERMISSION = 30;
341 float SVC_FINALE = 31;
342 float SVC_CDTRACK = 32;
343 float SVC_SELLSCREEN = 33;
347 float TE_SUPERSPIKE = 1;
348 float TE_GUNSHOT = 2;
349 float TE_EXPLOSION = 3;
350 float TE_TAREXPLOSION = 4;
351 float TE_LIGHTNING1 = 5;
352 float TE_LIGHTNING2 = 6;
353 float TE_WIZSPIKE = 7;
354 float TE_KNIGHTSPIKE = 8;
355 float TE_LIGHTNING3 = 9;
356 float TE_LAVASPLASH = 10;
357 float TE_TELEPORT = 11;
360 // channel 0 never willingly overrides
361 // other channels (1-7) allways override a playing sound on that channel
363 float CHAN_WEAPON = 1;
364 float CHAN_VOICE = 2;
371 float ATTN_STATIC = 3;
375 float UPDATE_GENERAL = 0;
376 float UPDATE_STATIC = 1;
377 float UPDATE_BINARY = 2;
378 float UPDATE_TEMP = 3;
382 float EF_BRIGHTFIELD = 1;
383 float EF_MUZZLEFLASH = 2;
384 float EF_BRIGHTLIGHT = 4;
385 float EF_DIMLIGHT = 8;
389 float MSG_BROADCAST = 0; // unreliable to all
390 float MSG_ONE = 1; // reliable to one (msg_entity)
391 float MSG_ALL = 2; // reliable to all
392 float MSG_INIT = 3; // write to the init string
394 //================================================
400 float gameover; // set when a rule exits
402 string string_null; // null string, nothing should be held here
405 entity newmis; // launch_spike sets this after spawning it
407 entity activator; // the entity that activated a trigger or brush
409 entity damage_attacker; // set by T_Damage
414 //================================================
417 // world fields (FIXME: make globals)
421 .float worldtype; // 0=medieval 1=metal 2=base
423 //================================================
430 .float light_lev; // not used by game, but parsed by light util
440 .float() th_missile; // LordHavoc: changed from void() to float(), returns true if attacking
442 .void(entity attacker, float damage, float damgtype, string dethtype) th_pain;
445 .entity oldenemy; // mad at this player before taking damage
454 float AS_STRAIGHT = 1;
455 float AS_SLIDING = 2;
457 float AS_MISSILE = 4;
460 // player only fields
464 .float attack_finished;
465 .float pain_finished;
467 .float invincible_finished;
468 .float invisible_finished;
469 .float super_damage_finished;
470 .float radsuit_finished;
471 .float spawnshieldtime;
473 .float invincible_time, invincible_sound;
474 .float invisible_time, invisible_sound;
475 .float super_time, super_sound;
481 .float show_hostile; // set to time+0.2 whenever a client fires a
482 // weapon or takes damage. Used to alert
483 // monsters that otherwise would let the player go
484 .float jump_flag; // player jump flag
485 .float swim_flag; // player swimming sound flag
486 .float air_finished; // when time > air_finished, start drowning
487 .float bubble_count; // keeps track of the number of bubbles
488 .string deathtype; // keeps track of how the player died
494 .vector mangle; // angle at start
496 .vector oldorigin; // only used by secret door
498 .float t_length, t_width;
504 .vector dest, dest1, dest2;
505 .float wait; // time from firing to restarting
506 .float delay; // time from activation to firing
507 .entity trigger_field; // door's trigger entity
521 .float dmg; // damage done by door when hit
526 .float cnt; // misc flag
532 //.vector finaldest, finalangle;
537 .float count; // for counting triggers
541 // plats / doors / buttons
545 .vector pos1, pos2; // top and bottom positions
551 .float waitmin, waitmax;
558 //===========================================================================
565 void(vector ang) makevectors = #1; // sets v_forward, etc globals
566 void(entity e, vector o) setorigin = #2;
567 void(entity e, string m) setmodel = #3; // set movetype and solid first
568 void(entity e, vector min, vector max) setsize = #4;
571 float() random = #7; // returns 0 - 1
572 void(entity e, float chan, string samp, float vol, float atten) sound = #8;
573 vector(vector v) normalize = #9;
574 void(string e, ...) error = #10;
575 void(string e, ...) objerror = #11;
576 float(vector v) vlen = #12;
577 float(vector v) vectoyaw = #13;
578 entity() spawn = #14;
579 void(entity e) remove = #15;
581 // sets trace_* globals
582 // nomonsters can be:
583 // An entity will also be ignored for testing if forent == test,
584 // forent->owner == test, or test->owner == forent
585 // a forent of world is ignored
586 void(vector v1, vector v2, float nomonsters, entity forent) traceline = #16;
588 entity() checkclient = #17; // returns a client to look for
589 entity(entity start, .string fld, string match) find = #18;
590 string(string s) precache_sound = #19;
591 string(string s) precache_model = #20;
592 void(entity client, string s, ...)stuffcmd = #21;
593 entity(vector org, float rad) findradius = #22;
594 void(string s, ...) bprint = #23;
595 void(entity client, string s, ...) sprint = #24;
596 void(string s, ...) dprint = #25;
597 string(float f) ftos = #26;
598 string(vector v) vtos = #27;
599 void() coredump = #28; // prints all edicts
600 void() traceon = #29; // turns statment trace on
601 void() traceoff = #30;
602 void(entity e) eprint = #31; // prints an entire edict
603 float(float yaw, float dist) walkmove = #32; // returns TRUE or FALSE
605 float() droptofloor= #34; // TRUE if landed on floor
606 void(float style, string value) lightstyle = #35;
607 float(float v) rint = #36; // round to nearest int
608 float(float v) floor = #37; // largest integer <= v
609 float(float v) ceil = #38; // smallest integer >= v
611 float(entity e) checkbottom = #40; // true if self is on ground
612 float(vector v) pointcontents = #41; // returns a CONTENT_*
614 float(float f) fabs = #43;
615 vector(entity e, float speed) aim = #44; // returns the shooting vector
616 float(string s) cvar = #45; // return cvar.value
617 void(string s, ...) localcmd = #46; // put string into local que
618 entity(entity e) nextent = #47; // for looping through all ents
619 void(vector o, vector d, float color, float count) particle = #48;// start a particle effect
620 void() ChangeYaw = #49; // turn towards self.ideal_yaw
623 vector(vector v) vectoangles = #51;
626 // direct client message generation
628 void(float to, float f) WriteByte = #52;
629 void(float to, float f) WriteChar = #53;
630 void(float to, float f) WriteShort = #54;
631 void(float to, float f) WriteLong = #55;
632 void(float to, float f) WriteCoord = #56;
633 void(float to, float f) WriteAngle = #57;
634 void(float to, string s, ...) WriteString = #58;
635 void(float to, entity s) WriteEntity = #59;
638 // broadcast client message generation
641 // void(float f) bWriteByte = #59;
642 // void(float f) bWriteChar = #60;
643 // void(float f) bWriteShort = #61;
644 // void(float f) bWriteLong = #62;
645 // void(float f) bWriteCoord = #63;
646 // void(float f) bWriteAngle = #64;
647 // void(string s) bWriteString = #65;
648 // void(entity e) bWriteEntity = #66;
650 void(float step) movetogoal = #67;
652 string(string s) precache_file = #68; // no effect except for -copy
653 void(entity e) makestatic = #69;
654 void(string s) changelevel = #70;
658 void(string var, string val) cvar_set = #72; // sets cvar.value
660 void(entity client, string s, ...) centerprint = #73; // sprint, but in middle
662 void(vector pos, string samp, float vol, float atten) ambientsound = #74;
664 string(string s) precache_model2 = #75; // registered version only
665 string(string s) precache_sound2 = #76; // registered version only
666 string(string s) precache_file2 = #77; // registered version only
668 void(entity e) setspawnparms = #78; // set parm1... to the
669 // values at level start
672 //============================================================================
677 void(vector tdest, float tspeed, void() func) SUB_CalcMove;
678 void(entity ent, vector tdest, float tspeed, void() func) SUB_CalcMoveEnt;
679 void(vector destangle, float tspeed, void() func) SUB_CalcAngleMove;
680 void() SUB_CalcMoveDone;
681 void() SUB_CalcAngleMoveDone;
683 void() SUB_UseTargets;
692 float(entity targ, entity inflictor) CanDamage;
698 //void(vector org, entity en, vector dir, float holetype) newbullethole;
701 //void(float msg, vector a) WriteVec =
703 // WriteCoord(msg, a_x);
704 // WriteCoord(msg, a_y);
705 // WriteCoord(msg, a_z);
710 return 2*(random() - 0.5);
713 vector(vector m1, vector m2) randompos =
717 v_x = m2_x * random() + m1_x;
718 v_y = m2_y * random() + m1_y;
719 v_z = m2_z * random() + m1_z;
723 // LordHavoc: made this a builtin function
730 v_x = random() - 0.5; // scaled up in the return()
731 v_y = random() - 0.5;
732 v_z = random() - 0.5;
734 while (vlen(v) > 0.25);
739 vector() randomvec2 =
742 v_x = random() - 0.5; // scale doesn't matter because it's normalized
743 v_y = random() - 0.5;
744 v_z = random() - 0.5;
749 vector() randomdirvec =
756 v_x = random() - 0.5;
757 v_y = random() - 0.5;
758 v_z = random() - 0.5;
760 while (vlen(v) > 0.25);
762 while (vlen(v) < 0.1);
767 float(float a) sqrt = // now this IS silly (using vlen to do square root)
775 // returns an empty point near the location if it's in a solid
776 // (useful for explosions)
777 vector (vector org) findbetterlocation =
781 if (pointcontents(org) != CONTENT_SOLID)
787 // 4.1 to get it to choose +2 occasionally (rather than a 1 in 32768 chance)
788 v_x = org_x + random() * 4.1 - 2;
789 v_y = org_y + random() * 4.1 - 2;
790 v_z = org_z + random() * 4.1 - 2;
791 if (pointcontents(v) != CONTENT_SOLID)
794 return org; // failed to find an empty point
797 // adjusts the entity's origin to move it out of a solid
798 // (useful for projectiles with no size, so they explode in open air)
799 // note this is mostly useless on entities bigger than that
800 // (unless they happen to have their origin on the surface of a wall)
801 void (entity e) findbetterlocation2 =
805 if (pointcontents(e.origin) != CONTENT_SOLID)
812 // 4.1 to get it to choose 4 occasionally (rather than a 1 in 32768 chance)
813 v_x = org_x + random() * 4.1 - 2;
814 v_y = org_y + random() * 4.1 - 2;
815 v_z = org_z + random() * 4.1 - 2;
816 if (pointcontents(v) != CONTENT_SOLID)
822 return; // failed to find an empty point
825 // returns a point at least 12 units away from walls
826 // (useful for explosion animations, although the blast is performed where it really happened)
827 vector (vector org) findbetterlocation3 =
830 traceline(org, org - '12 0 0' , TRUE, world);if (trace_fraction < 1) {v2 = trace_endpos;traceline(v2, v2 + '12 0 0' , TRUE, world);if (trace_fraction >= 1) org = v2 + '12 0 0' ;}
831 traceline(org, org - '-12 0 0', TRUE, world);if (trace_fraction < 1) {v2 = trace_endpos;traceline(v2, v2 + '-12 0 0', TRUE, world);if (trace_fraction >= 1) org = v2 + '-12 0 0';}
832 traceline(org, org - '0 12 0' , TRUE, world);if (trace_fraction < 1) {v2 = trace_endpos;traceline(v2, v2 + '0 12 0' , TRUE, world);if (trace_fraction >= 1) org = v2 + '0 12 0' ;}
833 traceline(org, org - '0 -12 0', TRUE, world);if (trace_fraction < 1) {v2 = trace_endpos;traceline(v2, v2 + '0 -12 0', TRUE, world);if (trace_fraction >= 1) org = v2 + '0 -12 0';}
834 traceline(org, org - '0 0 12' , TRUE, world);if (trace_fraction < 1) {v2 = trace_endpos;traceline(v2, v2 + '0 0 12' , TRUE, world);if (trace_fraction >= 1) org = v2 + '0 0 12' ;}
835 traceline(org, org - '0 0 -12', TRUE, world);if (trace_fraction < 1) {v2 = trace_endpos;traceline(v2, v2 + '0 0 -12', TRUE, world);if (trace_fraction >= 1) org = v2 + '0 0 -12';}
839 vector (vector org) findbetterlocation4 =
842 traceline(org, org - '5 0 0' , TRUE, world);if (trace_fraction < 1) {v2 = trace_endpos;traceline(v2, v2 + '5 0 0' , TRUE, world);if (trace_fraction >= 1) org = v2 + '5 0 0' ;}
843 traceline(org, org - '-5 0 0', TRUE, world);if (trace_fraction < 1) {v2 = trace_endpos;traceline(v2, v2 + '-5 0 0', TRUE, world);if (trace_fraction >= 1) org = v2 + '-5 0 0';}
844 traceline(org, org - '0 5 0' , TRUE, world);if (trace_fraction < 1) {v2 = trace_endpos;traceline(v2, v2 + '0 5 0' , TRUE, world);if (trace_fraction >= 1) org = v2 + '0 5 0' ;}
845 traceline(org, org - '0 -5 0', TRUE, world);if (trace_fraction < 1) {v2 = trace_endpos;traceline(v2, v2 + '0 -5 0', TRUE, world);if (trace_fraction >= 1) org = v2 + '0 -5 0';}
846 traceline(org, org - '0 0 5' , TRUE, world);if (trace_fraction < 1) {v2 = trace_endpos;traceline(v2, v2 + '0 0 5' , TRUE, world);if (trace_fraction >= 1) org = v2 + '0 0 5' ;}
847 traceline(org, org - '0 0 -5', TRUE, world);if (trace_fraction < 1) {v2 = trace_endpos;traceline(v2, v2 + '0 0 -5', TRUE, world);if (trace_fraction >= 1) org = v2 + '0 0 -5';}
852 void(vector v1, vector v2, vector m1, vector m2) lh_traceagainstbox =
854 local vector b, dir, delta, dironx, dirony, dironz;
855 local float completedist, r;
858 if (vlen(v2 - v1) < 0.1) // too short, might do a divide by zero
860 // throw out the complete misses
861 if (v1_x <= m1_x) if (v2_x <= m1_x) return;
862 if (v1_x >= m2_x) if (v2_x >= m2_x) return;
863 if (v1_y <= m1_y) if (v2_y <= m1_y) return;
864 if (v1_y >= m2_y) if (v2_y >= m2_y) return;
865 if (v1_z <= m1_z) if (v2_z <= m1_z) return;
866 if (v1_z >= m2_z) if (v2_z >= m2_z) return;
867 // starting inside the box?
868 if (v1_x >= m1_x) if (v1_x < m2_x) if (v1_y >= m1_y) if (v1_y < m2_y) if (v1_z >= m1_z) if (v1_z < m2_z) return;
870 dir = normalize(delta);
871 completedist = vlen(v2 - v1);
872 if (delta_x < -0.001 || delta_x > 0.001)
874 dironx_x = 1;if (delta_x < 0) dironx_x = -1;
875 dironx_y = delta_y / delta_x;
876 dironx_z = delta_z / delta_x;
880 dironx_x = 1;if (delta_x < 0) dironx_x = -1;
884 if (delta_y < -0.001 || delta_y > 0.001)
886 dirony_x = delta_x / delta_y;
887 dirony_y = 1;if (delta_y < 0) dirony_y = -1;
888 dirony_z = delta_z / delta_y;
893 dirony_y = 1;if (delta_y < 0) dirony_y = -1;
896 if (delta_z < -0.001 || delta_z > 0.001)
898 dironz_x = delta_x / delta_z;
899 dironz_y = delta_y / delta_z;
900 dironz_z = 1;if (delta_z < 0) dironz_z = -1;
906 dironz_z = 1;if (delta_z < 0) dironz_z = -1;
909 r = floor(random() * 1000);
914 b = b + dironx * (m1_x - b_x);
915 trace_fraction = vlen(b - v1) / completedist;
922 b = b - dironx * (m2_x - b_x);
923 trace_fraction = vlen(b - v1) / completedist;
927 if (trace_fraction > 1) trace_fraction = 1;
932 b = b + dirony * (m1_y - b_y);
933 trace_fraction = vlen(b - v1) / completedist;
940 b = b - dirony * (m2_y - b_y);
941 trace_fraction = vlen(b - v1) / completedist;
945 if (trace_fraction > 1) trace_fraction = 1;
950 b = b + dironz * (m1_z - b_z);
951 trace_fraction = vlen(b - v1) / completedist;
958 b = b - dironz * (m2_z - b_z);
959 trace_fraction = vlen(b - v1) / completedist;
963 if (trace_fraction > 1) trace_fraction = 1;
969 void(float n) bprintfloat =
976 void(vector n) bprintvector =
983 void(float n) dprintfloat =
990 void(vector n) dprintvector =
997 string deathstring1, deathstring2, deathstring3, deathstring4;
999 float DTYPE_OTHER = 0;
1000 float DTYPE_PLAYER = 1;
1001 float DTYPE_WORLD = 2;
1002 float DTYPE_TEAMKILL = 3;
1003 float DTYPE_SUICIDE = 4;
1005 void(entity targ, entity attacker, string dmsg, float dtype) Obituary_Generic =
1007 deathstring1 = targ.netname;
1008 deathstring2 = dmsg;
1013 // called by various obit functions to give a generic message for cases they do not handle
1014 void(entity targ, entity attacker, string dmsg, float dtype) Obituary_Fallback =
1016 if (dtype == DTYPE_OTHER)
1018 deathstring1 = targ.netname;
1019 deathstring2 = dmsg;
1023 else if (dtype == DTYPE_SUICIDE)
1025 deathstring1 = targ.netname;
1026 deathstring2 = " became bored with life";
1030 else if (dtype == DTYPE_PLAYER)
1032 deathstring1 = targ.netname;
1033 deathstring2 = " was killed by ";
1034 deathstring3 = attacker.netname;
1037 else if (dtype == DTYPE_TEAMKILL)
1039 deathstring1 = targ.netname;
1040 deathstring2 = " was mowed down by his teammate ";
1041 deathstring3 = attacker.netname;
1044 else if (dtype == DTYPE_WORLD)
1046 deathstring1 = targ.netname;
1047 deathstring2 = " died of unknown causes";
1053 float GAME_QUAKE = 0;
1054 float GAME_NEXUIZ = 1;
1059 float IT_WEAPON1 = 4096;
1060 float IT_WEAPON2 = 1;
1061 float IT_WEAPON3 = 2;
1062 float IT_WEAPON4 = 4;
1063 float IT_WEAPON5 = 8;
1064 float IT_WEAPON6 = 16;
1065 float IT_WEAPON7 = 32;
1066 float IT_WEAPON8 = 64;
1067 float IT_WEAPON9 = 128;
1068 float IT_WEAPON10 = 8388608;
1070 // see modecheck.qc for deathmatch and teamplay settings
1072 // added for Dark Places
1073 float CHAN_SPEECH = 5;
1074 float CHAN_FOOT = 6;
1075 float CHAN_WEAPON2 = 7;
1077 // .gravity field added in Quake 1.07 (Scourge of Armagon)
1080 .float bodyhealth; // used by corpse code
1081 .float iscorpse; // used by corpse code
1083 .vector dest, dest1, dest2, dest3, dest4;//, dest5;
1086 .entity flame; // the flame burning this thing
1088 .float doobits; // set if this should do obit on death
1090 //.vector bodymins, bodymaxs, headmins, headmaxs;
1095 // counts of how many keys this player/bot has
1101 .float(entity player, entity item) pickupevalfunc; // returns rating for item considering player's condition (don't pick up health if it's not needed, etc)
1103 .float dangerrating;
1105 // called whenever damage is done, if not supplied there is no visible effect.
1106 .void(vector org, float bodydamage, float armordamage, vector vel, float damgtype) bleedfunc;
1109 .float count1, count2, count3, count4, count5, count6, cnt1, cnt2;
1111 .void(entity t, entity a, string m, float dtyp) obitfunc1;
1114 float maxclients; // set by worldspawn code
1120 //void(vector org, entity en, vector dir, float splattype, float importance) newbloodsplat;
1121 void(vector org, float bodydamage, float armordamage, vector vel, float damgtype) genericbleedfunc;
1128 void(entity targ, entity inflictor, entity attacker, float damage, float bdamage, string dt, float damgtype, vector damgpoint, vector force, void(entity t, entity a, string m, float dtyp) obitfunc) T_Damage;
1129 void(entity inflictor, entity attacker, float damage, float force, float radius, entity ignore, string dethtype, float damgtype, void(entity t, entity a, string m, float dtyp) obitfunc) T_RadiusDamage;
1132 // resistances to 4 kinds of damage:
1133 .float resist_bullet, resist_explosive, resist_energy, resist_fire, resist_ice, resist_axe;
1134 // every monster can have resistances
1135 // note: -1 means immune, as 0.0 can't be used
1139 // copied from .deathtype for the attacker
1140 // a map entity can gain alot of meaning by
1141 // adding a kill message in the deathtype key
1142 // such as ' was chopped to bits'
1143 // or ' fell into the abyss'
1144 // if you set a deathtype for a monster
1145 // in a map key it will override the normal
1146 // kill message for that monster
1147 // so you could have some hell knights that
1148 // say ' was slain by one of the palace guards'
1149 // and many other ways to add meaning to a map
1152 .float regenthink; // next time player will regen some health
1154 .float radiusdamage_amount; // damage counter
1155 .vector radiusdamage_force; // direction and power of blast kick
1156 .float radiusdamage_hit; // 1 if it was hit, reset to 0 afterward
1157 .vector radiusdamage_lasthit; // location
1158 .float radiusdamage_ownerdamagescale; // if set on inflictor this will scale damage to owner (overriding default of 0.5)
1159 vector raddamage_lasthit;
1163 .float thawedeffects;
1164 .void() thawedtouch;
1165 .float thawedmovetype;
1166 .void() thawedthink;
1167 .float thawedthinkdelay;
1169 .void() knockedloosefunc; // called when kinetically disturbed
1170 .float forcescale; // used for damage force calculations (shambler has lower forcescale than player for instance)
1172 // how much bleeding 'matters' to this entity, a percentage between
1173 // bodydamage (-1 = 0% as 0 doesn't work) and healthdamage (1.0 = 100%)
1174 // for instance a player is 100% and a zombie is 0% (bleeding doesn't matter)
1176 .float(entity e, float healthdamage, float damage, float damgtype, string dethtype) damagemodifier;
1180 .float health; // if this goes below 1 the thing is dead
1181 .float bodyhealth; // used for gibbing
1182 .float healthregen; // regenerate this much health per second
1183 .float healthlostthisframe; // reset by iscreature code each frame
1185 // adjustable monster damage settings
1186 float monsterdamagescale;
1187 float monsterresistancescale;
1188 // adjustable player damage settings
1189 float playerdamagescale;
1191 void(entity targ, entity attacker, string dmsg, float dtype, void(entity t, entity a, string m, float dtyp) obitfunc) ClientObituary;
1193 void() monster_death_use;