本文整理汇总了C++中CCharacter::IsFrozen方法的典型用法代码示例。如果您正苦于以下问题:C++ CCharacter::IsFrozen方法的具体用法?C++ CCharacter::IsFrozen怎么用?C++ CCharacter::IsFrozen使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCharacter
的用法示例。
在下文中一共展示了CCharacter::IsFrozen方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Tick
void CBarrier::Tick()
{
m_LifeSpan--;
if(m_LifeSpan < 0)
{
GameServer()->m_World.DestroyEntity(this);
}
else
{
// Find other players
for(CCharacter *p = (CCharacter*) GameWorld()->FindFirst(CGameWorld::ENTTYPE_CHARACTER); p; p = (CCharacter *)p->TypeNext())
{
if(!p->IsInfected()) continue;
vec2 IntersectPos = closest_point_on_line(m_Pos, m_Pos2, p->m_Pos);
float Len = distance(p->m_Pos, IntersectPos);
if(Len < p->m_ProximityRadius+g_BarrierRadius)
{
//Check for portal traps
if(p->GetClass() != PLAYERCLASS_UNDEAD && (Server()->Tick() - p->m_PortalTick) < Server()->TickSpeed()/2)
{
CPlayer* pPortalPlayer = GameServer()->m_apPlayers[p->m_LastPortalOwner];
if(pPortalPlayer)
{
pPortalPlayer->IncreaseScore(1);
}
}
//Check for hook traps. The case when the player is frozen is in the function Die()
if(!p->IsFrozen())
{
for(CCharacter *pHook = (CCharacter*) GameWorld()->FindFirst(CGameWorld::ENTTYPE_CHARACTER); pHook; pHook = (CCharacter *)pHook->TypeNext())
{
if(p->GetPlayer() && pHook->GetPlayer() && pHook->m_Core.m_HookedPlayer == p->GetPlayer()->GetCID() && pHook->GetPlayer()->GetCID() != m_Owner)
{
pHook->GetPlayer()->IncreaseScore(1);
}
}
}
p->Die(m_Owner, WEAPON_HAMMER);
}
}
}
}