tarbaby.qc 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. /* Copyright (C) 1996-1997 Id Software, Inc.
  2. This program is free software; you can redistribute it and/or modify
  3. it under the terms of the GNU General Public License as published by
  4. the Free Software Foundation; either version 2 of the License, or
  5. (at your option) any later version.
  6. This program is distributed in the hope that it will be useful,
  7. but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  9. GNU General Public License for more details.
  10. You should have received a copy of the GNU General Public License
  11. along with this program; if not, write to the Free Software
  12. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  13. See file, 'COPYING', for details.
  14. */
  15. /*
  16. ==============================================================================
  17. BLOB
  18. ==============================================================================
  19. */
  20. $cd /raid/quake/id1/models/tarbaby
  21. $origin 0 0 24
  22. $base base
  23. $skin skin
  24. $frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 walk10
  25. $frame walk11 walk12 walk13 walk14 walk15 walk16 walk17 walk18 walk19
  26. $frame walk20 walk21 walk22 walk23 walk24 walk25
  27. $frame run1 run2 run3 run4 run5 run6 run7 run8 run9 run10 run11 run12 run13
  28. $frame run14 run15 run16 run17 run18 run19 run20 run21 run22 run23
  29. $frame run24 run25
  30. $frame jump1 jump2 jump3 jump4 jump5 jump6
  31. $frame fly1 fly2 fly3 fly4
  32. $frame exp
  33. void() tbaby_stand1 =[ $walk1, tbaby_stand1 ] {ai_stand();};
  34. void() tbaby_hang1 =[ $walk1, tbaby_hang1 ] {ai_stand();};
  35. void() tbaby_walk1 =[ $walk1, tbaby_walk2 ] {ai_turn();};
  36. void() tbaby_walk2 =[ $walk2, tbaby_walk3 ] {ai_turn();};
  37. void() tbaby_walk3 =[ $walk3, tbaby_walk4 ] {ai_turn();};
  38. void() tbaby_walk4 =[ $walk4, tbaby_walk5 ] {ai_turn();};
  39. void() tbaby_walk5 =[ $walk5, tbaby_walk6 ] {ai_turn();};
  40. void() tbaby_walk6 =[ $walk6, tbaby_walk7 ] {ai_turn();};
  41. void() tbaby_walk7 =[ $walk7, tbaby_walk8 ] {ai_turn();};
  42. void() tbaby_walk8 =[ $walk8, tbaby_walk9 ] {ai_turn();};
  43. void() tbaby_walk9 =[ $walk9, tbaby_walk10 ] {ai_turn();};
  44. void() tbaby_walk10 =[ $walk10, tbaby_walk11 ] {ai_turn();};
  45. void() tbaby_walk11 =[ $walk11, tbaby_walk12 ] {ai_walk(2);};
  46. void() tbaby_walk12 =[ $walk12, tbaby_walk13 ] {ai_walk(2);};
  47. void() tbaby_walk13 =[ $walk13, tbaby_walk14 ] {ai_walk(2);};
  48. void() tbaby_walk14 =[ $walk14, tbaby_walk15 ] {ai_walk(2);};
  49. void() tbaby_walk15 =[ $walk15, tbaby_walk16 ] {ai_walk(2);};
  50. void() tbaby_walk16 =[ $walk16, tbaby_walk17 ] {ai_walk(2);};
  51. void() tbaby_walk17 =[ $walk17, tbaby_walk18 ] {ai_walk(2);};
  52. void() tbaby_walk18 =[ $walk18, tbaby_walk19 ] {ai_walk(2);};
  53. void() tbaby_walk19 =[ $walk19, tbaby_walk20 ] {ai_walk(2);};
  54. void() tbaby_walk20 =[ $walk20, tbaby_walk21 ] {ai_walk(2);};
  55. void() tbaby_walk21 =[ $walk21, tbaby_walk22 ] {ai_walk(2);};
  56. void() tbaby_walk22 =[ $walk22, tbaby_walk23 ] {ai_walk(2);};
  57. void() tbaby_walk23 =[ $walk23, tbaby_walk24 ] {ai_walk(2);};
  58. void() tbaby_walk24 =[ $walk24, tbaby_walk25 ] {ai_walk(2);};
  59. void() tbaby_walk25 =[ $walk25, tbaby_walk1 ] {ai_walk(2);};
  60. void() tbaby_run1 =[ $run1, tbaby_run2 ] {ai_face();};
  61. void() tbaby_run2 =[ $run2, tbaby_run3 ] {ai_face();};
  62. void() tbaby_run3 =[ $run3, tbaby_run4 ] {ai_face();};
  63. void() tbaby_run4 =[ $run4, tbaby_run5 ] {ai_face();};
  64. void() tbaby_run5 =[ $run5, tbaby_run6 ] {ai_face();};
  65. void() tbaby_run6 =[ $run6, tbaby_run7 ] {ai_face();};
  66. void() tbaby_run7 =[ $run7, tbaby_run8 ] {ai_face();};
  67. void() tbaby_run8 =[ $run8, tbaby_run9 ] {ai_face();};
  68. void() tbaby_run9 =[ $run9, tbaby_run10 ] {ai_face();};
  69. void() tbaby_run10 =[ $run10, tbaby_run11 ] {ai_face();};
  70. void() tbaby_run11 =[ $run11, tbaby_run12 ] {ai_run(2);};
  71. void() tbaby_run12 =[ $run12, tbaby_run13 ] {ai_run(2);};
  72. void() tbaby_run13 =[ $run13, tbaby_run14 ] {ai_run(2);};
  73. void() tbaby_run14 =[ $run14, tbaby_run15 ] {ai_run(2);};
  74. void() tbaby_run15 =[ $run15, tbaby_run16 ] {ai_run(2);};
  75. void() tbaby_run16 =[ $run16, tbaby_run17 ] {ai_run(2);};
  76. void() tbaby_run17 =[ $run17, tbaby_run18 ] {ai_run(2);};
  77. void() tbaby_run18 =[ $run18, tbaby_run19 ] {ai_run(2);};
  78. void() tbaby_run19 =[ $run19, tbaby_run20 ] {ai_run(2);};
  79. void() tbaby_run20 =[ $run20, tbaby_run21 ] {ai_run(2);};
  80. void() tbaby_run21 =[ $run21, tbaby_run22 ] {ai_run(2);};
  81. void() tbaby_run22 =[ $run22, tbaby_run23 ] {ai_run(2);};
  82. void() tbaby_run23 =[ $run23, tbaby_run24 ] {ai_run(2);};
  83. void() tbaby_run24 =[ $run24, tbaby_run25 ] {ai_run(2);};
  84. void() tbaby_run25 =[ $run25, tbaby_run1 ] {ai_run(2);};
  85. //============================================================================
  86. void() tbaby_jump1;
  87. void() Tar_JumpTouch =
  88. {
  89. local float ldmg;
  90. if (other.takedamage && other.classname != self.classname)
  91. {
  92. if ( vlen(self.velocity) > 400 )
  93. {
  94. ldmg = 10 + 10*random();
  95. T_Damage (other, self, self, ldmg);
  96. sound (self, CHAN_WEAPON, "blob/hit1.wav", 1, ATTN_NORM);
  97. }
  98. }
  99. else
  100. sound (self, CHAN_WEAPON, "blob/land1.wav", 1, ATTN_NORM);
  101. if (!checkbottom(self))
  102. {
  103. if (self.flags & FL_ONGROUND)
  104. { // jump randomly to not get hung up
  105. //dprint ("popjump\n");
  106. self.touch = SUB_Null;
  107. self.think = tbaby_run1;
  108. self.movetype = MOVETYPE_STEP;
  109. self.nextthink = time + 0.1;
  110. // self.velocity_x = (random() - 0.5) * 600;
  111. // self.velocity_y = (random() - 0.5) * 600;
  112. // self.velocity_z = 200;
  113. // self.flags = self.flags - FL_ONGROUND;
  114. }
  115. return; // not on ground yet
  116. }
  117. self.touch = SUB_Null;
  118. self.think = tbaby_jump1;
  119. self.nextthink = time + 0.1;
  120. };
  121. void() tbaby_jump5;
  122. void() tbaby_fly1 =[ $fly1, tbaby_fly2 ] {};
  123. void() tbaby_fly2 =[ $fly2, tbaby_fly3 ] {};
  124. void() tbaby_fly3 =[ $fly3, tbaby_fly4 ] {};
  125. void() tbaby_fly4 =[ $fly4, tbaby_fly1 ] {
  126. self.cnt = self.cnt + 1;
  127. if (self.cnt == 4)
  128. {
  129. //dprint ("spawn hop\n");
  130. tbaby_jump5 ();
  131. }
  132. };
  133. void() tbaby_jump1 =[ $jump1, tbaby_jump2 ] {ai_face();};
  134. void() tbaby_jump2 =[ $jump2, tbaby_jump3 ] {ai_face();};
  135. void() tbaby_jump3 =[ $jump3, tbaby_jump4 ] {ai_face();};
  136. void() tbaby_jump4 =[ $jump4, tbaby_jump5 ] {ai_face();};
  137. void() tbaby_jump5 =[ $jump5, tbaby_jump6 ]
  138. {
  139. self.movetype = MOVETYPE_BOUNCE;
  140. self.touch = Tar_JumpTouch;
  141. makevectors (self.angles);
  142. self.origin_z = self.origin_z + 1;
  143. self.velocity = v_forward * 600 + '0 0 200';
  144. self.velocity_z = self.velocity_z + random()*150;
  145. if (self.flags & FL_ONGROUND)
  146. self.flags = self.flags - FL_ONGROUND;
  147. self.cnt = 0;
  148. };
  149. void() tbaby_jump6 =[ $jump6,tbaby_fly1 ] {};
  150. //=============================================================================
  151. void() tbaby_die1 =[ $exp, tbaby_die2 ] {
  152. self.takedamage = DAMAGE_NO;
  153. };
  154. void() tbaby_die2 =[ $exp, tbaby_run1 ]
  155. {
  156. T_RadiusDamage (self, self, 120, world);
  157. sound (self, CHAN_VOICE, "blob/death1.wav", 1, ATTN_NORM);
  158. self.origin = self.origin - 8*normalize(self.velocity);
  159. WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
  160. WriteByte (MSG_BROADCAST, TE_TAREXPLOSION);
  161. WriteCoord (MSG_BROADCAST, self.origin_x);
  162. WriteCoord (MSG_BROADCAST, self.origin_y);
  163. WriteCoord (MSG_BROADCAST, self.origin_z);
  164. BecomeExplosion ();
  165. };
  166. //=============================================================================
  167. /*QUAKED monster_tarbaby (1 0 0) (-16 -16 -24) (16 16 24) Ambush
  168. */
  169. void() monster_tarbaby =
  170. {
  171. if (deathmatch)
  172. {
  173. remove(self);
  174. return;
  175. }
  176. precache_model2 ("progs/tarbaby.mdl");
  177. precache_sound2 ("blob/death1.wav");
  178. precache_sound2 ("blob/hit1.wav");
  179. precache_sound2 ("blob/land1.wav");
  180. precache_sound2 ("blob/sight1.wav");
  181. self.solid = SOLID_SLIDEBOX;
  182. self.movetype = MOVETYPE_STEP;
  183. setmodel (self, "progs/tarbaby.mdl");
  184. setsize (self, '-16 -16 -24', '16 16 40');
  185. self.health = 80;
  186. self.th_stand = tbaby_stand1;
  187. self.th_walk = tbaby_walk1;
  188. self.th_run = tbaby_run1;
  189. self.th_missile = tbaby_jump1;
  190. self.th_melee = tbaby_jump1;
  191. self.th_die = tbaby_die1;
  192. walkmonster_start ();
  193. };