server.qc 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. /*
  2. server.qc
  3. server functions (movetarget code)
  4. Copyright (C) 1996-1997 Id Software, Inc.
  5. This program is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU General Public License
  7. as published by the Free Software Foundation; either version 2
  8. of the License, or (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  12. See the GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to:
  15. Free Software Foundation, Inc.
  16. 59 Temple Place - Suite 330
  17. Boston, MA 02111-1307, USA
  18. */
  19. void() monster_ogre = {remove(self);};
  20. void() monster_demon1 = {remove(self);};
  21. void() monster_shambler = {remove(self);};
  22. void() monster_knight = {remove(self);};
  23. void() monster_army = {remove(self);};
  24. void() monster_wizard = {remove(self);};
  25. void() monster_dog = {remove(self);};
  26. void() monster_zombie = {remove(self);};
  27. void() monster_boss = {remove(self);};
  28. void() monster_tarbaby = {remove(self);};
  29. void() monster_hell_knight = {remove(self);};
  30. void() monster_fish = {remove(self);};
  31. void() monster_shalrath = {remove(self);};
  32. void() monster_enforcer = {remove(self);};
  33. void() monster_oldone = {remove(self);};
  34. void() event_lightning = {remove(self);};
  35. /*
  36. ==============================================================================
  37. MOVETARGET CODE
  38. The angle of the movetarget effects standing and bowing direction, but has no effect on movement, which allways heads to the next target.
  39. targetname
  40. must be present. The name of this movetarget.
  41. target
  42. the next spot to move to. If not present, stop here for good.
  43. pausetime
  44. The number of seconds to spend standing or bowing for path_stand or path_bow
  45. ==============================================================================
  46. */
  47. /*
  48. =============
  49. t_movetarget
  50. Something has bumped into a movetarget. If it is a monster
  51. moving towards it, change the next destination and continue.
  52. ==============
  53. */
  54. void() t_movetarget =
  55. {
  56. local entity temp;
  57. if (other.movetarget != self)
  58. return;
  59. if (other.enemy)
  60. return; // fighting, not following a path
  61. temp = self;
  62. self = other;
  63. other = temp;
  64. if (self.classname == "monster_ogre")
  65. sound (self, CHAN_VOICE, "ogre/ogdrag.wav", 1, ATTN_IDLE);// play chainsaw drag sound
  66. //dprint ("t_movetarget\n");
  67. self.goalentity = self.movetarget = find (world, targetname, other.target);
  68. self.ideal_yaw = vectoyaw(self.goalentity.origin - self.origin);
  69. if (!self.movetarget)
  70. {
  71. self.pausetime = time + 999999;
  72. self.th_stand ();
  73. return;
  74. }
  75. };
  76. void() movetarget_f =
  77. {
  78. if (!self.targetname)
  79. objerror ("monster_movetarget: no targetname");
  80. self.solid = SOLID_TRIGGER;
  81. self.touch = t_movetarget;
  82. setsize (self, '-8 -8 -8', '8 8 8');
  83. };
  84. /*QUAKED path_corner (0.5 0.3 0) (-8 -8 -8) (8 8 8)
  85. Monsters will continue walking towards the next target corner.
  86. */
  87. void() path_corner =
  88. {
  89. movetarget_f ();
  90. };
  91. //============================================================================