예제 #1
0
void
ai_stand2(edict_t *self, float dist)
{
  	if (!self)
	{
		return;
	}

	if (self->spawnflags & 8)
	{
		ai_move(self, dist);

		if (!(self->spawnflags & 1) && (self->monsterinfo.idle) &&
			(level.time > self->monsterinfo.idle_time))
		{
			if (self->monsterinfo.idle_time)
			{
				self->monsterinfo.idle(self);
				self->monsterinfo.idle_time = level.time + 15 + random() * 15;
			}
			else
			{
				self->monsterinfo.idle_time = level.time + random() * 15;
			}
		}
	}
	else
	{
		ai_stand(self, dist);
	}
}
예제 #2
0
void _ogre_stand5( void )
{
	if ( g_random() < 0.2 )
		sound( self, CHAN_VOICE, "ogre/ogidle.wav", 1, ATTN_IDLE );

	ai_stand();
}
예제 #3
0
파일: ai.c 프로젝트: yquake2/zaero
/*
=============
ai_schoolStand

Used for standing around and looking for players / schooling monsters of the same type.
Distance is for slight position adjustments needed by the animations
==============
*/
void ai_schoolStand (edict_t *self, float dist)
{
  float speed;

  if(!(self->monsterinfo.aiflags & AI_SCHOOLING))
  {
    ai_stand(self, dist);
    return;
  }

  // init school var's for this frame
  self->zRaduisList = NULL;

  if(self->enemy || FindTarget(self))
  {
    ai_stand(self, dist);
    return;
  }
  else
  {
    // run schooling routines
    switch(zSchoolMonsters(self, dist, 0, &speed))
    {
    case 1:
		  self->monsterinfo.walk (self);
      break;

    case 2:
		  self->monsterinfo.run (self);
      break;
    }
  }

  // do the normal stand stuff
  if (dist)
		M_walkmove (self, self->ideal_yaw, dist);
}