本文整理汇总了C++中Bot::SetLastEnemy方法的典型用法代码示例。如果您正苦于以下问题:C++ Bot::SetLastEnemy方法的具体用法?C++ Bot::SetLastEnemy怎么用?C++ Bot::SetLastEnemy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bot
的用法示例。
在下文中一共展示了Bot::SetLastEnemy方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Execute
//.........这里部分代码省略.........
if (!IsZombieEntity(victim) && IsAlive(victim))
break;
for (int i = 0; i < engine->GetMaxClients(); i++)
{
Bot *bot = g_botManager->GetBot(i);
if (bot == null || !IsAlive(bot->GetEntity()))
continue;
if (IsZombieEntity(bot->GetEntity()))
continue;
if (GetGameMod() == 0 && killer != bot->GetEntity() && bot->EntityIsVisible(GetEntityOrigin(victim)) &&
GetTeam(killer) == GetTeam(bot->GetEntity()) && GetTeam(killer) != GetTeam(victim))
{
if (killer == g_hostEntity)
bot->HandleChatterMessage("#Bot_NiceShotCommander");
else
bot->HandleChatterMessage("#Bot_NiceShotPall");
break;
}
if (GetTeam(bot->GetEntity()) == GetTeam(victim) && IsVisible(GetEntityOrigin(killer), bot->GetEntity()) && FNullEnt(bot->m_enemy) && GetTeam(killer) != GetTeam(victim))
{
// SyPB Pro P.30 - AMXX API
if (bot->m_blockCheckEnemyTime > engine->GetTime())
continue;
bot->m_actualReactionTime = 0.0f;
bot->m_seeEnemyTime = engine->GetTime();
bot->m_enemy = killer;
bot->SetLastEnemy(killer);
}
}
Bot *bot = g_botManager->GetBot(killer);
if (bot != null)
bot->m_lastVictim = victim;
else if (GetGameMod () == 0)
{
if (victimer != null)
{
if (GetTeam(killer) == GetTeam(victim))
victimer->m_voteKickIndex = killerIndex;
victimer->m_notKilled = false;
}
}
}
break;
}
break;
case NETMSG_SCREENFADE: // this message gets sent when the Screen fades (Flashbang)
switch (m_state)
{
case 3:
r = PTR_TO_BYTE (p);
break;
case 4:
g = PTR_TO_BYTE (p);
break;