本文整理汇总了C++中CCharacter::Invisible方法的典型用法代码示例。如果您正苦于以下问题:C++ CCharacter::Invisible方法的具体用法?C++ CCharacter::Invisible怎么用?C++ CCharacter::Invisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCharacter
的用法示例。
在下文中一共展示了CCharacter::Invisible方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Fire
void CTeslacoil::Fire()
{
m_AttackTick = Server()->Tick();
vec2 TurretPos = m_Pos+vec2(0, -67*m_FlipY);
bool Sound = false;
for (int i = 0; i < MAX_CLIENTS; i++)
{
CPlayer *pPlayer = GameServer()->m_apPlayers[i];
if(!pPlayer)
continue;
if (pPlayer->GetTeam() == m_Team && GameServer()->m_pController->IsTeamplay())
continue;
CCharacter *pCharacter = pPlayer->GetCharacter();
if (!pCharacter)
continue;
if ((!pCharacter->IsAlive() || pCharacter->GetPlayer()->GetCID() == m_OwnerPlayer) && !GameServer()->m_pController->IsTeamplay())
continue;
if (GameServer()->m_pController->IsCoop())
{
if (!pCharacter->m_IsBot && m_Team >= 0)
continue;
if (pCharacter->m_IsBot && m_Team < 0)
continue;
}
if (pCharacter->Invisible())
continue;
int Distance = distance(pCharacter->m_Pos, TurretPos);
if (Distance < 700 && !GameServer()->Collision()->FastIntersectLine(pCharacter->m_Pos, TurretPos))
{
new CLightning(GameWorld(), TurretPos, pCharacter->m_Pos);
pCharacter->TakeDamage(m_OwnerPlayer, GetBuildingWeapon(BUILDING_TESLACOIL), 5, vec2(0, 0), vec2(0, 0));
//pCharacter->TakeDamage(vec2(0, 0), 5, m_DamageOwner, DEATHTYPE_TESLACOIL, vec2(0, 0), DAMAGETYPE_ELECTRIC, false);
Sound = true;
}
}
if (Sound)
GameServer()->CreateSound(m_Pos + vec2(0, -50*m_FlipY), SOUND_TESLACOIL_FIRE);
}