home *** CD-ROM | disk | FTP | other *** search
/ PC PowerPlay 11 / PCPP11.iso / patch / quake2 / misc.qc < prev    next >
Encoding:
Text File  |  1996-12-05  |  15.9 KB  |  727 lines

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