예제 #1
0
파일: hornet.cpp 프로젝트: XashDev/XashXT
//=========================================================
// Tracking Hornet hit something
//=========================================================
void CHornet :: TrackTouch ( CBaseEntity *pOther )
{
	if ( pOther->edict() == pev->owner || pOther->pev->modelindex == pev->modelindex )
	{// bumped into the guy that shot it.
		pev->solid = SOLID_NOT;
		return;
	}

	if ( IRelationship( pOther ) <= R_NO )
	{
		// hit something we don't want to hurt, so turn around.
		Vector vecVelocity = GetAbsVelocity();

		vecVelocity = vecVelocity.Normalize();

		vecVelocity.x *= -1;
		vecVelocity.y *= -1;

		SetAbsVelocity( vecVelocity );

		SetAbsOrigin( GetAbsOrigin() + GetAbsVelocity() * 4 ); // bounce the hornet off a bit.
		SetAbsVelocity( GetAbsVelocity() * m_flFlySpeed );

		return;
	}

	DieTouch( pOther );
}
예제 #2
0
파일: hornet.cpp 프로젝트: zenithght/xash3d
//=========================================================
// Tracking Hornet hit something
//=========================================================
void CHornet :: TrackTouch ( CBaseEntity *pOther )
{
	if ( pOther->edict() == pev->owner || pOther->pev->modelindex == pev->modelindex )
	{// bumped into the guy that shot it.
		pev->solid = SOLID_NOT;
		return;
	}

	if ( IRelationship( pOther ) <= R_NO )
	{
		// hit something we don't want to hurt, so turn around.

		pev->velocity = pev->velocity.Normalize();

		pev->velocity.x *= -1;
		pev->velocity.y *= -1;

		pev->origin = pev->origin + pev->velocity * 4; // bounce the hornet off a bit.
		pev->velocity = pev->velocity * m_flFlySpeed;

		return;
	}

	DieTouch( pOther );
}
//=========================================================
// Tracking Hornet hit something
//=========================================================
void CNPC_Hornet::TrackTouch ( CBaseEntity *pOther )
{
	if ( !pOther->IsSolid() || pOther->IsSolidFlagSet(FSOLID_VOLUME_CONTENTS) )
	{
		return;
	}

	if ( pOther == GetOwnerEntity() || pOther->GetModelIndex() == GetModelIndex() )
	{// bumped into the guy that shot it.
		//SetSolid( SOLID_NOT );
		return;
	}

	int nRelationship = IRelationType( pOther );
	if ( (nRelationship == D_FR || nRelationship == D_NU || nRelationship == D_LI) )
	{
		// hit something we don't want to hurt, so turn around.
		Vector vecVel = GetAbsVelocity();

		VectorNormalize( vecVel );

		vecVel.x *= -1;
		vecVel.y *= -1;

		SetAbsOrigin( GetAbsOrigin() + vecVel * 4 ); // bounce the hornet off a bit.
		SetAbsVelocity( vecVel * m_flFlySpeed );

		return;
	}

	DieTouch( pOther );
}
예제 #4
0
파일: hornet.cpp 프로젝트: ET-NiK/amxxgroup
//=========================================================
// Tracking Hornet hit something
//=========================================================
void CMHornet :: TrackTouch ( edict_t *pOther )
{
	if ( (pOther == pev->owner) || pOther->v.modelindex == pev->modelindex )
	{// bumped into the guy that shot it.
		pev->solid = SOLID_NOT;
		return;
	}

   // is this NOT a player and IS a monster?
   if (!UTIL_IsPlayer(pOther) && (pOther->v.euser4 != NULL))
   {
		CMBaseMonster *pMonster = GetClassPtr((CMBaseMonster *)VARS(pOther));

		if ( IRelationship( pMonster ) <= R_NO )
		{
			// hit something we don't want to hurt, so turn around.

			pev->velocity = pev->velocity.Normalize();

			pev->velocity.x *= -1;
			pev->velocity.y *= -1;

			pev->origin = pev->origin + pev->velocity * 4; // bounce the hornet off a bit.
			pev->velocity = pev->velocity * m_flFlySpeed;

			return;
		}
	}

	DieTouch( pOther );
}
예제 #5
0
파일: hornet.cpp 프로젝트: XashDev/XashXT
void CHornet::DartTouch( CBaseEntity *pOther )
{
	DieTouch( pOther );
}
예제 #6
0
파일: hornet.cpp 프로젝트: ET-NiK/amxxgroup
void CMHornet::DartTouch( edict_t *pOther )
{
	DieTouch( pOther );
}