m_parasite.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677
  1. // Copyright (c) ZeniMax Media Inc.
  2. // Licensed under the GNU General Public License 2.0.
  3. /*
  4. ==============================================================================
  5. parasite
  6. ==============================================================================
  7. */
  8. #include "g_local.h"
  9. #include "m_parasite.h"
  10. static int sound_pain1;
  11. static int sound_pain2;
  12. static int sound_die;
  13. static int sound_launch;
  14. static int sound_impact;
  15. static int sound_suck;
  16. static int sound_reelin;
  17. static int sound_sight;
  18. static int sound_tap;
  19. static int sound_scratch;
  20. static int sound_search;
  21. void parasite_stand (edict_t *self);
  22. void parasite_start_run (edict_t *self);
  23. void parasite_run (edict_t *self);
  24. void parasite_walk (edict_t *self);
  25. void parasite_start_walk (edict_t *self);
  26. void parasite_end_fidget (edict_t *self);
  27. void parasite_do_fidget (edict_t *self);
  28. void parasite_refidget (edict_t *self);
  29. void parasite_launch (edict_t *self)
  30. {
  31. gi.sound (self, CHAN_WEAPON, sound_launch, 1, ATTN_NORM, 0);
  32. }
  33. void parasite_reel_in (edict_t *self)
  34. {
  35. gi.sound (self, CHAN_WEAPON, sound_reelin, 1, ATTN_NORM, 0);
  36. }
  37. void parasite_sight (edict_t *self, edict_t *other)
  38. {
  39. gi.sound (self, CHAN_WEAPON, sound_sight, 1, ATTN_NORM, 0);
  40. }
  41. void parasite_tap (edict_t *self)
  42. {
  43. gi.sound (self, CHAN_WEAPON, sound_tap, 1, ATTN_IDLE, 0);
  44. }
  45. void parasite_scratch (edict_t *self)
  46. {
  47. gi.sound (self, CHAN_WEAPON, sound_scratch, 1, ATTN_IDLE, 0);
  48. }
  49. void parasite_search (edict_t *self)
  50. {
  51. gi.sound (self, CHAN_WEAPON, sound_search, 1, ATTN_IDLE, 0);
  52. }
  53. mframe_t parasite_frames_start_fidget [] =
  54. {
  55. ai_stand, 0, NULL,
  56. ai_stand, 0, NULL,
  57. ai_stand, 0, NULL,
  58. ai_stand, 0, NULL
  59. };
  60. mmove_t parasite_move_start_fidget = {FRAME_stand18, FRAME_stand21, parasite_frames_start_fidget, parasite_do_fidget};
  61. mframe_t parasite_frames_fidget [] =
  62. {
  63. ai_stand, 0, parasite_scratch,
  64. ai_stand, 0, NULL,
  65. ai_stand, 0, NULL,
  66. ai_stand, 0, parasite_scratch,
  67. ai_stand, 0, NULL,
  68. ai_stand, 0, NULL
  69. };
  70. mmove_t parasite_move_fidget = {FRAME_stand22, FRAME_stand27, parasite_frames_fidget, parasite_refidget};
  71. mframe_t parasite_frames_end_fidget [] =
  72. {
  73. ai_stand, 0, parasite_scratch,
  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. };
  82. mmove_t parasite_move_end_fidget = {FRAME_stand28, FRAME_stand35, parasite_frames_end_fidget, parasite_stand};
  83. void parasite_end_fidget (edict_t *self)
  84. {
  85. self->monsterinfo.currentmove = &parasite_move_end_fidget;
  86. }
  87. void parasite_do_fidget (edict_t *self)
  88. {
  89. self->monsterinfo.currentmove = &parasite_move_fidget;
  90. }
  91. void parasite_refidget (edict_t *self)
  92. {
  93. if (random() <= 0.8)
  94. self->monsterinfo.currentmove = &parasite_move_fidget;
  95. else
  96. self->monsterinfo.currentmove = &parasite_move_end_fidget;
  97. }
  98. void parasite_idle (edict_t *self)
  99. {
  100. self->monsterinfo.currentmove = &parasite_move_start_fidget;
  101. }
  102. mframe_t parasite_frames_stand [] =
  103. {
  104. ai_stand, 0, NULL,
  105. ai_stand, 0, NULL,
  106. ai_stand, 0, parasite_tap,
  107. ai_stand, 0, NULL,
  108. ai_stand, 0, parasite_tap,
  109. ai_stand, 0, NULL,
  110. ai_stand, 0, NULL,
  111. ai_stand, 0, NULL,
  112. ai_stand, 0, parasite_tap,
  113. ai_stand, 0, NULL,
  114. ai_stand, 0, parasite_tap,
  115. ai_stand, 0, NULL,
  116. ai_stand, 0, NULL,
  117. ai_stand, 0, NULL,
  118. ai_stand, 0, parasite_tap,
  119. ai_stand, 0, NULL,
  120. ai_stand, 0, parasite_tap
  121. };
  122. mmove_t parasite_move_stand = {FRAME_stand01, FRAME_stand17, parasite_frames_stand, parasite_stand};
  123. void parasite_stand (edict_t *self)
  124. {
  125. self->monsterinfo.currentmove = &parasite_move_stand;
  126. }
  127. mframe_t parasite_frames_run [] =
  128. {
  129. ai_run, 30, NULL,
  130. ai_run, 30, NULL,
  131. ai_run, 22, NULL,
  132. ai_run, 19, NULL,
  133. ai_run, 24, NULL,
  134. ai_run, 28, NULL,
  135. ai_run, 25, NULL
  136. };
  137. mmove_t parasite_move_run = {FRAME_run03, FRAME_run09, parasite_frames_run, NULL};
  138. mframe_t parasite_frames_start_run [] =
  139. {
  140. ai_run, 0, NULL,
  141. ai_run, 30, NULL,
  142. };
  143. mmove_t parasite_move_start_run = {FRAME_run01, FRAME_run02, parasite_frames_start_run, parasite_run};
  144. mframe_t parasite_frames_stop_run [] =
  145. {
  146. ai_run, 20, NULL,
  147. ai_run, 20, NULL,
  148. ai_run, 12, NULL,
  149. ai_run, 10, NULL,
  150. ai_run, 0, NULL,
  151. ai_run, 0, NULL
  152. };
  153. mmove_t parasite_move_stop_run = {FRAME_run10, FRAME_run15, parasite_frames_stop_run, NULL};
  154. void parasite_start_run (edict_t *self)
  155. {
  156. if (self->monsterinfo.aiflags & AI_STAND_GROUND)
  157. self->monsterinfo.currentmove = &parasite_move_stand;
  158. else
  159. self->monsterinfo.currentmove = &parasite_move_start_run;
  160. }
  161. void parasite_run (edict_t *self)
  162. {
  163. if (self->monsterinfo.aiflags & AI_STAND_GROUND)
  164. self->monsterinfo.currentmove = &parasite_move_stand;
  165. else
  166. self->monsterinfo.currentmove = &parasite_move_run;
  167. }
  168. mframe_t parasite_frames_walk [] =
  169. {
  170. ai_walk, 30, NULL,
  171. ai_walk, 30, NULL,
  172. ai_walk, 22, NULL,
  173. ai_walk, 19, NULL,
  174. ai_walk, 24, NULL,
  175. ai_walk, 28, NULL,
  176. ai_walk, 25, NULL
  177. };
  178. mmove_t parasite_move_walk = {FRAME_run03, FRAME_run09, parasite_frames_walk, parasite_walk};
  179. mframe_t parasite_frames_start_walk [] =
  180. {
  181. ai_walk, 0, NULL,
  182. ai_walk, 30, parasite_walk
  183. };
  184. mmove_t parasite_move_start_walk = {FRAME_run01, FRAME_run02, parasite_frames_start_walk, NULL};
  185. mframe_t parasite_frames_stop_walk [] =
  186. {
  187. ai_walk, 20, NULL,
  188. ai_walk, 20, NULL,
  189. ai_walk, 12, NULL,
  190. ai_walk, 10, NULL,
  191. ai_walk, 0, NULL,
  192. ai_walk, 0, NULL
  193. };
  194. mmove_t parasite_move_stop_walk = {FRAME_run10, FRAME_run15, parasite_frames_stop_walk, NULL};
  195. void parasite_start_walk (edict_t *self)
  196. {
  197. self->monsterinfo.currentmove = &parasite_move_start_walk;
  198. }
  199. void parasite_walk (edict_t *self)
  200. {
  201. self->monsterinfo.currentmove = &parasite_move_walk;
  202. }
  203. mframe_t parasite_frames_pain1 [] =
  204. {
  205. ai_move, 0, NULL,
  206. ai_move, 0, NULL,
  207. ai_move, 0, NULL,
  208. ai_move, 0, NULL,
  209. ai_move, 0, NULL,
  210. ai_move, 0, NULL,
  211. ai_move, 6, NULL,
  212. ai_move, 16, NULL,
  213. ai_move, -6, NULL,
  214. ai_move, -7, NULL,
  215. ai_move, 0, NULL
  216. };
  217. mmove_t parasite_move_pain1 = {FRAME_pain101, FRAME_pain111, parasite_frames_pain1, parasite_start_run};
  218. void parasite_pain (edict_t *self, edict_t *other, float kick, int damage)
  219. {
  220. if (self->health < (self->max_health / 2))
  221. self->s.skinnum = 1;
  222. if (level.time < self->pain_debounce_time)
  223. return;
  224. self->pain_debounce_time = level.time + 3;
  225. if (skill->value == 3)
  226. return; // no pain anims in nightmare
  227. if (random() < 0.5)
  228. gi.sound (self, CHAN_VOICE, sound_pain1, 1, ATTN_NORM, 0);
  229. else
  230. gi.sound (self, CHAN_VOICE, sound_pain2, 1, ATTN_NORM, 0);
  231. self->monsterinfo.currentmove = &parasite_move_pain1;
  232. }
  233. //static qboolean parasite_drain_attack_ok (vec3_t start, vec3_t end)
  234. qboolean parasite_drain_attack_ok (vec3_t start, vec3_t end)
  235. {
  236. vec3_t dir, angles;
  237. // check for max distance
  238. VectorSubtract (start, end, dir);
  239. if (VectorLength(dir) > 256)
  240. return false;
  241. // check for min/max pitch
  242. vectoangles (dir, angles);
  243. if (angles[0] < -180)
  244. angles[0] += 360;
  245. if (fabs(angles[0]) > 30)
  246. return false;
  247. return true;
  248. }
  249. void parasite_drain_attack (edict_t *self)
  250. {
  251. vec3_t offset, start, f, r, end, dir;
  252. trace_t tr;
  253. int damage;
  254. AngleVectors (self->s.angles, f, r, NULL);
  255. VectorSet (offset, 24, 0, 6);
  256. G_ProjectSource (self->s.origin, offset, f, r, start);
  257. VectorCopy (self->enemy->s.origin, end);
  258. if (!parasite_drain_attack_ok(start, end))
  259. {
  260. end[2] = self->enemy->s.origin[2] + self->enemy->maxs[2] - 8;
  261. if (!parasite_drain_attack_ok(start, end))
  262. {
  263. end[2] = self->enemy->s.origin[2] + self->enemy->mins[2] + 8;
  264. if (!parasite_drain_attack_ok(start, end))
  265. return;
  266. }
  267. }
  268. VectorCopy (self->enemy->s.origin, end);
  269. tr = gi.trace (start, NULL, NULL, end, self, MASK_SHOT);
  270. if (tr.ent != self->enemy)
  271. return;
  272. if (self->s.frame == FRAME_drain03)
  273. {
  274. damage = 5;
  275. gi.sound (self->enemy, CHAN_AUTO, sound_impact, 1, ATTN_NORM, 0);
  276. }
  277. else
  278. {
  279. if (self->s.frame == FRAME_drain04)
  280. gi.sound (self, CHAN_WEAPON, sound_suck, 1, ATTN_NORM, 0);
  281. damage = 2;
  282. }
  283. gi.WriteByte (svc_temp_entity);
  284. gi.WriteByte (TE_PARASITE_ATTACK);
  285. gi.WriteShort (self - g_edicts);
  286. gi.WritePosition (start);
  287. gi.WritePosition (end);
  288. gi.multicast (self->s.origin, MULTICAST_PVS);
  289. VectorSubtract (start, end, dir);
  290. T_Damage (self->enemy, self, self, dir, self->enemy->s.origin, vec3_origin, damage, 0, DAMAGE_NO_KNOCKBACK, MOD_UNKNOWN);
  291. }
  292. mframe_t parasite_frames_drain [] =
  293. {
  294. ai_charge, 0, parasite_launch,
  295. ai_charge, 0, NULL,
  296. ai_charge, 15, parasite_drain_attack, // Target hits
  297. ai_charge, 0, parasite_drain_attack, // drain
  298. ai_charge, 0, parasite_drain_attack, // drain
  299. ai_charge, 0, parasite_drain_attack, // drain
  300. ai_charge, 0, parasite_drain_attack, // drain
  301. ai_charge, -2, parasite_drain_attack, // drain
  302. ai_charge, -2, parasite_drain_attack, // drain
  303. ai_charge, -3, parasite_drain_attack, // drain
  304. ai_charge, -2, parasite_drain_attack, // drain
  305. ai_charge, 0, parasite_drain_attack, // drain
  306. ai_charge, -1, parasite_drain_attack, // drain
  307. ai_charge, 0, parasite_reel_in, // let go
  308. ai_charge, -2, NULL,
  309. ai_charge, -2, NULL,
  310. ai_charge, -3, NULL,
  311. ai_charge, 0, NULL
  312. };
  313. mmove_t parasite_move_drain = {FRAME_drain01, FRAME_drain18, parasite_frames_drain, parasite_start_run};
  314. mframe_t parasite_frames_break [] =
  315. {
  316. ai_charge, 0, NULL,
  317. ai_charge, -3, NULL,
  318. ai_charge, 1, NULL,
  319. ai_charge, 2, NULL,
  320. ai_charge, -3, NULL,
  321. ai_charge, 1, NULL,
  322. ai_charge, 1, NULL,
  323. ai_charge, 3, NULL,
  324. ai_charge, 0, NULL,
  325. ai_charge, -18, NULL,
  326. ai_charge, 3, NULL,
  327. ai_charge, 9, NULL,
  328. ai_charge, 6, NULL,
  329. ai_charge, 0, NULL,
  330. ai_charge, -18, NULL,
  331. ai_charge, 0, NULL,
  332. ai_charge, 8, NULL,
  333. ai_charge, 9, NULL,
  334. ai_charge, 0, NULL,
  335. ai_charge, -18, NULL,
  336. ai_charge, 0, NULL,
  337. ai_charge, 0, NULL, // airborne
  338. ai_charge, 0, NULL, // airborne
  339. ai_charge, 0, NULL, // slides
  340. ai_charge, 0, NULL, // slides
  341. ai_charge, 0, NULL, // slides
  342. ai_charge, 0, NULL, // slides
  343. ai_charge, 4, NULL,
  344. ai_charge, 11, NULL,
  345. ai_charge, -2, NULL,
  346. ai_charge, -5, NULL,
  347. ai_charge, 1, NULL
  348. };
  349. mmove_t parasite_move_break = {FRAME_break01, FRAME_break32, parasite_frames_break, parasite_start_run};
  350. /*
  351. ===
  352. Break Stuff Ends
  353. ===
  354. */
  355. void parasite_attack (edict_t *self)
  356. {
  357. // if (random() <= 0.2)
  358. // self->monsterinfo.currentmove = &parasite_move_break;
  359. // else
  360. self->monsterinfo.currentmove = &parasite_move_drain;
  361. }
  362. //================
  363. //ROGUE
  364. void parasite_jump_down (edict_t *self)
  365. {
  366. vec3_t forward,up;
  367. monster_jump_start (self);
  368. AngleVectors (self->s.angles, forward, NULL, up);
  369. VectorMA(self->velocity, 100, forward, self->velocity);
  370. VectorMA(self->velocity, 300, up, self->velocity);
  371. }
  372. void parasite_jump_up (edict_t *self)
  373. {
  374. vec3_t forward,up;
  375. monster_jump_start (self);
  376. AngleVectors (self->s.angles, forward, NULL, up);
  377. VectorMA(self->velocity, 200, forward, self->velocity);
  378. VectorMA(self->velocity, 450, up, self->velocity);
  379. }
  380. void parasite_jump_wait_land (edict_t *self)
  381. {
  382. if(self->groundentity == NULL)
  383. {
  384. self->monsterinfo.nextframe = self->s.frame;
  385. if(monster_jump_finished (self))
  386. self->monsterinfo.nextframe = self->s.frame + 1;
  387. }
  388. else
  389. self->monsterinfo.nextframe = self->s.frame + 1;
  390. }
  391. mframe_t parasite_frames_jump_up [] =
  392. {
  393. ai_move, -8, NULL,
  394. ai_move, -8, NULL,
  395. ai_move, -8, NULL,
  396. ai_move, -8, parasite_jump_up,
  397. ai_move, 0, NULL,
  398. ai_move, 0, NULL,
  399. ai_move, 0, parasite_jump_wait_land,
  400. ai_move, 0, NULL
  401. };
  402. mmove_t parasite_move_jump_up = { FRAME_jump01, FRAME_jump08, parasite_frames_jump_up, parasite_run };
  403. mframe_t parasite_frames_jump_down [] =
  404. {
  405. ai_move, 0, NULL,
  406. ai_move, 0, NULL,
  407. ai_move, 0, NULL,
  408. ai_move, 0, parasite_jump_down,
  409. ai_move, 0, NULL,
  410. ai_move, 0, NULL,
  411. ai_move, 0, parasite_jump_wait_land,
  412. ai_move, 0, NULL
  413. };
  414. mmove_t parasite_move_jump_down = { FRAME_jump01, FRAME_jump08, parasite_frames_jump_down, parasite_run };
  415. void parasite_jump (edict_t *self)
  416. {
  417. if(!self->enemy)
  418. return;
  419. if(self->enemy->s.origin[2] > self->s.origin[2])
  420. self->monsterinfo.currentmove = &parasite_move_jump_up;
  421. else
  422. self->monsterinfo.currentmove = &parasite_move_jump_down;
  423. }
  424. /*
  425. ===
  426. Blocked
  427. ===
  428. */
  429. qboolean parasite_blocked (edict_t *self, float dist)
  430. {
  431. if(blocked_checkshot (self, 0.25 + (0.05 * skill->value) ))
  432. return true;
  433. if(blocked_checkjump (self, dist, 256, 68))
  434. {
  435. parasite_jump (self);
  436. return true;
  437. }
  438. if(blocked_checkplat (self, dist))
  439. return true;
  440. }
  441. //ROGUE
  442. //================
  443. qboolean parasite_checkattack (edict_t *self)
  444. {
  445. vec3_t f, r, offset, start, end;
  446. trace_t tr;
  447. qboolean retval;
  448. retval = M_CheckAttack (self);
  449. if (!retval)
  450. return false;
  451. AngleVectors (self->s.angles, f, r, NULL);
  452. VectorSet (offset, 24, 0, 6);
  453. G_ProjectSource (self->s.origin, offset, f, r, start);
  454. VectorCopy (self->enemy->s.origin, end);
  455. if (!parasite_drain_attack_ok(start, end))
  456. {
  457. end[2] = self->enemy->s.origin[2] + self->enemy->maxs[2] - 8;
  458. if (!parasite_drain_attack_ok(start, end))
  459. {
  460. end[2] = self->enemy->s.origin[2] + self->enemy->mins[2] + 8;
  461. if (!parasite_drain_attack_ok(start, end))
  462. return false;
  463. }
  464. }
  465. VectorCopy (self->enemy->s.origin, end);
  466. tr = gi.trace (start, NULL, NULL, end, self, MASK_SHOT);
  467. if (tr.ent != self->enemy)
  468. {
  469. self->monsterinfo.aiflags |= AI_BLOCKED;
  470. if(self->monsterinfo.attack)
  471. self->monsterinfo.attack(self);
  472. self->monsterinfo.aiflags &= ~AI_BLOCKED;
  473. return true;
  474. }
  475. }
  476. /*
  477. ===
  478. Death Stuff Starts
  479. ===
  480. */
  481. void parasite_dead (edict_t *self)
  482. {
  483. VectorSet (self->mins, -16, -16, -24);
  484. VectorSet (self->maxs, 16, 16, -8);
  485. self->movetype = MOVETYPE_TOSS;
  486. self->svflags |= SVF_DEADMONSTER;
  487. self->nextthink = 0;
  488. gi.linkentity (self);
  489. }
  490. mframe_t parasite_frames_death [] =
  491. {
  492. ai_move, 0, NULL,
  493. ai_move, 0, NULL,
  494. ai_move, 0, NULL,
  495. ai_move, 0, NULL,
  496. ai_move, 0, NULL,
  497. ai_move, 0, NULL,
  498. ai_move, 0, NULL
  499. };
  500. mmove_t parasite_move_death = {FRAME_death101, FRAME_death107, parasite_frames_death, parasite_dead};
  501. void parasite_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
  502. {
  503. int n;
  504. // check for gib
  505. if (self->health <= self->gib_health)
  506. {
  507. gi.sound (self, CHAN_VOICE, gi.soundindex ("misc/udeath.wav"), 1, ATTN_NORM, 0);
  508. for (n= 0; n < 2; n++)
  509. ThrowGib (self, "models/objects/gibs/bone/tris.md2", damage, GIB_ORGANIC);
  510. for (n= 0; n < 4; n++)
  511. ThrowGib (self, "models/objects/gibs/sm_meat/tris.md2", damage, GIB_ORGANIC);
  512. ThrowHead (self, "models/objects/gibs/head2/tris.md2", damage, GIB_ORGANIC);
  513. self->deadflag = DEAD_DEAD;
  514. return;
  515. }
  516. if (self->deadflag == DEAD_DEAD)
  517. return;
  518. // regular death
  519. gi.sound (self, CHAN_VOICE, sound_die, 1, ATTN_NORM, 0);
  520. self->deadflag = DEAD_DEAD;
  521. self->takedamage = DAMAGE_YES;
  522. self->monsterinfo.currentmove = &parasite_move_death;
  523. }
  524. /*
  525. ===
  526. End Death Stuff
  527. ===
  528. */
  529. /*QUAKED monster_parasite (1 .5 0) (-16 -16 -24) (16 16 32) Ambush Trigger_Spawn Sight
  530. */
  531. void SP_monster_parasite (edict_t *self)
  532. {
  533. if (deathmatch->value)
  534. {
  535. G_FreeEdict (self);
  536. return;
  537. }
  538. sound_pain1 = gi.soundindex ("parasite/parpain1.wav");
  539. sound_pain2 = gi.soundindex ("parasite/parpain2.wav");
  540. sound_die = gi.soundindex ("parasite/pardeth1.wav");
  541. sound_launch = gi.soundindex("parasite/paratck1.wav");
  542. sound_impact = gi.soundindex("parasite/paratck2.wav");
  543. sound_suck = gi.soundindex("parasite/paratck3.wav");
  544. sound_reelin = gi.soundindex("parasite/paratck4.wav");
  545. sound_sight = gi.soundindex("parasite/parsght1.wav");
  546. sound_tap = gi.soundindex("parasite/paridle1.wav");
  547. sound_scratch = gi.soundindex("parasite/paridle2.wav");
  548. sound_search = gi.soundindex("parasite/parsrch1.wav");
  549. self->s.modelindex = gi.modelindex ("models/monsters/parasite/tris.md2");
  550. VectorSet (self->mins, -16, -16, -24);
  551. VectorSet (self->maxs, 16, 16, 24);
  552. self->movetype = MOVETYPE_STEP;
  553. self->solid = SOLID_BBOX;
  554. self->health = 175;
  555. self->gib_health = -50;
  556. self->mass = 250;
  557. self->pain = parasite_pain;
  558. self->die = parasite_die;
  559. self->monsterinfo.stand = parasite_stand;
  560. self->monsterinfo.walk = parasite_start_walk;
  561. self->monsterinfo.run = parasite_start_run;
  562. self->monsterinfo.attack = parasite_attack;
  563. self->monsterinfo.sight = parasite_sight;
  564. self->monsterinfo.idle = parasite_idle;
  565. self->monsterinfo.blocked = parasite_blocked; // PGM
  566. self->monsterinfo.checkattack = parasite_checkattack;
  567. gi.linkentity (self);
  568. self->monsterinfo.currentmove = &parasite_move_stand;
  569. self->monsterinfo.scale = MODEL_SCALE;
  570. walkmonster_start (self);
  571. }