mummy.qc 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527
  1. /* Copyright (C) 1996-2022 id Software LLC
  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. mummy
  18. ==============================================================================
  19. */
  20. $cd /qwork/xpack/models/mummy
  21. $origin 0 0 24
  22. $base base
  23. $skin skin
  24. $frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8
  25. $frame stand9 stand10 stand11 stand12 stand13 stand14 stand15
  26. $frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 walk10 walk11
  27. $frame walk12 walk13 walk14 walk15 walk16 walk17 walk18 walk19
  28. $frame run1 run2 run3 run4 run5 run6 run7 run8 run9 run10 run11 run12
  29. $frame run13 run14 run15 run16 run17 run18
  30. $frame atta1 atta2 atta3 atta4 atta5 atta6 atta7 atta8 atta9 atta10 atta11
  31. $frame atta12 atta13
  32. $frame attb1 attb2 attb3 attb4 attb5 attb6 attb7 attb8 attb9 attb10 attb11
  33. $frame attb12 attb13 attb14
  34. $frame attc1 attc2 attc3 attc4 attc5 attc6 attc7 attc8 attc9 attc10 attc11
  35. $frame attc12
  36. $frame paina1 paina2 paina3 paina4 paina5 paina6 paina7 paina8 paina9 paina10
  37. $frame paina11 paina12
  38. $frame painb1 painb2 painb3 painb4 painb5 painb6 painb7 painb8 painb9 painb10
  39. $frame painb11 painb12 painb13 painb14 painb15 painb16 painb17 painb18 painb19
  40. $frame painb20 painb21 painb22 painb23 painb24 painb25 painb26 painb27 painb28
  41. $frame painc1 painc2 painc3 painc4 painc5 painc6 painc7 painc8 painc9 painc10
  42. $frame painc11 painc12 painc13 painc14 painc15 painc16 painc17 painc18
  43. $frame paind1 paind2 paind3 paind4 paind5 paind6 paind7 paind8 paind9 paind10
  44. $frame paind11 paind12 paind13
  45. $frame paine1 paine2 paine3 paine4 paine5 paine6 paine7 paine8 paine9 paine10
  46. $frame paine11 paine12 paine13 paine14 paine15 paine16 paine17 paine18 paine19
  47. $frame paine20 paine21 paine22 paine23 paine24 paine25 paine26 paine27 paine28
  48. $frame paine29 paine30
  49. //=============================================================================
  50. .float inpain;
  51. void() mummy_stand1 =[ $stand1, mummy_stand2 ] {ai_stand();};
  52. void() mummy_stand2 =[ $stand2, mummy_stand3 ] {ai_stand();};
  53. void() mummy_stand3 =[ $stand3, mummy_stand4 ] {ai_stand();};
  54. void() mummy_stand4 =[ $stand4, mummy_stand5 ] {ai_stand();};
  55. void() mummy_stand5 =[ $stand5, mummy_stand6 ] {ai_stand();};
  56. void() mummy_stand6 =[ $stand6, mummy_stand7 ] {ai_stand();};
  57. void() mummy_stand7 =[ $stand7, mummy_stand8 ] {ai_stand();};
  58. void() mummy_stand8 =[ $stand8, mummy_stand9 ] {ai_stand();};
  59. void() mummy_stand9 =[ $stand9, mummy_stand10 ] {ai_stand();};
  60. void() mummy_stand10 =[ $stand10, mummy_stand11 ] {ai_stand();};
  61. void() mummy_stand11 =[ $stand11, mummy_stand12 ] {ai_stand();};
  62. void() mummy_stand12 =[ $stand12, mummy_stand13 ] {ai_stand();};
  63. void() mummy_stand13 =[ $stand13, mummy_stand14 ] {ai_stand();};
  64. void() mummy_stand14 =[ $stand14, mummy_stand15 ] {ai_stand();};
  65. void() mummy_stand15 =[ $stand15, mummy_stand1 ] {ai_stand();};
  66. void() mummy_walk1 =[ $walk1, mummy_walk2 ] {ai_walk(0);};
  67. void() mummy_walk2 =[ $walk2, mummy_walk3 ] {ai_walk(3);};
  68. void() mummy_walk3 =[ $walk3, mummy_walk4 ] {ai_walk(5);};
  69. void() mummy_walk4 =[ $walk4, mummy_walk5 ] {ai_walk(4);};
  70. void() mummy_walk5 =[ $walk5, mummy_walk6 ] {ai_walk(2);};
  71. void() mummy_walk6 =[ $walk6, mummy_walk7 ] {ai_walk(0);};
  72. void() mummy_walk7 =[ $walk7, mummy_walk8 ] {ai_walk(0);};
  73. void() mummy_walk8 =[ $walk8, mummy_walk9 ] {ai_walk(0);};
  74. void() mummy_walk9 =[ $walk9, mummy_walk10 ] {ai_walk(0);};
  75. void() mummy_walk10 =[ $walk10, mummy_walk11 ] {ai_walk(0);};
  76. void() mummy_walk11 =[ $walk11, mummy_walk12 ] {ai_walk(3);};
  77. void() mummy_walk12 =[ $walk12, mummy_walk13 ] {ai_walk(4);};
  78. void() mummy_walk13 =[ $walk13, mummy_walk14 ] {ai_walk(2);};
  79. void() mummy_walk14 =[ $walk14, mummy_walk15 ] {ai_walk(0);};
  80. void() mummy_walk15 =[ $walk15, mummy_walk16 ] {ai_walk(0);};
  81. void() mummy_walk16 =[ $walk16, mummy_walk17 ] {ai_walk(0);};
  82. void() mummy_walk17 =[ $walk17, mummy_walk18 ] {ai_walk(0);};
  83. void() mummy_walk18 =[ $walk18, mummy_walk19 ] {ai_walk(0);};
  84. void() mummy_walk19 =[ $walk19, mummy_walk1 ]
  85. {
  86. ai_walk(0);
  87. if (random() < 0.2)
  88. sound (self, CHAN_VOICE, "zombie/z_idle.wav", 1, ATTN_IDLE);
  89. };
  90. void() mummy_run1 =[ $run1, mummy_run2 ] {ai_run(2);self.inpain = 0;};
  91. void() mummy_run2 =[ $run2, mummy_run3 ] {ai_run(2);};
  92. void() mummy_run3 =[ $run3, mummy_run4 ] {ai_run(0);};
  93. void() mummy_run4 =[ $run4, mummy_run5 ] {ai_run(2);};
  94. void() mummy_run5 =[ $run5, mummy_run6 ] {ai_run(4);};
  95. void() mummy_run6 =[ $run6, mummy_run7 ] {ai_run(6);};
  96. void() mummy_run7 =[ $run7, mummy_run8 ] {ai_run(8);};
  97. void() mummy_run8 =[ $run8, mummy_run9 ] {ai_run(8);};
  98. void() mummy_run9 =[ $run9, mummy_run10 ] {ai_run(4);};
  99. void() mummy_run10 =[ $run10, mummy_run11 ] {ai_run(0);};
  100. void() mummy_run11 =[ $run11, mummy_run12 ] {ai_run(0);};
  101. void() mummy_run12 =[ $run12, mummy_run13 ] {ai_run(0);};
  102. void() mummy_run13 =[ $run13, mummy_run14 ] {ai_run(4);};
  103. void() mummy_run14 =[ $run14, mummy_run15 ] {ai_run(8);};
  104. void() mummy_run15 =[ $run15, mummy_run16 ] {ai_run(12);};
  105. void() mummy_run16 =[ $run16, mummy_run17 ] {ai_run(14);};
  106. void() mummy_run17 =[ $run17, mummy_run18 ] {ai_run(6);};
  107. void() mummy_run18 =[ $run18, mummy_run1 ]
  108. {
  109. ai_run(16);
  110. if (random() < 0.2)
  111. sound (self, CHAN_VOICE, "zombie/z_idle.wav", 1, ATTN_IDLE);
  112. if (random() > 0.8)
  113. sound (self, CHAN_VOICE, "zombie/z_idle1.wav", 1, ATTN_IDLE);
  114. };
  115. /*
  116. =============================================================================
  117. ATTACKS
  118. =============================================================================
  119. */
  120. void() mummyGrenadeTouch =
  121. {
  122. local float mummyDamage;
  123. if (other == self.owner)
  124. return; // don't explode on owner
  125. if (other.takedamage)
  126. {
  127. mummyDamage = 15 + random() * 15;
  128. T_Damage (other, self, self.owner, mummyDamage );
  129. sound (self, CHAN_WEAPON, "zombie/z_hit.wav", 1, ATTN_NORM);
  130. remove (self);
  131. return;
  132. }
  133. sound (self, CHAN_WEAPON, "zombie/z_miss.wav", 1, ATTN_NORM); // bounce sound
  134. self.velocity = '0 0 0';
  135. self.avelocity = '0 0 0';
  136. self.touch = SUB_Remove;
  137. };
  138. /*
  139. ================
  140. mummyFireGrenade
  141. ================
  142. */
  143. void(vector st) mummyFireGrenade =
  144. {
  145. local entity missile, mpuff;
  146. local vector org;
  147. sound (self, CHAN_WEAPON, "zombie/z_shot1.wav", 1, ATTN_NORM);
  148. missile = spawn ();
  149. missile.owner = self;
  150. missile.movetype = MOVETYPE_BOUNCE;
  151. missile.solid = SOLID_BBOX;
  152. // calc org
  153. org = self.origin + st_x * v_forward + st_y * v_right + (st_z - 24) * v_up;
  154. // set missile speed
  155. makevectors (self.angles);
  156. missile.velocity = normalize(self.enemy.origin - org);
  157. missile.velocity = missile.velocity * 600;
  158. missile.velocity_z = 200;
  159. missile.avelocity = '3000 1000 2000';
  160. missile.touch = mummyGrenadeTouch;
  161. // set missile duration
  162. missile.nextthink = time + 2.5;
  163. missile.think = SUB_Remove;
  164. setmodel (missile, "progs/zom_gib.mdl");
  165. setsize (missile, '0 0 0', '0 0 0');
  166. setorigin (missile, org);
  167. };
  168. void() mummy_atta1 =[ $atta1, mummy_atta2 ] {ai_face();};
  169. void() mummy_atta2 =[ $atta2, mummy_atta3 ] {ai_face();};
  170. void() mummy_atta3 =[ $atta3, mummy_atta4 ] {ai_face();};
  171. void() mummy_atta4 =[ $atta4, mummy_atta5 ] {ai_face();};
  172. void() mummy_atta5 =[ $atta5, mummy_atta6 ] {ai_face();};
  173. void() mummy_atta6 =[ $atta6, mummy_atta7 ] {ai_face();};
  174. void() mummy_atta7 =[ $atta7, mummy_atta8 ] {ai_face();};
  175. void() mummy_atta8 =[ $atta8, mummy_atta9 ] {ai_face();};
  176. void() mummy_atta9 =[ $atta9, mummy_atta10 ] {ai_face();};
  177. void() mummy_atta10 =[ $atta10, mummy_atta11 ] {ai_face();};
  178. void() mummy_atta11 =[ $atta11, mummy_atta12 ] {ai_face();};
  179. void() mummy_atta12 =[ $atta12, mummy_atta13 ] {ai_face();};
  180. void() mummy_atta13 =[ $atta13, mummy_run1 ]
  181. { ai_face(); mummyFireGrenade('-10 -22 30'); };
  182. void() mummy_attb1 =[ $attb1, mummy_attb2 ] {ai_face();};
  183. void() mummy_attb2 =[ $attb2, mummy_attb3 ] {ai_face();};
  184. void() mummy_attb3 =[ $attb3, mummy_attb4 ] {ai_face();};
  185. void() mummy_attb4 =[ $attb4, mummy_attb5 ] {ai_face();};
  186. void() mummy_attb5 =[ $attb5, mummy_attb6 ] {ai_face();};
  187. void() mummy_attb6 =[ $attb6, mummy_attb7 ] {ai_face();};
  188. void() mummy_attb7 =[ $attb7, mummy_attb8 ] {ai_face();};
  189. void() mummy_attb8 =[ $attb8, mummy_attb9 ] {ai_face();};
  190. void() mummy_attb9 =[ $attb9, mummy_attb10 ] {ai_face();};
  191. void() mummy_attb10 =[ $attb10, mummy_attb11 ] {ai_face();};
  192. void() mummy_attb11 =[ $attb11, mummy_attb12 ] {ai_face();};
  193. void() mummy_attb12 =[ $attb12, mummy_attb13 ] {ai_face();};
  194. void() mummy_attb13 =[ $attb13, mummy_attb14 ] {ai_face();};
  195. void() mummy_attb14 =[ $attb13, mummy_run1 ]
  196. { ai_face(); mummyFireGrenade('-10 -24 29'); };
  197. void() mummy_attc1 =[ $attc1, mummy_attc2 ] {ai_face();};
  198. void() mummy_attc2 =[ $attc2, mummy_attc3 ] {ai_face();};
  199. void() mummy_attc3 =[ $attc3, mummy_attc4 ] {ai_face();};
  200. void() mummy_attc4 =[ $attc4, mummy_attc5 ] {ai_face();};
  201. void() mummy_attc5 =[ $attc5, mummy_attc6 ] {ai_face();};
  202. void() mummy_attc6 =[ $attc6, mummy_attc7 ] {ai_face();};
  203. void() mummy_attc7 =[ $attc7, mummy_attc8 ] {ai_face();};
  204. void() mummy_attc8 =[ $attc8, mummy_attc9 ] {ai_face();};
  205. void() mummy_attc9 =[ $attc9, mummy_attc10 ] {ai_face();};
  206. void() mummy_attc10 =[ $attc10, mummy_attc11 ] {ai_face();};
  207. void() mummy_attc11 =[ $attc11, mummy_attc12 ] {ai_face();};
  208. void() mummy_attc12 =[ $attc12, mummy_run1 ]
  209. { ai_face(); mummyFireGrenade('-12 -19 29'); };
  210. void() mummy_missile =
  211. {
  212. local float r;
  213. r = random();
  214. if (r < 0.3)
  215. mummy_atta1 ();
  216. else if (r < 0.6)
  217. mummy_attb1 ();
  218. else
  219. mummy_attc1 ();
  220. };
  221. /*
  222. =============================================================================
  223. PAIN
  224. =============================================================================
  225. */
  226. void() mummy_paina1 =[ $paina1, mummy_paina2 ]
  227. {sound (self, CHAN_VOICE, "zombie/z_pain.wav", 1, ATTN_NORM);};
  228. void() mummy_paina2 =[ $paina2, mummy_paina3 ] {ai_painforward(3);};
  229. void() mummy_paina3 =[ $paina3, mummy_paina4 ] {ai_painforward(1);};
  230. void() mummy_paina4 =[ $paina4, mummy_paina5 ] {ai_pain(1);};
  231. void() mummy_paina5 =[ $paina5, mummy_paina6 ] {ai_pain(3);};
  232. void() mummy_paina6 =[ $paina6, mummy_paina7 ] {ai_pain(1);};
  233. void() mummy_paina7 =[ $paina7, mummy_paina8 ] {};
  234. void() mummy_paina8 =[ $paina8, mummy_paina9 ] {};
  235. void() mummy_paina9 =[ $paina9, mummy_paina10 ] {};
  236. void() mummy_paina10 =[ $paina10, mummy_paina11 ] {};
  237. void() mummy_paina11 =[ $paina11, mummy_paina12 ] {};
  238. void() mummy_paina12 =[ $paina12, mummy_run1 ] {};
  239. void() mummy_painb1 =[ $painb1, mummy_painb2 ]
  240. {sound (self, CHAN_VOICE, "zombie/z_pain1.wav", 1, ATTN_NORM);};
  241. void() mummy_painb2 =[ $painb2, mummy_painb3 ] {ai_pain(2);};
  242. void() mummy_painb3 =[ $painb3, mummy_painb4 ] {ai_pain(8);};
  243. void() mummy_painb4 =[ $painb4, mummy_painb5 ] {ai_pain(6);};
  244. void() mummy_painb5 =[ $painb5, mummy_painb6 ] {ai_pain(2);};
  245. void() mummy_painb6 =[ $painb6, mummy_painb7 ] {};
  246. void() mummy_painb7 =[ $painb7, mummy_painb8 ] {};
  247. void() mummy_painb8 =[ $painb8, mummy_painb9 ] {};
  248. void() mummy_painb9 =[ $painb9, mummy_painb10 ]
  249. {sound (self, CHAN_BODY, "zombie/z_fall.wav", 1, ATTN_NORM);};
  250. void() mummy_painb10 =[ $painb10, mummy_painb11 ] {};
  251. void() mummy_painb11 =[ $painb11, mummy_painb12 ] {};
  252. void() mummy_painb12 =[ $painb12, mummy_painb13 ] {};
  253. void() mummy_painb13 =[ $painb13, mummy_painb14 ] {};
  254. void() mummy_painb14 =[ $painb14, mummy_painb15 ] {};
  255. void() mummy_painb15 =[ $painb15, mummy_painb16 ] {};
  256. void() mummy_painb16 =[ $painb16, mummy_painb17 ] {};
  257. void() mummy_painb17 =[ $painb17, mummy_painb18 ] {};
  258. void() mummy_painb18 =[ $painb18, mummy_painb19 ] {};
  259. void() mummy_painb19 =[ $painb19, mummy_painb20 ] {};
  260. void() mummy_painb20 =[ $painb20, mummy_painb21 ] {};
  261. void() mummy_painb21 =[ $painb21, mummy_painb22 ] {};
  262. void() mummy_painb22 =[ $painb22, mummy_painb23 ] {};
  263. void() mummy_painb23 =[ $painb23, mummy_painb24 ] {};
  264. void() mummy_painb24 =[ $painb24, mummy_painb25 ] {};
  265. void() mummy_painb25 =[ $painb25, mummy_painb26 ] {ai_painforward(1);};
  266. void() mummy_painb26 =[ $painb26, mummy_painb27 ] {};
  267. void() mummy_painb27 =[ $painb27, mummy_painb28 ] {};
  268. void() mummy_painb28 =[ $painb28, mummy_run1 ] {};
  269. void() mummy_painc1 =[ $painc1, mummy_painc2 ]
  270. {sound (self, CHAN_VOICE, "zombie/z_pain1.wav", 1, ATTN_NORM);};
  271. void() mummy_painc2 =[ $painc2, mummy_painc3 ] {};
  272. void() mummy_painc3 =[ $painc3, mummy_painc4 ] {ai_pain(3);};
  273. void() mummy_painc4 =[ $painc4, mummy_painc5 ] {ai_pain(1);};
  274. void() mummy_painc5 =[ $painc5, mummy_painc6 ] {};
  275. void() mummy_painc6 =[ $painc6, mummy_painc7 ] {};
  276. void() mummy_painc7 =[ $painc7, mummy_painc8 ] {};
  277. void() mummy_painc8 =[ $painc8, mummy_painc9 ] {};
  278. void() mummy_painc9 =[ $painc9, mummy_painc10 ] {};
  279. void() mummy_painc10 =[ $painc10, mummy_painc11 ] {};
  280. void() mummy_painc11 =[ $painc11, mummy_painc12 ] {ai_painforward(1);};
  281. void() mummy_painc12 =[ $painc12, mummy_painc13 ] {ai_painforward(1);};
  282. void() mummy_painc13 =[ $painc13, mummy_painc14 ] {};
  283. void() mummy_painc14 =[ $painc14, mummy_painc15 ] {};
  284. void() mummy_painc15 =[ $painc15, mummy_painc16 ] {};
  285. void() mummy_painc16 =[ $painc16, mummy_painc17 ] {};
  286. void() mummy_painc17 =[ $painc17, mummy_painc18 ] {};
  287. void() mummy_painc18 =[ $painc18, mummy_run1 ] {};
  288. void() mummy_paind1 =[ $paind1, mummy_paind2 ]
  289. {sound (self, CHAN_VOICE, "zombie/z_pain.wav", 1, ATTN_NORM);};
  290. void() mummy_paind2 =[ $paind2, mummy_paind3 ] {};
  291. void() mummy_paind3 =[ $paind3, mummy_paind4 ] {};
  292. void() mummy_paind4 =[ $paind4, mummy_paind5 ] {};
  293. void() mummy_paind5 =[ $paind5, mummy_paind6 ] {};
  294. void() mummy_paind6 =[ $paind6, mummy_paind7 ] {};
  295. void() mummy_paind7 =[ $paind7, mummy_paind8 ] {};
  296. void() mummy_paind8 =[ $paind8, mummy_paind9 ] {};
  297. void() mummy_paind9 =[ $paind9, mummy_paind10 ] {ai_pain(1);};
  298. void() mummy_paind10 =[ $paind10, mummy_paind11 ] {};
  299. void() mummy_paind11 =[ $paind11, mummy_paind12 ] {};
  300. void() mummy_paind12 =[ $paind12, mummy_paind13 ] {};
  301. void() mummy_paind13 =[ $paind13, mummy_run1 ] {};
  302. void() mummy_paine1 =[ $paine1, mummy_paine2 ]
  303. { sound (self, CHAN_VOICE, "zombie/z_pain.wav", 1, ATTN_NORM); };
  304. void() mummy_paine2 =[ $paine2, mummy_paine3 ] {ai_pain(8);};
  305. void() mummy_paine3 =[ $paine3, mummy_paine4 ] {ai_pain(5);};
  306. void() mummy_paine4 =[ $paine4, mummy_paine5 ] {ai_pain(3);};
  307. void() mummy_paine5 =[ $paine5, mummy_paine6 ] {ai_pain(1);};
  308. void() mummy_paine6 =[ $paine6, mummy_paine7 ] {ai_pain(2);};
  309. void() mummy_paine7 =[ $paine7, mummy_paine8 ] {ai_pain(1);};
  310. void() mummy_paine8 =[ $paine8, mummy_paine9 ] {ai_pain(1);};
  311. void() mummy_paine9 =[ $paine9, mummy_paine10 ] {ai_pain(2);};
  312. void() mummy_paine10 =[ $paine10, mummy_paine11 ]
  313. {
  314. sound (self, CHAN_BODY, "zombie/z_fall.wav", 1, ATTN_NORM);
  315. self.solid = SOLID_NOT;
  316. };
  317. void() mummy_paine11 =[ $paine11, mummy_paine12 ]
  318. { self.nextthink = self.nextthink + 5; };
  319. void() mummy_paine12 =[ $paine12, mummy_paine13 ]
  320. {
  321. // see if ok to stand up
  322. sound (self, CHAN_VOICE, "zombie/z_idle.wav", 1, ATTN_IDLE);
  323. setsize (self, VEC_HULL_MIN, VEC_HULL_MAX);
  324. self.solid = SOLID_SLIDEBOX;
  325. if (!walkmove (0, 0))
  326. {
  327. self.think = mummy_paine11;
  328. self.solid = SOLID_NOT;
  329. return;
  330. }
  331. };
  332. void() mummy_paine13 =[ $paine13, mummy_paine14 ] {};
  333. void() mummy_paine14 =[ $paine14, mummy_paine15 ] {};
  334. void() mummy_paine15 =[ $paine15, mummy_paine16 ] {};
  335. void() mummy_paine16 =[ $paine16, mummy_paine17 ] {};
  336. void() mummy_paine17 =[ $paine17, mummy_paine18 ] {};
  337. void() mummy_paine18 =[ $paine18, mummy_paine19 ] {};
  338. void() mummy_paine19 =[ $paine19, mummy_paine20 ] {};
  339. void() mummy_paine20 =[ $paine20, mummy_paine21 ] {};
  340. void() mummy_paine21 =[ $paine21, mummy_paine22 ] {};
  341. void() mummy_paine22 =[ $paine22, mummy_paine23 ] {};
  342. void() mummy_paine23 =[ $paine23, mummy_paine24 ] {};
  343. void() mummy_paine24 =[ $paine24, mummy_paine25 ] {};
  344. void() mummy_paine25 =[ $paine25, mummy_paine26 ] {ai_painforward(5);};
  345. void() mummy_paine26 =[ $paine26, mummy_paine27 ] {ai_painforward(3);};
  346. void() mummy_paine27 =[ $paine27, mummy_paine28 ] {ai_painforward(1);};
  347. void() mummy_paine28 =[ $paine28, mummy_paine29 ] {ai_pain(1);};
  348. void() mummy_paine29 =[ $paine29, mummy_paine30 ] {};
  349. void() mummy_paine30 =[ $paine30, mummy_run1 ]
  350. { };
  351. void() mummy_die =
  352. {
  353. self.health = -35;
  354. sound (self, CHAN_VOICE, "zombie/z_gib.wav", 1, ATTN_NORM);
  355. ThrowHead ("progs/h_zombie.mdl", self.health);
  356. ThrowGib ("progs/gib1.mdl", self.health);
  357. ThrowGib ("progs/gib2.mdl", self.health);
  358. ThrowGib ("progs/gib3.mdl", self.health);
  359. };
  360. /*
  361. =================
  362. mummy_pain
  363. =================
  364. */
  365. void(entity attacker, float take) mummy_pain =
  366. {
  367. local float r;
  368. if ( self.pain_finished > time )
  369. return;
  370. r = random();
  371. if (r > 0.24)
  372. return;
  373. self.pain_finished = time + 2.5;
  374. if (r < 0.06)
  375. mummy_paina1 ();
  376. else if (r < 0.12)
  377. mummy_painb1 ();
  378. else if (r < 0.18)
  379. mummy_painc1 ();
  380. else
  381. mummy_paind1 ();
  382. };
  383. void() mummy_sleep = [ $paine11, mummy_sleep ] { ai_stand(); };
  384. void() mummy_wake =
  385. {
  386. self.th_stand = mummy_stand1;
  387. self.th_walk = mummy_walk1;
  388. self.th_pain = mummy_pain;
  389. self.th_run = mummy_run1;
  390. self.th_missile = mummy_missile;
  391. mummy_paine12();
  392. };
  393. //============================================================================
  394. float MUMMY_STRONG = 4;
  395. /*QUAKED monster_mummy (1 0 0) (-16 -16 -24) (16 16 32) Ambush Lying Stronger
  396. Lying - mummy will start lying down, and stand when player spotted.
  397. Stronger - mummy starts with 1000 hitpoints, rather than 500.
  398. */
  399. void() monster_mummy =
  400. {
  401. if (deathmatch)
  402. {
  403. remove(self);
  404. return;
  405. }
  406. precache_model ("progs/mummy.mdl");
  407. precache_model ("progs/h_zombie.mdl");
  408. precache_model ("progs/zom_gib.mdl");
  409. precache_sound ("zombie/z_idle.wav");
  410. precache_sound ("zombie/z_idle1.wav");
  411. precache_sound ("zombie/z_shot1.wav");
  412. precache_sound ("zombie/z_gib.wav");
  413. precache_sound ("zombie/z_pain.wav");
  414. precache_sound ("zombie/z_pain1.wav");
  415. precache_sound ("zombie/z_fall.wav");
  416. precache_sound ("zombie/z_miss.wav");
  417. precache_sound ("zombie/z_hit.wav");
  418. precache_sound ("zombie/idle_w2.wav");
  419. self.solid = SOLID_SLIDEBOX;
  420. self.movetype = MOVETYPE_STEP;
  421. setmodel (self, "progs/mummy.mdl");
  422. setsize (self, VEC_HULL_MIN, VEC_HULL_MAX);
  423. if (self.spawnflags & MUMMY_STRONG)
  424. self.health = 1000;
  425. else
  426. self.health = 500;
  427. self.th_stand = mummy_stand1;
  428. self.th_walk = mummy_walk1;
  429. self.th_run = mummy_run1;
  430. self.th_pain = mummy_pain;
  431. self.th_die = mummy_die;
  432. self.th_missile = mummy_missile;
  433. if (self.spawnflags & SPAWN_LYING)
  434. {
  435. setsize (self, '-16 -16 -24', '16 16 -16');
  436. self.solid = SOLID_NOT;
  437. self.th_stand = mummy_sleep;
  438. self.th_run = mummy_wake;
  439. self.th_walk = mummy_wake;
  440. self.th_pain = mummy_wake;
  441. self.th_missile = mummy_wake;
  442. walkmonster_start();
  443. }
  444. else
  445. walkmonster_start();
  446. };