예제 #1
0
void CNPCSimpleTalker::OnChangeRunningBehavior( CAI_BehaviorBase *pOldBehavior,  CAI_BehaviorBase *pNewBehavior )
{
	BaseClass::OnChangeRunningBehavior( pOldBehavior,  pNewBehavior );

	CAI_FollowBehavior *pFollowBehavior;
	if ( ( pFollowBehavior = dynamic_cast<CAI_FollowBehavior *>(pNewBehavior) ) != NULL  )
	{
		OnStartingFollow( pFollowBehavior->GetFollowTarget() );
	}
	else if ( ( pFollowBehavior = dynamic_cast<CAI_FollowBehavior *>(pOldBehavior) ) != NULL  )
	{
		OnStoppingFollow( pFollowBehavior->GetFollowTarget() );
	}
}
예제 #2
0
void CAI_PlayerAlly::OnChangeRunningBehavior( CAI_BehaviorBase *pOldBehavior,  CAI_BehaviorBase *pNewBehavior )
{
	BaseClass::OnChangeRunningBehavior( pOldBehavior,  pNewBehavior );
	CAI_FollowBehavior *pFollowBehavior;
	if ( dynamic_cast<CAI_FollowBehavior *>(pNewBehavior) != NULL )
	{
		GetExpresser()->SetSpokeConcept( TLK_HELLO, NULL );	// Don't say hi after you've started following
		if ( IsOkToCombatSpeak() )
			Speak( TLK_USE );
		SetSpeechTarget( GetTarget() );
		ClearCondition( COND_PLAYER_PUSHING );
	}
	else if ( ( pFollowBehavior = dynamic_cast<CAI_FollowBehavior *>(pOldBehavior) ) != NULL  )
	{
		if ( !(m_afMemory & bits_MEMORY_PROVOKED) )
		{
			if ( IsOkToCombatSpeak() )
			{
				if ( pFollowBehavior->GetFollowTarget() == NULL )
					Speak( TLK_UNUSE );
				else
					Speak( TLK_STOP );
			}
			SetSpeechTarget( FindNearestFriend(true) );
		}
	}
}