本文整理汇总了C++中P_PLAYER::saycolor方法的典型用法代码示例。如果您正苦于以下问题:C++ P_PLAYER::saycolor方法的具体用法?C++ P_PLAYER::saycolor怎么用?C++ P_PLAYER::saycolor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类P_PLAYER
的用法示例。
在下文中一共展示了P_PLAYER::saycolor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: castSpell
void cNewMagic::castSpell( P_PLAYER pMage, UINT8 spell )
{
P_PLAYER pp = dynamic_cast<P_PLAYER>(pMage);
if( !pp || !pp->socket() )
return;
stNewSpell *sInfo = findSpell( spell );
if( !sInfo )
{
pp->socket()->sysMessage( tr( "This spell is either not implemented or invalid" ) );
return;
}
// Check if we can cast this spell
if( !hasSpell( pMage, spell ) )
{
pp->socket()->sysMessage( tr( "You don't know this spell." ) );
return;
}
// Check for required mana and required reagents, if not present: cancel casting
if( !checkMana( pMage, spell ) )
{
pp->message( tr( "You don't have enough mana to cast this spell." ) );
return;
}
if( !pp->isGM() && !checkReagents( pMage, spell ) )
return;
if( pMage->isCasting() )
disturb( pMage, true );
// We start casting here
pMage->setCasting( true );
// We get frozen here too
pMage->setFrozen( true );
// Say the mantra
// Type 0x0A : Spell
pMage->talk( sInfo->mantra, pMage->saycolor() );
// This is a very interesting move of OSI
// They send all action-packets the character has to perform in a row.
// But they use the action 0xE9 instead of 0x10, maybe it's a bitmask
// of 0xD9 but i am unsure.
// This will repeat the animation until
// We are done casting or until we are being
// disturbed.
//pMage->startRepeatedAction( sInfo->action, sInfo->actiondelay ); // Repeat every 1250 ms
// I *do* know that this is a drawback but for now a single animation is exactly what we need.
pMage->action( sInfo->action );
// Now we have to do the following:
// We show the target cursor after a given amount of time (set in the scripts)
// So what we are adding here is cEndCasting() supplying the Serial of our Mage
// And the ID of our Spell.
TempEffects::instance()->insert( new cEndCasting( pMage, spell, CT_BOOK, sInfo->delay ) );
}