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

  1. //------
  2. // Squat
  3. //------
  4. // A special animation where the guy squats down like he's relaxing or talking to his 
  5. // buddies (who would also have to be squatting).
  6.  
  7.  
  8. //======================================================================
  9. start:
  10.     //println "Entering idle.scr"
  11.     //println "Called Idle.scr with position " self.position " mood " self.mood
  12.  
  13.     waitexec "anim/default_inithandler.scr"
  14.  
  15.     self.blendtime = 0.5    // Slow blendtime to avoid popping during idles.
  16.  
  17.     switch (self.position)
  18.     {
  19.         prone:
  20.         pronewalk:
  21.             self waitexec anim/crouch.scr
  22.             // Now go on to the crouch case
  23.         crouch:
  24.         crouchwalk:
  25.         crouchrun:
  26.         stand:
  27.         walk:
  28.         run:
  29.             self setmotionanim unarmed_squat_intro
  30.             self waittill flaggedanimdone
  31.             self.position = crouch
  32.             while (1)
  33.             {
  34.                 self setmotionanim unarmed_squat
  35.                 self waittill flaggedanimdone    
  36.                 if (self.getup == 1)
  37.                 {
  38.                     self.getup = NIL
  39.                     goto getup
  40.                 }            
  41.             }
  42.             break
  43.  
  44.         dead:
  45.             println "^~^~^ Dead guy trying to squat."
  46.             break
  47.         knees:
  48.         crawl:
  49.         floor:
  50.             // Oh my goodness I'm in agony!  Try to stand up, see if your legs will hold
  51.             // you.  (My first aid instructor always said that you should stay down so
  52.             // you didn't lose bloodflow to the brain and faint or worse.  These guys are
  53.             // more gung-ho than me I guess.)
  54.             waitexec anim/continue_pain.scr
  55.             goto start
  56.  
  57.         default:
  58.             println ("^~^~^ Squat Default case for "+self.position+" position - fix squat.scr")
  59.             break
  60.     }
  61. end
  62.  
  63. //======================================================================
  64. getup:
  65.     waitexec "anim/default_inithandler.scr"
  66.     self setmotionanim unarmed_squat_outtro
  67.     self waittill flaggedanimdone
  68.     self.position = stand
  69. end