misc.qc 17 KB

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