void DroidObjectImplementation::fillObjectMenuResponse(ObjectMenuResponse* menuResponse, CreatureObject* player){ SceneObjectImplementation::fillObjectMenuResponse( menuResponse, player ); // PetMenuComponent // Allow modules to add radials PetControlDevice* pcd = getControlDevice().get().castTo<PetControlDevice*>(); for( int i=0; i<modules.size(); i++){ BaseDroidModuleComponent* module = modules.get(i); module->fillObjectMenuResponse( _this.get(), menuResponse, player ); } }
int DroidObjectImplementation::handleObjectMenuSelect(CreatureObject* player, byte selectedID){ // Allow modules to handle radials if desired PetControlDevice* pcd = getControlDevice().get().castTo<PetControlDevice*>(); for( int i=0; i<modules.size(); i++){ BaseDroidModuleComponent* module = modules.get(i); module->handleObjectMenuSelect(player, selectedID, pcd); } return SceneObjectImplementation::handleObjectMenuSelect(player, selectedID); // PetMenuComponent }
bool CreatureImplementation::isMount() { if (!isPet()) return false; ManagedReference<PetControlDevice*> pcd = getControlDevice().get().castTo<PetControlDevice*>(); if (pcd == NULL) return false; if (pcd->isTrainedAsMount()) return true; return false; }
int DroidObjectImplementation::handleObjectMenuSelect(CreatureObject* player, byte selectedID){ PetControlDevice* pcd = getControlDevice().get().castTo<PetControlDevice*>(); if (getLinkedCreature().get() == player) { // Allow modules to handle radials if desired for( int i=0; i<modules.size(); i++){ BaseDroidModuleComponent* module = modules.get(i); module->handleObjectMenuSelect(player, selectedID, pcd); } } else if (isMerchantBarker()) { BaseDroidModuleComponent* module = getModule("merchant_barker"); if(module != NULL) module->handleObjectMenuSelect(player, selectedID, pcd); } return SceneObjectImplementation::handleObjectMenuSelect(player, selectedID); // PetMenuComponent }
void DroidObjectImplementation::fillObjectMenuResponse(ObjectMenuResponse* menuResponse, CreatureObject* player){ SceneObjectImplementation::fillObjectMenuResponse( menuResponse, player ); // PetMenuComponent if (isMerchantBarker() && getLinkedCreature().get() != player) { BaseDroidModuleComponent* module = getModule("merchant_barker"); if (module != NULL) module->fillObjectMenuResponse( _this.getReferenceUnsafeStaticCast(), menuResponse, player ); return; } if (getLinkedCreature().get() != player) { return; } // Allow modules to add radials PetControlDevice* pcd = getControlDevice().get().castTo<PetControlDevice*>(); for( int i=0; i<modules.size(); i++){ BaseDroidModuleComponent* module = modules.get(i); module->fillObjectMenuResponse( _this.getReferenceUnsafeStaticCast(), menuResponse, player ); } }
void DroidObjectImplementation::fillAttributeList(AttributeListMessage* msg, CreatureObject* object){ AiAgentImplementation::fillAttributeList( msg, object ); ManagedReference<ControlDevice*> device = getControlDevice().get(); if (device != NULL && device->isASubChildOf(object)) { float percentPower = ((float)power/(float)MAX_POWER)*100.0; msg->insertAttribute("@obj_attr_n:battery_power", String::valueOf((int)percentPower) + "%"); if (paintCount > 0){ msg->insertAttribute("customization_cnt", paintCount); } for( int i=0; i<modules.size(); i++){ BaseDroidModuleComponent* module = modules.get(i); if( module != NULL ){ module->fillAttributeList(msg, object); } } } }