ogre.qc 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523
  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. OGRE
  18. ==============================================================================
  19. */
  20. $cd id1/models/ogre_c
  21. $origin 0 0 24
  22. $base base
  23. $skin base
  24. $frame stand1 stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9
  25. $frame walk1 walk2 walk3 walk4 walk5 walk6 walk7
  26. $frame walk8 walk9 walk10 walk11 walk12 walk13 walk14 walk15 walk16
  27. $frame run1 run2 run3 run4 run5 run6 run7 run8
  28. $frame swing1 swing2 swing3 swing4 swing5 swing6 swing7
  29. $frame swing8 swing9 swing10 swing11 swing12 swing13 swing14
  30. $frame smash1 smash2 smash3 smash4 smash5 smash6 smash7
  31. $frame smash8 smash9 smash10 smash11 smash12 smash13 smash14
  32. $frame shoot1 shoot2 shoot3 shoot4 shoot5 shoot6
  33. $frame pain1 pain2 pain3 pain4 pain5
  34. $frame painb1 painb2 painb3
  35. $frame painc1 painc2 painc3 painc4 painc5 painc6
  36. $frame paind1 paind2 paind3 paind4 paind5 paind6 paind7 paind8 paind9 paind10
  37. $frame paind11 paind12 paind13 paind14 paind15 paind16
  38. $frame paine1 paine2 paine3 paine4 paine5 paine6 paine7 paine8 paine9 paine10
  39. $frame paine11 paine12 paine13 paine14 paine15
  40. $frame death1 death2 death3 death4 death5 death6
  41. $frame death7 death8 death9 death10 death11 death12
  42. $frame death13 death14
  43. $frame bdeath1 bdeath2 bdeath3 bdeath4 bdeath5 bdeath6
  44. $frame bdeath7 bdeath8 bdeath9 bdeath10
  45. $frame pull1 pull2 pull3 pull4 pull5 pull6 pull7 pull8 pull9 pull10 pull11
  46. //=============================================================================
  47. float OGRE_BOSS = 2;
  48. float OGRE_NORMAL = 4;
  49. void() OgreGrenadeExplode =
  50. {
  51. T_RadiusDamage (self, self.owner, 40, world);
  52. sound (self, CHAN_VOICE, "weapons/r_exp3.wav", 1, ATTN_NORM);
  53. WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
  54. WriteByte (MSG_BROADCAST, TE_EXPLOSION);
  55. WriteCoord (MSG_BROADCAST, self.origin_x);
  56. WriteCoord (MSG_BROADCAST, self.origin_y);
  57. WriteCoord (MSG_BROADCAST, self.origin_z);
  58. self.velocity = '0 0 0';
  59. self.touch = SUB_Null;
  60. setmodel (self, "progs/s_explod.spr");
  61. self.solid = SOLID_NOT;
  62. s_explode1 ();
  63. };
  64. void() OgreGrenadeTouch =
  65. {
  66. if (other == self.owner)
  67. return; // don't explode on owner
  68. if (other.takedamage == DAMAGE_AIM)
  69. {
  70. OgreGrenadeExplode();
  71. return;
  72. }
  73. sound (self, CHAN_VOICE, "weapons/bounce.wav", 1, ATTN_NORM); // bounce sound
  74. if (self.velocity == '0 0 0')
  75. self.avelocity = '0 0 0';
  76. };
  77. /*
  78. ================
  79. OgreFireGrenade
  80. ================
  81. */
  82. void() MultiGrenadeTouch;
  83. void() MultiGrenadeExplode;
  84. void() OgreFireGrenade =
  85. {
  86. local entity missile, mpuff;
  87. self.effects = self.effects | EF_MUZZLEFLASH;
  88. sound (self, CHAN_WEAPON, "weapons/grenade.wav", 1, ATTN_NORM);
  89. missile = spawn ();
  90. missile.owner = self;
  91. missile.movetype = MOVETYPE_BOUNCE;
  92. missile.solid = SOLID_BBOX;
  93. missile.classname = "ogre_grenade";
  94. // set missile speed
  95. makevectors (self.angles);
  96. missile.velocity = normalize(self.enemy.origin - self.origin);
  97. missile.velocity = missile.velocity * 600;
  98. missile.velocity_z = 200;
  99. missile.avelocity = '300 300 300';
  100. missile.angles = vectoangles(missile.velocity);
  101. if (cvar("pr_checkextension"))
  102. if (checkextension("EX_EXTENDED_EF"))
  103. missile.effects = missile.effects | EF_CANDLELIGHT; // give the projectiles a weak glow
  104. // set missile duration
  105. if(self.spawnflags & OGRE_BOSS)
  106. {
  107. missile.touch = MultiGrenadeTouch;
  108. missile.nextthink = time + 2.5;
  109. missile.think = MultiGrenadeExplode;
  110. setmodel (missile, "progs/mervup.mdl");
  111. setsize (missile, '0 0 0', '0 0 0');
  112. setorigin (missile, self.origin);
  113. missile.classname = "MultiGrenade";
  114. }
  115. else
  116. {
  117. missile.touch = OgreGrenadeTouch;
  118. missile.nextthink = time + 2.5;
  119. missile.think = OgreGrenadeExplode;
  120. setmodel (missile, "progs/grenade.mdl");
  121. setsize (missile, '0 0 0', '0 0 0');
  122. setorigin (missile, self.origin);
  123. }
  124. };
  125. //=============================================================================
  126. /*
  127. ================
  128. chainsaw
  129. FIXME
  130. ================
  131. */
  132. void(float side) chainsaw =
  133. {
  134. local vector delta;
  135. local float ldmg;
  136. if (!self.enemy)
  137. return;
  138. if (!CanDamage (self.enemy, self))
  139. return;
  140. ai_charge(10);
  141. delta = self.enemy.origin - self.origin;
  142. if (vlen(delta) > 100)
  143. return;
  144. ldmg = (random() + random() + random()) * 4;
  145. T_Damage (self.enemy, self, self, ldmg);
  146. if (side)
  147. {
  148. makevectors (self.angles);
  149. if (side == 1)
  150. SpawnMeatSpray (self.origin + v_forward*16, crandom() * 100 * v_right);
  151. else
  152. SpawnMeatSpray (self.origin + v_forward*16, side * v_right);
  153. }
  154. };
  155. void() ogre_stand1 =[ $stand1, ogre_stand2 ] {ai_stand();};
  156. void() ogre_stand2 =[ $stand2, ogre_stand3 ] {ai_stand();};
  157. void() ogre_stand3 =[ $stand3, ogre_stand4 ] {ai_stand();};
  158. void() ogre_stand4 =[ $stand4, ogre_stand5 ] {ai_stand();};
  159. void() ogre_stand5 =[ $stand5, ogre_stand6 ] {
  160. if (random() < 0.2)
  161. sound (self, CHAN_VOICE, "ogre/ogidle.wav", 1, ATTN_IDLE);
  162. ai_stand();
  163. };
  164. void() ogre_stand6 =[ $stand6, ogre_stand7 ] {ai_stand();};
  165. void() ogre_stand7 =[ $stand7, ogre_stand8 ] {ai_stand();};
  166. void() ogre_stand8 =[ $stand8, ogre_stand9 ] {ai_stand();};
  167. void() ogre_stand9 =[ $stand9, ogre_stand1 ] {ai_stand();};
  168. void() ogre_walk1 =[ $walk1, ogre_walk2 ] {ai_walk(3);};
  169. void() ogre_walk2 =[ $walk2, ogre_walk3 ] {ai_walk(2);};
  170. void() ogre_walk3 =[ $walk3, ogre_walk4 ] {
  171. ai_walk(2);
  172. if (random() < 0.2)
  173. sound (self, CHAN_VOICE, "ogre/ogidle.wav", 1, ATTN_IDLE);
  174. };
  175. void() ogre_walk4 =[ $walk4, ogre_walk5 ] {ai_walk(2);};
  176. void() ogre_walk5 =[ $walk5, ogre_walk6 ] {ai_walk(2);};
  177. void() ogre_walk6 =[ $walk6, ogre_walk7 ] {
  178. ai_walk(5);
  179. if (random() < 0.1)
  180. sound (self, CHAN_VOICE, "ogre/ogdrag.wav", 1, ATTN_IDLE);
  181. };
  182. void() ogre_walk7 =[ $walk7, ogre_walk8 ] {ai_walk(3);};
  183. void() ogre_walk8 =[ $walk8, ogre_walk9 ] {ai_walk(2);};
  184. void() ogre_walk9 =[ $walk9, ogre_walk10 ] {ai_walk(3);};
  185. void() ogre_walk10 =[ $walk10, ogre_walk11 ] {ai_walk(1);};
  186. void() ogre_walk11 =[ $walk11, ogre_walk12 ] {ai_walk(2);};
  187. void() ogre_walk12 =[ $walk12, ogre_walk13 ] {ai_walk(3);};
  188. void() ogre_walk13 =[ $walk13, ogre_walk14 ] {ai_walk(3);};
  189. void() ogre_walk14 =[ $walk14, ogre_walk15 ] {ai_walk(3);};
  190. void() ogre_walk15 =[ $walk15, ogre_walk16 ] {ai_walk(3);};
  191. void() ogre_walk16 =[ $walk16, ogre_walk1 ] {ai_walk(4);};
  192. void() ogre_run1 =[ $run1, ogre_run2 ] {ai_run(9);
  193. if (random() < 0.2)
  194. sound (self, CHAN_VOICE, "ogre/ogidle2.wav", 1, ATTN_IDLE);
  195. };
  196. void() ogre_run2 =[ $run2, ogre_run3 ] {ai_run(12);};
  197. void() ogre_run3 =[ $run3, ogre_run4 ] {ai_run(8);};
  198. void() ogre_run4 =[ $run4, ogre_run5 ] {ai_run(22);};
  199. void() ogre_run5 =[ $run5, ogre_run6 ] {ai_run(16);};
  200. void() ogre_run6 =[ $run6, ogre_run7 ] {ai_run(4);};
  201. void() ogre_run7 =[ $run7, ogre_run8 ] {ai_run(13);};
  202. void() ogre_run8 =[ $run8, ogre_run1 ] {ai_run(24);};
  203. void() ogre_swing1 =[ $swing1, ogre_swing2 ] {ai_charge(11);
  204. sound (self, CHAN_WEAPON, "ogre/ogsawatk.wav", 1, ATTN_NORM);
  205. };
  206. void() ogre_swing2 =[ $swing2, ogre_swing3 ] {ai_charge(1);};
  207. void() ogre_swing3 =[ $swing3, ogre_swing4 ] {ai_charge(4);};
  208. void() ogre_swing4 =[ $swing4, ogre_swing5 ] {ai_charge(13);};
  209. void() ogre_swing5 =[ $swing5, ogre_swing6 ] {ai_charge(9); chainsaw(0);self.angles_y = self.angles_y + random()*25;};
  210. void() ogre_swing6 =[ $swing6, ogre_swing7 ] {chainsaw(200);self.angles_y = self.angles_y + random()* 25;};
  211. void() ogre_swing7 =[ $swing7, ogre_swing8 ] {chainsaw(0);self.angles_y = self.angles_y + random()* 25;};
  212. void() ogre_swing8 =[ $swing8, ogre_swing9 ] {chainsaw(0);self.angles_y = self.angles_y + random()* 25;};
  213. void() ogre_swing9 =[ $swing9, ogre_swing10 ] {chainsaw(0);self.angles_y = self.angles_y + random()* 25;};
  214. void() ogre_swing10 =[ $swing10, ogre_swing11 ] {chainsaw(-200);self.angles_y = self.angles_y + random()* 25;};
  215. void() ogre_swing11 =[ $swing11, ogre_swing12 ] {chainsaw(0);self.angles_y = self.angles_y + random()* 25;};
  216. void() ogre_swing12 =[ $swing12, ogre_swing13 ] {ai_charge(3);};
  217. void() ogre_swing13 =[ $swing13, ogre_swing14 ] {ai_charge(8);};
  218. void() ogre_swing14 =[ $swing14, ogre_run1 ] {ai_charge(9);};
  219. void() ogre_smash1 =[ $smash1, ogre_smash2 ] {ai_charge(6);
  220. sound (self, CHAN_WEAPON, "ogre/ogsawatk.wav", 1, ATTN_NORM);
  221. };
  222. void() ogre_smash2 =[ $smash2, ogre_smash3 ] {ai_charge(0);};
  223. void() ogre_smash3 =[ $smash3, ogre_smash4 ] {ai_charge(0);};
  224. void() ogre_smash4 =[ $smash4, ogre_smash5 ] {ai_charge(1);};
  225. void() ogre_smash5 =[ $smash5, ogre_smash6 ] {ai_charge(4);};
  226. void() ogre_smash6 =[ $smash6, ogre_smash7 ] {ai_charge(4); chainsaw(0);};
  227. void() ogre_smash7 =[ $smash7, ogre_smash8 ] {ai_charge(4); chainsaw(0);};
  228. void() ogre_smash8 =[ $smash8, ogre_smash9 ] {ai_charge(10); chainsaw(0);};
  229. void() ogre_smash9 =[ $smash9, ogre_smash10 ] {ai_charge(13); chainsaw(0);};
  230. void() ogre_smash10 =[ $smash10, ogre_smash11 ] {chainsaw(1);};
  231. void() ogre_smash11 =[ $smash11, ogre_smash12 ] {ai_charge(2); chainsaw(0);
  232. self.nextthink = self.nextthink + random()*0.2;}; // slight variation
  233. void() ogre_smash12 =[ $smash12, ogre_smash13 ] {ai_charge();};
  234. void() ogre_smash13 =[ $smash13, ogre_smash14 ] {ai_charge(4);};
  235. void() ogre_smash14 =[ $smash14, ogre_run1 ] {ai_charge(12);};
  236. void() ogre_nail1 =[ $shoot1, ogre_nail2 ] {ai_face();};
  237. void() ogre_nail2 =[ $shoot2, ogre_nail3 ] {ai_face();};
  238. void() ogre_nail3 =[ $shoot2, ogre_nail4 ] {ai_face();};
  239. void() ogre_nail4 =[ $shoot3, ogre_nail5 ] {ai_face();OgreFireGrenade();};
  240. void() ogre_nail5 =[ $shoot4, ogre_nail6 ] {ai_face();};
  241. void() ogre_nail6 =[ $shoot5, ogre_nail7 ] {ai_face();};
  242. void() ogre_nail7 =[ $shoot6, ogre_run1 ] {ai_face();};
  243. void() ogre_pain1 =[ $pain1, ogre_pain2 ] {};
  244. void() ogre_pain2 =[ $pain2, ogre_pain3 ] {};
  245. void() ogre_pain3 =[ $pain3, ogre_pain4 ] {};
  246. void() ogre_pain4 =[ $pain4, ogre_pain5 ] {};
  247. void() ogre_pain5 =[ $pain5, ogre_run1 ] {};
  248. void() ogre_painb1 =[ $painb1, ogre_painb2 ] {};
  249. void() ogre_painb2 =[ $painb2, ogre_painb3 ] {};
  250. void() ogre_painb3 =[ $painb3, ogre_run1 ] {};
  251. void() ogre_painc1 =[ $painc1, ogre_painc2 ] {};
  252. void() ogre_painc2 =[ $painc2, ogre_painc3 ] {};
  253. void() ogre_painc3 =[ $painc3, ogre_painc4 ] {};
  254. void() ogre_painc4 =[ $painc4, ogre_painc5 ] {};
  255. void() ogre_painc5 =[ $painc5, ogre_painc6 ] {};
  256. void() ogre_painc6 =[ $painc6, ogre_run1 ] {};
  257. void() ogre_paind1 =[ $paind1, ogre_paind2 ] {};
  258. void() ogre_paind2 =[ $paind2, ogre_paind3 ] {ai_pain(10);};
  259. void() ogre_paind3 =[ $paind3, ogre_paind4 ] {ai_pain(9);};
  260. void() ogre_paind4 =[ $paind4, ogre_paind5 ] {ai_pain(4);};
  261. void() ogre_paind5 =[ $paind5, ogre_paind6 ] {};
  262. void() ogre_paind6 =[ $paind6, ogre_paind7 ] {};
  263. void() ogre_paind7 =[ $paind7, ogre_paind8 ] {};
  264. void() ogre_paind8 =[ $paind8, ogre_paind9 ] {};
  265. void() ogre_paind9 =[ $paind9, ogre_paind10 ] {};
  266. void() ogre_paind10=[ $paind10, ogre_paind11 ] {};
  267. void() ogre_paind11=[ $paind11, ogre_paind12 ] {};
  268. void() ogre_paind12=[ $paind12, ogre_paind13 ] {};
  269. void() ogre_paind13=[ $paind13, ogre_paind14 ] {};
  270. void() ogre_paind14=[ $paind14, ogre_paind15 ] {};
  271. void() ogre_paind15=[ $paind15, ogre_paind16 ] {};
  272. void() ogre_paind16=[ $paind16, ogre_run1 ] {};
  273. void() ogre_paine1 =[ $paine1, ogre_paine2 ] {};
  274. void() ogre_paine2 =[ $paine2, ogre_paine3 ] {ai_pain(10);};
  275. void() ogre_paine3 =[ $paine3, ogre_paine4 ] {ai_pain(9);};
  276. void() ogre_paine4 =[ $paine4, ogre_paine5 ] {ai_pain(4);};
  277. void() ogre_paine5 =[ $paine5, ogre_paine6 ] {};
  278. void() ogre_paine6 =[ $paine6, ogre_paine7 ] {};
  279. void() ogre_paine7 =[ $paine7, ogre_paine8 ] {};
  280. void() ogre_paine8 =[ $paine8, ogre_paine9 ] {};
  281. void() ogre_paine9 =[ $paine9, ogre_paine10 ] {};
  282. void() ogre_paine10=[ $paine10, ogre_paine11 ] {};
  283. void() ogre_paine11=[ $paine11, ogre_paine12 ] {};
  284. void() ogre_paine12=[ $paine12, ogre_paine13 ] {};
  285. void() ogre_paine13=[ $paine13, ogre_paine14 ] {};
  286. void() ogre_paine14=[ $paine14, ogre_paine15 ] {};
  287. void() ogre_paine15=[ $paine15, ogre_run1 ] {};
  288. void(entity attacker, float damage) ogre_pain =
  289. {
  290. local float r;
  291. // don't make multiple pain sounds right after each other
  292. if (self.pain_finished > time)
  293. return;
  294. sound (self, CHAN_VOICE, "ogre/ogpain1.wav", 1, ATTN_NORM);
  295. r = random();
  296. if (r < 0.25)
  297. {
  298. ogre_pain1 ();
  299. self.pain_finished = time + 1;
  300. }
  301. else if (r < 0.5)
  302. {
  303. ogre_painb1 ();
  304. self.pain_finished = time + 1;
  305. }
  306. else if (r < 0.75)
  307. {
  308. ogre_painc1 ();
  309. self.pain_finished = time + 1;
  310. }
  311. else if (r < 0.88)
  312. {
  313. ogre_paind1 ();
  314. self.pain_finished = time + 2;
  315. }
  316. else
  317. {
  318. ogre_paine1 ();
  319. self.pain_finished = time + 2;
  320. }
  321. };
  322. void() ogre_die1 =[ $death1, ogre_die2 ] {};
  323. void() ogre_die2 =[ $death2, ogre_die3 ] {};
  324. void() ogre_die3 =[ $death3, ogre_die4 ]
  325. {
  326. self.solid = SOLID_NOT;
  327. if (self.spawnflags & OGRE_BOSS)
  328. self.ammo_multi_rockets = 2;
  329. else
  330. self.ammo_rockets = 2;
  331. DropBackpack();
  332. };
  333. void() ogre_die4 =[ $death4, ogre_die5 ] {};
  334. void() ogre_die5 =[ $death5, ogre_die6 ] {};
  335. void() ogre_die6 =[ $death6, ogre_die7 ] {};
  336. void() ogre_die7 =[ $death7, ogre_die8 ] {};
  337. void() ogre_die8 =[ $death8, ogre_die9 ] {};
  338. void() ogre_die9 =[ $death9, ogre_die10 ] {};
  339. void() ogre_die10 =[ $death10, ogre_die11 ] {};
  340. void() ogre_die11 =[ $death11, ogre_die12 ] {};
  341. void() ogre_die12 =[ $death12, ogre_die13 ] {};
  342. void() ogre_die13 =[ $death13, ogre_die14 ] {};
  343. void() ogre_die14 =[ $death14, ogre_die14 ] {};
  344. void() ogre_bdie1 =[ $bdeath1, ogre_bdie2 ] {};
  345. void() ogre_bdie2 =[ $bdeath2, ogre_bdie3 ] {ai_forward(5);};
  346. void() ogre_bdie3 =[ $bdeath3, ogre_bdie4 ]
  347. {
  348. self.solid = SOLID_NOT;
  349. if (self.spawnflags & OGRE_BOSS)
  350. self.ammo_multi_rockets = 2;
  351. else
  352. self.ammo_rockets = 2;
  353. DropBackpack();
  354. };
  355. void() ogre_bdie4 =[ $bdeath4, ogre_bdie5 ] {ai_forward(1);};
  356. void() ogre_bdie5 =[ $bdeath5, ogre_bdie6 ] {ai_forward(3);};
  357. void() ogre_bdie6 =[ $bdeath6, ogre_bdie7 ] {ai_forward(7);};
  358. void() ogre_bdie7 =[ $bdeath7, ogre_bdie8 ] {ai_forward(25);};
  359. void() ogre_bdie8 =[ $bdeath8, ogre_bdie9 ] {};
  360. void() ogre_bdie9 =[ $bdeath9, ogre_bdie10 ] {};
  361. void() ogre_bdie10 =[ $bdeath10, ogre_bdie10 ] {};
  362. void() ogre_die =
  363. {
  364. // check for gib
  365. if (self.health < -80)
  366. {
  367. sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM);
  368. ThrowHead ("progs/h_ogre.mdl", self.health);
  369. ThrowGib ("progs/gib3.mdl", self.health);
  370. ThrowGib ("progs/gib3.mdl", self.health);
  371. ThrowGib ("progs/gib3.mdl", self.health);
  372. return;
  373. }
  374. sound (self, CHAN_VOICE, "ogre/ogdth.wav", 1, ATTN_NORM);
  375. if (random() < 0.5)
  376. ogre_die1 ();
  377. else
  378. ogre_bdie1 ();
  379. };
  380. void() ogre_melee =
  381. {
  382. if (random() > 0.5)
  383. ogre_smash1 ();
  384. else
  385. ogre_swing1 ();
  386. };
  387. /*QUAKED monster_ogre (1 0 0) (-32 -32 -24) (32 32 64) Ambush Boss Normal
  388. The Ogre
  389. Boss: use the modified skin and fire multigrenades.
  390. Normal: use the original skin and fire normal grenades.
  391. */
  392. void() monster_ogre =
  393. {
  394. if (deathmatch)
  395. {
  396. remove(self);
  397. return;
  398. }
  399. precache_model ("progs/ogre.mdl");
  400. precache_model ("progs/h_ogre.mdl");
  401. precache_model ("progs/grenade.mdl");
  402. precache_sound ("ogre/ogdrag.wav");
  403. precache_sound ("ogre/ogdth.wav");
  404. precache_sound ("ogre/ogidle.wav");
  405. precache_sound ("ogre/ogidle2.wav");
  406. precache_sound ("ogre/ogpain1.wav");
  407. precache_sound ("ogre/ogsawatk.wav");
  408. precache_sound ("ogre/ogwake.wav");
  409. self.solid = SOLID_SLIDEBOX;
  410. self.movetype = MOVETYPE_STEP;
  411. setmodel (self, "progs/ogre.mdl");
  412. // none specified - choose random. 25% boss on normal, hard, bloodbath
  413. if (self.spawnflags <= 1)
  414. {
  415. if (cvar("skill") > 0)
  416. {
  417. if ( random() <= 0.25 )
  418. {
  419. self.spawnflags = self.spawnflags | OGRE_BOSS;
  420. }
  421. }
  422. }
  423. if (self.spawnflags & OGRE_BOSS)
  424. {
  425. self.skin = 1;
  426. }
  427. setsize (self, VEC_HULL2_MIN, VEC_HULL2_MAX);
  428. self.health = 200;
  429. self.th_stand = ogre_stand1;
  430. self.th_walk = ogre_walk1;
  431. self.th_run = ogre_run1;
  432. self.th_die = ogre_die;
  433. self.th_melee = ogre_melee;
  434. self.th_missile = ogre_nail1;
  435. self.th_pain = ogre_pain;
  436. walkmonster_start();
  437. };