defs.qc 23 KB

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