home *** CD-ROM | disk | FTP | other *** search
/ Quaaake Level & Editor 2 / Quaaake_2.iso / Quake / snake / SNAKEMAN.QC < prev    next >
Encoding:
Text File  |  1996-10-24  |  9.7 KB  |  242 lines

  1. /*
  2. ==============================================================================
  3.  
  4. snake
  5.  
  6. ==============================================================================
  7. */
  8. $cd /raid/quake/id1/models/snakeman
  9. $origin 0 0 -24
  10. $base base
  11. $skin skin
  12. $scale 1
  13.  
  14. $frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 walk10
  15. $frame walk11 walk12 walk13 walk14 walk15 walk16
  16.  
  17. $frame attack1 attack2 attack3 attack4 attack5 attack6 attack7 attack8
  18. $frame attack9 attack10
  19.  
  20. $frame pain1 pain2 pain3 pain4 pain5 pain6 pain7
  21.  
  22. $frame die die die1 die2 die3 die4 die5 die6 die7 die8 die9 die10 die11
  23.  
  24. $frame dead2 dead3 dead4 dead5 dead6 dead7
  25.  
  26. $frame bpain1 bpain2 bpain3 bpain4 bpain5 bpain6 bpain7
  27.  
  28. void() snake_pain;
  29. void(float offset) SnakeMissile;
  30. void() snake_stand     =[      $walk10,       snake_stand2    ] {ai_stand();};
  31. void() snake_stand2     =[      $walk11,       snake_stand3    ] {ai_turn();};
  32. void() snake_stand3     =[      $walk12,       snake_stand4    ] {ai_stand();};
  33. void() snake_stand4     =[      $walk13,       snake_stand5    ] {ai_turn();};
  34. void() snake_stand5     =[      $walk14,       snake_stand6    ] {ai_stand();};
  35. void() snake_stand6     =[      $walk15,       snake_stand7    ] {ai_turn();};
  36. void() snake_stand7     =[      $walk16,       snake_stand8    ] {ai_turn();};
  37. void() snake_stand8     =[      $walk15,       snake_stand9    ] {ai_turn();};
  38. void() snake_stand9     =[      $walk14,       snake_stand10    ] {ai_stand();};
  39. void() snake_stand10     =[      $walk13,       snake_stand11    ] {ai_turn();};
  40. void() snake_stand11     =[      $walk12,       snake_stand12    ] {ai_stand();};
  41. void() snake_stand12     =[      $walk11,       snake_stand    ] {ai_turn();};
  42.  
  43. void() snake_walk1     =[      $walk1,       snake_walk2    ] {
  44. if (random() < 0.2)
  45.     sound (self, CHAN_VOICE, "wizard/widle2.wav", 1, ATTN_IDLE);
  46. ai_walk(2);};
  47. void() snake_walk2     =[      $walk2,       snake_walk3    ] {ai_walk(3);};
  48. void() snake_walk3     =[      $walk3,       snake_walk4    ] {ai_walk(3);};
  49. void() snake_walk4     =[      $walk4,       snake_walk5    ] {ai_walk(3);};
  50. void() snake_walk5     =[      $walk5,       snake_walk6    ] {ai_walk(3);};
  51. void() snake_walk6     =[      $walk6,       snake_walk7    ] {ai_walk(3);};
  52. void() snake_walk7     =[      $walk7,       snake_walk8    ] {ai_walk(3);};
  53. void() snake_walk8     =[      $walk8,       snake_walk9    ] {ai_walk(3);};
  54. void() snake_walk9     =[      $walk9,       snake_walk10   ] {ai_walk(3);};
  55. void() snake_walk10    =[      $walk10,      snake_walk11   ] {ai_walk(3);};
  56. void() snake_walk11    =[      $walk11,      snake_walk12   ] {ai_walk(3);};
  57. void() snake_walk12    =[      $walk12,      snake_walk13   ] {ai_walk(2);};
  58. void() snake_walk13    =[      $walk13,      snake_walk14   ] {ai_walk(2);};
  59. void() snake_walk14    =[      $walk14,      snake_walk15   ] {ai_walk(2);};
  60. void() snake_walk15    =[      $walk15,      snake_walk16   ] {ai_walk(1);};
  61. void() snake_walk16    =[      $walk16,      snake_walk1    ] {ai_walk(1);};
  62.  
  63. void() snake_run1  =[  $walk1,  snake_run2  ] { 
  64. self.attack_state = AS_SLIDING;  //snakeman now strafes 
  65. if (random() < 0.2) 
  66.    sound (self, CHAN_VOICE, "wizard/widle1.wav", 1, ATTN_IDLE); 
  67. ai_run(6);}; 
  68. void() snake_run2  =[  $walk3,  snake_run3  ] {ai_run(9);}; 
  69. void() snake_run3  =[  $walk5,  snake_run4  ] {ai_run(6);}; 
  70. void() snake_run4  =[  $walk7,  snake_run5  ] {ai_run(9);}; 
  71. void() snake_run5  =[  $walk9,  snake_run6  ] {self.attack_state = AS_STRAIGHT;ai_face();}; 
  72. void() snake_run6  =[  $walk11,  snake_run7  ] {ai_run(15);}; 
  73. void() snake_run7  =[  $walk13,  snake_run8  ] {ai_run(12);};        
  74. void() snake_run8  =[  $walk15,  snake_run1  ] {ai_run(15);}; 
  75.  
  76. void() snake_attack1  =[  $attack1,  snake_attack6  ] { 
  77. sound (self, CHAN_VOICE, "wizard/wattack.wav", 1, ATTN_NORM); 
  78. ai_face();}; 
  79. void() snake_attack6  =[  $attack6,  snake_attack7  ] {ai_run(12);ai_run_slide();SnakeMissile(2);SnakeMissile(-2);}; 
  80. void() snake_attack7  =[  $attack7,  snake_attack8  ] {ai_run(12);ai_run_slide();SnakeMissile(1);SnakeMissile(-1);}; 
  81. void() snake_attack8  =[  $attack8,  snake_attack9  ] {ai_run(12);ai_run_slide();SnakeMissile(0);SnakeMissile(0);}; 
  82. void() snake_attack9  =[  $attack9,  snake_attack10  ] {ai_run(12);ai_run_slide();SnakeMissile(0);SnakeMissile(0);}; 
  83. void() snake_attack10  =[  $attack10,  snake_run1  ] {ai_run(12);ai_run_slide();SnakeMissile(0);SnakeMissile(0);SUB_CheckRefire (snake_attack1);}; 
  84.  
  85. void() snake_pain1       =[      $pain1, snake_pain2      ] {};
  86. void() snake_pain2       =[      $pain2, snake_pain3      ] {};
  87. void() snake_pain3       =[      $pain3, snake_pain4      ] {};
  88. void() snake_pain4       =[      $pain4, snake_pain5      ] {};
  89. void() snake_pain5       =[      $pain5, snake_pain6      ] {};
  90. void() snake_pain6       =[      $pain6, snake_pain7      ] {};
  91. void() snake_pain7       =[      $pain7, snake_run1       ] {};
  92.  
  93. void() snake_bpain1       =[      $bpain1, snake_bpain2      ] {};
  94. void() snake_bpain2       =[      $bpain2, snake_bpain3      ] {};
  95. void() snake_bpain3       =[      $bpain3, snake_bpain4      ] {};
  96. void() snake_bpain4       =[      $bpain4, snake_bpain5      ] {};
  97. void() snake_bpain5       =[      $bpain5, snake_bpain6      ] {};
  98. void() snake_bpain6       =[      $bpain6, snake_bpain7      ] {};
  99. void() snake_bpain7       =[      $bpain7, snake_run1       ] {};
  100.  
  101. void() snake_death1      =[      $die2,        snake_death3     ] {};
  102. void() snake_death3      =[      $die3,        snake_death4     ] {};
  103. void() snake_death4      =[      $die4,        snake_death5     ] {};
  104. void() snake_death5      =[      $die5,        snake_death6     ] {};
  105. void() snake_death6      =[      $die6,        snake_death7     ] {};
  106. void() snake_death7      =[      $die7,        snake_death8     ] {};
  107. void() snake_death8      =[      $die8,        snake_death9     ] {};
  108. void() snake_death9      =[      $die9,        snake_death10    ] {self.ammo_nails = 15;DropBackpack();};
  109. void() snake_death10     =[      $die10,        snake_death11    ] {};
  110. void() snake_death11     =[      $die11,        snake_death12    ] {};
  111. void() snake_death12     =[      $die11,        snake_death12    ] {};
  112.  
  113. void() snake_dead1     =[      $dead2,        snake_dead2    ] {};
  114. void() snake_dead2     =[      $dead3,        snake_dead3    ] {};
  115. void() snake_dead3     =[      $dead4,        snake_dead4    ] {};
  116. void() snake_dead4     =[      $dead5,        snake_dead5    ] {self.ammo_nails = 15;DropBackpack();};
  117. void() snake_dead5     =[      $dead6,        snake_dead6    ] {};
  118. void() snake_dead6     =[      $dead7,        snake_dead6    ] {};
  119.  
  120. void() snake_pain =
  121. {
  122.     if (self.pain_finished > time)
  123.                 return;
  124.  
  125.                 sound (self, CHAN_VOICE, "ogre/ogpain1.wav", 1, ATTN_NORM);
  126. self.velocity_x = -50 - 50 * random();
  127. self.velocity_y = 0;
  128. self.velocity_z = 5 + 2 * random();
  129. self.flags = self.flags - (self.flags & FL_ONGROUND);
  130.     self.pain_finished = time + 3;
  131.     if (random() > 0.5)
  132.         snake_pain1 ();
  133.     else
  134.         snake_bpain1 ();
  135. };
  136.  
  137. void() snake_die =
  138. {
  139. // check for gib
  140.     if (self.health < -25)
  141.     {
  142.         sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM);
  143.         ThrowHead ("progs/gib3.mdl", self.health);
  144.         ThrowGib ("progs/gib1.mdl", self.health);
  145.         ThrowGib ("progs/gib2.mdl", self.health);
  146.         ThrowGib ("progs/uzi.mdl", self.health);
  147.         ThrowGib ("progs/uzi.mdl", self.health);
  148.         ThrowGib ("progs/gib2.mdl", self.health);
  149.         return;
  150.     }
  151.  
  152.     sound (self, CHAN_VOICE, "wizard/wdeath.wav", 1, ATTN_NORM);
  153. self.movetype = MOVETYPE_BOUNCE;
  154. self.velocity_x = -50 + 100*random();
  155. self.velocity_y = -50 + 100*random();
  156. self.velocity_z = 2 + 2*random();
  157. self.avelocity_x = -20 + 40*random();
  158. self.avelocity_y = -200 + 400*random();
  159. self.avelocity_z = 0;
  160. self.flags = self.flags - (self.flags & FL_ONGROUND);
  161.     self.solid = SOLID_NOT;
  162.     // insert death sounds here
  163.     if (random() > 0.5)
  164.         snake_death1 ();
  165.     else
  166.         snake_dead1 ();
  167. };
  168.  
  169. /*
  170. ================
  171. SnakeMissile
  172. ================
  173. */
  174.  
  175. void(float offset) SnakeMissile =
  176.     local   vector  offang; 
  177.     local   vector  org, vec; 
  178.         self.effects = self.effects | EF_MUZZLEFLASH;
  179.     offang = vectoangles (self.enemy.origin - self.origin);
  180.     offang_y = offang_y + offset * 6;
  181.     
  182.     makevectors (offang);
  183.  
  184.     org = self.origin - 30*normalize(self.velocity);
  185.  
  186. // set missile speed
  187.     vec = normalize (v_forward);
  188.     vec_z = 0 - vec_z + (random() - 0.5)*0.1;
  189.     
  190.     launch_spike (org, vec);
  191.     newmis.classname = "LaunchNails";
  192.     setmodel (newmis, "progs/spike.mdl");
  193.     setsize (newmis, VEC_ORIGIN, VEC_ORIGIN);        
  194.     newmis.velocity = vec*1000;
  195.     sound (self, CHAN_WEAPON, "weapons/sgun1.wav", 1, ATTN_NORM);
  196.  
  197. };
  198.  
  199. //=================================================================
  200.  
  201. /*QUAKED monster_snakeman (1 0 0) (-32 -32 -24) (50 50 50) Ambush
  202. */
  203. void() monster_snakeman =
  204. {
  205.     if (deathmatch)
  206.     {
  207.         remove(self);
  208.         return;
  209.     }
  210.     precache_model2 ("progs/snakeman.mdl");
  211.     precache_model2 ("progs/k_spike.mdl");
  212.     precache_model2 ("progs/uzi.mdl");
  213.  
  214.     precache_sound2 ("wizard/wattack.wav");
  215.     precache_sound2 ("wizard/widle2.wav");
  216.     precache_sound2 ("wizard/wdeath.wav");
  217.     precache_sound2 ("wizard/widle1.wav");
  218.     precache_sound2 ("ogre/ogpain1.wav");
  219.     precache_sound2 ("wizard/wdeath.wav");
  220.     
  221.     self.solid = SOLID_SLIDEBOX;
  222.     self.movetype = MOVETYPE_STEP;
  223.     
  224.     setmodel (self, "progs/snakeman.mdl");
  225.     setsize (self, VEC_HULL2_MIN, VEC_HULL2_MAX); 
  226.     self.health = 150;
  227.  
  228.     self.th_stand = snake_stand;
  229.     self.th_walk = snake_walk1;
  230.     self.th_run = snake_run1;
  231.     self.th_die = snake_die;
  232.     self.th_pain = snake_pain;
  233.     self.th_missile = snake_attack1;
  234.  
  235.     self.think = walkmonster_start;
  236.     self.nextthink = time + 0.1 + random ()*0.1;    
  237. };
  238.  
  239.  
  240. // setsize (self, '-16 -16 -24', '16 16 40');  
  241.