m_mutant.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727
  1. // Copyright (c) ZeniMax Media Inc.
  2. // Licensed under the GNU General Public License 2.0.
  3. /*
  4. ==============================================================================
  5. mutant
  6. ==============================================================================
  7. */
  8. #include "g_local.h"
  9. #include "m_mutant.h"
  10. static int sound_swing;
  11. static int sound_hit;
  12. static int sound_hit2;
  13. static int sound_death;
  14. static int sound_idle;
  15. static int sound_pain1;
  16. static int sound_pain2;
  17. static int sound_sight;
  18. static int sound_search;
  19. static int sound_step1;
  20. static int sound_step2;
  21. static int sound_step3;
  22. static int sound_thud;
  23. //
  24. // SOUNDS
  25. //
  26. void mutant_step (edict_t *self)
  27. {
  28. int n;
  29. n = (rand() + 1) % 3;
  30. if (n == 0)
  31. gi.sound (self, CHAN_VOICE, sound_step1, 1, ATTN_NORM, 0);
  32. else if (n == 1)
  33. gi.sound (self, CHAN_VOICE, sound_step2, 1, ATTN_NORM, 0);
  34. else
  35. gi.sound (self, CHAN_VOICE, sound_step3, 1, ATTN_NORM, 0);
  36. }
  37. void mutant_sight (edict_t *self, edict_t *other)
  38. {
  39. gi.sound (self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0);
  40. }
  41. void mutant_search (edict_t *self)
  42. {
  43. gi.sound (self, CHAN_VOICE, sound_search, 1, ATTN_NORM, 0);
  44. }
  45. void mutant_swing (edict_t *self)
  46. {
  47. gi.sound (self, CHAN_VOICE, sound_swing, 1, ATTN_NORM, 0);
  48. }
  49. //
  50. // STAND
  51. //
  52. mframe_t mutant_frames_stand [] =
  53. {
  54. ai_stand, 0, NULL,
  55. ai_stand, 0, NULL,
  56. ai_stand, 0, NULL,
  57. ai_stand, 0, NULL,
  58. ai_stand, 0, NULL,
  59. ai_stand, 0, NULL,
  60. ai_stand, 0, NULL,
  61. ai_stand, 0, NULL,
  62. ai_stand, 0, NULL,
  63. ai_stand, 0, NULL, // 10
  64. ai_stand, 0, NULL,
  65. ai_stand, 0, NULL,
  66. ai_stand, 0, NULL,
  67. ai_stand, 0, NULL,
  68. ai_stand, 0, NULL,
  69. ai_stand, 0, NULL,
  70. ai_stand, 0, NULL,
  71. ai_stand, 0, NULL,
  72. ai_stand, 0, NULL,
  73. ai_stand, 0, NULL, // 20
  74. ai_stand, 0, NULL,
  75. ai_stand, 0, NULL,
  76. ai_stand, 0, NULL,
  77. ai_stand, 0, NULL,
  78. ai_stand, 0, NULL,
  79. ai_stand, 0, NULL,
  80. ai_stand, 0, NULL,
  81. ai_stand, 0, NULL,
  82. ai_stand, 0, NULL,
  83. ai_stand, 0, NULL, // 30
  84. ai_stand, 0, NULL,
  85. ai_stand, 0, NULL,
  86. ai_stand, 0, NULL,
  87. ai_stand, 0, NULL,
  88. ai_stand, 0, NULL,
  89. ai_stand, 0, NULL,
  90. ai_stand, 0, NULL,
  91. ai_stand, 0, NULL,
  92. ai_stand, 0, NULL,
  93. ai_stand, 0, NULL, // 40
  94. ai_stand, 0, NULL,
  95. ai_stand, 0, NULL,
  96. ai_stand, 0, NULL,
  97. ai_stand, 0, NULL,
  98. ai_stand, 0, NULL,
  99. ai_stand, 0, NULL,
  100. ai_stand, 0, NULL,
  101. ai_stand, 0, NULL,
  102. ai_stand, 0, NULL,
  103. ai_stand, 0, NULL, // 50
  104. ai_stand, 0, NULL
  105. };
  106. mmove_t mutant_move_stand = {FRAME_stand101, FRAME_stand151, mutant_frames_stand, NULL};
  107. void mutant_stand (edict_t *self)
  108. {
  109. self->monsterinfo.currentmove = &mutant_move_stand;
  110. }
  111. //
  112. // IDLE
  113. //
  114. void mutant_idle_loop (edict_t *self)
  115. {
  116. if (random() < 0.75)
  117. self->monsterinfo.nextframe = FRAME_stand155;
  118. }
  119. mframe_t mutant_frames_idle [] =
  120. {
  121. ai_stand, 0, NULL,
  122. ai_stand, 0, NULL,
  123. ai_stand, 0, NULL,
  124. ai_stand, 0, NULL, // scratch loop start
  125. ai_stand, 0, NULL,
  126. ai_stand, 0, NULL,
  127. ai_stand, 0, mutant_idle_loop, // scratch loop end
  128. ai_stand, 0, NULL,
  129. ai_stand, 0, NULL,
  130. ai_stand, 0, NULL,
  131. ai_stand, 0, NULL,
  132. ai_stand, 0, NULL,
  133. ai_stand, 0, NULL
  134. };
  135. mmove_t mutant_move_idle = {FRAME_stand152, FRAME_stand164, mutant_frames_idle, mutant_stand};
  136. void mutant_idle (edict_t *self)
  137. {
  138. self->monsterinfo.currentmove = &mutant_move_idle;
  139. gi.sound (self, CHAN_VOICE, sound_idle, 1, ATTN_IDLE, 0);
  140. }
  141. //
  142. // WALK
  143. //
  144. void mutant_walk (edict_t *self);
  145. mframe_t mutant_frames_walk [] =
  146. {
  147. ai_walk, 3, NULL,
  148. ai_walk, 1, NULL,
  149. ai_walk, 5, NULL,
  150. ai_walk, 10, NULL,
  151. ai_walk, 13, NULL,
  152. ai_walk, 10, NULL,
  153. ai_walk, 0, NULL,
  154. ai_walk, 5, NULL,
  155. ai_walk, 6, NULL,
  156. ai_walk, 16, NULL,
  157. ai_walk, 15, NULL,
  158. ai_walk, 6, NULL
  159. };
  160. mmove_t mutant_move_walk = {FRAME_walk05, FRAME_walk16, mutant_frames_walk, NULL};
  161. void mutant_walk_loop (edict_t *self)
  162. {
  163. self->monsterinfo.currentmove = &mutant_move_walk;
  164. }
  165. mframe_t mutant_frames_start_walk [] =
  166. {
  167. ai_walk, 5, NULL,
  168. ai_walk, 5, NULL,
  169. ai_walk, -2, NULL,
  170. ai_walk, 1, NULL
  171. };
  172. mmove_t mutant_move_start_walk = {FRAME_walk01, FRAME_walk04, mutant_frames_start_walk, mutant_walk_loop};
  173. void mutant_walk (edict_t *self)
  174. {
  175. self->monsterinfo.currentmove = &mutant_move_start_walk;
  176. }
  177. //
  178. // RUN
  179. //
  180. mframe_t mutant_frames_run [] =
  181. {
  182. ai_run, 40, NULL,
  183. ai_run, 40, mutant_step,
  184. ai_run, 24, NULL,
  185. ai_run, 5, mutant_step,
  186. ai_run, 17, NULL,
  187. ai_run, 10, NULL
  188. };
  189. mmove_t mutant_move_run = {FRAME_run03, FRAME_run08, mutant_frames_run, NULL};
  190. void mutant_run (edict_t *self)
  191. {
  192. if (self->monsterinfo.aiflags & AI_STAND_GROUND)
  193. self->monsterinfo.currentmove = &mutant_move_stand;
  194. else
  195. self->monsterinfo.currentmove = &mutant_move_run;
  196. }
  197. //
  198. // MELEE
  199. //
  200. void mutant_hit_left (edict_t *self)
  201. {
  202. vec3_t aim;
  203. VectorSet (aim, MELEE_DISTANCE, self->mins[0], 8);
  204. if (fire_hit (self, aim, (10 + (rand() %5)), 100))
  205. gi.sound (self, CHAN_WEAPON, sound_hit, 1, ATTN_NORM, 0);
  206. else
  207. gi.sound (self, CHAN_WEAPON, sound_swing, 1, ATTN_NORM, 0);
  208. }
  209. void mutant_hit_right (edict_t *self)
  210. {
  211. vec3_t aim;
  212. VectorSet (aim, MELEE_DISTANCE, self->maxs[0], 8);
  213. if (fire_hit (self, aim, (10 + (rand() %5)), 100))
  214. gi.sound (self, CHAN_WEAPON, sound_hit2, 1, ATTN_NORM, 0);
  215. else
  216. gi.sound (self, CHAN_WEAPON, sound_swing, 1, ATTN_NORM, 0);
  217. }
  218. void mutant_check_refire (edict_t *self)
  219. {
  220. if (!self->enemy || !self->enemy->inuse || self->enemy->health <= 0)
  221. return;
  222. if ( ((skill->value == 3) && (random() < 0.5)) || (range(self, self->enemy) == RANGE_MELEE) )
  223. self->monsterinfo.nextframe = FRAME_attack09;
  224. }
  225. mframe_t mutant_frames_attack [] =
  226. {
  227. ai_charge, 0, NULL,
  228. ai_charge, 0, NULL,
  229. ai_charge, 0, mutant_hit_left,
  230. ai_charge, 0, NULL,
  231. ai_charge, 0, NULL,
  232. ai_charge, 0, mutant_hit_right,
  233. ai_charge, 0, mutant_check_refire
  234. };
  235. mmove_t mutant_move_attack = {FRAME_attack09, FRAME_attack15, mutant_frames_attack, mutant_run};
  236. void mutant_melee (edict_t *self)
  237. {
  238. self->monsterinfo.currentmove = &mutant_move_attack;
  239. }
  240. //
  241. // ATTACK
  242. //
  243. void mutant_jump_touch (edict_t *self, edict_t *other, cplane_t *plane, csurface_t *surf)
  244. {
  245. if (self->health <= 0)
  246. {
  247. self->touch = NULL;
  248. return;
  249. }
  250. if (other->takedamage)
  251. {
  252. if (VectorLength(self->velocity) > 400)
  253. {
  254. vec3_t point;
  255. vec3_t normal;
  256. int damage;
  257. VectorCopy (self->velocity, normal);
  258. VectorNormalize(normal);
  259. VectorMA (self->s.origin, self->maxs[0], normal, point);
  260. damage = 40 + 10 * random();
  261. T_Damage (other, self, self, self->velocity, point, normal, damage, damage, 0, MOD_UNKNOWN);
  262. }
  263. }
  264. if (!M_CheckBottom (self))
  265. {
  266. if (self->groundentity)
  267. {
  268. self->monsterinfo.nextframe = FRAME_attack02;
  269. self->touch = NULL;
  270. }
  271. return;
  272. }
  273. self->touch = NULL;
  274. }
  275. void mutant_jump_takeoff (edict_t *self)
  276. {
  277. vec3_t forward;
  278. gi.sound (self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0);
  279. AngleVectors (self->s.angles, forward, NULL, NULL);
  280. self->s.origin[2] += 1;
  281. VectorScale (forward, 600, self->velocity);
  282. self->velocity[2] = 250;
  283. self->groundentity = NULL;
  284. self->monsterinfo.aiflags |= AI_DUCKED;
  285. self->monsterinfo.attack_finished = level.time + 3;
  286. self->touch = mutant_jump_touch;
  287. }
  288. void mutant_check_landing (edict_t *self)
  289. {
  290. if (self->groundentity)
  291. {
  292. gi.sound (self, CHAN_WEAPON, sound_thud, 1, ATTN_NORM, 0);
  293. self->monsterinfo.attack_finished = 0;
  294. self->monsterinfo.aiflags &= ~AI_DUCKED;
  295. return;
  296. }
  297. if (level.time > self->monsterinfo.attack_finished)
  298. self->monsterinfo.nextframe = FRAME_attack02;
  299. else
  300. self->monsterinfo.nextframe = FRAME_attack05;
  301. }
  302. mframe_t mutant_frames_jump [] =
  303. {
  304. ai_charge, 0, NULL,
  305. ai_charge, 17, NULL,
  306. ai_charge, 15, mutant_jump_takeoff,
  307. ai_charge, 15, NULL,
  308. ai_charge, 15, mutant_check_landing,
  309. ai_charge, 0, NULL,
  310. ai_charge, 3, NULL,
  311. ai_charge, 0, NULL
  312. };
  313. mmove_t mutant_move_jump = {FRAME_attack01, FRAME_attack08, mutant_frames_jump, mutant_run};
  314. void mutant_jump (edict_t *self)
  315. {
  316. self->monsterinfo.currentmove = &mutant_move_jump;
  317. }
  318. //
  319. // CHECKATTACK
  320. //
  321. qboolean mutant_check_melee (edict_t *self)
  322. {
  323. if (range (self, self->enemy) == RANGE_MELEE)
  324. return true;
  325. return false;
  326. }
  327. qboolean mutant_check_jump (edict_t *self)
  328. {
  329. vec3_t v;
  330. float distance;
  331. if (self->absmin[2] > (self->enemy->absmin[2] + 0.75 * self->enemy->size[2]))
  332. return false;
  333. if (self->absmax[2] < (self->enemy->absmin[2] + 0.25 * self->enemy->size[2]))
  334. return false;
  335. v[0] = self->s.origin[0] - self->enemy->s.origin[0];
  336. v[1] = self->s.origin[1] - self->enemy->s.origin[1];
  337. v[2] = 0;
  338. distance = VectorLength(v);
  339. if (distance < 100)
  340. return false;
  341. if (distance > 100)
  342. {
  343. if (random() < 0.9)
  344. return false;
  345. }
  346. return true;
  347. }
  348. qboolean mutant_checkattack (edict_t *self)
  349. {
  350. if (!self->enemy || self->enemy->health <= 0)
  351. return false;
  352. if (mutant_check_melee(self))
  353. {
  354. self->monsterinfo.attack_state = AS_MELEE;
  355. return true;
  356. }
  357. if (mutant_check_jump(self))
  358. {
  359. self->monsterinfo.attack_state = AS_MISSILE;
  360. // FIXME play a jump sound here
  361. return true;
  362. }
  363. return false;
  364. }
  365. //
  366. // PAIN
  367. //
  368. mframe_t mutant_frames_pain1 [] =
  369. {
  370. ai_move, 4, NULL,
  371. ai_move, -3, NULL,
  372. ai_move, -8, NULL,
  373. ai_move, 2, NULL,
  374. ai_move, 5, NULL
  375. };
  376. mmove_t mutant_move_pain1 = {FRAME_pain101, FRAME_pain105, mutant_frames_pain1, mutant_run};
  377. mframe_t mutant_frames_pain2 [] =
  378. {
  379. ai_move, -24,NULL,
  380. ai_move, 11, NULL,
  381. ai_move, 5, NULL,
  382. ai_move, -2, NULL,
  383. ai_move, 6, NULL,
  384. ai_move, 4, NULL
  385. };
  386. mmove_t mutant_move_pain2 = {FRAME_pain201, FRAME_pain206, mutant_frames_pain2, mutant_run};
  387. mframe_t mutant_frames_pain3 [] =
  388. {
  389. ai_move, -22,NULL,
  390. ai_move, 3, NULL,
  391. ai_move, 3, NULL,
  392. ai_move, 2, NULL,
  393. ai_move, 1, NULL,
  394. ai_move, 1, NULL,
  395. ai_move, 6, NULL,
  396. ai_move, 3, NULL,
  397. ai_move, 2, NULL,
  398. ai_move, 0, NULL,
  399. ai_move, 1, NULL
  400. };
  401. mmove_t mutant_move_pain3 = {FRAME_pain301, FRAME_pain311, mutant_frames_pain3, mutant_run};
  402. void mutant_pain (edict_t *self, edict_t *other, float kick, int damage)
  403. {
  404. float r;
  405. if (self->health < (self->max_health / 2))
  406. self->s.skinnum = 1;
  407. if (level.time < self->pain_debounce_time)
  408. return;
  409. self->pain_debounce_time = level.time + 3;
  410. if (skill->value == 3)
  411. return; // no pain anims in nightmare
  412. r = random();
  413. if (r < 0.33)
  414. {
  415. gi.sound (self, CHAN_VOICE, sound_pain1, 1, ATTN_NORM, 0);
  416. self->monsterinfo.currentmove = &mutant_move_pain1;
  417. }
  418. else if (r < 0.66)
  419. {
  420. gi.sound (self, CHAN_VOICE, sound_pain2, 1, ATTN_NORM, 0);
  421. self->monsterinfo.currentmove = &mutant_move_pain2;
  422. }
  423. else
  424. {
  425. gi.sound (self, CHAN_VOICE, sound_pain1, 1, ATTN_NORM, 0);
  426. self->monsterinfo.currentmove = &mutant_move_pain3;
  427. }
  428. }
  429. //
  430. // DEATH
  431. //
  432. void mutant_dead (edict_t *self)
  433. {
  434. VectorSet (self->mins, -16, -16, -24);
  435. VectorSet (self->maxs, 16, 16, -8);
  436. self->movetype = MOVETYPE_TOSS;
  437. self->svflags |= SVF_DEADMONSTER;
  438. gi.linkentity (self);
  439. M_FlyCheck (self);
  440. }
  441. mframe_t mutant_frames_death1 [] =
  442. {
  443. ai_move, 0, NULL,
  444. ai_move, 0, NULL,
  445. ai_move, 0, NULL,
  446. ai_move, 0, NULL,
  447. ai_move, 0, NULL,
  448. ai_move, 0, NULL,
  449. ai_move, 0, NULL,
  450. ai_move, 0, NULL,
  451. ai_move, 0, NULL
  452. };
  453. mmove_t mutant_move_death1 = {FRAME_death101, FRAME_death109, mutant_frames_death1, mutant_dead};
  454. mframe_t mutant_frames_death2 [] =
  455. {
  456. ai_move, 0, NULL,
  457. ai_move, 0, NULL,
  458. ai_move, 0, NULL,
  459. ai_move, 0, NULL,
  460. ai_move, 0, NULL,
  461. ai_move, 0, NULL,
  462. ai_move, 0, NULL,
  463. ai_move, 0, NULL,
  464. ai_move, 0, NULL,
  465. ai_move, 0, NULL
  466. };
  467. mmove_t mutant_move_death2 = {FRAME_death201, FRAME_death210, mutant_frames_death2, mutant_dead};
  468. void mutant_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
  469. {
  470. int n;
  471. if (self->health <= self->gib_health)
  472. {
  473. gi.sound (self, CHAN_VOICE, gi.soundindex ("misc/udeath.wav"), 1, ATTN_NORM, 0);
  474. for (n= 0; n < 2; n++)
  475. ThrowGib (self, "models/objects/gibs/bone/tris.md2", damage, GIB_ORGANIC);
  476. for (n= 0; n < 4; n++)
  477. ThrowGib (self, "models/objects/gibs/sm_meat/tris.md2", damage, GIB_ORGANIC);
  478. ThrowHead (self, "models/objects/gibs/head2/tris.md2", damage, GIB_ORGANIC);
  479. self->deadflag = DEAD_DEAD;
  480. return;
  481. }
  482. if (self->deadflag == DEAD_DEAD)
  483. return;
  484. gi.sound (self, CHAN_VOICE, sound_death, 1, ATTN_NORM, 0);
  485. self->deadflag = DEAD_DEAD;
  486. self->takedamage = DAMAGE_YES;
  487. self->s.skinnum = 1;
  488. if (random() < 0.5)
  489. self->monsterinfo.currentmove = &mutant_move_death1;
  490. else
  491. self->monsterinfo.currentmove = &mutant_move_death2;
  492. }
  493. //================
  494. //ROGUE
  495. void mutant_jump_down (edict_t *self)
  496. {
  497. vec3_t forward,up;
  498. AngleVectors (self->s.angles, forward, NULL, up);
  499. VectorMA(self->velocity, 100, forward, self->velocity);
  500. VectorMA(self->velocity, 300, up, self->velocity);
  501. }
  502. void mutant_jump_up (edict_t *self)
  503. {
  504. vec3_t forward,up;
  505. AngleVectors (self->s.angles, forward, NULL, up);
  506. VectorMA(self->velocity, 200, forward, self->velocity);
  507. VectorMA(self->velocity, 450, up, self->velocity);
  508. }
  509. void mutant_jump_wait_land (edict_t *self)
  510. {
  511. if(self->groundentity == NULL)
  512. self->monsterinfo.nextframe = self->s.frame;
  513. else
  514. self->monsterinfo.nextframe = self->s.frame + 1;
  515. }
  516. mframe_t mutant_frames_jump_up [] =
  517. {
  518. ai_move, -8, NULL,
  519. ai_move, -8, mutant_jump_up,
  520. ai_move, 0, mutant_jump_wait_land,
  521. ai_move, 0, NULL,
  522. ai_move, 0, NULL
  523. };
  524. mmove_t mutant_move_jump_up = { FRAME_jump01, FRAME_jump05, mutant_frames_jump_up, mutant_run };
  525. mframe_t mutant_frames_jump_down [] =
  526. {
  527. ai_move, 0, NULL,
  528. ai_move, 0, mutant_jump_down,
  529. ai_move, 0, mutant_jump_wait_land,
  530. ai_move, 0, NULL,
  531. ai_move, 0, NULL
  532. };
  533. mmove_t mutant_move_jump_down = { FRAME_jump01, FRAME_jump05, mutant_frames_jump_down, mutant_run };
  534. void mutant_jump_updown (edict_t *self)
  535. {
  536. if(!self->enemy)
  537. return;
  538. if(self->enemy->s.origin[2] > self->s.origin[2])
  539. self->monsterinfo.currentmove = &mutant_move_jump_up;
  540. else
  541. self->monsterinfo.currentmove = &mutant_move_jump_down;
  542. }
  543. /*
  544. ===
  545. Blocked
  546. ===
  547. */
  548. qboolean mutant_blocked (edict_t *self, float dist)
  549. {
  550. if(blocked_checkjump (self, dist, 256, 68))
  551. {
  552. mutant_jump_updown (self);
  553. return true;
  554. }
  555. if(blocked_checkplat (self, dist))
  556. return true;
  557. }
  558. //ROGUE
  559. //================
  560. //
  561. // SPAWN
  562. //
  563. /*QUAKED monster_mutant (1 .5 0) (-32 -32 -24) (32 32 32) Ambush Trigger_Spawn Sight
  564. */
  565. void SP_monster_mutant (edict_t *self)
  566. {
  567. if (deathmatch->value)
  568. {
  569. G_FreeEdict (self);
  570. return;
  571. }
  572. sound_swing = gi.soundindex ("mutant/mutatck1.wav");
  573. sound_hit = gi.soundindex ("mutant/mutatck2.wav");
  574. sound_hit2 = gi.soundindex ("mutant/mutatck3.wav");
  575. sound_death = gi.soundindex ("mutant/mutdeth1.wav");
  576. sound_idle = gi.soundindex ("mutant/mutidle1.wav");
  577. sound_pain1 = gi.soundindex ("mutant/mutpain1.wav");
  578. sound_pain2 = gi.soundindex ("mutant/mutpain2.wav");
  579. sound_sight = gi.soundindex ("mutant/mutsght1.wav");
  580. sound_search = gi.soundindex ("mutant/mutsrch1.wav");
  581. sound_step1 = gi.soundindex ("mutant/step1.wav");
  582. sound_step2 = gi.soundindex ("mutant/step2.wav");
  583. sound_step3 = gi.soundindex ("mutant/step3.wav");
  584. sound_thud = gi.soundindex ("mutant/thud1.wav");
  585. self->movetype = MOVETYPE_STEP;
  586. self->solid = SOLID_BBOX;
  587. self->s.modelindex = gi.modelindex ("models/monsters/mutant/tris.md2");
  588. VectorSet (self->mins, -32, -32, -24);
  589. VectorSet (self->maxs, 32, 32, 48);
  590. self->health = 300;
  591. self->gib_health = -120;
  592. self->mass = 300;
  593. self->pain = mutant_pain;
  594. self->die = mutant_die;
  595. self->monsterinfo.stand = mutant_stand;
  596. self->monsterinfo.walk = mutant_walk;
  597. self->monsterinfo.run = mutant_run;
  598. self->monsterinfo.dodge = NULL;
  599. self->monsterinfo.attack = mutant_jump;
  600. self->monsterinfo.melee = mutant_melee;
  601. self->monsterinfo.sight = mutant_sight;
  602. self->monsterinfo.search = mutant_search;
  603. self->monsterinfo.idle = mutant_idle;
  604. self->monsterinfo.checkattack = mutant_checkattack;
  605. self->monsterinfo.blocked = mutant_blocked; // PGM
  606. gi.linkentity (self);
  607. self->monsterinfo.currentmove = &mutant_move_stand;
  608. self->monsterinfo.scale = MODEL_SCALE;
  609. walkmonster_start (self);
  610. }