misc.qc 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747
  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. /*QUAKED info_null (0 0.5 0) (-4 -4 -4) (4 4 4)
  16. Used as a positional target for spotlights, etc.
  17. */
  18. void() info_null =
  19. {
  20. remove(self);
  21. };
  22. /*QUAKED info_notnull (0 0.5 0) (-4 -4 -4) (4 4 4)
  23. Used as a positional target for lightning.
  24. */
  25. void() info_notnull =
  26. {
  27. };
  28. //============================================================================
  29. float START_OFF = 1;
  30. void() light_use =
  31. {
  32. if (self.spawnflags & START_OFF)
  33. {
  34. lightstyle(self.style, "m");
  35. self.spawnflags = self.spawnflags - START_OFF;
  36. }
  37. else
  38. {
  39. lightstyle(self.style, "a");
  40. self.spawnflags = self.spawnflags + START_OFF;
  41. }
  42. };
  43. /*QUAKED light (0 1 0) (-8 -8 -8) (8 8 8) START_OFF
  44. Non-displayed light.
  45. Default light value is 300
  46. Default style is 0
  47. If targeted, it will toggle between on or off.
  48. */
  49. void() light =
  50. {
  51. if (!self.targetname)
  52. { // inert light
  53. remove(self);
  54. return;
  55. }
  56. if (self.style >= 32)
  57. {
  58. self.use = light_use;
  59. if (self.spawnflags & START_OFF)
  60. lightstyle(self.style, "a");
  61. else
  62. lightstyle(self.style, "m");
  63. }
  64. };
  65. /*QUAKED light_fluoro (0 1 0) (-8 -8 -8) (8 8 8) START_OFF
  66. Non-displayed light.
  67. Default light value is 300
  68. Default style is 0
  69. If targeted, it will toggle between on or off.
  70. Makes steady fluorescent humming sound
  71. */
  72. void() light_fluoro =
  73. {
  74. if (self.style >= 32)
  75. {
  76. self.use = light_use;
  77. if (self.spawnflags & START_OFF)
  78. lightstyle(self.style, "a");
  79. else
  80. lightstyle(self.style, "m");
  81. }
  82. precache_sound ("ambience/fl_hum1.wav");
  83. ambientsound (self.origin, "ambience/fl_hum1.wav", 0.5, ATTN_STATIC);
  84. };
  85. /*QUAKED light_fluorospark (0 1 0) (-8 -8 -8) (8 8 8)
  86. Non-displayed light.
  87. Default light value is 300
  88. Default style is 10
  89. Makes sparking, broken fluorescent sound
  90. */
  91. void() light_fluorospark =
  92. {
  93. if (!self.style)
  94. self.style = 10;
  95. precache_sound ("ambience/buzz1.wav");
  96. ambientsound (self.origin, "ambience/buzz1.wav", 0.5, ATTN_STATIC);
  97. };
  98. /*QUAKED light_globe (0 1 0) (-8 -8 -8) (8 8 8)
  99. Sphere globe light.
  100. Default light value is 300
  101. Default style is 0
  102. */
  103. void() light_globe =
  104. {
  105. precache_model ("progs/s_light.spr");
  106. setmodel (self, "progs/s_light.spr");
  107. makestatic (self);
  108. };
  109. void() FireAmbient =
  110. {
  111. precache_sound ("ambience/fire1.wav");
  112. // attenuate fast
  113. ambientsound (self.origin, "ambience/fire1.wav", 0.5, ATTN_STATIC);
  114. };
  115. /*QUAKED light_torch_small_walltorch (0 .5 0) (-10 -10 -20) (10 10 20) Quiet
  116. Short wall torch
  117. Default light value is 300
  118. Default style is 0
  119. */
  120. void() light_torch_small_walltorch =
  121. {
  122. precache_model ("progs/flame.mdl");
  123. setmodel (self, "progs/flame.mdl");
  124. if (!(self.spawnflags & 1))
  125. FireAmbient ();
  126. makestatic (self);
  127. };
  128. /*QUAKED light_flame_large_yellow (0 1 0) (-10 -10 -12) (12 12 18)
  129. Large yellow flame ball
  130. */
  131. void() light_flame_large_yellow =
  132. {
  133. precache_model ("progs/flame2.mdl");
  134. setmodel (self, "progs/flame2.mdl");
  135. self.frame = 1;
  136. FireAmbient ();
  137. makestatic (self);
  138. };
  139. /*QUAKED light_flame_small_yellow (0 1 0) (-8 -8 -8) (8 8 8) START_OFF
  140. Small yellow flame ball
  141. */
  142. void() light_flame_small_yellow =
  143. {
  144. precache_model ("progs/flame2.mdl");
  145. setmodel (self, "progs/flame2.mdl");
  146. FireAmbient ();
  147. makestatic (self);
  148. };
  149. /*QUAKED light_flame_small_white (0 1 0) (-10 -10 -40) (10 10 40) START_OFF
  150. Small white flame ball
  151. */
  152. void() light_flame_small_white =
  153. {
  154. precache_model ("progs/flame2.mdl");
  155. setmodel (self, "progs/flame2.mdl");
  156. FireAmbient ();
  157. makestatic (self);
  158. };
  159. //============================================================================
  160. /*QUAKED misc_fireball (0 .5 .8) (-8 -8 -8) (8 8 8)
  161. Lava Balls
  162. */
  163. void() fire_fly;
  164. void() fire_touch;
  165. void() misc_fireball =
  166. {
  167. precache_model ("progs/lavaball.mdl");
  168. self.classname = "fireball";
  169. self.nextthink = time + (random() * 5);
  170. self.think = fire_fly;
  171. if (!self.speed)
  172. self.speed == 1000;
  173. };
  174. void() fire_fly =
  175. {
  176. local entity fireball;
  177. fireball = spawn();
  178. fireball.solid = SOLID_TRIGGER;
  179. fireball.movetype = MOVETYPE_TOSS;
  180. fireball.velocity = '0 0 1000';
  181. fireball.velocity_x = (random() * 100) - 50;
  182. fireball.velocity_y = (random() * 100) - 50;
  183. fireball.velocity_z = self.speed + (random() * 200);
  184. fireball.classname = "fireball";
  185. setmodel (fireball, "progs/lavaball.mdl");
  186. setsize (fireball, '0 0 0', '0 0 0');
  187. setorigin (fireball, self.origin);
  188. fireball.nextthink = time + 5;
  189. fireball.think = SUB_Remove;
  190. fireball.touch = fire_touch;
  191. self.nextthink = time + (random() * 5) + 3;
  192. self.think = fire_fly;
  193. };
  194. void() fire_touch =
  195. {
  196. T_Damage (other, self, self, 20);
  197. remove(self);
  198. };
  199. //============================================================================
  200. void() barrel_explode =
  201. {
  202. self.takedamage = DAMAGE_NO;
  203. self.classname = "explo_box";
  204. // did say self.owner
  205. T_RadiusDamage (self, self, 160, world);
  206. sound (self, CHAN_VOICE, "weapons/r_exp3.wav", 1, ATTN_NORM);
  207. particle (self.origin, '0 0 0', 75, 255);
  208. self.origin_z = self.origin_z + 32;
  209. BecomeExplosion ();
  210. };
  211. /*QUAKED misc_explobox (0 .5 .8) (0 0 0) (32 32 64)
  212. TESTING THING
  213. */
  214. void() misc_explobox =
  215. {
  216. local float oldz;
  217. self.solid = SOLID_BBOX;
  218. self.movetype = MOVETYPE_NONE;
  219. precache_model ("maps/b_explob.bsp");
  220. setmodel (self, "maps/b_explob.bsp");
  221. precache_sound ("weapons/r_exp3.wav");
  222. self.health = 20;
  223. self.th_die = barrel_explode;
  224. self.takedamage = DAMAGE_AIM;
  225. self.origin_z = self.origin_z + 2;
  226. oldz = self.origin_z;
  227. droptofloor();
  228. if (oldz - self.origin_z > 250)
  229. {
  230. dprint ("item fell out of level at ");
  231. dprint (vtos(self.origin));
  232. dprint ("\n");
  233. remove(self);
  234. }
  235. };
  236. /*QUAKED misc_explobox2 (0 .5 .8) (0 0 0) (32 32 64)
  237. Smaller exploding box, REGISTERED ONLY
  238. */
  239. void() misc_explobox2 =
  240. {
  241. local float oldz;
  242. self.solid = SOLID_BBOX;
  243. self.movetype = MOVETYPE_NONE;
  244. precache_model2 ("maps/b_exbox2.bsp");
  245. setmodel (self, "maps/b_exbox2.bsp");
  246. precache_sound ("weapons/r_exp3.wav");
  247. self.health = 20;
  248. self.th_die = barrel_explode;
  249. self.takedamage = DAMAGE_AIM;
  250. self.origin_z = self.origin_z + 2;
  251. oldz = self.origin_z;
  252. droptofloor();
  253. if (oldz - self.origin_z > 250)
  254. {
  255. dprint ("item fell out of level at ");
  256. dprint (vtos(self.origin));
  257. dprint ("\n");
  258. remove(self);
  259. }
  260. };
  261. //============================================================================
  262. float SPAWNFLAG_SUPERSPIKE = 1;
  263. float SPAWNFLAG_LASER = 2;
  264. float SPAWNFLAG_LAVASPIKE = 4;
  265. float SPAWNFLAG_SUPERLAVA = 8;
  266. float SPAWNFLAG_LAVASKILL = 16;
  267. float SPAWNFLAG_FIREBALL = 32;
  268. void(vector org, vector vec) LaunchLaser;
  269. void(vector org, vector dir) launch_lava_spike;
  270. void(vector org, vector dir) launch_fireball;
  271. void() spikeshooter_use =
  272. {
  273. if (self.spawnflags & SPAWNFLAG_SUPERSPIKE || !(self.spawnflags))
  274. {
  275. sound (self, CHAN_VOICE, "weapons/spike2.wav", 1, ATTN_NORM);
  276. launch_spike (self.origin, self.movedir);
  277. newmis.velocity = self.movedir * 500;
  278. if (self.spawnflags & SPAWNFLAG_SUPERSPIKE)
  279. newmis.touch = superspike_touch;
  280. }
  281. else if (self.spawnflags & SPAWNFLAG_LASER)
  282. {
  283. sound (self, CHAN_VOICE, "enforcer/enfire.wav", 1, ATTN_NORM);
  284. LaunchLaser (self.origin, self.movedir);
  285. }
  286. else if (self.spawnflags & SPAWNFLAG_FIREBALL)
  287. {
  288. launch_fireball (self.origin, self.movedir);
  289. }
  290. else
  291. {
  292. sound (self, CHAN_VOICE, "weapons/spike2.wav", 1, ATTN_NORM);
  293. launch_lava_spike (self.origin, self.movedir);
  294. newmis.velocity = self.movedir * 500;
  295. if (self.spawnflags & SPAWNFLAG_SUPERLAVA)
  296. newmis.touch = superlavaspike_touch;
  297. else if((self.spawnflags & SPAWNFLAG_LAVASKILL) && (skill > 1))
  298. newmis.touch = superlavaspike_touch;
  299. }
  300. };
  301. void() shooter_think =
  302. {
  303. spikeshooter_use ();
  304. self.nextthink = time + self.wait;
  305. newmis.velocity = self.movedir * 500;
  306. };
  307. /*QUAKED trap_spikeshooter (0 .5 .8) (-8 -8 -8) (8 8 8) superspike laser lava superlava skilllava fireball
  308. When triggered, fires a spike in the direction set in QuakeEd.
  309. Laser, Lava and SuperLava are only for REGISTERED.
  310. */
  311. void() trap_spikeshooter =
  312. {
  313. SetMovedir ();
  314. self.use = spikeshooter_use;
  315. if (self.spawnflags & SPAWNFLAG_LASER)
  316. {
  317. precache_model2 ("progs/laser.mdl");
  318. precache_sound2 ("enforcer/enfire.wav");
  319. precache_sound2 ("enforcer/enfstop.wav");
  320. }
  321. else if (self.spawnflags & SPAWNFLAG_LAVASPIKE)
  322. {
  323. precache_model2 ("progs/lspike.mdl");
  324. precache_sound2 ("lavagun/snail.wav"); // lava nail gun cooldown
  325. precache_sound2 ("weapons/rocket1i.wav");
  326. }
  327. else if (self.spawnflags & SPAWNFLAG_SUPERLAVA)
  328. {
  329. precache_model2 ("progs/lspike.mdl");
  330. precache_sound2 ("lavagun/snail.wav"); // lava nail gun cooldown
  331. precache_sound2 ("weapons/spike2.wav");
  332. }
  333. else if (self.spawnflags & SPAWNFLAG_LAVASKILL)
  334. {
  335. precache_model2 ("progs/lspike.mdl");
  336. precache_sound2 ("lavagun/snail.wav"); // lava nail gun cooldown
  337. precache_sound2 ("weapons/rocket1i.wav");
  338. precache_sound2 ("weapons/spike2.wav");
  339. }
  340. else if (self.spawnflags & SPAWNFLAG_FIREBALL)
  341. {
  342. precache_model ("progs/fireball.mdl");
  343. }
  344. else
  345. precache_sound ("weapons/spike2.wav");
  346. };
  347. /*QUAKED trap_shooter (0 .5 .8) (-8 -8 -8) (8 8 8) superspike laser
  348. Continuously fires spikes.
  349. "wait" time between spike (1.0 default)
  350. "nextthink" delay before firing first spike, so multiple shooters can be stagered.
  351. */
  352. void() trap_shooter =
  353. {
  354. trap_spikeshooter ();
  355. if (self.wait == 0)
  356. self.wait = 1;
  357. self.nextthink = self.nextthink + self.wait + self.ltime;
  358. self.think = shooter_think;
  359. };
  360. /*
  361. ===============================================================================
  362. ===============================================================================
  363. */
  364. void() make_bubbles;
  365. void() bubble_remove;
  366. void() bubble_bob;
  367. /*QUAKED air_bubbles (0 .5 .8) (-8 -8 -8) (8 8 8)
  368. testing air bubbles
  369. */
  370. void() air_bubbles =
  371. {
  372. if (deathmatch)
  373. {
  374. remove (self);
  375. return;
  376. }
  377. precache_model ("progs/s_bubble.spr");
  378. self.nextthink = time + 1;
  379. self.think = make_bubbles;
  380. };
  381. void() make_bubbles =
  382. {
  383. local entity bubble;
  384. bubble = spawn();
  385. setmodel (bubble, "progs/s_bubble.spr");
  386. setorigin (bubble, self.origin);
  387. bubble.movetype = MOVETYPE_NOCLIP;
  388. bubble.solid = SOLID_NOT;
  389. bubble.velocity = '0 0 15';
  390. bubble.nextthink = time + 0.5;
  391. bubble.think = bubble_bob;
  392. bubble.touch = bubble_remove;
  393. bubble.classname = "bubble";
  394. bubble.frame = 0;
  395. bubble.cnt = 0;
  396. setsize (bubble, '-8 -8 -8', '8 8 8');
  397. self.nextthink = time + random() + 0.5;
  398. self.think = make_bubbles;
  399. };
  400. void() bubble_split =
  401. {
  402. local entity bubble;
  403. bubble = spawn();
  404. setmodel (bubble, "progs/s_bubble.spr");
  405. setorigin (bubble, self.origin);
  406. bubble.movetype = MOVETYPE_NOCLIP;
  407. bubble.solid = SOLID_NOT;
  408. bubble.velocity = self.velocity;
  409. bubble.nextthink = time + 0.5;
  410. bubble.think = bubble_bob;
  411. bubble.touch = bubble_remove;
  412. bubble.classname = "bubble";
  413. bubble.frame = 1;
  414. bubble.cnt = 10;
  415. setsize (bubble, '-8 -8 -8', '8 8 8');
  416. self.frame = 1;
  417. self.cnt = 10;
  418. if (self.waterlevel != 3)
  419. remove (self);
  420. };
  421. void() bubble_remove =
  422. {
  423. if (other.classname == self.classname)
  424. {
  425. // dprint ("bump");
  426. return;
  427. }
  428. remove(self);
  429. };
  430. void() bubble_bob =
  431. {
  432. local float rnd1, rnd2, rnd3;
  433. local vector vtmp1, modi;
  434. // PGM fix - 02/25/97 so bubbles won't go through walls
  435. rnd1 = pointcontents(self.origin);
  436. if (rnd1 == CONTENT_SOLID)
  437. remove(self);
  438. // PGM fix - 02/25/97 so bubbles pop 2 seconds after leaving water
  439. else if (rnd1 == CONTENT_EMPTY)
  440. {
  441. if (self.cnt < 16)
  442. self.cnt = 16;
  443. }
  444. self.cnt = self.cnt + 1;
  445. if (self.cnt == 4)
  446. bubble_split();
  447. if (self.cnt == 20)
  448. remove(self);
  449. rnd1 = self.velocity_x + (-10 + (random() * 20));
  450. rnd2 = self.velocity_y + (-10 + (random() * 20));
  451. rnd3 = self.velocity_z + 10 + random() * 10;
  452. if (rnd1 > 10)
  453. rnd1 = 5;
  454. if (rnd1 < -10)
  455. rnd1 = -5;
  456. if (rnd2 > 10)
  457. rnd2 = 5;
  458. if (rnd2 < -10)
  459. rnd2 = -5;
  460. if (rnd3 < 10)
  461. rnd3 = 15;
  462. if (rnd3 > 30)
  463. rnd3 = 25;
  464. self.velocity_x = rnd1;
  465. self.velocity_y = rnd2;
  466. self.velocity_z = rnd3;
  467. self.nextthink = time + 0.5;
  468. self.think = bubble_bob;
  469. };
  470. /*~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>
  471. ~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~<~>~*/
  472. /*QUAKED viewthing (0 .5 .8) (-8 -8 -8) (8 8 8)
  473. Just for the debugging level. Don't use
  474. */
  475. void() viewthing =
  476. {
  477. self.movetype = MOVETYPE_NONE;
  478. self.solid = SOLID_NOT;
  479. precache_model ("progs/player.mdl");
  480. setmodel (self, "progs/player.mdl");
  481. };
  482. /*
  483. ==============================================================================
  484. SIMPLE BMODELS
  485. ==============================================================================
  486. */
  487. void() func_wall_use =
  488. { // change to alternate textures
  489. self.frame = 1 - self.frame;
  490. };
  491. /*QUAKED func_wall (0 .5 .8) ?
  492. This is just a solid wall if not inhibitted
  493. */
  494. void() func_wall =
  495. {
  496. self.angles = '0 0 0';
  497. self.movetype = MOVETYPE_PUSH; // so it doesn't get pushed by anything
  498. self.solid = SOLID_BSP;
  499. self.use = func_wall_use;
  500. setmodel (self, self.model);
  501. };
  502. /*QUAKED func_illusionary (0 .5 .8) ?
  503. A simple entity that looks solid but lets you walk through it.
  504. */
  505. void() func_illusionary =
  506. {
  507. self.angles = '0 0 0';
  508. self.movetype = MOVETYPE_NONE;
  509. self.solid = SOLID_NOT;
  510. setmodel (self, self.model);
  511. makestatic ();
  512. };
  513. /*QUAKED func_episodegate (0 .5 .8) ? E1 E2 E3 E4
  514. This bmodel will appear if the episode has allready been completed, so players can't reenter it.
  515. */
  516. void() func_episodegate =
  517. {
  518. if (!(serverflags & self.spawnflags))
  519. return; // can still enter episode
  520. self.angles = '0 0 0';
  521. self.movetype = MOVETYPE_PUSH; // so it doesn't get pushed by anything
  522. self.solid = SOLID_BSP;
  523. self.use = func_wall_use;
  524. setmodel (self, self.model);
  525. };
  526. /*QUAKED func_bossgate (0 .5 .8) ?
  527. This bmodel appears unless players have all of the episode sigils.
  528. */
  529. void() func_bossgate =
  530. {
  531. if ( (serverflags & 15) == 15)
  532. return; // all episodes completed
  533. self.angles = '0 0 0';
  534. self.movetype = MOVETYPE_PUSH; // so it doesn't get pushed by anything
  535. self.solid = SOLID_BSP;
  536. self.use = func_wall_use;
  537. setmodel (self, self.model);
  538. };
  539. //============================================================================
  540. /*QUAKED ambient_suck_wind (0.3 0.1 0.6) (-10 -10 -8) (10 10 8)
  541. */
  542. void() ambient_suck_wind =
  543. {
  544. precache_sound ("ambience/suck1.wav");
  545. ambientsound (self.origin, "ambience/suck1.wav", 1, ATTN_STATIC);
  546. };
  547. /*QUAKED ambient_drone (0.3 0.1 0.6) (-10 -10 -8) (10 10 8)
  548. */
  549. void() ambient_drone =
  550. {
  551. precache_sound ("ambience/drone6.wav");
  552. ambientsound (self.origin, "ambience/drone6.wav", 0.5, ATTN_STATIC);
  553. };
  554. /*QUAKED ambient_flouro_buzz (0.3 0.1 0.6) (-10 -10 -8) (10 10 8)
  555. */
  556. void() ambient_flouro_buzz =
  557. {
  558. precache_sound ("ambience/buzz1.wav");
  559. ambientsound (self.origin, "ambience/buzz1.wav", 1, ATTN_STATIC);
  560. };
  561. /*QUAKED ambient_drip (0.3 0.1 0.6) (-10 -10 -8) (10 10 8)
  562. */
  563. void() ambient_drip =
  564. {
  565. precache_sound ("ambience/drip1.wav");
  566. ambientsound (self.origin, "ambience/drip1.wav", 0.5, ATTN_STATIC);
  567. };
  568. /*QUAKED ambient_comp_hum (0.3 0.1 0.6) (-10 -10 -8) (10 10 8)
  569. */
  570. void() ambient_comp_hum =
  571. {
  572. precache_sound ("ambience/comp1.wav");
  573. ambientsound (self.origin, "ambience/comp1.wav", 1, ATTN_STATIC);
  574. };
  575. /*QUAKED ambient_thunder (0.3 0.1 0.6) (-10 -10 -8) (10 10 8)
  576. */
  577. void() ambient_thunder =
  578. {
  579. precache_sound ("ambience/thunder1.wav");
  580. ambientsound (self.origin, "ambience/thunder1.wav", 0.5, ATTN_STATIC);
  581. };
  582. /*QUAKED ambient_light_buzz (0.3 0.1 0.6) (-10 -10 -8) (10 10 8)
  583. */
  584. void() ambient_light_buzz =
  585. {
  586. precache_sound ("ambience/fl_hum1.wav");
  587. ambientsound (self.origin, "ambience/fl_hum1.wav", 0.5, ATTN_STATIC);
  588. };
  589. /*QUAKED ambient_swamp1 (0.3 0.1 0.6) (-10 -10 -8) (10 10 8)
  590. */
  591. void() ambient_swamp1 =
  592. {
  593. precache_sound ("ambience/swamp1.wav");
  594. ambientsound (self.origin, "ambience/swamp1.wav", 0.5, ATTN_STATIC);
  595. };
  596. /*QUAKED ambient_swamp2 (0.3 0.1 0.6) (-10 -10 -8) (10 10 8)
  597. */
  598. void() ambient_swamp2 =
  599. {
  600. precache_sound ("ambience/swamp2.wav");
  601. ambientsound (self.origin, "ambience/swamp2.wav", 0.5, ATTN_STATIC);
  602. };
  603. //============================================================================
  604. void() noise_think =
  605. {
  606. self.nextthink = time + 0.5;
  607. sound (self, 1, "enforcer/enfire.wav", 1, ATTN_NORM);
  608. sound (self, 2, "enforcer/enfstop.wav", 1, ATTN_NORM);
  609. sound (self, 3, "enforcer/sight1.wav", 1, ATTN_NORM);
  610. sound (self, 4, "enforcer/sight2.wav", 1, ATTN_NORM);
  611. sound (self, 5, "enforcer/sight3.wav", 1, ATTN_NORM);
  612. sound (self, 6, "enforcer/sight4.wav", 1, ATTN_NORM);
  613. sound (self, 7, "enforcer/pain1.wav", 1, ATTN_NORM);
  614. };
  615. /*QUAKED misc_noisemaker (1 0.5 0) (-10 -10 -10) (10 10 10)
  616. For optimzation testing, starts a lot of sounds.
  617. */
  618. void() misc_noisemaker =
  619. {
  620. precache_sound2 ("enforcer/enfire.wav");
  621. precache_sound2 ("enforcer/enfstop.wav");
  622. precache_sound2 ("enforcer/sight1.wav");
  623. precache_sound2 ("enforcer/sight2.wav");
  624. precache_sound2 ("enforcer/sight3.wav");
  625. precache_sound2 ("enforcer/sight4.wav");
  626. precache_sound2 ("enforcer/pain1.wav");
  627. precache_sound2 ("enforcer/pain2.wav");
  628. precache_sound2 ("enforcer/death1.wav");
  629. precache_sound2 ("enforcer/idle1.wav");
  630. self.nextthink = time + 0.1 + random();
  631. self.think = noise_think;
  632. };