Esempio n. 1
0
void CTalkMonster :: FollowerUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )
{
	// Don't allow use during a scripted_sentence
	if ( m_useTime > gpGlobals->time )
		return;

	if ( pCaller != NULL && pCaller->IsPlayer() )
	{
		// Pre-disaster followers can't be used
		if ( GetSpawnFlags().Any( SF_MONSTER_PREDISASTER ) )
		{
			DeclineFollowing();
		}
		else if ( CanFollow() )
		{
			LimitFollowers( pCaller , 1 );

			if ( m_afMemory & bits_MEMORY_PROVOKED )
				ALERT( at_console, "I'm not following you, you evil person!\n" );
			else
			{
				StartFollowing( pCaller );
				SetBits(m_bitsSaid, bit_saidHelloPlayer);	// Don't say hi after you've started following
			}
		}
		else
		{
			StopFollowing( true );
		}
	}
}
Esempio n. 2
0
void CNPCSimpleTalker::FollowerUse( CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value )
{
	// Don't allow use during a scripted_sentence
	if ( m_useTime > gpGlobals->curtime )
		return;

	if ( pCaller != NULL && pCaller->IsPlayer() )
	{
		if ( !m_FollowBehavior.GetFollowTarget() && IsInterruptable() )
		{
#if TOML_TODO
			LimitFollowers( pCaller , 1 );
#endif

			if ( m_afMemory & bits_MEMORY_PROVOKED )
				Msg( "I'm not following you, you evil person!\n" );
			else
			{
				StartFollowing( pCaller );
			}
		}
		else
		{
			StopFollowing();
		}
	}
}
void CNPCSimpleTalker::Event_Killed( const CTakeDamageInfo &info )
{
	if ( info.GetAttacker()->GetFlags() & FL_CLIENT )
	{
		LimitFollowers( info.GetAttacker(), 0 );
	}
	BaseClass::Event_Killed( info );
}
Esempio n. 4
0
void CTalkMonster::Killed( const CTakeDamageInfo& info, GibAction gibAction )
{
	// If a client killed me (unless I was already Barnacle'd), make everyone else mad/afraid of him
	if ( info.GetAttacker() && info.GetAttacker()->GetFlags().Any( FL_CLIENT ) && m_MonsterState != MONSTERSTATE_PRONE )
	{
		AlertFriends();
		LimitFollowers( info.GetAttacker(), 0 );
	}

	m_hTargetEnt = NULL;
	// Don't finish that sentence
	StopTalking();
	SetUse( NULL );
	CBaseMonster::Killed( info, gibAction );
}
Esempio n. 5
0
void CMTalkMonster :: Killed( entvars_t *pevAttacker, int iGib )
{
	// If a client killed me (unless I was already Barnacle'd), make everyone else mad/afraid of him
	if ( (pevAttacker->flags & FL_CLIENT) && m_MonsterState != MONSTERSTATE_PRONE )
	{
		AlertFriends();
		LimitFollowers( ENT(pevAttacker), 0 );
	}

	m_hTargetEnt = NULL;
	// Don't finish that sentence
	StopTalking();
	SetUse( NULL );
	CMBaseMonster::Killed( pevAttacker, iGib );
}