本文整理汇总了C++中PlayerObject::getFactionStatus方法的典型用法代码示例。如果您正苦于以下问题:C++ PlayerObject::getFactionStatus方法的具体用法?C++ PlayerObject::getFactionStatus怎么用?C++ PlayerObject::getFactionStatus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerObject
的用法示例。
在下文中一共展示了PlayerObject::getFactionStatus方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: checkContainerPermission
bool MinefieldContainerComponent::checkContainerPermission(SceneObject* sceneObject, CreatureObject* creature, uint16 permission){
if(sceneObject == NULL || !sceneObject->isTangibleObject())
return false;
InstallationObject* minefield = cast<InstallationObject*>(sceneObject);
if(creature == NULL || minefield == NULL)
return false;
if(creature->getFaction() == 0 || minefield->getFaction() == 0)
return false;
PlayerObject* ghost = creature->getPlayerObject();
if(ghost == NULL)
return false;
if(permission == ContainerPermissions::OPEN || permission == ContainerPermissions::MOVEIN){
if(minefield->getFaction() == creature->getFaction() && ghost->getFactionStatus() != FactionStatus::ONLEAVE)
return true;
} else if (permission == ContainerPermissions::MOVEOUT){
if(creature->getFaction() != minefield->getFaction())
return false;
return minefield->isOnAdminList(creature);
}
return ContainerComponent::checkContainerPermission(sceneObject, creature, permission);
}
示例2: addEntertainerBuffStrength
void EntertainingSessionImplementation::addEntertainerBuffStrength(CreatureObject* creature, int performanceType, float strength) {
ManagedReference<CreatureObject*> entertainer = this->entertainer.get();
int buffStrength = getEntertainerBuffStrength(creature, performanceType);
float newBuffStrength = buffStrength + strength;
float maxBuffStrength = 0.0f; //cap based on enhancement skill
if(dancing) {
maxBuffStrength = (float) entertainer->getSkillMod("healing_dance_mind");
}
else if (playingMusic) {
maxBuffStrength = (float) entertainer->getSkillMod("healing_music_mind");
}
if(maxBuffStrength > 125.0f)
maxBuffStrength = 125.0f; //cap at 125% power
float factionPerkStrength = entertainer->getSkillMod("private_faction_buff_mind");
ManagedReference<BuildingObject*> building = entertainer->getRootParent().get().castTo<BuildingObject*>();
if (building != NULL && factionPerkStrength > 0 && building->isPlayerRegisteredWithin(entertainer->getObjectID())) {
unsigned int buildingFaction = building->getFaction();
unsigned int entFaction = entertainer->getFaction();
PlayerObject* ghost = entertainer->getPlayerObject();
if (ghost != NULL && entFaction != 0 && entFaction == buildingFaction && ghost->getFactionStatus() == FactionStatus::OVERT) {
maxBuffStrength += factionPerkStrength;
}
}
//add xp based on % added to buff strength
if (newBuffStrength < maxBuffStrength) {
healingXp += strength;
}
else {
healingXp += maxBuffStrength - buffStrength;
newBuffStrength = maxBuffStrength;
}
//newBuffStrength = newBuffStrength;
setEntertainerBuffStrength(creature, performanceType, newBuffStrength);
}
示例3: doEntertainerPatronEffects
void EntertainingSessionImplementation::doEntertainerPatronEffects() {
ManagedReference<CreatureObject*> creo = entertainer.get();
if (creo == NULL)
return;
if (performanceName == "")
return;
Locker locker(creo);
//**DECLARATIONS**
VectorMap<ManagedReference<CreatureObject*>, EntertainingData>* patrons = NULL;
SkillManager* skillManager = creo->getZoneServer()->getSkillManager();
PerformanceManager* performanceManager = skillManager->getPerformanceManager();
Performance* performance = NULL;
ManagedReference<Instrument*> instrument = getInstrument(creo);
float woundHealingSkill = 0.0f;
float playerShockHealingSkill = 0.0f;
float buildingShockHealingSkill = creo->getSkillMod("private_med_battle_fatigue");
float factionPerkSkill = creo->getSkillMod("private_faction_mind_heal");
//**LOAD PATRONS, GET THE PERFORMANCE AND ENT'S HEALING SKILL.**
if (dancing) {
patrons = &watchers;
performance = performanceManager->getDance(performanceName);
woundHealingSkill = (float) creo->getSkillMod("healing_dance_wound");
playerShockHealingSkill = (float) creo->getSkillMod("healing_dance_shock");
} else if (playingMusic && instrument != NULL) {
patrons = &listeners;
performance = performanceManager->getSong(performanceName, instrument->getInstrumentType());
woundHealingSkill = (float) creo->getSkillMod("healing_music_wound");
playerShockHealingSkill = (float) creo->getSkillMod("healing_music_shock");
} else {
cancelSession();
return;
}
if (performance == NULL) {
return;
}
ManagedReference<BuildingObject*> building = creo->getRootParent().get().castTo<BuildingObject*>();
if (building != NULL && factionPerkSkill > 0 && building->isPlayerRegisteredWithin(creo->getObjectID())) {
unsigned int buildingFaction = building->getFaction();
unsigned int healerFaction = creo->getFaction();
PlayerObject* ghost = creo->getPlayerObject();
if (ghost != NULL && healerFaction != 0 && healerFaction == buildingFaction && ghost->getFactionStatus() == FactionStatus::OVERT) {
woundHealingSkill += factionPerkSkill;
playerShockHealingSkill += factionPerkSkill;
}
}
//**DETERMINE WOUND HEAL AMOUNTS.**
int woundHeal = ceil(performance->getHealMindWound() * (woundHealingSkill / 100.0f));
int shockHeal = ceil(performance->getHealShockWound() * ((playerShockHealingSkill + buildingShockHealingSkill) / 100.0f));
//**ENTERTAINER HEALS THEIR OWN MIND.**
healWounds(creo, woundHeal*(flourishCount+1), shockHeal*(flourishCount+1));
//**APPLY EFFECTS TO PATRONS.**
if (patrons != NULL && patrons->size() > 0) {
for (int i = 0; i < patrons->size(); ++i) {
ManagedReference<CreatureObject*> patron = patrons->elementAt(i).getKey();
try {
//**VERIFY THE PATRON IS NOT ON THE DENY SERVICE LIST
if (creo->isInRange(patron, 10.0f)) {
healWounds(patron, woundHeal*(flourishCount+1), shockHeal*(flourishCount+1));
increaseEntertainerBuff(patron);
} else { //patron is not in range, force to stop listening
ManagedReference<PlayerManager*> playerManager = patron->getZoneServer()->getPlayerManager();
Locker locker(patron, entertainer.get());
if (dancing) {
if (playerManager != NULL)
playerManager->stopWatch(patron, creo->getObjectID(), true, false, false, true);
if (!patron->isListening())
sendEntertainmentUpdate(patron, 0, "", true);
} else if (playingMusic) {
if (playerManager != NULL)
playerManager->stopListen(patron, creo->getObjectID(), true, false, false, true);
if (!patron->isWatching())
sendEntertainmentUpdate(patron, 0, "", true);
}
}
//.........这里部分代码省略.........