p_enemy.c
/*
==============
=
= A_Look
=
= Stay in state until a player is sighted
=
==============
*/
A_Look
Stay in state until a player is sighted
A_Look Stay in state until a player is sighted
void A_Look (mobj_t *actor)
{
	const mobjinfo_t* ainfo = &mobjinfo[actor->type];
	if (!P_LookForPlayers (actor, false) )
		return;
#if 0
	actor->threshold = 0;		
	targ = actor->subsector->sector->soundtarget;
	if (targ && (targ->flags & MF_SHOOTABLE) )
		actor->target = targ;
	return;
#endif
	if (ainfo->seesound)
	{
		int		sound;
		switch (ainfo->seesound)
		{
		case sfx_posit1:
		case sfx_posit2:
		case sfx_posit3:
			sound = sfx_posit1+(P_Random()&1);
			break;
		case sfx_bgsit1:
		case sfx_bgsit2:
			sound = sfx_bgsit1+(P_Random()&1);
			break;
		default:
			sound = ainfo->seesound;
			break;
		}
		S_StartSound (actor, sound);
	}
	P_SetMobjState (actor, ainfo->seestate);
}
void A_Look ( mobj_t * actor ) { const mobjinfo_t * ainfo = & mobjinfo [ actor -> type ] ; if ( ! P_LookForPlayers ( actor , false ) ) return ; #if 0 actor -> threshold = 0 ; targ = actor -> subsector -> sector -> soundtarget ; if ( targ && ( targ -> flags & MF_SHOOTABLE ) ) actor -> target = targ ; return ; #endif if ( ainfo -> seesound ) { int sound ; switch ( ainfo -> seesound ) { case sfx_posit1 : case sfx_posit2 : case sfx_posit3 : sound = sfx_posit1 + ( P_Random ( ) & 1 ) ; break ; case sfx_bgsit1 : case sfx_bgsit2 : sound = sfx_bgsit1 + ( P_Random ( ) & 1 ) ; break ; default : sound = ainfo -> seesound ; break ; } S_StartSound ( actor , sound ) ; } P_SetMobjState ( actor , ainfo -> seestate ) ; }
A_Look
Stay in state until a player is sighted
A_Look Stay in state until a player is sighted
/* mobj_t		*targ;
        */ /* if current target is visible, start attacking */ /* if the sector has a living soundtarget, make that the new target */ /* any shot will wake up */ /* go into chase state */