home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 2003 June / macformat-130.iso / mac / Reviewed⁄Demos / Spearhead Demo / demota / pak1.pk3 / anim / suppress.scr < prev    next >
Encoding:
Text File  |  2002-10-21  |  1.1 KB  |  52 lines

  1. //-----
  2. // Suppress
  3. //-----
  4.  
  5. //=============================================================
  6. //=============================================================
  7. SuppressMain:
  8.  
  9.     // These values were lifted directly from attack.scr.
  10.     // It is a good idea to keep them in synch, so that the transition from
  11.     // suppress to attack is as smooth as possible.
  12.  
  13.     self.shortrange = 150
  14.     self.mediumrange = 650
  15.     self.pronedistance = 850
  16.  
  17.     //----------------------
  18.     // decide how to stand
  19.  
  20.     local.distance = self.distancetoenemy
  21.     if (local.distance > self.pronedistance && self.weapongroup != bazooka && self.team == german)
  22.     {
  23.         // prone
  24.         waitexec anim/prone.scr
  25.     }
  26.     else if (local.distance > self.mediumrange)
  27.     {
  28.         // crouch
  29.         waitexec anim/crouch.scr::transition
  30.     }
  31.     else
  32.     {
  33.         // stand
  34.         waitexec anim/stand.scr::transition
  35.     }
  36.  
  37.     //----------------------
  38.     // attack
  39.  
  40.     waitexec anim/shoot.scr
  41.  
  42.     //----------------------
  43.     // wait a bit
  44.  
  45.     local.stopwaitingtime = level.time + .5 + randomfloat(1)
  46.  
  47.     while (level.time < local.stopwaitingtime)
  48.     {
  49.         waitexec anim/aim.scr
  50.     }
  51. end
  52.