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

  1. start:
  2.  
  3. self.blendtime = 0.25
  4.  
  5. switch (self.position)
  6. {
  7. // Pain positions
  8. // This is actually the main pain handling script.  People in pain will go through 
  9. // this script in an attempt to stand back up, and should, in the process, do lots 
  10. // of cool, agonized-looking stuff.  There is also a section in crouch.scr to handle 
  11. // going from knees to the crouch pose.
  12. knees:
  13.     // Try to stand up - allow for the fact that chances are we're in too much 
  14.     // pain and we'll just fall about on the floor some more.
  15.     local.randnum = randomint 100
  16.     if ( self.normal_health > local.randnum )
  17.     {
  18.         // Recover - stand up
  19.         switch (self.weapontype)
  20.         {
  21.         grenade:
  22.             //println "Knees pain recover, hold Grenade"    
  23.             // (Temp, need transition with grenade)
  24.             self setmotionanim pistol_pain_kneestostand
  25.             break
  26.     
  27.         rifle:
  28.             //println "Knees pain recover, hold Rifle"
  29.             self setmotionanim rifle_pain_kneestostand
  30.             break
  31.     
  32.         smg:
  33.             //println "Knees pain recover, hold SMG"
  34.             self setmotionanim thompson_pain_kneestostand
  35.             break
  36.     
  37.         bazooka:
  38.             println "^~^~^ Knees pain recover, hold Bazooka.  Shouldn't happen."
  39.             self setmotionanim pistol_pain_kneestostand
  40.             break
  41.     
  42.         default:
  43.             println "^~^~^ Knees pain recover, unrecognized weapon - bug in continue_pain.scr"
  44.             self setmotionanim pistol_pain_kneestostand
  45.             break
  46.         }
  47.         self waittill flaggedanimdone
  48.         self.position = stand
  49.     }
  50.     else if ( self.normal_health < local.randnum - 30 )
  51.     {
  52.         // I'm in so much pain!  I can't even stay on my knees, I'm so weak.
  53.         switch (self.weapontype)
  54.         {
  55.         grenade:
  56.             //println "Knees, hold Grenade"            
  57.             // (Temp, need transition with grenade)
  58.             self setmotionanim pistol_pain_kneestocrawl
  59.             break
  60.  
  61.         rifle:
  62.             //println "Knees, hold Rifle"
  63.             self setmotionanim rifle_pain_kneestocrawl
  64.             break
  65.  
  66.         smg:
  67.             //println "Knees, hold SMG"
  68.             self setmotionanim thompson_pain_kneestocrawl
  69.             break
  70.  
  71.         bazooka:
  72.             println "^~^~^ Knees, hold Bazooka.  Shouldn't happen."
  73.             self setmotionanim pistol_pain_kneestocrawl
  74.             break
  75.  
  76.         default:
  77.             println "^~^~^ Knees, unrecognized weapon - bug in continue_pain.scr"
  78.             self setmotionanim pistol_pain_kneestocrawl
  79.             break
  80.         }
  81.         self waittill flaggedanimdone
  82.         self.position = crawl
  83.         goto start
  84.     }
  85.     // Don't do kneestofloor, that's only for when you get shot.
  86.     else 
  87.     {
  88.         switch (self.weapontype)
  89.         {
  90.         grenade:
  91.             //println "Knees, hold Grenade"            
  92.             // (Temp, need transition with grenade)
  93.             self setmotionanim pistol_pain_kneesidle
  94.             break
  95.  
  96.         rifle:
  97.             //println "Knees, hold Rifle"
  98.             self setmotionanim rifle_pain_kneesidle
  99.             break
  100.  
  101.         smg:
  102.             //println "Knees, hold SMG"
  103.             self setmotionanim thompson_pain_kneesidle
  104.             break
  105.  
  106.         bazooka:
  107.             println "^~^~^ Knees, hold Bazooka.  Shouldn't happen."
  108.             self setmotionanim pistol_pain_kneesidle
  109.             break
  110.  
  111.         default:
  112.             println "^~^~^ Knee pain idle, unrecognized weapon - bug in continue_pain.scr"
  113.             self setmotionanim pistol_pain_kneesidle
  114.             break
  115.         }
  116.         self waittill flaggedanimdone
  117.         goto start
  118.     }
  119.     break
  120.  
  121. crawl:
  122.     // Falling to the floor from crawl could be considered a recovery, or the 
  123.     // opposite, so let's just do it randomly.
  124.     local.randnum = randomint 100
  125.     if ( local.randnum > 50 )
  126.     {
  127.         switch (self.weapontype)
  128.         {
  129.         grenade:
  130.             //println "Crawl pain floor, hold Grenade"    
  131.             // (Temp, need transition with grenade)
  132.             self setmotionanim pistol_pain_crawltofloor
  133.             break
  134.     
  135.         rifle:
  136.             //println "Crawl pain floor, hold Rifle"
  137.             self setmotionanim rifle_pain_crawltofloor
  138.             break
  139.     
  140.         smg:
  141.             //println "Crawl pain floor, hold SMG"
  142.             self setmotionanim thompson_pain_crawltofloor
  143.             break
  144.     
  145.         bazooka:
  146.             println "^~^~^ Crawl pain floor, hold Bazooka.  Shouldn't happen."
  147.             self setmotionanim pistol_pain_crawltofloor
  148.             break
  149.     
  150.         default:
  151.             println "^~^~^ Crawl pain floor, unrecognized weapon - bug in continue_pain.scr"
  152.             self setmotionanim pistol_pain_crawltofloor
  153.             break
  154.         }
  155.         self waittill flaggedanimdone
  156.         self.position = floor
  157.         goto start
  158.     }
  159.     else
  160.     {
  161.         switch (self.weapontype)
  162.         {
  163.         grenade:
  164.             //println "Crawl pain, hold Grenade"        
  165.             // (Temp, need transition with grenade)
  166.             self setmotionanim pistol_pain_crawl
  167.             break
  168.     
  169.         rifle:
  170.             //println "Crawl pain, hold Rifle"
  171.             self setmotionanim rifle_pain_crawl
  172.             break
  173.     
  174.         smg:
  175.             //println "Crawl pain, hold SMG"
  176.             self setmotionanim thompson_pain_crawl
  177.             break
  178.     
  179.         bazooka:
  180.             println "^~^~^ Crawl pain, hold Bazooka.  Shouldn't happen."
  181.             self setmotionanim pistol_pain_crawl
  182.             break
  183.     
  184.         default:
  185.             println "^~^~^ Crawl pain, unrecognized weapon - bug in continue_pain.scr"
  186.             self setmotionanim pistol_pain_crawl
  187.             break
  188.         }
  189.         self waittill flaggedanimdone
  190.         goto start
  191.     }
  192.     break
  193.  
  194. floor:
  195.     // Try to stand up - allow for the fact that chances are we're in too much 
  196.     // pain and we'll just fall about on the floor some more.
  197.     local.randnum = randomint 100
  198.     if ( self.normal_health > local.randnum )
  199.     {
  200.         // Climb to knees
  201.         switch (self.weapontype)
  202.         {
  203.         grenade:
  204.             //println "Floor pain recover, hold Grenade"    
  205.             // (Temp, need transition with grenade)
  206.             self setmotionanim pistol_pain_floortoknees
  207.             break
  208.     
  209.         rifle:
  210.             //println "Floor pain recover, hold Rifle"
  211.             self setmotionanim rifle_pain_floortoknees
  212.             break
  213.     
  214.         smg:
  215.             //println "Floor pain recover, hold SMG"
  216.             self setmotionanim thompson_pain_floortoknees
  217.             break
  218.     
  219.         bazooka:
  220.             println "^~^~^ Floor pain recover, hold Bazooka.  Shouldn't happen."
  221.             self setmotionanim pistol_pain_floortoknees
  222.             break
  223.     
  224.         default:
  225.             println "^~^~^ Floor pain recover, unrecognized weapon - bug in continue_pain.scr"
  226.             self setmotionanim pistol_pain_floortoknees
  227.             break
  228.         }
  229.         self waittill flaggedanimdone
  230.         self.position = knees
  231.         goto start
  232.     }
  233.     else
  234.     {
  235.         // Wallow in your misery (could randomly crawl here too)
  236.         switch (self.weapontype)
  237.         {
  238.         grenade:
  239.             //println "Floor pain, hold Grenade"        
  240.             // (Temp, need transition with grenade)
  241.             self setmotionanim pistol_pain_flooridle
  242.             break
  243.     
  244.         rifle:
  245.             //println "Floor pain, hold Rifle"
  246.             self setmotionanim rifle_pain_flooridle
  247.             break
  248.     
  249.         smg:
  250.             //println "Floor pain, hold SMG"
  251.             self setmotionanim thompson_pain_flooridle
  252.             break
  253.     
  254.         bazooka:
  255.             println "^~^~^ Floor pain, hold Bazooka.  Shouldn't happen."
  256.             self setmotionanim pistol_pain_flooridle
  257.             break
  258.     
  259.         default:
  260.             println "^~^~^ Floor pain, unrecognized weapon - bug in continue_pain.scr"
  261.             self setmotionanim pistol_pain_flooridle
  262.             break
  263.         }
  264.         self waittill flaggedanimdone
  265.         goto start
  266.     }
  267.     break
  268.  
  269. default:
  270.     waitexec anim/idle.scr
  271.     break
  272. }
  273.