diff options
| author | Travis Bradshaw <travis.bradshaw@idsoftware.com> | 2012-01-31 16:03:17 -0600 |
|---|---|---|
| committer | Travis Bradshaw <travis.bradshaw@idsoftware.com> | 2012-01-31 16:03:17 -0600 |
| commit | bf4ac424ce754894ac8f1dae6a3981954bc9852d (patch) | |
| tree | ff4a31bc2a3ae18eb8fa5bbca9a9bab90f0d11ab /qw-qc/server.qc | |
| parent | 0023db327bc1db00068284b70e1db45857aeee35 (diff) | |
| download | quake-pum-bf4ac424ce754894ac8f1dae6a3981954bc9852d.tar.gz | |
Just kind of shoving the QuakeWorld QuakeC source in here.
Diffstat (limited to 'qw-qc/server.qc')
| -rw-r--r-- | qw-qc/server.qc | 123 |
1 files changed, 123 insertions, 0 deletions
diff --git a/qw-qc/server.qc b/qw-qc/server.qc new file mode 100644 index 0000000..5c4b6e1 --- /dev/null +++ b/qw-qc/server.qc @@ -0,0 +1,123 @@ +/* + server.qc + + server functions (movetarget code) + + Copyright (C) 1996-1997 Id Software, Inc. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + See the GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to: + + Free Software Foundation, Inc. + 59 Temple Place - Suite 330 + Boston, MA 02111-1307, USA + +*/ + +void() monster_ogre = {remove(self);}; +void() monster_demon1 = {remove(self);}; +void() monster_shambler = {remove(self);}; +void() monster_knight = {remove(self);}; +void() monster_army = {remove(self);}; +void() monster_wizard = {remove(self);}; +void() monster_dog = {remove(self);}; +void() monster_zombie = {remove(self);}; +void() monster_boss = {remove(self);}; +void() monster_tarbaby = {remove(self);}; +void() monster_hell_knight = {remove(self);}; +void() monster_fish = {remove(self);}; +void() monster_shalrath = {remove(self);}; +void() monster_enforcer = {remove(self);}; +void() monster_oldone = {remove(self);}; +void() event_lightning = {remove(self);}; + +/* +============================================================================== + +MOVETARGET CODE + +The angle of the movetarget effects standing and bowing direction, but has no effect on movement, which allways heads to the next target. + +targetname +must be present. The name of this movetarget. + +target +the next spot to move to. If not present, stop here for good. + +pausetime +The number of seconds to spend standing or bowing for path_stand or path_bow + +============================================================================== +*/ + +/* +============= +t_movetarget + +Something has bumped into a movetarget. If it is a monster +moving towards it, change the next destination and continue. +============== +*/ +void() t_movetarget = +{ +local entity temp; + + if (other.movetarget != self) + return; + + if (other.enemy) + return; // fighting, not following a path + + temp = self; + self = other; + other = temp; + + if (self.classname == "monster_ogre") + sound (self, CHAN_VOICE, "ogre/ogdrag.wav", 1, ATTN_IDLE);// play chainsaw drag sound + +//dprint ("t_movetarget\n"); + self.goalentity = self.movetarget = find (world, targetname, other.target); + self.ideal_yaw = vectoyaw(self.goalentity.origin - self.origin); + if (!self.movetarget) + { + self.pausetime = time + 999999; + self.th_stand (); + return; + } +}; + + + +void() movetarget_f = +{ + if (!self.targetname) + objerror ("monster_movetarget: no targetname"); + + self.solid = SOLID_TRIGGER; + self.touch = t_movetarget; + setsize (self, '-8 -8 -8', '8 8 8'); + +}; + +/*QUAKED path_corner (0.5 0.3 0) (-8 -8 -8) (8 8 8) +Monsters will continue walking towards the next target corner. +*/ +void() path_corner = +{ + movetarget_f (); +}; + + + +//============================================================================ |
