本文整理汇总了C++中P_PLAYER::isCasting方法的典型用法代码示例。如果您正苦于以下问题:C++ P_PLAYER::isCasting方法的具体用法?C++ P_PLAYER::isCasting怎么用?C++ P_PLAYER::isCasting使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类P_PLAYER
的用法示例。
在下文中一共展示了P_PLAYER::isCasting方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SkillUse
void cSkills::SkillUse( cUOSocket* socket, quint16 id ) // Skill is clicked on the skill list
{
P_PLAYER pChar = socket->player();
// No Char no Skill use
if ( !pChar )
return;
if ( pChar->isJailed() ) {
socket->sysMessage( tr("You cannot use skills while you are in jail.") );
return;
}
if ( pChar->isDead() )
{
socket->clilocMessage( 1019048 ); // I am dead and cannot do that.
return;
}
/*
if ( id != STEALTH )
pChar->unhide(); // Don't unhide if we're trying to stealth
*/
pChar->disturbMed(); // Disturb meditation if we're using a skill
if ( pChar->isCasting() )
{
socket->sysMessage( 1061131 ); // You cannot do that while casting a spell.
return;
}
if ( pChar->skillDelay() > Server::instance()->time() && !pChar->isGM() )
{
socket->sysMessage( 500118 ); // You must wait a few moments to use another skill.
return;
}
if ( pChar->onSkillUse( id ) )
return;
cTargetRequest* targetRequest = NULL;
QString message;
switch ( id )
{
case MEDITATION:
Skills::instance()->Meditation( socket );
break;
default:
socket->sysMessage( tr( "That skill has not been implemented yet." ) );
return;
}
if ( targetRequest )
socket->attachTarget( targetRequest );
if ( !message.isEmpty() )
pChar->message( message );
pChar->setSkillDelay( Server::instance()->time() + Config::instance()->skillDelay() * MY_CLOCKS_PER_SEC );
}