本文整理汇总了C++中P_PLAYER::isInvisible方法的典型用法代码示例。如果您正苦于以下问题:C++ P_PLAYER::isInvisible方法的具体用法?C++ P_PLAYER::isInvisible怎么用?C++ P_PLAYER::isInvisible使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类P_PLAYER
的用法示例。
在下文中一共展示了P_PLAYER::isInvisible方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: preCondition
float Animal_Wild_Flee::preCondition()
{
return 0.0f;
/*
* Fleeing from an approaching player has the following preconditions:
* - There is a player within flight range.
* - There is no character attacking us.
* - Our owner is not in range.
*
*/
if ( m_npc->attackTarget() )
return 0.0f;
MapCharsIterator ri = MapObjects::instance()->listCharsInCircle( m_npc->pos(), Config::instance()->animalWildFleeRange() );
for ( P_CHAR pChar = ri.first(); pChar; pChar = ri.next() )
{
P_PLAYER pPlayer = dynamic_cast<P_PLAYER>( pChar );
if ( pPlayer && !pPlayer->free && !pPlayer->isGMorCounselor() && !pPlayer->isHidden() && !pPlayer->isInvisible() )
{
pFleeFromSer = pPlayer->serial();
}
if ( pPlayer && m_npc->owner() == pPlayer )
return 0.0f;
}
if ( pFleeFromSer != INVALID_SERIAL )
return 1.0f;
return 0.0f;
}
示例2: postCondition
float Animal_Wild_Flee::postCondition()
{
/*
* Fleeing from an approaching player has the following postconditions:
* - There is no character in flight range.
* - There is an character attacking us.
* - Our owner has come in range.
*
*/
if( m_npc->attackTarget() )
return 1.0f;
RegionIterator4Chars ri( m_npc->pos(), SrvParams->animalWildFleeRange() );
bool found = false;
for(ri.Begin(); !ri.atEnd(); ri++)
{
P_PLAYER pPlayer = dynamic_cast<P_PLAYER>(ri.GetData());
if( pPlayer && !pPlayer->free && !pPlayer->isGMorCounselor() && !pPlayer->isHidden() && !pPlayer->isInvisible() )
found = true;
if( pPlayer && m_npc->owner() == pPlayer )
return 1.0f;
}
if( found )
return 0.0f;
return 1.0f;
}
示例3: postCondition
float Animal_Wild_Flee::postCondition()
{
/*
* Fleeing from an approaching player has the following postconditions:
* - There is no character in flight range.
* - There is an character attacking us.
* - Our owner has come in range.
*
*/
if ( m_npc->attackTarget() )
return 1.0f;
bool found = false;
MapCharsIterator ri = MapObjects::instance()->listCharsInCircle( m_npc->pos(), Config::instance()->animalWildFleeRange() );
for ( P_CHAR pChar = ri.first(); pChar; pChar = ri.next() )
{
P_PLAYER pPlayer = dynamic_cast<P_PLAYER>( pChar );
if ( pPlayer && !pPlayer->free && !pPlayer->isGMorCounselor() && !pPlayer->isHidden() && !pPlayer->isInvisible() )
found = true;
if ( pPlayer && m_npc->owner() == pPlayer )
return 1.0f;
}
if ( found )
return 0.0f;
return 1.0f;
}