当前位置: 首页>>代码示例>>C++>>正文


C++ P_PLAYER::isHidden方法代码示例

本文整理汇总了C++中P_PLAYER::isHidden方法的典型用法代码示例。如果您正苦于以下问题:C++ P_PLAYER::isHidden方法的具体用法?C++ P_PLAYER::isHidden怎么用?C++ P_PLAYER::isHidden使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在P_PLAYER的用法示例。


在下文中一共展示了P_PLAYER::isHidden方法的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;
}
开发者ID:BackupTheBerlios,项目名称:wolfpack-svn,代码行数:32,代码来源:ai_animals.cpp

示例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;
}
开发者ID:BackupTheBerlios,项目名称:wolfpack-svn,代码行数:30,代码来源:ai_animals.cpp

示例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;
}
开发者ID:BackupTheBerlios,项目名称:wolfpack-svn,代码行数:30,代码来源:ai_animals.cpp


注:本文中的P_PLAYER::isHidden方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。