本文整理汇总了C++中CAI_BaseNPC::Remember方法的典型用法代码示例。如果您正苦于以下问题:C++ CAI_BaseNPC::Remember方法的具体用法?C++ CAI_BaseNPC::Remember怎么用?C++ CAI_BaseNPC::Remember使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAI_BaseNPC
的用法示例。
在下文中一共展示了CAI_BaseNPC::Remember方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AlertFriends
void CAI_PlayerAlly::AlertFriends( CBaseEntity *pKiller )
{
CBaseEntity *pFriend = NULL;
int i;
// for each friend in this bsp...
for ( i = 0; i < TLK_CFRIENDS; i++ )
{
while (pFriend = EnumFriends( pFriend, i, true ))
{
CAI_BaseNPC *pNPC = pFriend->MyNPCPointer();
if ( pNPC->IsAlive() )
{
// If a client killed me, make everyone else mad/afraid of him
if ( pKiller->GetFlags() & FL_CLIENT )
{
pNPC->SetSchedule( SCHED_TALKER_BETRAYED );
#ifdef ALLIES_CAN_BE_PROVOKED
pNPC->Remember( bits_MEMORY_PROVOKED );
if( IsSelected() )
{
PlayerSelect( false );
}
#endif
}
else
{
if( IRelationType(pKiller) == D_HT)
{
// Killed by an enemy!!!
CAI_PlayerAlly *pAlly = (CAI_PlayerAlly *)pNPC;
if( pAlly && pAlly->GetExpresser()->CanSpeakConcept( TLK_ALLY_KILLED ) )
{
pAlly->Speak( TLK_ALLY_KILLED );
}
}
}
}
}
}
}
示例2: CallForHelp
void CNPC_Vortigaunt::CallForHelp( char *szClassname, float flDist, CBaseEntity * pEnemy, Vector &vecLocation )
{
// ALERT( at_aiconsole, "help " );
// skip ones not on my netname
if ( !m_pSquad )
return;
AISquadIter_t iter;
for (CAI_BaseNPC *pSquadMember = m_pSquad->GetFirstMember( &iter ); pSquadMember; pSquadMember = m_pSquad->GetNextMember( &iter ) )
{
float d = ( GetAbsOrigin() - pSquadMember->GetAbsOrigin() ).Length();
if ( d < flDist )
{
pSquadMember->Remember( bits_MEMORY_PROVOKED );
pSquadMember->UpdateEnemyMemory( pEnemy, vecLocation );
}
}
}