m_boss31.cpp 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643
  1. // Copyright (c) ZeniMax Media Inc.
  2. // Licensed under the GNU General Public License 2.0.
  3. /*
  4. ==============================================================================
  5. jorg
  6. ==============================================================================
  7. */
  8. #include "g_local.h"
  9. #include "m_boss31.h"
  10. #include "m_flash.h"
  11. void SP_monster_makron(edict_t *self);
  12. static cached_soundindex sound_pain1;
  13. static cached_soundindex sound_pain2;
  14. static cached_soundindex sound_pain3;
  15. static cached_soundindex sound_idle;
  16. static cached_soundindex sound_death;
  17. static cached_soundindex sound_search1;
  18. static cached_soundindex sound_search2;
  19. static cached_soundindex sound_search3;
  20. static cached_soundindex sound_attack1, sound_attack1_loop, sound_attack1_end;
  21. static cached_soundindex sound_attack2, sound_bfg_fire;
  22. static cached_soundindex sound_firegun;
  23. static cached_soundindex sound_step_left;
  24. static cached_soundindex sound_step_right;
  25. static cached_soundindex sound_death_hit;
  26. void MakronToss(edict_t *self);
  27. void jorg_attack1_end_sound(edict_t *self)
  28. {
  29. if (self->monsterinfo.weapon_sound)
  30. {
  31. gi.sound(self, CHAN_WEAPON, sound_attack1_end, 1, ATTN_NORM, 0);
  32. self->monsterinfo.weapon_sound = 0;
  33. }
  34. }
  35. MONSTERINFO_SEARCH(jorg_search) (edict_t *self) -> void
  36. {
  37. float r;
  38. r = frandom();
  39. if (r <= 0.3f)
  40. gi.sound(self, CHAN_VOICE, sound_search1, 1, ATTN_NORM, 0);
  41. else if (r <= 0.6f)
  42. gi.sound(self, CHAN_VOICE, sound_search2, 1, ATTN_NORM, 0);
  43. else
  44. gi.sound(self, CHAN_VOICE, sound_search3, 1, ATTN_NORM, 0);
  45. }
  46. void jorg_dead(edict_t *self);
  47. void jorgBFG(edict_t *self);
  48. void jorg_firebullet(edict_t *self);
  49. void jorg_reattack1(edict_t *self);
  50. void jorg_attack1(edict_t *self);
  51. void jorg_idle(edict_t *self);
  52. void jorg_step_left(edict_t *self);
  53. void jorg_step_right(edict_t *self);
  54. void jorg_death_hit(edict_t *self);
  55. //
  56. // stand
  57. //
  58. mframe_t jorg_frames_stand[] = {
  59. { ai_stand, 0, jorg_idle },
  60. { ai_stand },
  61. { ai_stand },
  62. { ai_stand },
  63. { ai_stand },
  64. { ai_stand },
  65. { ai_stand },
  66. { ai_stand },
  67. { ai_stand },
  68. { ai_stand }, // 10
  69. { ai_stand },
  70. { ai_stand },
  71. { ai_stand },
  72. { ai_stand },
  73. { ai_stand },
  74. { ai_stand },
  75. { ai_stand },
  76. { ai_stand },
  77. { ai_stand },
  78. { ai_stand }, // 20
  79. { ai_stand },
  80. { ai_stand },
  81. { ai_stand },
  82. { ai_stand },
  83. { ai_stand },
  84. { ai_stand },
  85. { ai_stand },
  86. { ai_stand },
  87. { ai_stand },
  88. { ai_stand }, // 30
  89. { ai_stand },
  90. { ai_stand },
  91. { ai_stand },
  92. { ai_stand, 19 },
  93. { ai_stand, 11, jorg_step_left },
  94. { ai_stand },
  95. { ai_stand },
  96. { ai_stand, 6 },
  97. { ai_stand, 9, jorg_step_right },
  98. { ai_stand }, // 40
  99. { ai_stand },
  100. { ai_stand },
  101. { ai_stand },
  102. { ai_stand },
  103. { ai_stand },
  104. { ai_stand },
  105. { ai_stand, -2, nullptr },
  106. { ai_stand, -17, jorg_step_left },
  107. { ai_stand },
  108. { ai_stand, -12 }, // 50
  109. { ai_stand, -14, jorg_step_right } // 51
  110. };
  111. MMOVE_T(jorg_move_stand) = { FRAME_stand01, FRAME_stand51, jorg_frames_stand, nullptr };
  112. void jorg_idle (edict_t *self)
  113. {
  114. gi.sound(self, CHAN_VOICE, sound_idle, 1, ATTN_NORM, 0);
  115. }
  116. void jorg_death_hit(edict_t *self)
  117. {
  118. gi.sound(self, CHAN_BODY, sound_death_hit, 1, ATTN_NORM, 0);
  119. }
  120. void jorg_step_left(edict_t *self)
  121. {
  122. gi.sound(self, CHAN_BODY, sound_step_left, 1, ATTN_NORM, 0);
  123. }
  124. void jorg_step_right(edict_t *self)
  125. {
  126. gi.sound(self, CHAN_BODY, sound_step_right, 1, ATTN_NORM, 0);
  127. }
  128. MONSTERINFO_STAND(jorg_stand) (edict_t *self) -> void
  129. {
  130. M_SetAnimation(self, &jorg_move_stand);
  131. jorg_attack1_end_sound(self);
  132. }
  133. mframe_t jorg_frames_run[] = {
  134. { ai_run, 17, jorg_step_left },
  135. { ai_run },
  136. { ai_run },
  137. { ai_run },
  138. { ai_run, 12 },
  139. { ai_run, 8 },
  140. { ai_run, 10 },
  141. { ai_run, 33, jorg_step_right },
  142. { ai_run },
  143. { ai_run },
  144. { ai_run },
  145. { ai_run, 9 },
  146. { ai_run, 9 },
  147. { ai_run, 9 }
  148. };
  149. MMOVE_T(jorg_move_run) = { FRAME_walk06, FRAME_walk19, jorg_frames_run, nullptr };
  150. //
  151. // walk
  152. //
  153. #if 0
  154. mframe_t jorg_frames_start_walk[] = {
  155. { ai_walk, 5 },
  156. { ai_walk, 6 },
  157. { ai_walk, 7 },
  158. { ai_walk, 9 },
  159. { ai_walk, 15 }
  160. };
  161. MMOVE_T(jorg_move_start_walk) = { FRAME_walk01, FRAME_walk05, jorg_frames_start_walk, nullptr };
  162. #endif
  163. mframe_t jorg_frames_walk[] = {
  164. { ai_walk, 17 },
  165. { ai_walk },
  166. { ai_walk },
  167. { ai_walk },
  168. { ai_walk, 12 },
  169. { ai_walk, 8 },
  170. { ai_walk, 10 },
  171. { ai_walk, 33 },
  172. { ai_walk },
  173. { ai_walk },
  174. { ai_walk },
  175. { ai_walk, 9 },
  176. { ai_walk, 9 },
  177. { ai_walk, 9 }
  178. };
  179. MMOVE_T(jorg_move_walk) = { FRAME_walk06, FRAME_walk19, jorg_frames_walk, nullptr };
  180. #if 0
  181. mframe_t jorg_frames_end_walk[] = {
  182. { ai_walk, 11 },
  183. { ai_walk },
  184. { ai_walk },
  185. { ai_walk },
  186. { ai_walk, 8 },
  187. { ai_walk, -8 }
  188. };
  189. MMOVE_T(jorg_move_end_walk) = { FRAME_walk20, FRAME_walk25, jorg_frames_end_walk, nullptr };
  190. #endif
  191. MONSTERINFO_WALK(jorg_walk) (edict_t *self) -> void
  192. {
  193. M_SetAnimation(self, &jorg_move_walk);
  194. }
  195. MONSTERINFO_RUN(jorg_run) (edict_t *self) -> void
  196. {
  197. if (self->monsterinfo.aiflags & AI_STAND_GROUND)
  198. M_SetAnimation(self, &jorg_move_stand);
  199. else
  200. M_SetAnimation(self, &jorg_move_run);
  201. jorg_attack1_end_sound(self);
  202. }
  203. mframe_t jorg_frames_pain3[] = {
  204. { ai_move, -28 },
  205. { ai_move, -6 },
  206. { ai_move, -3, jorg_step_left },
  207. { ai_move, -9 },
  208. { ai_move, 0, jorg_step_right },
  209. { ai_move },
  210. { ai_move },
  211. { ai_move },
  212. { ai_move, -7 },
  213. { ai_move, 1 },
  214. { ai_move, -11 },
  215. { ai_move, -4 },
  216. { ai_move },
  217. { ai_move },
  218. { ai_move, 10 },
  219. { ai_move, 11 },
  220. { ai_move },
  221. { ai_move, 10 },
  222. { ai_move, 3 },
  223. { ai_move, 10 },
  224. { ai_move, 7, jorg_step_left },
  225. { ai_move, 17 },
  226. { ai_move },
  227. { ai_move },
  228. { ai_move, 0, jorg_step_right }
  229. };
  230. MMOVE_T(jorg_move_pain3) = { FRAME_pain301, FRAME_pain325, jorg_frames_pain3, jorg_run };
  231. mframe_t jorg_frames_pain2[] = {
  232. { ai_move },
  233. { ai_move },
  234. { ai_move }
  235. };
  236. MMOVE_T(jorg_move_pain2) = { FRAME_pain201, FRAME_pain203, jorg_frames_pain2, jorg_run };
  237. mframe_t jorg_frames_pain1[] = {
  238. { ai_move },
  239. { ai_move },
  240. { ai_move }
  241. };
  242. MMOVE_T(jorg_move_pain1) = { FRAME_pain101, FRAME_pain103, jorg_frames_pain1, jorg_run };
  243. mframe_t jorg_frames_death1[] = {
  244. { ai_move, 0, BossExplode },
  245. { ai_move },
  246. { ai_move },
  247. { ai_move },
  248. { ai_move },
  249. { ai_move, -2 },
  250. { ai_move, -5 },
  251. { ai_move, -8 },
  252. { ai_move, -15, jorg_step_left },
  253. { ai_move }, // 10
  254. { ai_move },
  255. { ai_move },
  256. { ai_move },
  257. { ai_move },
  258. { ai_move },
  259. { ai_move, -11 },
  260. { ai_move, -25 },
  261. { ai_move, -10, jorg_step_right },
  262. { ai_move },
  263. { ai_move }, // 20
  264. { ai_move },
  265. { ai_move },
  266. { ai_move },
  267. { ai_move },
  268. { ai_move, -21 },
  269. { ai_move, -10 },
  270. { ai_move, -16, jorg_step_left },
  271. { ai_move },
  272. { ai_move },
  273. { ai_move }, // 30
  274. { ai_move },
  275. { ai_move },
  276. { ai_move, 22 },
  277. { ai_move, 33, jorg_step_left },
  278. { ai_move },
  279. { ai_move },
  280. { ai_move, 28 },
  281. { ai_move, 28, jorg_step_right },
  282. { ai_move },
  283. { ai_move }, // 40
  284. { ai_move },
  285. { ai_move },
  286. { ai_move },
  287. { ai_move },
  288. { ai_move },
  289. { ai_move },
  290. { ai_move, -19 },
  291. { ai_move, 0, jorg_death_hit },
  292. { ai_move },
  293. { ai_move } // 50
  294. };
  295. MMOVE_T(jorg_move_death) = { FRAME_death01, FRAME_death50, jorg_frames_death1, jorg_dead };
  296. mframe_t jorg_frames_attack2[] = {
  297. { ai_charge },
  298. { ai_charge },
  299. { ai_charge },
  300. { ai_charge },
  301. { ai_charge },
  302. { ai_charge },
  303. { ai_charge, 0, jorgBFG },
  304. { ai_move },
  305. { ai_move },
  306. { ai_move },
  307. { ai_move },
  308. { ai_move },
  309. { ai_move }
  310. };
  311. MMOVE_T(jorg_move_attack2) = { FRAME_attak201, FRAME_attak213, jorg_frames_attack2, jorg_run };
  312. mframe_t jorg_frames_start_attack1[] = {
  313. { ai_charge },
  314. { ai_charge },
  315. { ai_charge },
  316. { ai_charge },
  317. { ai_charge },
  318. { ai_charge },
  319. { ai_charge },
  320. { ai_charge }
  321. };
  322. MMOVE_T(jorg_move_start_attack1) = { FRAME_attak101, FRAME_attak108, jorg_frames_start_attack1, jorg_attack1 };
  323. mframe_t jorg_frames_attack1[] = {
  324. { ai_charge, 0, jorg_firebullet },
  325. { ai_charge, 0, jorg_firebullet },
  326. { ai_charge, 0, jorg_firebullet },
  327. { ai_charge, 0, jorg_firebullet },
  328. { ai_charge, 0, jorg_firebullet },
  329. { ai_charge, 0, jorg_firebullet }
  330. };
  331. MMOVE_T(jorg_move_attack1) = { FRAME_attak109, FRAME_attak114, jorg_frames_attack1, jorg_reattack1 };
  332. mframe_t jorg_frames_end_attack1[] = {
  333. { ai_move },
  334. { ai_move },
  335. { ai_move },
  336. { ai_move }
  337. };
  338. MMOVE_T(jorg_move_end_attack1) = { FRAME_attak115, FRAME_attak118, jorg_frames_end_attack1, jorg_run };
  339. void jorg_reattack1(edict_t *self)
  340. {
  341. if (visible(self, self->enemy))
  342. {
  343. if (frandom() < 0.9f)
  344. M_SetAnimation(self, &jorg_move_attack1);
  345. else
  346. {
  347. M_SetAnimation(self, &jorg_move_end_attack1);
  348. jorg_attack1_end_sound(self);
  349. }
  350. }
  351. else
  352. {
  353. M_SetAnimation(self, &jorg_move_end_attack1);
  354. jorg_attack1_end_sound(self);
  355. }
  356. }
  357. void jorg_attack1(edict_t *self)
  358. {
  359. M_SetAnimation(self, &jorg_move_attack1);
  360. }
  361. PAIN(jorg_pain) (edict_t *self, edict_t *other, float kick, int damage, const mod_t &mod) -> void
  362. {
  363. if (level.time < self->pain_debounce_time)
  364. return;
  365. // Lessen the chance of him going into his pain frames if he takes little damage
  366. if (mod.id != MOD_CHAINFIST)
  367. {
  368. if (damage <= 40)
  369. if (frandom() <= 0.6f)
  370. return;
  371. /*
  372. If he's entering his attack1 or using attack1, lessen the chance of him
  373. going into pain
  374. */
  375. if ((self->s.frame >= FRAME_attak101) && (self->s.frame <= FRAME_attak108))
  376. if (frandom() <= 0.005f)
  377. return;
  378. if ((self->s.frame >= FRAME_attak109) && (self->s.frame <= FRAME_attak114))
  379. if (frandom() <= 0.00005f)
  380. return;
  381. if ((self->s.frame >= FRAME_attak201) && (self->s.frame <= FRAME_attak208))
  382. if (frandom() <= 0.005f)
  383. return;
  384. }
  385. self->pain_debounce_time = level.time + 3_sec;
  386. bool do_pain3 = false;
  387. if (damage > 50)
  388. {
  389. if (damage <= 100)
  390. {
  391. gi.sound(self, CHAN_VOICE, sound_pain2, 1, ATTN_NORM, 0);
  392. }
  393. else
  394. {
  395. if (frandom() <= 0.3f)
  396. {
  397. do_pain3 = true;
  398. gi.sound(self, CHAN_VOICE, sound_pain3, 1, ATTN_NORM, 0);
  399. }
  400. }
  401. }
  402. if (!M_ShouldReactToPain(self, mod))
  403. return; // no pain anims in nightmare
  404. jorg_attack1_end_sound(self);
  405. if (damage <= 50)
  406. M_SetAnimation(self, &jorg_move_pain1);
  407. else if (damage <= 100)
  408. M_SetAnimation(self, &jorg_move_pain2);
  409. else if (do_pain3)
  410. M_SetAnimation(self, &jorg_move_pain3);
  411. }
  412. MONSTERINFO_SETSKIN(jorg_setskin) (edict_t *self) -> void
  413. {
  414. if (self->health < (self->max_health / 2))
  415. self->s.skinnum = 1;
  416. else
  417. self->s.skinnum = 0;
  418. }
  419. void jorgBFG(edict_t *self)
  420. {
  421. vec3_t forward, right;
  422. vec3_t start;
  423. vec3_t dir;
  424. vec3_t vec;
  425. AngleVectors(self->s.angles, forward, right, nullptr);
  426. start = M_ProjectFlashSource(self, monster_flash_offset[MZ2_JORG_BFG_1], forward, right);
  427. vec = self->enemy->s.origin;
  428. vec[2] += self->enemy->viewheight;
  429. dir = vec - start;
  430. dir.normalize();
  431. gi.sound(self, CHAN_WEAPON, sound_bfg_fire, 1, ATTN_NORM, 0);
  432. monster_fire_bfg(self, start, dir, 50, 300, 100, 200, MZ2_JORG_BFG_1);
  433. }
  434. void jorg_firebullet_right(edict_t *self)
  435. {
  436. vec3_t forward, right, start;
  437. AngleVectors(self->s.angles, forward, right, nullptr);
  438. start = M_ProjectFlashSource(self, monster_flash_offset[MZ2_JORG_MACHINEGUN_R1], forward, right);
  439. PredictAim(self, self->enemy, start, 0, false, -0.2f, &forward, nullptr);
  440. monster_fire_bullet(self, start, forward, 6, 4, DEFAULT_BULLET_HSPREAD, DEFAULT_BULLET_VSPREAD, MZ2_JORG_MACHINEGUN_R1);
  441. }
  442. void jorg_firebullet_left(edict_t *self)
  443. {
  444. vec3_t forward, right, start;
  445. AngleVectors(self->s.angles, forward, right, nullptr);
  446. start = M_ProjectFlashSource(self, monster_flash_offset[MZ2_JORG_MACHINEGUN_L1], forward, right);
  447. PredictAim(self, self->enemy, start, 0, false, 0.2f, &forward, nullptr);
  448. monster_fire_bullet(self, start, forward, 6, 4, DEFAULT_BULLET_HSPREAD, DEFAULT_BULLET_VSPREAD, MZ2_JORG_MACHINEGUN_L1);
  449. }
  450. void jorg_firebullet(edict_t *self)
  451. {
  452. jorg_firebullet_left(self);
  453. jorg_firebullet_right(self);
  454. };
  455. MONSTERINFO_ATTACK(jorg_attack) (edict_t *self) -> void
  456. {
  457. if (frandom() <= 0.75f)
  458. {
  459. gi.sound(self, CHAN_WEAPON, sound_attack1, 1, ATTN_NORM, 0);
  460. self->monsterinfo.weapon_sound = gi.soundindex("boss3/w_loop.wav");
  461. M_SetAnimation(self, &jorg_move_start_attack1);
  462. }
  463. else
  464. {
  465. gi.sound(self, CHAN_VOICE, sound_attack2, 1, ATTN_NORM, 0);
  466. M_SetAnimation(self, &jorg_move_attack2);
  467. }
  468. }
  469. void jorg_dead(edict_t *self)
  470. {
  471. gi.WriteByte(svc_temp_entity);
  472. gi.WriteByte(TE_EXPLOSION1_BIG);
  473. gi.WritePosition(self->s.origin);
  474. gi.multicast(self->s.origin, MULTICAST_PHS, false);
  475. self->s.sound = 0;
  476. self->s.skinnum /= 2;
  477. ThrowGibs(self, 500, {
  478. { 2, "models/objects/gibs/sm_meat/tris.md2" },
  479. { 2, "models/objects/gibs/sm_metal/tris.md2", GIB_METALLIC },
  480. { "models/monsters/boss3/jorg/gibs/chest.md2", GIB_SKINNED },
  481. { 2, "models/monsters/boss3/jorg/gibs/foot.md2", GIB_SKINNED },
  482. { 2, "models/monsters/boss3/jorg/gibs/gun.md2", GIB_SKINNED | GIB_UPRIGHT },
  483. { 2, "models/monsters/boss3/jorg/gibs/thigh.md2", GIB_SKINNED | GIB_UPRIGHT },
  484. { "models/monsters/boss3/jorg/gibs/spine.md2", GIB_SKINNED | GIB_UPRIGHT },
  485. { 4, "models/monsters/boss3/jorg/gibs/tube.md2", GIB_SKINNED },
  486. { 6, "models/monsters/boss3/jorg/gibs/spike.md2", GIB_SKINNED },
  487. { "models/monsters/boss3/jorg/gibs/head.md2", GIB_SKINNED | GIB_METALLIC | GIB_HEAD }
  488. });
  489. MakronToss(self);
  490. }
  491. DIE(jorg_die) (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, const vec3_t &point, const mod_t &mod) -> void
  492. {
  493. gi.sound(self, CHAN_VOICE, sound_death, 1, ATTN_NORM, 0);
  494. jorg_attack1_end_sound(self);
  495. self->deadflag = true;
  496. self->takedamage = false;
  497. self->count = 0;
  498. M_SetAnimation(self, &jorg_move_death);
  499. }
  500. // [Paril-KEX] use generic function
  501. MONSTERINFO_CHECKATTACK(Jorg_CheckAttack) (edict_t *self) -> bool
  502. {
  503. return M_CheckAttack_Base(self, 0.4f, 0.8f, 0.4f, 0.2f, 0.0f, 0.f);
  504. }
  505. void MakronPrecache();
  506. /*QUAKED monster_jorg (1 .5 0) (-80 -80 0) (90 90 140) Ambush Trigger_Spawn Sight
  507. */
  508. void SP_monster_jorg(edict_t *self)
  509. {
  510. if ( !M_AllowSpawn( self ) ) {
  511. G_FreeEdict( self );
  512. return;
  513. }
  514. sound_pain1.assign("boss3/bs3pain1.wav");
  515. sound_pain2.assign("boss3/bs3pain2.wav");
  516. sound_pain3.assign("boss3/bs3pain3.wav");
  517. sound_death.assign("boss3/bs3deth1.wav");
  518. sound_attack1.assign("boss3/bs3atck1.wav");
  519. sound_attack1_loop.assign("boss3/bs3atck1_loop.wav");
  520. sound_attack1_end.assign("boss3/bs3atck1_end.wav");
  521. sound_attack2.assign("boss3/bs3atck2.wav");
  522. sound_search1.assign("boss3/bs3srch1.wav");
  523. sound_search2.assign("boss3/bs3srch2.wav");
  524. sound_search3.assign("boss3/bs3srch3.wav");
  525. sound_idle.assign("boss3/bs3idle1.wav");
  526. sound_step_left.assign("boss3/step1.wav");
  527. sound_step_right.assign("boss3/step2.wav");
  528. sound_firegun.assign("boss3/xfire.wav");
  529. sound_death_hit.assign("boss3/d_hit.wav");
  530. sound_bfg_fire.assign("makron/bfg_fire.wav");
  531. MakronPrecache();
  532. self->movetype = MOVETYPE_STEP;
  533. self->solid = SOLID_BBOX;
  534. self->s.modelindex = gi.modelindex("models/monsters/boss3/jorg/tris.md2");
  535. self->s.modelindex2 = gi.modelindex("models/monsters/boss3/rider/tris.md2");
  536. gi.modelindex("models/monsters/boss3/jorg/gibs/chest.md2");
  537. gi.modelindex("models/monsters/boss3/jorg/gibs/foot.md2");
  538. gi.modelindex("models/monsters/boss3/jorg/gibs/gun.md2");
  539. gi.modelindex("models/monsters/boss3/jorg/gibs/head.md2");
  540. gi.modelindex("models/monsters/boss3/jorg/gibs/spike.md2");
  541. gi.modelindex("models/monsters/boss3/jorg/gibs/spine.md2");
  542. gi.modelindex("models/monsters/boss3/jorg/gibs/thigh.md2");
  543. gi.modelindex("models/monsters/boss3/jorg/gibs/tube.md2");
  544. self->mins = { -80, -80, 0 };
  545. self->maxs = { 80, 80, 140 };
  546. self->health = 8000 * st.health_multiplier;
  547. self->gib_health = -2000;
  548. self->mass = 1000;
  549. self->pain = jorg_pain;
  550. self->die = jorg_die;
  551. self->monsterinfo.stand = jorg_stand;
  552. self->monsterinfo.walk = jorg_walk;
  553. self->monsterinfo.run = jorg_run;
  554. self->monsterinfo.dodge = nullptr;
  555. self->monsterinfo.attack = jorg_attack;
  556. self->monsterinfo.search = jorg_search;
  557. self->monsterinfo.melee = nullptr;
  558. self->monsterinfo.sight = nullptr;
  559. self->monsterinfo.checkattack = Jorg_CheckAttack;
  560. self->monsterinfo.setskin = jorg_setskin;
  561. gi.linkentity(self);
  562. M_SetAnimation(self, &jorg_move_stand);
  563. self->monsterinfo.scale = MODEL_SCALE;
  564. walkmonster_start(self);
  565. // PMM
  566. self->monsterinfo.aiflags |= AI_IGNORE_SHOTS;
  567. // pmm
  568. self->monsterinfo.aiflags |= AI_DOUBLE_TROUBLE;
  569. }