本文整理汇总了C++中CCharacter::IsSliding方法的典型用法代码示例。如果您正苦于以下问题:C++ CCharacter::IsSliding方法的具体用法?C++ CCharacter::IsSliding怎么用?C++ CCharacter::IsSliding使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCharacter
的用法示例。
在下文中一共展示了CCharacter::IsSliding方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Tick
void CBuilding::Tick()
{
if (m_Type == BUILDING_SAWBLADE)
{
CCharacter *pChr = GameServer()->m_World.ClosestCharacter(m_Pos, m_ProximityRadius*1.4f, 0);
if(pChr && pChr->IsAlive())
pChr->TakeSawbladeDamage(m_Pos);
}
// effect testing on all buildings
//if (GameServer()->Server()->Tick()%40 == 1)
// GameServer()->CreateEffect(FX_BARREL, m_Pos);
if (m_SetTimer > 0)
m_SetTimer--;
if (m_Type == BUILDING_FLAMETRAP)
{
// on / off
if (m_TriggerTimer < GameServer()->Server()->Tick() - GameServer()->Server()->TickSpeed() * 3.0f)
m_TriggerTimer = GameServer()->Server()->Tick() + GameServer()->Server()->TickSpeed() * 2.0f;
// if on
if (m_TriggerTimer > GameServer()->Server()->Tick())
{
m_aStatus[BSTATUS_FIRE] = 1;
// small delay before settings players to aflame
if (m_TriggerTimer > GameServer()->Server()->Tick() && m_TriggerTimer < GameServer()->Server()->Tick() + GameServer()->Server()->TickSpeed() * 1.7f)
{
{
CCharacter *pChr = GameServer()->m_World.ClosestCharacter(m_Pos + vec2((m_Mirror ? -50 : 50), -4), m_ProximityRadius, 0);
if(pChr && pChr->IsAlive())
{
pChr->TakeDamage(vec2(0, 0), 2, NEUTRAL_BASE, DEATHTYPE_FLAMETRAP, vec2(0, 0), DAMAGETYPE_FLAME);
pChr->SetAflame(2.5f, NEUTRAL_BASE, DEATHTYPE_FLAMETRAP);
}
}
{
CCharacter *pChr = GameServer()->m_World.ClosestCharacter(m_Pos + vec2((m_Mirror ? -102 : 102), -4), m_ProximityRadius*1.3f, 0);
if(pChr && pChr->IsAlive())
{
pChr->TakeDamage(vec2(0, 0), 2, NEUTRAL_BASE, DEATHTYPE_FLAMETRAP, vec2(0, 0), DAMAGETYPE_FLAME);
pChr->SetAflame(2.5f, NEUTRAL_BASE, DEATHTYPE_FLAMETRAP);
}
}
}
}
else
m_aStatus[BSTATUS_FIRE] = 0;
}
// destruction
if (m_DeathTimer > 0)
{
m_DeathTimer--;
if (m_Life <= 0 && m_DeathTimer <= 0)
{
// turret?
Destroy();
//GameServer()->m_World.DestroyEntity(this);
}
}
else
if (m_SetTimer <= 0 && (m_Type == BUILDING_MINE1 || m_Type == BUILDING_MINE2))
{
CCharacter *pChr = GameServer()->m_World.ClosestCharacter(m_Pos, m_ProximityRadius*1.7f, 0);
if(pChr && pChr->IsAlive() && !pChr->IsSliding())// && (pChr->GetPlayer()->GetTeam() != m_Team || !GameServer()->m_pController->IsTeamplay()))
{
if (pChr->GetPlayer()->GetTeam() != m_Team || !GameServer()->m_pController->IsTeamplay())
{
m_DeathTimer = 1;
m_Life = 0;
}
}
}
UpdateStatus();
}