本文整理汇总了C++中AiAgent::hasSpecialAttack方法的典型用法代码示例。如果您正苦于以下问题:C++ AiAgent::hasSpecialAttack方法的具体用法?C++ AiAgent::hasSpecialAttack怎么用?C++ AiAgent::hasSpecialAttack使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AiAgent
的用法示例。
在下文中一共展示了AiAgent::hasSpecialAttack方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fillObjectMenuResponse
//.........这里部分代码省略.........
menuResponse->addRadialMenuItemToRadialID(141, 151, 3, "@pet/pet_menu:menu_assume_formation_2" ); // PET_ASSUME_FORMATION_2
menuResponse->addRadialMenuItemToRadialID(141, 158, 3, "@pet/pet_menu:menu_group" ); // PET_GROUP
menuResponse->addRadialMenuItemToRadialID(141, 163, 3, "@pet/pet_menu:menu_ranged_attack" );
menuResponse->addRadialMenuItemToRadialID(141, 164, 3, "@pet/pet_menu:menu_store" );
menuResponse->addRadialMenuItemToRadialID(141, 165, 3, "@pet/pet_menu:menu_follow_other" );
if( pet->isIncapacitated() ){
menuResponse->addRadialMenuItem(166, 3, "@pet/pet_menu:awaken" );
}
}
// CREATURES
else if( controlDevice->getPetType() == PetManager::CREATUREPET ){
menuResponse->addRadialMenuItem(234, 3, "@pet/pet_menu:menu_feed" ); // PET_FEED
menuResponse->addRadialMenuItem(141, 3, "@pet/pet_menu:menu_command"); // PET_COMMAND
if( player->hasSkill( "outdoors_creaturehandler_novice" ) ){
menuResponse->addRadialMenuItemToRadialID(141, 142, 3, "@pet/pet_menu:menu_follow" ); // PET_FOLLOW
menuResponse->addRadialMenuItemToRadialID(141, 146, 3, "@pet/pet_menu:menu_attack" ); // PET_ATTACK
menuResponse->addRadialMenuItemToRadialID(141, 164, 3, "@pet/pet_menu:menu_store" );
}
if( player->hasSkill( "outdoors_creaturehandler_training_01" ) ){
menuResponse->addRadialMenuItemToRadialID(141, 143, 3, "@pet/pet_menu:menu_stay" ); // PET_STAY
}
if( player->hasSkill( "outdoors_creaturehandler_training_02" ) ){
menuResponse->addRadialMenuItemToRadialID(141, 144, 3, "@pet/pet_menu:menu_guard" ); // PET_GUARD
}
if( player->hasSkill( "outdoors_creaturehandler_training_03" ) ){
menuResponse->addRadialMenuItemToRadialID(141, 147, 3, "@pet/pet_menu:menu_patrol" ); // PET_PATROL
menuResponse->addRadialMenuItemToRadialID(141, 148, 3, "@pet/pet_menu:menu_get_patrol_point" ); // PET_GET_PATROL_POINT
menuResponse->addRadialMenuItemToRadialID(141, 149, 3, "@pet/pet_menu:menu_clear_patrol_points" ); // PET_CLEAR_PATROL_POINTS
}
if( player->hasSkill( "outdoors_creaturehandler_training_04" ) ){
menuResponse->addRadialMenuItemToRadialID(141, 150, 3, "@pet/pet_menu:menu_assume_formation_1" ); // PET_ASSUME_FORMATION_1
menuResponse->addRadialMenuItemToRadialID(141, 151, 3, "@pet/pet_menu:menu_assume_formation_2" ); // PET_ASSUME_FORMATION_2
}
if( player->hasSkill( "outdoors_creaturehandler_healing_01" ) ){
menuResponse->addRadialMenuItemToRadialID(141, 154, 3, "@pet/pet_menu:menu_trick_1" ); // PET_TRICK_1
}
if( player->hasSkill( "outdoors_creaturehandler_healing_03" ) ){
menuResponse->addRadialMenuItemToRadialID(141, 155, 3, "@pet/pet_menu:menu_trick_2" ); // PET_TRICK_2
}
if( player->hasSkill( "outdoors_creaturehandler_support_01" ) ){
menuResponse->addRadialMenuItemToRadialID(141, 158, 3, "@pet/pet_menu:menu_group" ); // PET_GROUP
}
if( player->hasSkill( "outdoors_creaturehandler_support_02" ) ){
menuResponse->addRadialMenuItemToRadialID(141, 165, 3, "@pet/pet_menu:menu_follow_other" );
}
if( player->hasSkill( "outdoors_creaturehandler_support_03" ) ){
menuResponse->addRadialMenuItemToRadialID(141, 145, 3, "@pet/pet_menu:menu_friend" ); // PET_FRIEND
}
if( player->hasSkill( "outdoors_creaturehandler_taming_03" ) && pet->hasSpecialAttack(1) ){
menuResponse->addRadialMenuItemToRadialID(141, 161, 3, "@pet/pet_menu:menu_specialattack_one" ); // PET_SPECIAL_ATTACK_ONE
}
if( player->hasSkill( "outdoors_creaturehandler_taming_04" ) && pet->hasSpecialAttack(2) ){
menuResponse->addRadialMenuItemToRadialID(141, 162, 3, "@pet/pet_menu:menu_specialattack_two" ); // PET_SPECIAL_ATTACK_TWO
}
if( player->hasSkill( "outdoors_creaturehandler_master" ) ){
if (pet->hasRangedWeapon()) {
menuResponse->addRadialMenuItemToRadialID(141, 163, 3, "@pet/pet_menu:menu_ranged_attack" );
}
menuResponse->addRadialMenuItemToRadialID(141, 152, 3, "@pet/pet_menu:menu_transfer" ); // PET_TRANSFER
}
if( player->hasSkill( "outdoors_creaturehandler_support_04") && !controlDevice->isTrainedAsMount() && petManager->checkMountEligibility(controlDevice) == PetManager::CANBEMOUNTTRAINED){
menuResponse->addRadialMenuItemToRadialID(141, 207, 3, "@pet/pet_menu:menu_train_mount" ); // Train Pet As A Mount
}
if( pet->isIncapacitated() ){
menuResponse->addRadialMenuItem(166, 3, "@pet/pet_menu:awaken" );
}
if (controlDevice->isTrainedAsMount() && !pet->isDead() && !pet->isIncapacitated()) {
Reference<SceneObject*> rider = pet->getSlottedObject("rider");
if (rider == NULL) {
menuResponse->addRadialMenuItem(205, 3, "@pet/pet_menu:menu_mount"); // Climb Aboard Pet
} else {
menuResponse->addRadialMenuItem(206, 3, "@pet/pet_menu:menu_dismount"); // Climb Off Of Pet
}
}
}
}
示例2: setTrainingCommand
void PetControlDeviceImplementation::setTrainingCommand( unsigned int commandID ){
// we set to 0 to flag completion so skip all this then.
if (commandID == 0) {
trainingCommand = 0;
return;
}
ManagedReference<TangibleObject*> controlledObject = this->controlledObject.get();
if (controlledObject == NULL || !controlledObject->isAiAgent())
return;
AiAgent* pet = cast<AiAgent*>(controlledObject.get());
if( pet == NULL )
return;
ManagedReference<CreatureObject*> owner = pet->getLinkedCreature().get();
if (owner == NULL || !owner->isPlayerCreature())
return;
if( petType == PetManager::DROIDPET) {
ManagedReference<DroidObject*> droid = this->controlledObject.get().castTo<DroidObject*>();
if (droid == NULL)
return;
// Check power on droids
if( !droid->hasPower() ){
droid->showFlyText("npc_reaction/flytext","low_power", 204, 0, 0); // "*Low Power*"
return;
}
if(((commandID == PetManager::ATTACK || commandID == PetManager::GUARD) && !droid->isCombatDroid()) ||
(commandID == PetManager::RANGED_ATTACK && (!droid->isCombatDroid() || !droid->hasRangedWeapon())) ||
(commandID == PetManager::RECHARGEOTHER && !droid->isPowerDroid()) ||
(commandID == PetManager::TRANSFER) ||
(commandID == PetManager::SPECIAL_ATTACK1) ||
(commandID == PetManager::SPECIAL_ATTACK2) ||
(commandID == PetManager::TRICK1) ||
(commandID == PetManager::TRICK2)){
return;
}
}
else if(petType == PetManager::CREATUREPET){
if(((commandID == PetManager::ATTACK || commandID == PetManager::FOLLOW || commandID == PetManager::STORE) && !owner->hasSkill("outdoors_creaturehandler_novice") ) ||
(commandID == PetManager::STAY && !owner->hasSkill("outdoors_creaturehandler_training_01")) ||
(commandID == PetManager::GUARD && !owner->hasSkill("outdoors_creaturehandler_training_02")) ||
(commandID == PetManager::FRIEND && !owner->hasSkill("outdoors_creaturehandler_support_03")) ||
((commandID == PetManager::PATROL || commandID == PetManager::GETPATROLPOINT || commandID == PetManager::CLEARPATROLPOINTS) && !owner->hasSkill("outdoors_creaturehandler_training_03")) ||
((commandID == PetManager::FORMATION1 || commandID == PetManager::FORMATION2) && !owner->hasSkill("outdoors_creaturehandler_training_04")) ||
(commandID == PetManager::TRANSFER && !owner->hasSkill("outdoors_creaturehandler_master")) ||
(commandID == PetManager::TRICK1 && !owner->hasSkill("outdoors_creaturehandler_healing_01")) ||
(commandID == PetManager::TRICK2 && !owner->hasSkill("outdoors_creaturehandler_healing_03")) ||
(commandID == PetManager::GROUP && !owner->hasSkill("outdoors_creaturehandler_support_01")) ||
(commandID == PetManager::SPECIAL_ATTACK1 && (!owner->hasSkill("outdoors_creaturehandler_taming_03") || !pet->hasSpecialAttack(1))) ||
(commandID == PetManager::SPECIAL_ATTACK2 && (!owner->hasSkill("outdoors_creaturehandler_taming_04") || !pet->hasSpecialAttack(2))) ||
(commandID == PetManager::RANGED_ATTACK && (!owner->hasSkill("outdoors_creaturehandler_master") || !pet->hasRangedWeapon())) ||
(commandID == PetManager::FOLLOWOTHER && !owner->hasSkill("outdoors_creaturehandler_support_02")) ||
(commandID == PetManager::RECHARGEOTHER))
return;
}
else if(petType == PetManager::FACTIONPET){
if(commandID == PetManager::RECHARGEOTHER ||
(commandID == PetManager::TRANSFER) ||
(commandID == PetManager::SPECIAL_ATTACK1) ||
(commandID == PetManager::SPECIAL_ATTACK2) ||
(commandID == PetManager::TRICK1) ||
(commandID == PetManager::TRICK2))
return;
}
/** Check for converse and if so, get its personalityStf**/
if (pet->getOptionsBitmask() & OptionBitmask::CONVERSE) {
String stf = pet->getPersonalityStf();
StringBuffer message;
message << stf << ":start_convo_4";
StringIdChatParameter chat;
chat.setStringId(message.toString());
pet->getZoneServer()->getChatManager()->broadcastChatMessage(pet,chat,0,0,0);
} else {
pet->showFlyText("npc_reaction/flytext","alert", 204, 0, 0); // "?"
}
trainingCommand = commandID;
}