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


C++ P_CHAR::body方法代码示例

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


在下文中一共展示了P_CHAR::body方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: playMissedSoundEffect

/*!
	Play the sound effect for a miss.
*/
void cCombat::playMissedSoundEffect( P_CHAR pChar, UINT16 skill )
{
	UINT16 id = 0;

	switch( skill )
	{
	case ARCHERY:
		id = RandomNum( 0, 1 ) ? 0x233 : 0x238;
		break;

	// Wrestling Sounds are creature-dependant
	case WRESTLING:
		if( !pChar->isHuman() )
		{
			cCharBaseDef *def = BaseDefManager::instance()->getCharBaseDef( pChar->body() );

			if( def != 0 )
				id = def->basesound() + RandomNum( 0, 1 );
			break;
		}

	default:
		id = RandomNum( 0x238, 0x23a );
		break;
	}

	if( id != 0 )
		pChar->soundEffect( id );
}
开发者ID:BackupTheBerlios,项目名称:wolfpack-svn,代码行数:32,代码来源:combat.cpp

示例2: playGetHitSoundEffect

/*!
	Play the soundeffect for getting hit.
*/
void cCombat::playGetHitSoundEffect( P_CHAR pChar )
{
	if ( pChar->body() == 0x191 )
	{
		UI16 sound = hex2dec( Definitions::instance()->getRandomListEntry( "SOUNDS_COMBAT_HIT_HUMAN_FEMALE" ) ).toUShort();
		if ( sound > 0 )
			pChar->soundEffect( sound );
		else
			pChar->soundEffect( 0x14b );
	}
	else if ( pChar->body() == 0x190 )
	{
		UI16 sound = hex2dec( Definitions::instance()->getRandomListEntry( "SOUNDS_COMBAT_HIT_HUMAN_MALE" ) ).toUShort();
		if ( sound > 0 )
			pChar->soundEffect( sound );
		else
			pChar->soundEffect( 0x156 );
	}
	else
		pChar->bark( cBaseChar::Bark_GetHit );
}
开发者ID:BackupTheBerlios,项目名称:wolfpack-svn,代码行数:24,代码来源:combat.cpp

示例3:

	cTrackingList( P_CHAR player, UINT8 type )
	{
		setType( 0xFE12ACDE );

		startPage( 0 );
		addBackground( 0x13BE, 440, 160 );
		addResizeGump( 10, 10, 0xA3C, 420, 75 );
		addResizeGump( 10, 85, 0xBB8, 420, 50 );

		UINT32 pCount = 0;
		UINT32 pAmount = 0;

		// 1: Animals
		// 2: Monsters
		// 3: Humans
		// 4: Players
		cCharSectorIterator *iter = SectorMaps::instance()->findChars( player->pos(), 18 );

		for( P_CHAR pChar = iter->first(); pChar; pChar = iter->next() )
		{
			// Do the neccesary checks
			bool passed = true;

			switch( type )
			{
			// Animals
			case 1:
				passed = !( pChar->objectType() != enNPC || pChar->body() == 0x190 || pChar->body() == 0x191 ); //|| pChar->npcaitype() == 2 );
				break;
			// Monsters
			case 2:
				passed = !( pChar->objectType() != enNPC || pChar->body() == 0x190 || pChar->body() == 0x191 ); //|| pChar->npcaitype() != 2 );
				break;
			// Human
			case 3:
				passed = !( pChar->objectType() != enNPC || ( pChar->body() != 0x190 && pChar->body() != 0x191 ) );
				break;
			case 4:
				passed = ( pChar->objectType() == enPlayer && dynamic_cast<P_PLAYER>(pChar)->socket() );
				break;
			};

			if( !passed )
				continue;

			// Checks passed, add the character
			if( pAmount == 0 ) // Start new page
			{
				// Add a button on the old page
				if( pCount > 0 )
				{
					addPageButton( 395, 137, 0x26af, 0x26b1, pCount );
				}

				startPage( ++pCount );

				// Add a button on the new page
				if( pCount > 1 )
				{
					addPageButton( 365, 137, 0x26b5, 0x26b7, pCount-1 );
				}
			}

			cCharBaseDef *def = BaseDefManager::instance()->getCharBaseDef( pChar->body() );

			if( def && def->shrinked() != 0 )
				addTilePic( (pAmount*100)+20, 20, def->shrinked() );

			addButton( (pAmount*100)+20, 110, 0xFA5, 0xFA7, pChar->serial() );
			addCroppedText( (pAmount*100)+20, 90, 100, 40, pChar->name() );

			++pAmount;
		}

		delete iter;
	}
开发者ID:BackupTheBerlios,项目名称:wolfpack-svn,代码行数:76,代码来源:tracking.cpp


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