本文整理汇总了C++中CCharacter::GetHookedPlayer方法的典型用法代码示例。如果您正苦于以下问题:C++ CCharacter::GetHookedPlayer方法的具体用法?C++ CCharacter::GetHookedPlayer怎么用?C++ CCharacter::GetHookedPlayer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCharacter
的用法示例。
在下文中一共展示了CCharacter::GetHookedPlayer方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoHookers
void CGameControllerSoloFNG::DoHookers()
{
for(int i = 0; i < MAX_CLIENTS; i++)
{
CCharacter *pChr = CHAR(i);
if (!pChr)
continue;
int Hooking = pChr->GetHookedPlayer();
if (Hooking >= 0)
{
CCharacter *pVic = CHAR(Hooking);
if (!pVic || (/*pVic->GetPlayer()->GetTeam() != pChr->GetPlayer()->GetTeam() && */pChr->GetHookTick() < CFG(HookRegisterDelay)))
Hooking = -1;
}
int HammeredBy = pChr->LastHammeredBy();
pChr->ClearLastHammeredBy();
if (Hooking >= 0)
{
CCharacter *pVic = CHAR(Hooking);
if (pVic)
{
//bool SameTeam = pChr->GetPlayer()->GetTeam() == pVic->GetPlayer()->GetTeam();
m_aLastInteraction[Hooking] = /*SameTeam ? -1 : */ i;
}
}
if (HammeredBy >= 0)
{
CCharacter *pHam = CHAR(HammeredBy);
if (pHam)
{
//bool SameTeam = pChr->GetPlayer()->GetTeam() == pHam->GetPlayer()->GetTeam();
m_aLastInteraction[i] = /*SameTeam ? -1 : */ HammeredBy;
if (/* !SameTeam &&*/ CFG(HammerFreeze) && pChr->GetFreezeTicks() <= 0)
{
pChr->Freeze(CFG(HammerFreeze) * TS, HammeredBy);
m_aFrozenBy[i] = HammeredBy; //suppress kill event being generated
}
}
else
m_aLastInteraction[i] = -1;
}
}
}
示例2: DoHookers
void CGameControllerOpenFNG::DoHookers()
{
for(int i = 0; i < MAX_CLIENTS; i++)
{
CCharacter *pChr = CHAR(i);
if (!pChr)
continue;
int Hooking = pChr->GetHookedPlayer();
if (Hooking >= 0)
{
CCharacter *pVic = CHAR(Hooking);
if (!pVic || (pVic->GetPlayer()->GetTeam() != pChr->GetPlayer()->GetTeam() && pChr->GetHookTick() < CFG(HookRegisterDelay)))
Hooking = -1;
}
int HammeredBy = pChr->LastHammeredBy();
pChr->ClearLastHammeredBy();
if (Hooking >= 0)
{
CCharacter *pVic = CHAR(Hooking);
if (pVic)
{
bool SameTeam = pChr->GetPlayer()->GetTeam() == pVic->GetPlayer()->GetTeam();
m_aLastInteraction[Hooking] = SameTeam ? -1 : i;
}
}
/*
CPlayer *pPlayer = TPLAYER(Hooking);
if (pVic)
{
bool SameTeam = pChr->GetPlayer()->GetTeam() == pVic->GetPlayer()->GetTeam();
m_aLastInteraction[Hooking] = SameTeam ? -1 : i;
if(pPlayer)
{
if (!SameTeam && CFG(HammerFreeze) && pVic->GetFreezeTicks() <= 0)
{
pVic->Freeze(CFG(HammerFreeze) * TS, i);
m_aFrozenBy[Hooking] = i; //suppress kill event being generated
}
}
}
*/
if (HammeredBy >= 0)
{
CCharacter *pHam = CHAR(HammeredBy);
CPlayer *pPlayer = TPLAYER(HammeredBy);
if (pHam)
{
bool SameTeam = pChr->GetPlayer()->GetTeam() == pHam->GetPlayer()->GetTeam();
m_aLastInteraction[i] = SameTeam ? -1 : HammeredBy;
if(pPlayer)
{
if (!SameTeam && CFG(HammerFreeze) && pChr->GetFreezeTicks() <= 0 && pPlayer->m_HammerFreeze)
{
pChr->Freeze(CFG(HammerFreeze) * TS, HammeredBy);
m_aFrozenBy[i] = HammeredBy; //suppress kill event being generated
}
}
}
else
m_aLastInteraction[i] = -1;
}
}
}