defs.qc 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889
  1. /* Copyright (C) 1996-2022 id Software LLC
  2. This program is free software; you can redistribute it and/or modify
  3. it under the terms of the GNU General Public License as published by
  4. the Free Software Foundation; either version 2 of the License, or
  5. (at your option) any later version.
  6. This program is distributed in the hope that it will be useful,
  7. but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  9. GNU General Public License for more details.
  10. You should have received a copy of the GNU General Public License
  11. along with this program; if not, write to the Free Software
  12. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  13. See file, 'COPYING', for details.
  14. */
  15. /*
  16. ==============================================================================
  17. SOURCE FOR GLOBALVARS_T C STRUCTURE
  18. ==============================================================================
  19. */
  20. //
  21. // system globals
  22. //
  23. entity self;
  24. entity other;
  25. entity world;
  26. float time;
  27. float frametime;
  28. float force_retouch; // force all entities to touch triggers
  29. // next frame. this is needed because
  30. // non-moving things don't normally scan
  31. // for triggers, and when a trigger is
  32. // created (like a teleport trigger), it
  33. // needs to catch everything.
  34. // decremented each frame, so set to 2
  35. // to guarantee everything is touched
  36. string mapname;
  37. float deathmatch;
  38. float coop;
  39. float teamplay;
  40. float serverflags; // propagated from level to level, used to
  41. // keep track of completed episodes
  42. float total_secrets;
  43. float total_monsters;
  44. float found_secrets; // number of secrets found
  45. float killed_monsters; // number of monsters killed
  46. // spawnparms are used to encode information about clients across server
  47. // level changes
  48. float parm1, parm2, parm3, parm4, parm5, parm6, parm7, parm8, parm9, parm10, parm11, parm12, parm13, parm14, parm15, parm16;
  49. //
  50. // global variables set by built in functions
  51. //
  52. vector v_forward, v_up, v_right; // set by makevectors()
  53. // set by traceline / tracebox
  54. float trace_allsolid;
  55. float trace_startsolid;
  56. float trace_fraction;
  57. vector trace_endpos;
  58. vector trace_plane_normal;
  59. float trace_plane_dist;
  60. entity trace_ent;
  61. float trace_inopen;
  62. float trace_inwater;
  63. entity msg_entity; // destination of single entity writes
  64. //
  65. // required prog functions
  66. //
  67. void() main; // only for testing
  68. void() StartFrame;
  69. void() PlayerPreThink;
  70. void() PlayerPostThink;
  71. void() ClientKill;
  72. void() ClientConnect;
  73. void() PutClientInServer; // call after setting the parm1... parms
  74. void() ClientDisconnect;
  75. void() SetNewParms; // called when a client first connects to
  76. // a server. sets parms so they can be
  77. // saved off for restarts
  78. void() SetChangeParms; // call to set parms for self so they can
  79. // be saved for a level transition
  80. //================================================
  81. void end_sys_globals; // flag for structure dumping
  82. //================================================
  83. /*
  84. ==============================================================================
  85. SOURCE FOR ENTVARS_T C STRUCTURE
  86. ==============================================================================
  87. */
  88. //
  89. // system fields (*** = do not set in prog code, maintained by C code)
  90. //
  91. .float modelindex; // *** model index in the precached list
  92. .vector absmin, absmax; // *** origin + mins / maxs
  93. .float ltime; // local time for entity
  94. .float movetype;
  95. .float solid;
  96. .vector origin; // ***
  97. .vector oldorigin; // ***
  98. .vector velocity;
  99. .vector angles;
  100. .vector avelocity;
  101. .vector punchangle; // temp angle adjust from damage or recoil
  102. .string classname; // spawn function
  103. .string model;
  104. .float frame;
  105. .float skin;
  106. .float effects;
  107. .vector mins, maxs; // bounding box extents reletive to origin
  108. .vector size; // maxs - mins
  109. .void() touch;
  110. .void() use;
  111. .void() think;
  112. .void() blocked; // for doors or plats, called when can't push other
  113. .float nextthink;
  114. .entity groundentity;
  115. // stats
  116. .float health;
  117. .float frags;
  118. .float weapon; // one of the IT_SHOTGUN, etc flags
  119. .string weaponmodel;
  120. .float weaponframe;
  121. .float currentammo;
  122. .float ammo_shells, ammo_nails, ammo_rockets, ammo_cells;
  123. .float items; // bit flags
  124. .float takedamage;
  125. .entity chain;
  126. .float deadflag;
  127. .vector view_ofs; // add to origin to get eye point
  128. .float button0; // fire
  129. .float button1; // use
  130. .float button2; // jump
  131. .float impulse; // weapon changes
  132. .float fixangle;
  133. .vector v_angle; // view / targeting angle for players
  134. .float idealpitch; // calculated pitch angle for lookup up slopes
  135. .string netname;
  136. .entity enemy;
  137. .float flags;
  138. .float colormap;
  139. .float team;
  140. .float max_health; // players maximum health is stored here
  141. .float teleport_time; // don't back up
  142. .float armortype; // save this fraction of incoming damage
  143. .float armorvalue;
  144. .float waterlevel; // 0 = not in, 1 = feet, 2 = waist, 3 = eyes
  145. .float watertype; // a contents value
  146. .float ideal_yaw;
  147. .float yaw_speed;
  148. .entity aiment;
  149. .entity goalentity; // a movetarget or an enemy
  150. .float spawnflags;
  151. .string target;
  152. .string targetname;
  153. // damage is accumulated through a frame. and sent as one single
  154. // message, so the super shotgun doesn't generate huge messages
  155. .float dmg_take;
  156. .float dmg_save;
  157. .entity dmg_inflictor;
  158. .entity owner; // who launched a missile
  159. .vector movedir; // mostly for doors, but also used for waterjump
  160. .string message; // trigger messages
  161. .float sounds; // either a cd track number or sound number
  162. .string noise, noise1, noise2, noise3; // contains names of wavs to play
  163. //================================================
  164. void end_sys_fields; // flag for structure dumping
  165. //================================================
  166. /*
  167. ==============================================================================
  168. VARS NOT REFERENCED BY C CODE
  169. ==============================================================================
  170. */
  171. //
  172. // constants
  173. //
  174. float FALSE = 0;
  175. float TRUE = 1;
  176. // edict.flags
  177. float FL_FLY = 1;
  178. float FL_SWIM = 2;
  179. float FL_CLIENT = 8; // set for all client edicts
  180. float FL_INWATER = 16; // for enter / leave water splash
  181. float FL_MONSTER = 32;
  182. float FL_GODMODE = 64; // player cheat
  183. float FL_NOTARGET = 128; // player cheat
  184. float FL_ITEM = 256; // extra wide size for bonus items
  185. float FL_ONGROUND = 512; // standing on something
  186. float FL_PARTIALGROUND = 1024; // not all corners are valid
  187. float FL_WATERJUMP = 2048; // player jumping out of water
  188. float FL_JUMPRELEASED = 4096; // for jump debouncing
  189. float FL_ISBOT = 8192; // mal: this will be set on bot players
  190. float FL_NO_PLAYERS = 16384; // mal: used by the spawn point editor
  191. float FL_NO_MONSTERS = 32768; // mal: used by the spawn point editor
  192. float FL_NO_BOTS = 65536; // mal: any item marked with this will be ignored by bots.
  193. float FL_OBJECTIVE = 131072; // mal: any item marked with this is an objective of some kind.
  194. // edict.movetype values
  195. float MOVETYPE_NONE = 0; // never moves
  196. //float MOVETYPE_ANGLENOCLIP = 1;
  197. //float MOVETYPE_ANGLECLIP = 2;
  198. float MOVETYPE_WALK = 3; // players only
  199. float MOVETYPE_STEP = 4; // discrete, not real time unless fall
  200. float MOVETYPE_FLY = 5;
  201. float MOVETYPE_TOSS = 6; // gravity
  202. float MOVETYPE_PUSH = 7; // no clip to world, push and crush
  203. float MOVETYPE_NOCLIP = 8;
  204. float MOVETYPE_FLYMISSILE = 9; // fly with extra size against monsters
  205. float MOVETYPE_BOUNCE = 10;
  206. float MOVETYPE_GIB = 11; // like MOVETYPE_BOUNCE, but with adjustable gravity
  207. // edict.solid values
  208. float SOLID_NOT = 0; // no interaction with other objects
  209. float SOLID_TRIGGER = 1; // touch on edge, but not blocking
  210. float SOLID_BBOX = 2; // touch on edge, block
  211. float SOLID_SLIDEBOX = 3; // touch on edge, but not an onground
  212. float SOLID_BSP = 4; // bsp clip, touch on edge, block
  213. float SOLID_CORPSE = 5; // reports touch and can shoot it, but not blocking otherwise.
  214. // range values
  215. float RANGE_MELEE = 0;
  216. float RANGE_NEAR = 1;
  217. float RANGE_MID = 2;
  218. float RANGE_FAR = 3;
  219. // deadflag values
  220. float DEAD_NO = 0;
  221. float DEAD_DYING = 1;
  222. float DEAD_DEAD = 2;
  223. float DEAD_RESPAWNABLE = 3;
  224. // takedamage values
  225. float DAMAGE_NO = 0;
  226. float DAMAGE_YES = 1;
  227. float DAMAGE_AIM = 2;
  228. // items
  229. float IT_AXE = 4096;
  230. float IT_SHOTGUN = 1;
  231. float IT_SUPER_SHOTGUN = 2;
  232. float IT_NAILGUN = 4;
  233. float IT_SUPER_NAILGUN = 8;
  234. float IT_GRENADE_LAUNCHER = 16;
  235. float IT_ROCKET_LAUNCHER = 32;
  236. float IT_LIGHTNING = 64;
  237. float IT_HOOK = 128;
  238. float IT_SHELLS = 256;
  239. float IT_NAILS = 512;
  240. float IT_ROCKETS = 1024;
  241. float IT_CELLS = 2048;
  242. float IT_ARMOR1 = 8192;
  243. float IT_ARMOR2 = 16384;
  244. float IT_ARMOR3 = 32768;
  245. float IT_SUPERHEALTH = 65536;
  246. float IT_KEY1 = 131072;
  247. float IT_KEY2 = 262144;
  248. float IT_INVISIBILITY = 524288;
  249. float IT_INVULNERABILITY = 1048576;
  250. float IT_SUIT = 2097152;
  251. float IT_QUAD = 4194304;
  252. float IT_SIGIL1 = 268435456;
  253. float IT_SIGIL2 = 536870912;
  254. float IT_SIGIL3 = 1073741824;
  255. float IT_SIGIL4 = 2147483648;
  256. // point content values
  257. float CONTENT_EMPTY = -1;
  258. float CONTENT_SOLID = -2;
  259. float CONTENT_WATER = -3;
  260. float CONTENT_SLIME = -4;
  261. float CONTENT_LAVA = -5;
  262. float CONTENT_SKY = -6;
  263. float STATE_TOP = 0;
  264. float STATE_BOTTOM = 1;
  265. float STATE_UP = 2;
  266. float STATE_DOWN = 3;
  267. vector VEC_ORIGIN = '0 0 0';
  268. vector VEC_HULL_MIN = '-16 -16 -24';
  269. vector VEC_HULL_MAX = '16 16 32';
  270. vector VEC_HULL2_MIN = '-32 -32 -24';
  271. vector VEC_HULL2_MAX = '32 32 64';
  272. // protocol bytes
  273. float SVC_TEMPENTITY = 23;
  274. float SVC_KILLEDMONSTER = 27;
  275. float SVC_FOUNDSECRET = 28;
  276. float SVC_INTERMISSION = 30;
  277. float SVC_FINALE = 31;
  278. float SVC_CDTRACK = 32;
  279. float SVC_SELLSCREEN = 33;
  280. float SVC_SPAWNEDMONSTER = 39;
  281. float SVC_ACHIEVEMENT = 52;
  282. float SVC_CHAT = 53;
  283. float SVC_LEVELCOMPLETED = 54;
  284. float SVC_BACKTOLOBBY = 55;
  285. float SVC_LOCALSOUND = 56;
  286. float SVC_PROMPT = 57;
  287. float TE_SPIKE = 0;
  288. float TE_SUPERSPIKE = 1;
  289. float TE_GUNSHOT = 2;
  290. float TE_EXPLOSION = 3;
  291. float TE_TAREXPLOSION = 4;
  292. float TE_LIGHTNING1 = 5;
  293. float TE_LIGHTNING2 = 6;
  294. float TE_WIZSPIKE = 7;
  295. float TE_KNIGHTSPIKE = 8;
  296. float TE_LIGHTNING3 = 9;
  297. float TE_LAVASPLASH = 10;
  298. float TE_TELEPORT = 11;
  299. float TE_EXPLOSION2 = 12;
  300. float TE_BEAM = 13;
  301. // sound channels
  302. // channel 0 never willingly overrides
  303. // other channels (1-7) allways override a playing sound on that channel
  304. float CHAN_AUTO = 0;
  305. float CHAN_WEAPON = 1;
  306. float CHAN_VOICE = 2;
  307. float CHAN_ITEM = 3;
  308. float CHAN_BODY = 4;
  309. float ATTN_NONE = 0;
  310. float ATTN_NORM = 1;
  311. float ATTN_IDLE = 2;
  312. float ATTN_STATIC = 3;
  313. // update types
  314. float UPDATE_GENERAL = 0;
  315. float UPDATE_STATIC = 1;
  316. float UPDATE_BINARY = 2;
  317. float UPDATE_TEMP = 3;
  318. // entity effects
  319. float EF_BRIGHTFIELD = 1;
  320. float EF_MUZZLEFLASH = 2;
  321. float EF_BRIGHTLIGHT = 4;
  322. float EF_DIMLIGHT = 8;
  323. float EF_QUADLIGHT = 16;
  324. float EF_PENTALIGHT = 32;
  325. float EF_CANDLELIGHT = 64;
  326. // messages
  327. float MSG_BROADCAST = 0; // unreliable to all
  328. float MSG_ONE = 1; // reliable to one (msg_entity)
  329. float MSG_ALL = 2; // reliable to all
  330. float MSG_INIT = 3; // write to the init string
  331. // mal: basic colors - based on the Quake color palette.
  332. float COLOR_RED = 251;
  333. float COLOR_GREEN = 184;
  334. float COLOR_BLUE = 208;
  335. float COLOR_YELLOW = 192;
  336. float COLOR_WHITE = 254;
  337. float COLOR_BLACK = 0;
  338. float COLOR_CYAN = 244;
  339. float COLOR_ORANGE = 95;
  340. float DRAW_AI_SINGLE_FRAME = .1; // mal: use for AI that think every 10th of a second
  341. float DRAW_GAME_SINGLE_FRAME = -1; // mal: use in game code that updates every frame.
  342. // player expanded settings flags
  343. float PEF_CHANGEONLYNEW = 1;
  344. float PEF_CHANGENEVER = 2;
  345. // mal: codes that the QuakeC built-ins "bot_movetopoint" and "bot_followentity" will return each time they're called
  346. float BOT_GOAL_ERROR = 0; // can't do this goal for some reason.
  347. float BOT_GOAL_SUCCESS = 1; // goal as requested is complete.
  348. float BOT_GOAL_IN_PROGRESS = 2; // goal is in progress
  349. // mal: codes that the QuakeC built-in "walkpathtogoal" will return each time it's called
  350. float PATH_ERROR = 0; // something bad happened ( no nav nodes, no nearby nodes, no path, etc. ).
  351. float PATH_REACHED_GOAL = 1; // reached whatever we were trying to get to.
  352. float PATH_REACHED_PATH_END = 2; // reached the end of the path - can now move directly to target.
  353. float PATH_MOVE_BLOCKED = 3; // something ( or someone ) is in our way.
  354. float PATH_IN_PROGRESS = 4; // path was found, and we're following it.
  355. //================================================
  356. //
  357. // globals
  358. //
  359. float movedist;
  360. float gameover; // set when a rule exits
  361. string string_null; // null string, nothing should be held here
  362. float empty_float;
  363. entity newmis; // launch_spike sets this after spawning it
  364. entity activator; // the entity that activated a trigger or brush
  365. entity damage_attacker; // set by T_Damage
  366. float framecount;
  367. float skill;
  368. entity runespawn;
  369. float runespawned;
  370. float cheats_allowed; // mal: let's us run cheat commands in DM/Coop games.
  371. float gamestart; // at start
  372. //================================================
  373. //
  374. // world fields (FIXME: make globals)
  375. //
  376. .string wad;
  377. .string map;
  378. float WORLDTYPE_MEDIEVAL = 0;
  379. float WORLDTYPE_METAL = 1;
  380. float WORLDTYPE_BASE = 2;
  381. .float worldtype;
  382. //================================================
  383. .string killtarget;
  384. //
  385. // quakeed fields
  386. //
  387. .float light_lev; // not used by game, but parsed by light util
  388. .float style;
  389. //
  390. // monster ai
  391. //
  392. .void() th_stand;
  393. .void() th_walk;
  394. .void() th_run;
  395. .void() th_missile;
  396. .void() th_melee;
  397. .void(entity attacker, float damage) th_pain;
  398. .void() th_die;
  399. .entity oldenemy; // mad at this player before taking damage
  400. .float speed;
  401. .float lefty;
  402. .float search_time;
  403. // Attack state ( not really used in Vanilla )
  404. .float attack_state;
  405. float AS_STRAIGHT = 1;
  406. float AS_SLIDING = 2;
  407. float AS_MELEE = 3;
  408. float AS_MISSILE = 4;
  409. .float allowPathFind; // not used in Vanilla, but added for demonstration purposes...
  410. // Combat style
  411. .float combat_style;
  412. float CS_NONE = 0; // default - used for bosses or other monsters that don't move
  413. float CS_RANGED = 1;
  414. float CS_MELEE = 2;
  415. float CS_MIXED = 3; // can do ranged or melee equally.
  416. //
  417. // player only fields
  418. //
  419. // *TEAMPLAY*
  420. .float lastteam; // The last team this player was a member of.
  421. // *XXX* EXPERT CTF ALTERNATE SCORING
  422. // time values
  423. .float flag_since; // how long a player has had the flag
  424. .float last_returned_flag; // last time player returned his own flag
  425. .float last_fragged_carrier; // last time player fragged a flag carrier
  426. .float last_hurt_carrier; // last time player hurt the flag carrier
  427. // *XXX* end
  428. // OBSERVER
  429. .float observer;
  430. .float do_observer;
  431. .float motd_sent;
  432. .float obs_fire_held;
  433. //ADMIN
  434. .float accesslvl; // current access level
  435. .float accessparm; // current access parm
  436. .float walkframe;
  437. .float attack_finished;
  438. .float pain_finished;
  439. .float hook_out;
  440. .float hook_pulling;
  441. .float hook_fire_time;
  442. .float invincible_finished;
  443. .float invisible_finished;
  444. .float super_damage_finished;
  445. .float radsuit_finished;
  446. .float invincible_time, invincible_sound;
  447. .float invisible_time, invisible_sound;
  448. .float super_time, super_sound;
  449. .float regeneration_sound;//RUNE: Elder Magic
  450. .float haste_sound;//RUNE: Hell Magic
  451. .float rad_time;
  452. .float fly_sound;
  453. .float healthrot_nextcheck; // if grabbed Mega-Health, the next time we'll rot the players health
  454. .float axhitme;
  455. .float show_hostile; // set to time+0.2 whenever a client fires a
  456. // weapon or takes damage. Used to alert
  457. // monsters that otherwise would let the player go
  458. .float jump_flag; // player jump flag
  459. .float swim_flag; // player swimming sound flag
  460. .float air_finished; // when time > air_finished, start drowning
  461. .float bubble_count; // keeps track of the number of bubbles
  462. .string deathtype; // keeps track of how the player died
  463. .float player_flag; // misc flags (skins, etc.)
  464. .float staydeadtime; // how long we should stay dead
  465. .float regen_time; // time to next regen
  466. .float rune_notice_time; // last time we notified about multi-runes
  467. .float voted; // non-zero if voted
  468. // ZOID: Runes
  469. float ITEM_RUNE1_FLAG = 1;
  470. float ITEM_RUNE2_FLAG = 2;
  471. float ITEM_RUNE3_FLAG = 4;
  472. float ITEM_RUNE4_FLAG = 8;
  473. float ITEM_RUNE_MASK = 15;
  474. // ZOID: Capture the flag
  475. float ITEM_ENEMY_FLAG = 16;
  476. // TEAMPLAY
  477. float TEAM_STUFF_COLOR = 32;
  478. .float suicide_count;
  479. .float killed; // have we been killed yet
  480. //
  481. // object stuff
  482. //
  483. .string mdl;
  484. .vector mangle; // angle at start
  485. .vector oldorigin; // only used by secret door
  486. .float t_length, t_width;
  487. //
  488. // doors, etc
  489. //
  490. .vector dest, dest1, dest2;
  491. .float wait; // time from firing to restarting
  492. .float delay; // time from activation to firing
  493. .entity trigger_field; // door's trigger entity
  494. .string noise4;
  495. //
  496. // monsters
  497. //
  498. .float pausetime;
  499. .entity movetarget;
  500. //
  501. // doors
  502. //
  503. .float aflag;
  504. .float dmg; // damage done by door when hit
  505. //
  506. // misc
  507. //
  508. .float cnt; // misc flag
  509. //
  510. // subs
  511. //
  512. .void() think1;
  513. .vector finaldest, finalangle;
  514. //
  515. // triggers
  516. //
  517. .float count; // for counting triggers
  518. //
  519. // plats / doors / buttons
  520. //
  521. .float lip;
  522. .float state;
  523. .vector pos1, pos2; // top and bottom positions
  524. .float height;
  525. //
  526. // sounds
  527. //
  528. .float waitmin, waitmax;
  529. .float distance;
  530. .float volume;
  531. .string killstring; // monster kill message
  532. .float items2; // supported by engine to send down runes
  533. //===========================================================================
  534. //
  535. // builtin functions
  536. //
  537. void(vector ang) makevectors = #1; // sets v_forward, etc globals
  538. void(entity e, vector o) setorigin = #2;
  539. void(entity e, string m) setmodel = #3; // set movetype and solid first
  540. void(entity e, vector min, vector max) setsize = #4;
  541. // #5 was removed
  542. void() break = #6;
  543. float() random = #7; // returns 0 - 1
  544. void(entity e, float chan, string samp, float vol, float atten) sound = #8;
  545. vector(vector v) normalize = #9;
  546. void(string e) error = #10;
  547. void(string e) objerror = #11;
  548. float(vector v) vlen = #12;
  549. float(vector v) vectoyaw = #13;
  550. entity() spawn = #14;
  551. void(entity e) remove = #15;
  552. // sets trace_* globals
  553. // nomonsters can be:
  554. // An entity will also be ignored for testing if forent == test,
  555. // forent->owner == test, or test->owner == forent
  556. // a forent of world is ignored
  557. void(vector v1, vector v2, float nomonsters, entity forent) traceline = #16;
  558. entity() checkclient = #17; // returns a client to look for
  559. entity(entity start, .string fld, string match) find = #18;
  560. string(string s) precache_sound = #19;
  561. string(string s) precache_model = #20;
  562. void(entity client, string s)stuffcmd = #21;
  563. entity(vector org, float rad) findradius = #22;
  564. void(string s, ...) bprint = #0:ex_bprint;
  565. void(entity client, string s, ...) sprint = #0:ex_sprint;
  566. void(string s, ...) dprint = #25;
  567. string(float f) ftos = #26;
  568. string(vector v) vtos = #27;
  569. void() coredump = #28; // prints all edicts
  570. void() traceon = #29; // turns statment trace on
  571. void() traceoff = #30;
  572. void(entity e) eprint = #31; // prints an entire edict
  573. float(float yaw, float dist) walkmove = #32; // returns TRUE or FALSE
  574. // #33 was removed
  575. float() droptofloor= #34; // TRUE if landed on floor
  576. void(float style, string value) lightstyle = #35;
  577. float(float v) rint = #36; // round to nearest int
  578. float(float v) floor = #37; // largest integer <= v
  579. float(float v) ceil = #38; // smallest integer >= v
  580. // #39 was removed
  581. float(entity e) checkbottom = #40; // true if self is on ground
  582. float(vector v) pointcontents = #41; // returns a CONTENT_*
  583. // #42 was removed
  584. float(float f) fabs = #43;
  585. vector(entity e, float speed) aim = #44; // returns the shooting vector
  586. float(string s) cvar = #45; // return cvar.value
  587. void(string s) localcmd = #46; // put string into local que
  588. entity(entity e) nextent = #47; // for looping through all ents
  589. void(vector o, vector d, float color, float count) particle = #48;// start a particle effect
  590. void() ChangeYaw = #49; // turn towards self.ideal_yaw
  591. // at self.yaw_speed
  592. // #50 was removed
  593. vector(vector v) vectoangles = #51;
  594. //
  595. // direct client message generation
  596. //
  597. void(float to, float f) WriteByte = #52;
  598. void(float to, float f) WriteChar = #53;
  599. void(float to, float f) WriteShort = #54;
  600. void(float to, float f) WriteLong = #55;
  601. void(float to, float f) WriteCoord = #56;
  602. void(float to, float f) WriteAngle = #57;
  603. void(float to, string s) WriteString = #58;
  604. void(float to, entity s) WriteEntity = #59;
  605. //
  606. // broadcast client message generation
  607. //
  608. // void(float f) bWriteByte = #59;
  609. // void(float f) bWriteChar = #60;
  610. // void(float f) bWriteShort = #61;
  611. // void(float f) bWriteLong = #62;
  612. // void(float f) bWriteCoord = #63;
  613. // void(float f) bWriteAngle = #64;
  614. // void(string s) bWriteString = #65;
  615. // void(entity e) bWriteEntity = #66;
  616. void(float step) movetogoal = #67;
  617. string(string s) precache_file = #68; // no effect except for -copy
  618. void(entity e) makestatic = #69;
  619. void(string s) changelevel = #70;
  620. //#71 was removed
  621. void(string var, string val) cvar_set = #72; // sets cvar.value
  622. void(entity client, string s, ...) centerprint = #0:ex_centerprint; // sprint, but in middle
  623. void(vector pos, string samp, float vol, float atten) ambientsound = #74;
  624. string(string s) precache_model2 = #75; // registered version only
  625. string(string s) precache_sound2 = #76; // registered version only
  626. string(string s) precache_file2 = #77; // registered version only
  627. void(entity e) setspawnparms = #78; // set parm1... to the
  628. // values at level start
  629. // for coop respawn
  630. float() finaleFinished = #0:ex_finaleFinished;
  631. // Plays a sound that only "client" can hear. Useful for announcers...
  632. void localsound( entity client, string sample ) = #0:ex_localsound;
  633. // Debug rendering functions.
  634. void draw_point( vector point, float colormap, float lifetime, float depthtest ) = #0:ex_draw_point;
  635. void draw_line( vector start, vector end, float colormap, float lifetime, float depthtest ) = #0:ex_draw_line;
  636. void draw_arrow( vector start, vector end, float colormap, float size, float lifetime, float depthtest ) = #0:ex_draw_arrow;
  637. void draw_ray( vector start, vector direction, float length, float colormap, float size, float lifetime, float depthtest ) = #0:ex_draw_ray;
  638. void draw_circle( vector origin, float radius, float colormap, float lifetime, float depthtest ) = #0:ex_draw_circle;
  639. void draw_bounds( vector min, vector max, float colormap, float lifetime, float depthtest ) = #0:ex_draw_bounds;
  640. void draw_worldtext( string s, vector origin, float size, float lifetime, float depthtest ) = #0:ex_draw_worldtext;
  641. void draw_sphere( vector origin, float radius, float colormap, float lifetime, float depthtest ) = #0:ex_draw_sphere;
  642. void draw_cylinder( vector origin, float halfHeight, float radius, float colormap, float lifetime, float depthtest ) = #0:ex_draw_cylinder;
  643. // Bot functions that return a value based on "BOT_GOAL_<X>", depending on the status of the goal.
  644. float bot_movetopoint( entity bot, vector point ) = #0:ex_bot_movetopoint;
  645. float bot_followentity( entity bot, entity goal ) = #0:ex_bot_followentity;
  646. // Function for checking new player configured flags, such as weapon swap behaviour
  647. float CheckPlayerEXFlags( entity playerEnt ) = #0:ex_CheckPlayerEXFlags;
  648. // Path monsters to the goal using any available nav nodes on the map
  649. float walkpathtogoal( float movedist, vector goal ) = #0:ex_walkpathtogoal;
  650. float checkextension( string s ) = #99;
  651. void setcolor( entity client, float color ) = #401;
  652. void prompt( entity client, string text, float numChoices ) = #0:ex_prompt;
  653. void promptchoice( entity client, string text, float impulse ) = #0:ex_promptchoice;
  654. void clearprompt( entity client ) = #0:ex_clearprompt;
  655. //============================================================================
  656. //
  657. // subs.qc
  658. //
  659. void(vector tdest, float tspeed, void() func) SUB_CalcMove;
  660. void(entity ent, vector tdest, float tspeed, void() func) SUB_CalcMoveEnt;
  661. void(vector destangle, float tspeed, void() func) SUB_CalcAngleMove;
  662. void() SUB_CalcMoveDone;
  663. void() SUB_CalcAngleMoveDone;
  664. void() SUB_Null;
  665. void() SUB_UseTargets;
  666. void() SUB_Remove;
  667. //
  668. // combat.qc
  669. //
  670. void(entity targ, entity inflictor, entity attacker, float damage) T_Damage;
  671. float (entity e, float healamount, float ignore) T_Heal; // health function
  672. float(entity targ, entity inflictor) CanDamage;
  673. //
  674. // status.qc
  675. //
  676. float teamscr1; // team 1's capture score
  677. float teamscr2; // team 2's capture score
  678. void(entity e) SendCTFScoresUpdate;
  679. void() SendCTFScoresUpdateAll; // send score update to all players using new EX HUD
  680. void (entity head, entity tail) GrappleTrail;
  681. void makevectorsfixed(vector ang) {
  682. ang_x *= -1;
  683. makevectors(ang);
  684. };
  685. float PromptSupported() {
  686. if (!cvar("pr_checkextension"))
  687. return FALSE;
  688. return checkextension("EX_PROMPT");
  689. }