本文整理汇总了C++中PlayerObject::isJedi方法的典型用法代码示例。如果您正苦于以下问题:C++ PlayerObject::isJedi方法的具体用法?C++ PlayerObject::isJedi怎么用?C++ PlayerObject::isJedi使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerObject
的用法示例。
在下文中一共展示了PlayerObject::isJedi方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: notifyObjectInserted
/**
* Is called when this object has been inserted with an object
* @param object object that has been inserted
*/
int PlayerContainerComponent::notifyObjectInserted(SceneObject* sceneObject, SceneObject* object) const {
CreatureObject* creo = dynamic_cast<CreatureObject*>(sceneObject);
if (creo == NULL) {
return 0;
}
if (object->isArmorObject()) {
PlayerManager* playerManager = sceneObject->getZoneServer()->getPlayerManager();
playerManager->applyEncumbrancies(creo, cast<ArmorObject*>(object));
}
if (object->isTangibleObject()) {
TangibleObject* tano = cast<TangibleObject*>(object);
tano->applySkillModsTo(creo);
}
if (object->isInstrument() && creo->isEntertaining())
creo->stopEntertaining();
//this it to update the equipment list
//we need a DeltaVector with all the slotted objects it seems
/*CreatureObjectMessage6* msg6 = new CreatureObjectMessage6(creo);
creo->broadcastMessage(msg6, true, true);*/
if (object->isTangibleObject() && object->getArrangementDescriptorSize() != 0 && object->getArrangementDescriptor(0)->size() != 0) {
const String& arrangement = object->getArrangementDescriptor(0)->get(0);
if (arrangement != "mission_bag" && arrangement != "ghost" && arrangement != "bank") {
creo->addWearableObject(object->asTangibleObject(), true);
}
}
if (object->isTangibleObject()) {
ManagedReference<TangibleObject*> tano = object->asTangibleObject();
tano->addTemplateSkillMods(creo);
}
// Jedi stuff below.
PlayerObject* ghost = creo->getPlayerObject();
if (ghost && ghost->isJedi()) {
if (object->isRobeObject()) {
ghost->recalculateForcePower();
} else if (object->isWeaponObject()) {
WeaponObject* weaponObject = cast<WeaponObject*>(object);
if (weaponObject->isJediWeapon()) {
VisibilityManager::instance()->increaseVisibility(creo, VisibilityManager::SABERVISMOD);
}
}
}
return ContainerComponent::notifyObjectInserted(sceneObject, object);
}
示例2: notifyObjectRemoved
/**
* Is called when an object was removed
* @param object object that has been inserted
*/
int PlayerContainerComponent::notifyObjectRemoved(SceneObject* sceneObject, SceneObject* object, SceneObject* destination) const {
CreatureObject* creo = dynamic_cast<CreatureObject*>(sceneObject);
if (creo == NULL) {
return 0;
}
if (object->isArmorObject()) {
PlayerManager* playerManager = creo->getZoneServer()->getPlayerManager();
playerManager->removeEncumbrancies(creo, cast<ArmorObject*>(object));
}
if (object->isTangibleObject()) {
TangibleObject* tano = cast<TangibleObject*>(object);
tano->removeSkillModsFrom(creo);
}
if (object->isInstrument()) {
if (creo->isPlayingMusic())
creo->stopEntertaining();
}
//this it to update the equipment list
//we need a DeltaVector with all the slotted objects it seems
/*CreatureObjectMessage6* msg6 = new CreatureObjectMessage6(creo);
creo->broadcastMessage(msg6, true, true);*/
if (object->isTangibleObject() && object->getArrangementDescriptorSize() != 0 && object->getArrangementDescriptor(0)->size() != 0) {
const String& arrangement = object->getArrangementDescriptor(0)->get(0); //CHK
if (arrangement != "mission_bag" && arrangement != "ghost" && arrangement != "bank") {
creo->removeWearableObject(object->asTangibleObject(), true);
}
}
if (object->isTangibleObject()) {
ManagedReference<TangibleObject*> tano = object->asTangibleObject();
tano->removeTemplateSkillMods(creo);
}
// Jedi stuff below.
PlayerObject* ghost = creo->getPlayerObject();
if (ghost && ghost->isJedi()) {
if (object->isRobeObject()) {
ghost->recalculateForcePower();
}
}
return ContainerComponent::notifyObjectRemoved(sceneObject, object, destination);
}