djcev.com

//

Git Repos / fte_dogmode / qc / info / path_corner.qc

Last update to this file was on 2024-06-15 at 19:50.

Show path_corner.qc

//==============================================================================
// path_corner
//==============================================================================

//======================================================================
// forward declarations
//======================================================================

void() path_corner_movetarget_touch;
void(entity e) path_corner_movetarget_init;
entity(entity src, vector org) spawn_path_corner;
void(entity e) path_corner_init;
void() path_corner;

//------------------------------------------------------------------------------

/*QUAKED path_corner (0.5 0.3 0) (-8 -8 -8) (8 8 8)
Monsters will continue walking towards the next target corner.
*/
//----------------------------------------------------------------------
// class path_corner: base_mapentity
// {
//--------------------------------------------------------------
// t_movetarget
//
// Something has bumped into a movetarget. If it is a monster
// moving towards it, change the next destination and continue.
//--------------------------------------------------------------
void() path_corner_movetarget_touch =
{
local entity stemp;

if (other.movetarget != self)
return;

if (other.enemy)
// fighting, not following a path
return;

stemp = self;
self = other;
other = stemp;

if (self.classtype == CT_MONSTER_OGRE)
// chainsaw drag sound -- sound_custom -- dumptruck_ds
sound_misc (self, CHAN_VOICE, "ogre/ogdrag.wav",
VOL_HIGH, ATTN_IDLE);

// 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;
// TODO CEV
/*
if (self.classgroup & CG_MONSTER)
{
self.think_stand ();
}
else
{
dprint (sprintf("t_movetarget: ERROR tried "
"to call th_stand on classname %s!\n",
self.classname));
}
*/
return;
}
};

//--------------------------------------------------------------
// MOVETARGET CODE
//
// The angle of the movetarget effects standing and bowing
// direction, but has no effect on movement, which always 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
//--------------------------------------------------------------
void(entity e) path_corner_movetarget_init =
{
if (!e.targetname)
objerror ("path_corner_movetarget_init: no targetname");

e.solid = SOLID_TRIGGER;
e.touch = path_corner_movetarget_touch;
setsize (e, '-8 -8 -8', '8 8 8');
};

//--------------------------------------------------------------
entity(entity src, vector org) spawn_path_corner =
{
local entity e = spawn ();
e.owner = src;
e.origin = org;
path_corner_init (e);
return e;
};

//--------------------------------------------------------------
void(entity e) path_corner_init =
{
base_mapentity_init (e);
e.classname = "path_corner";
e.classtype = CT_PATH_CORNER;

if (e.noise != __NULL__ && e.noise != "")
precache_sound (e.noise);
if (e.noise2 != __NULL__ && e.noise2 != "")
precache_sound (e.noise2);

path_corner_movetarget_init (e);
};

//--------------------------------------------------------------
void() path_corner =
{
// new spawnflags for all entities -- iw
if (SUB_Inhibit())
return;

path_corner_init (self);
};
// };

Return to the top of this page or return to the overview of this repo.

Log path_corner.qc

Date Commit Message Author + -
2024-06-15 Major update, committing as-is, will have bugs cev +1 -1
2024-03-24 2nd pass refactor, rework QC class structure cev +109 -125
2024-02-18 Client/player, projectiles, entrypoints refactor cev +10 -1
2024-01-31 Class based monster refactor & start projectiles cev +64  
2024-01-09 Continue OO / Class-based refactor cev +78  

Return to the top of this page or return to the overview of this repo.