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

  1. hammer local.spot local.lookspot:    
  2.     self forceactivate
  3.     self type_attack "alarm"
  4.     self alarmthread hammerinterupt
  5.     if(self.gun == "" || self.gun == NULL || self.gun == NIL || self.gun == "none")
  6.         self weapon "walter p38"
  7.  
  8.     self holster
  9.     waitframe
  10.     if(self.isinplace != 1)
  11.     {
  12.         self.isinplace = 1
  13.           self exec global/walkto.scr local.spot
  14.           self waittill movedone
  15.           self.origin = local.spot.origin
  16.           self exec global/turnto.scr local.lookspot
  17.     }
  18.     self waitthread hammeranimwait working_hammering_pullout
  19.     self waitthread hammeranimwait working_hammering_getdown
  20.     self.isup = 0
  21.     self anim working_hammering
  22.     local.randomnum = (randomint(5) + 10)
  23.     for (local.i = 1; local.i <= local.randomnum; local.i++)
  24.     {
  25.         
  26.         self waitthread hammeranimwait working_hammering
  27.         waitframe
  28.         self waitthread hammeranimwait working_hammering
  29.  
  30.     }
  31.     self waitthread hammeranimwait working_hammering_getup
  32.     self.isup = 1
  33.     self waitthread hammeranimwait working_hammering_putaway
  34. end
  35.  
  36. hammerinterupt:
  37.     self exec global/disable_ai.scr
  38.     if(self.isup == 0)
  39.     {
  40.         self.isup = 1
  41.         self waitthread hammeranimwait working_hammering_getup
  42.         self waittill animdone
  43.         self anim working_hammering_putaway
  44.         waitframe
  45.         waitframe
  46.         waitframe
  47.     }
  48.     else
  49.     {
  50.         self.isup = 0
  51.         self anim working_hammering_putaway
  52.         waitframe
  53.         waitframe
  54.         waitframe
  55.     }
  56.     waitframe
  57.     self unholster
  58.     self exec global/enable_ai.scr
  59.     self attackplayer
  60. end
  61.  
  62.  
  63. hammeranimwait local.anim:
  64.     if(isalive self)
  65.     {
  66.         self anim local.anim
  67.         self waittill animdone
  68.     }
  69. end
  70.