oldone.qc 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  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. OLD ONE
  18. ==============================================================================
  19. */
  20. $cd id1/models/old_one
  21. $origin 0 0 24
  22. $base base
  23. $skin skin
  24. $scale 1
  25. void() finale_1;
  26. void() finale_2;
  27. void() finale_3;
  28. void() finale_4;
  29. void() finale_5;
  30. void() finale_6;
  31. entity shub;
  32. $frame old1 old2 old3 old4 old5 old6 old7 old8 old9
  33. $frame old10 old11 old12 old13 old14 old15 old16 old17 old18 old19
  34. $frame old20 old21 old22 old23 old24 old25 old26 old27 old28 old29
  35. $frame old30 old31 old32 old33 old34 old35 old36 old37 old38 old39
  36. $frame old40 old41 old42 old43 old44 old45 old46
  37. $frame shake1 shake2 shake3 shake4 shake5 shake6 shake7 shake8
  38. $frame shake9 shake10 shake11 shake12 shake12 shake13 shake14
  39. $frame shake15 shake16 shake17 shake18 shake19 shake20
  40. //void() old_stand =[ $old1, old_stand ] {};
  41. void() old_idle1 =[ $old1, old_idle2 ] {};
  42. void() old_idle2 =[ $old2, old_idle3 ] {};
  43. void() old_idle3 =[ $old3, old_idle4 ] {};
  44. void() old_idle4 =[ $old4, old_idle5 ] {};
  45. void() old_idle5 =[ $old5, old_idle6 ] {};
  46. void() old_idle6 =[ $old6, old_idle7 ] {};
  47. void() old_idle7 =[ $old7, old_idle8 ] {};
  48. void() old_idle8 =[ $old8, old_idle9 ] {};
  49. void() old_idle9 =[ $old9, old_idle10 ] {};
  50. void() old_idle10 =[ $old10, old_idle11 ] {};
  51. void() old_idle11 =[ $old11, old_idle12 ] {};
  52. void() old_idle12 =[ $old12, old_idle13 ] {};
  53. void() old_idle13 =[ $old13, old_idle14 ] {};
  54. void() old_idle14 =[ $old14, old_idle15 ] {};
  55. void() old_idle15 =[ $old15, old_idle16 ] {};
  56. void() old_idle16 =[ $old16, old_idle17 ] {};
  57. void() old_idle17 =[ $old17, old_idle18 ] {};
  58. void() old_idle18 =[ $old18, old_idle19 ] {};
  59. void() old_idle19 =[ $old19, old_idle20 ] {};
  60. void() old_idle20 =[ $old20, old_idle21 ] {};
  61. void() old_idle21 =[ $old21, old_idle22 ] {};
  62. void() old_idle22 =[ $old22, old_idle23 ] {};
  63. void() old_idle23 =[ $old23, old_idle24 ] {};
  64. void() old_idle24 =[ $old24, old_idle25 ] {};
  65. void() old_idle25 =[ $old25, old_idle26 ] {};
  66. void() old_idle26 =[ $old26, old_idle27 ] {};
  67. void() old_idle27 =[ $old27, old_idle28 ] {};
  68. void() old_idle28 =[ $old28, old_idle29 ] {};
  69. void() old_idle29 =[ $old29, old_idle30 ] {};
  70. void() old_idle30 =[ $old30, old_idle31 ] {};
  71. void() old_idle31 =[ $old31, old_idle32 ] {};
  72. void() old_idle32 =[ $old32, old_idle33 ] {};
  73. void() old_idle33 =[ $old33, old_idle34 ] {};
  74. void() old_idle34 =[ $old34, old_idle35 ] {};
  75. void() old_idle35 =[ $old35, old_idle36 ] {};
  76. void() old_idle36 =[ $old36, old_idle37 ] {};
  77. void() old_idle37 =[ $old37, old_idle38 ] {};
  78. void() old_idle38 =[ $old38, old_idle39 ] {};
  79. void() old_idle39 =[ $old39, old_idle40 ] {};
  80. void() old_idle40 =[ $old40, old_idle41 ] {};
  81. void() old_idle41 =[ $old41, old_idle42 ] {};
  82. void() old_idle42 =[ $old42, old_idle43 ] {};
  83. void() old_idle43 =[ $old43, old_idle44 ] {};
  84. void() old_idle44 =[ $old44, old_idle45 ] {};
  85. void() old_idle45 =[ $old45, old_idle46 ] {};
  86. void() old_idle46 =[ $old46, old_idle1 ] {};
  87. void() old_thrash1 =[ $shake1, old_thrash2 ] {lightstyle(0, "m");};
  88. void() old_thrash2 =[ $shake2, old_thrash3 ] {lightstyle(0, "k");};
  89. void() old_thrash3 =[ $shake3, old_thrash4 ] {lightstyle(0, "k");};
  90. void() old_thrash4 =[ $shake4, old_thrash5 ] {lightstyle(0, "i");};
  91. void() old_thrash5 =[ $shake5, old_thrash6 ] {lightstyle(0, "g");};
  92. void() old_thrash6 =[ $shake6, old_thrash7 ] {lightstyle(0, "e");};
  93. void() old_thrash7 =[ $shake7, old_thrash8 ] {lightstyle(0, "c");};
  94. void() old_thrash8 =[ $shake8, old_thrash9 ] {lightstyle(0, "a");};
  95. void() old_thrash9 =[ $shake9, old_thrash10 ] {lightstyle(0, "c");};
  96. void() old_thrash10 =[ $shake10, old_thrash11 ] {lightstyle(0, "e");};
  97. void() old_thrash11 =[ $shake11, old_thrash12 ] {lightstyle(0, "g");};
  98. void() old_thrash12 =[ $shake12, old_thrash13 ] {lightstyle(0, "i");};
  99. void() old_thrash13 =[ $shake13, old_thrash14 ] {lightstyle(0, "k");};
  100. void() old_thrash14 =[ $shake14, old_thrash15 ] {lightstyle(0, "m");};
  101. void() old_thrash15 =[ $shake15, old_thrash16 ] {lightstyle(0, "m");
  102. self.cnt = self.cnt + 1;
  103. if (self.cnt != 3)
  104. self.think = old_thrash1;
  105. };
  106. void() old_thrash16 =[ $shake16, old_thrash17 ] {lightstyle(0, "g");};
  107. void() old_thrash17 =[ $shake17, old_thrash18 ] {lightstyle(0, "c");};
  108. void() old_thrash18 =[ $shake18, old_thrash19 ] {lightstyle(0, "b");};
  109. void() old_thrash19 =[ $shake19, old_thrash20 ] {lightstyle(0, "a");};
  110. void() old_thrash20 =[ $shake20, old_thrash20 ] {finale_4();};
  111. //============================================================================
  112. void() finale_1 =
  113. {
  114. local entity pos, pl;
  115. local entity timer;
  116. intermission_exittime = time + 10000000; // never allow exit
  117. intermission_running = 1;
  118. // find the intermission spot
  119. pos = find (world, classname, "info_intermission");
  120. if (!pos)
  121. error ("no info_intermission");
  122. pl = find (world, classname, "misc_teleporttrain");
  123. if (!pl)
  124. error ("no teleporttrain");
  125. remove (pl);
  126. WriteByte (MSG_ALL, SVC_FINALE);
  127. WriteString (MSG_ALL, "");
  128. pl = find (world, classname, "player");
  129. while (pl != world)
  130. {
  131. pl.view_ofs = '0 0 0';
  132. pl.angles = other.v_angle = pos.mangle;
  133. pl.fixangle = TRUE; // turn this way immediately
  134. pl.map = self.map;
  135. pl.nextthink = time + 0.5;
  136. pl.takedamage = DAMAGE_NO;
  137. pl.solid = SOLID_NOT;
  138. pl.movetype = MOVETYPE_NONE;
  139. pl.modelindex = 0;
  140. setorigin (pl, pos.origin);
  141. pl = find (pl, classname, "player");
  142. }
  143. // make fake versions of all players as standins, and move the real
  144. // players to the intermission spot
  145. // wait for 1 second
  146. timer = spawn();
  147. timer.nextthink = time + 1;
  148. timer.think = finale_2;
  149. };
  150. void() finale_2 =
  151. {
  152. local vector o;
  153. // start a teleport splash inside shub
  154. o = shub.origin - '0 100 0';
  155. WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
  156. WriteByte (MSG_BROADCAST, TE_TELEPORT);
  157. WriteCoord (MSG_BROADCAST, o_x);
  158. WriteCoord (MSG_BROADCAST, o_y);
  159. WriteCoord (MSG_BROADCAST, o_z);
  160. sound (shub, CHAN_VOICE, "misc/r_tele1.wav", 1, ATTN_NORM);
  161. self.nextthink = time + 2;
  162. self.think = finale_3;
  163. };
  164. void() finale_3 =
  165. {
  166. // start shub thrashing wildly
  167. shub.think = old_thrash1;
  168. sound (shub, CHAN_VOICE, "boss2/death.wav", 1, ATTN_NORM);
  169. lightstyle(0, "abcdefghijklmlkjihgfedcb");
  170. };
  171. void() finale_4 =
  172. {
  173. // throw tons of meat chunks
  174. local vector oldo;
  175. local float x, y, z;
  176. local float r;
  177. local entity n;
  178. sound (self, CHAN_VOICE, "boss2/pop2.wav", 1, ATTN_NORM);
  179. oldo = self.origin;
  180. z = 16;
  181. while (z <= 144)
  182. {
  183. x = -64;
  184. while (x <= 64)
  185. {
  186. y = -64;
  187. while (y <= 64)
  188. {
  189. self.origin_x = oldo_x + x;
  190. self.origin_y = oldo_y + y;
  191. self.origin_z = oldo_z + z;
  192. r = random();
  193. if (r < 0.3)
  194. ThrowGib ("progs/gib1.mdl", -999);
  195. else if (r < 0.6)
  196. ThrowGib ("progs/gib2.mdl", -999);
  197. else
  198. ThrowGib ("progs/gib3.mdl", -999);
  199. y = y + 32;
  200. }
  201. x = x + 32;
  202. }
  203. z = z + 96;
  204. }
  205. // start the end text
  206. WriteByte (MSG_ALL, SVC_FINALE);
  207. WriteString (MSG_ALL, "$qc_finale_end");
  208. // put a player model down
  209. n = spawn();
  210. setmodel (n, "progs/player.mdl");
  211. oldo = oldo - '32 264 0';
  212. setorigin (n, oldo);
  213. n.angles = '0 290 0';
  214. n.frame = 1;
  215. remove (self);
  216. // switch cd track
  217. WriteByte (MSG_ALL, SVC_CDTRACK);
  218. WriteByte (MSG_ALL, 3);
  219. WriteByte (MSG_ALL, 3);
  220. lightstyle(0, "m");
  221. // instead of sitting here forever, run the quake ex credits and send the user back to start
  222. local entity timer = spawn();
  223. timer.nextthink = time + 1;
  224. timer.think = finale_5;
  225. };
  226. void() finale_5 =
  227. {
  228. if (finaleFinished()) {
  229. self.nextthink = time + 5;
  230. self.think = finale_6;
  231. } else {
  232. self.nextthink = time + 0.1;
  233. }
  234. }
  235. void() finale_6 =
  236. {
  237. if (!coop) {
  238. localcmd("menu_credits\n");
  239. localcmd("disconnect\n");
  240. } else {
  241. changelevel("start");
  242. }
  243. }
  244. //============================================================================
  245. void () nopain =
  246. {
  247. self.health = 40000;
  248. };
  249. //============================================================================
  250. /*QUAKED monster_oldone (1 0 0) (-16 -16 -24) (16 16 32)
  251. */
  252. void() monster_oldone =
  253. {
  254. if (deathmatch)
  255. {
  256. remove(self);
  257. return;
  258. }
  259. precache_model2 ("progs/oldone.mdl");
  260. precache_sound2 ("boss2/death.wav");
  261. precache_sound2 ("boss2/idle.wav");
  262. precache_sound2 ("boss2/sight.wav");
  263. precache_sound2 ("boss2/pop2.wav");
  264. self.solid = SOLID_SLIDEBOX;
  265. self.movetype = MOVETYPE_STEP;
  266. setmodel (self, "progs/oldone.mdl");
  267. setsize (self, '-160 -128 -24', '160 128 256');
  268. self.health = 40000; // kill by telefrag
  269. self.think = old_idle1;
  270. self.nextthink = time + 0.1;
  271. self.takedamage = DAMAGE_YES;
  272. self.th_pain = nopain;
  273. self.th_die = finale_1;
  274. shub = self;
  275. total_monsters = total_monsters + 1;
  276. };