home *** CD-ROM | disk | FTP | other *** search
/ Quake 'em / QUAKEEM.BIN / quake / programs / qwiz12 / colors.qc < prev    next >
Encoding:
Text File  |  1996-08-16  |  1.9 KB  |  99 lines

  1. /*
  2.  
  3. ==============================================================================
  4.  
  5. Color Spray
  6.  
  7. ==============================================================================
  8.  
  9. */
  10.  
  11.  
  12. void() ColorsExplode =
  13. {
  14.     local vector    vel;
  15.  
  16. // Set up some red and yellow sparks
  17.     vel = '0 0 150';
  18.     particle (self.origin+vel*0.01,vel,111,150);
  19.         vel = '0 0 120';
  20.     particle (self.origin+vel*0.01,vel,73,200);
  21.  
  22.         remove(self);
  23. };
  24.  
  25.  
  26.  
  27. void() colors_touch; 
  28.  
  29. void (vector org, vector dir) launch_colors =
  30. {
  31.     local   entity  missile;
  32.  
  33.     missile = spawn ();
  34.     missile.owner = self;
  35.     missile.movetype = MOVETYPE_FLYMISSILE;
  36.     missile.solid = SOLID_BBOX;
  37.  
  38.     missile.angles = vectoangles(dir);
  39.  
  40.     missile.touch = colors_touch;
  41.         missile.classname = "colors";
  42.  
  43.     missile.nextthink=time+0.1;
  44.     missile.think=ColorsExplode;
  45.  
  46.     setmodel (missile, "progs/s_bubble.spr");
  47.     setsize (missile, VEC_ORIGIN, VEC_ORIGIN);               
  48.     setorigin (missile, org);
  49.     missile.velocity = dir * 1000;
  50.         missile.effects=EF_DIMLIGHT;
  51. };
  52.  
  53.  
  54.  
  55. void() colors_touch =
  56. {
  57.         remove(self);
  58.         return;
  59. };
  60.  
  61.  
  62.  
  63.  
  64.  
  65. void(float ox) W_FireColors =
  66. {
  67.     local vector    dir;
  68.     local entity    old;
  69.     
  70.     makevectors (self.v_angle);
  71.  
  72.     sound (self, CHAN_WEAPON, "shalrath/attack2.wav", 1, ATTN_NORM);
  73.     self.attack_finished = time + 0.5;
  74.     dir = aim (self, 1000);
  75.         launch_colors (self.origin + '0 0 20' + v_right*ox, dir);
  76.  
  77.     self.punchangle_x = -2;
  78. };
  79.  
  80.  
  81.  
  82.  
  83. //--------------------------------------------------------------------
  84. // Checks if Colors can be fired
  85. //--------------------------------------------------------------------
  86. void() ColorsC = 
  87. {
  88.     if (self.ammo_cells < 10)
  89.     {
  90.         sprint(self,"cells are low\n");
  91.         return;
  92.     }
  93.       self.currentammo = self.ammo_cells = self.ammo_cells - 10;
  94.     W_SetCurrentAmmo();
  95.  
  96.     sound (self, CHAN_WEAPON, "shalrath/attack2.wav", 1, ATTN_NORM);
  97.     W_FireColors ();
  98. };
  99.