invis_sw.qc 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  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. SWORD
  18. ==============================================================================
  19. */
  20. $cd /qwork/xpack/models/sword
  21. $origin 0 0 24
  22. $base base
  23. $skin badass3
  24. $frame stand1
  25. //$stand2 stand3 stand4 stand5 stand6 stand7 stand8 stand9
  26. $frame runb1 runb2 runb3 runb4 runb5 runb6 runb7 runb8
  27. //frame runc1 runc2 runc3 runc4 runc5 runc6
  28. //$frame runattack1 runattack2 runattack3 runattack4 runattack5
  29. //$frame runattack6 runattack7 runattack8 runattack9 runattack10
  30. //$frame runattack11
  31. //$frame pain1 pain2 pain3
  32. //$frame painb1 painb2 painb3 painb4 painb5 painb6 painb7 painb8 painb9
  33. //$frame painb10 painb11
  34. //frame attack1 attack2 attack3 attack4 attack5 attack6 attack7
  35. //frame attack8 attack9 attack10 attack11
  36. $frame attackb1 attackb2 attackb3 attackb4 attackb5
  37. $frame attackb6 attackb7 attackb8 attackb9 attackb10
  38. //$frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9
  39. //$frame walk10 walk11 walk12 walk13 walk14
  40. //$frame kneel1 kneel2 kneel3 kneel4 kneel5
  41. //$frame standing2 standing3 standing4 standing5
  42. $frame death1 death2 death3 death4 death5 death6 death7 death8
  43. $frame death9 death10
  44. $frame deathb1 deathb2 deathb3 deathb4 deathb5 deathb6 deathb7 deathb8
  45. $frame deathb9 deathb10 deathb11
  46. void() sword_stand1 =[ $stand1, sword_stand1 ] {ai_stand();};
  47. /*
  48. void() sword_walk1 =[ $walk1, sword_walk2 ] {ai_walk(4);};
  49. void() sword_walk2 =[ $walk2, sword_walk3 ] {ai_walk(4);};
  50. void() sword_walk3 =[ $walk3, sword_walk4 ] {ai_walk(4);};
  51. void() sword_walk4 =[ $walk4, sword_walk5 ] {ai_walk(4);};
  52. void() sword_walk5 =[ $walk5, sword_walk6 ] {ai_walk(4);};
  53. void() sword_walk6 =[ $walk6, sword_walk7 ] {ai_walk(4);};
  54. void() sword_walk7 =[ $walk7, sword_walk8 ] {ai_walk(4);};
  55. void() sword_walk8 =[ $walk8, sword_walk9 ] {ai_walk(4);};
  56. void() sword_walk9 =[ $walk9, sword_walk10 ] {ai_walk(4);};
  57. void() sword_walk10 =[ $walk10, sword_walk11 ] {ai_walk(4);};
  58. void() sword_walk11 =[ $walk11, sword_walk12 ] {ai_walk(4);};
  59. void() sword_walk12 =[ $walk12, sword_walk13 ] {ai_walk(4);};
  60. void() sword_walk13 =[ $walk13, sword_walk14 ] {ai_walk(4);};
  61. void() sword_walk14 =[ $walk14, sword_walk1 ] {ai_walk(4);};
  62. */
  63. void() sword_run1 =[ $runb1, sword_run2 ]
  64. {self.effects = EF_DIMLIGHT; ai_run(14);};
  65. void() sword_run2 =[ $runb2, sword_run3 ] {ai_run(14);};
  66. void() sword_run3 =[ $runb3, sword_run4 ] {ai_run(14);};
  67. void() sword_run4 =[ $runb4, sword_run5 ] {ai_run(14);};
  68. void() sword_run5 =[ $runb5, sword_run6 ] {ai_run(14);};
  69. void() sword_run6 =[ $runb6, sword_run7 ] {ai_run(14);};
  70. void() sword_run7 =[ $runb7, sword_run8 ] {ai_run(14);};
  71. void() sword_run8 =[ $runb8, sword_run1 ] {ai_run(14);};
  72. void() sword_atk1 =[ $attackb1, sword_atk2 ]
  73. {sound (self,0,"knight/sword1.wav", 1, 1);ai_charge(14);};
  74. void() sword_atk2 =[ $attackb2, sword_atk3 ] {ai_charge(14);};
  75. void() sword_atk3 =[ $attackb3, sword_atk4 ] {ai_charge(14);};
  76. void() sword_atk4 =[ $attackb4, sword_atk5 ] {ai_charge(14);};
  77. void() sword_atk5 =[ $attackb5, sword_atk6 ] {ai_melee();};
  78. void() sword_atk6 =[ $attackb6, sword_atk7 ] {ai_melee();};
  79. void() sword_atk7 =[ $attackb7, sword_atk8 ] {ai_melee();};
  80. void() sword_atk8 =[ $attackb8, sword_atk9 ] {ai_charge(14);};
  81. void() sword_atk9 =[ $attackb9, sword_atk10] {ai_charge(14);};
  82. void() sword_atk10=[ $attackb10, sword_run1 ] {ai_charge(14);};
  83. //===========================================================================
  84. void() sword_die1 =[ $death1, sword_die2 ] {};
  85. void() sword_die2 =[ $death2, sword_die3 ] {};
  86. void() sword_die3 =[ $death3, sword_die4 ]
  87. {self.solid = SOLID_NOT;};
  88. void() sword_die4 =[ $death4, sword_die5 ] {};
  89. void() sword_die5 =[ $death5, sword_die6 ] {};
  90. void() sword_die6 =[ $death6, sword_die7 ] {};
  91. void() sword_die7 =[ $death7, sword_die8 ]
  92. { sound (self, 1, "player/axhit2.wav", 0.5, ATTN_NORM);};
  93. void() sword_die8 =[ $death8, sword_die9 ] {};
  94. void() sword_die9 =[ $death9, sword_die10] {};
  95. void() sword_die10=[ $death10, sword_die10] {};
  96. void() sword_dieb1 =[ $deathb1, sword_dieb2 ] {};
  97. void() sword_dieb2 =[ $deathb2, sword_dieb3 ] {};
  98. void() sword_dieb3 =[ $deathb3, sword_dieb4 ]
  99. {self.solid = SOLID_NOT;};
  100. void() sword_dieb4 =[ $deathb4, sword_dieb5 ] {};
  101. void() sword_dieb5 =[ $deathb5, sword_dieb6 ] {};
  102. void() sword_dieb6 =[ $deathb6, sword_dieb7 ] {};
  103. void() sword_dieb7 =[ $deathb7, sword_dieb8 ]
  104. { sound (self, 1, "player/axhit2.wav", 0.5, ATTN_NORM); };
  105. void() sword_dieb8 =[ $deathb8, sword_dieb9 ] {};
  106. void() sword_dieb9 =[ $deathb9, sword_dieb10] {};
  107. void() sword_dieb10 = [ $deathb10, sword_dieb11] {};
  108. void() sword_dieb11 = [ $deathb11, sword_dieb11] {};
  109. void() sword_die =
  110. {
  111. // regular death
  112. self.effects=0;
  113. if (random() < 0.5)
  114. sword_die1 ();
  115. else
  116. sword_dieb1 ();
  117. };
  118. void() sword_pause =
  119. {
  120. self.th_run = sword_run1;
  121. self.think = sword_run1;
  122. self.nextthink = time + self.delay;
  123. self.delay = 0;
  124. };
  125. void() sword_pain =
  126. {
  127. self.th_run = sword_run1;
  128. self.think = sword_run1;
  129. self.nextthink = time + 0.1;
  130. self.delay = 0;
  131. self.th_pain = SUB_Null;
  132. };
  133. /*QUAKED monster_sword (1 0 0) (-16 -16 -24) (16 16 40) Ambush
  134. The Invisible Swordsman
  135. delay - seconds after first sighting before it attacks (default 10)
  136. */
  137. void() monster_sword =
  138. {
  139. if (deathmatch)
  140. {
  141. remove(self);
  142. return;
  143. }
  144. precache_model ("progs/sword.mdl");
  145. precache_sound ("knight/sword1.wav");
  146. precache_sound ("knight/ksight.wav");
  147. precache_sound ("player/axhit2.wav");
  148. self.solid = SOLID_SLIDEBOX;
  149. self.movetype = MOVETYPE_STEP;
  150. setmodel (self, "progs/sword.mdl");
  151. setsize (self, '-16 -16 -24', '16 16 40');
  152. self.health = 150; // 75;
  153. if ( !self.delay)
  154. self.delay = 10;
  155. self.th_stand = sword_stand1;
  156. // self.th_walk = sword_walk1;
  157. self.th_walk = sword_stand1;
  158. self.th_run = sword_pause;
  159. self.th_melee = sword_atk1;
  160. self.th_die = sword_die;
  161. self.th_pain = sword_pain;
  162. walkmonster_start ();
  163. };