本文整理汇总了C++中Performance::getFlourishXpMod方法的典型用法代码示例。如果您正苦于以下问题:C++ Performance::getFlourishXpMod方法的具体用法?C++ Performance::getFlourishXpMod怎么用?C++ Performance::getFlourishXpMod使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Performance
的用法示例。
在下文中一共展示了Performance::getFlourishXpMod方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: doFlourish
void EntertainingSessionImplementation::doFlourish(int flourishNumber) {
ManagedReference<CreatureObject*> entertainer = this->entertainer.get();
int fid = flourishNumber;
if (!dancing && !playingMusic) {
entertainer->sendSystemMessage("@performance:flourish_not_performing");
return;
}
PerformanceManager* performanceManager = SkillManager::instance()->getPerformanceManager();
Performance* performance = NULL;
ManagedReference<Instrument*> instrument = getInstrument(entertainer);
if (dancing)
performance = performanceManager->getDance(performanceName);
else if (playingMusic && instrument)
performance = performanceManager->getSong(performanceName, instrument->getInstrumentType());
else {
cancelSession();
return;
}
if (!performance) { // shouldn't happen
StringBuffer msg;
msg << "Performance was null. Please report to www.swgemu.com/bugs ! Name: " << performanceName << " and Type: " << dec << instrument->getInstrumentType();
entertainer->sendSystemMessage(msg.toString());
return;
}
float baseActionDrain = performance->getActionPointsPerLoop() - (int)(entertainer->getHAM(CreatureAttribute::QUICKNESS)/35.f);
//float baseActionDrain = -40 + (getQuickness() / 37.5);
float flourishActionDrain = baseActionDrain / 2.0;
int actionDrain = (int)round((flourishActionDrain * 10 + 0.5) / 10.0); // Round to nearest dec for actual int cost
if (entertainer->getHAM(CreatureAttribute::ACTION) <= actionDrain) {
entertainer->sendSystemMessage("@performance:flourish_too_tired");
} else {
entertainer->inflictDamage(entertainer, CreatureAttribute::ACTION, actionDrain, false, true);
if (dancing) {
StringBuffer msg;
msg << "skill_action_" << fid;
entertainer->doAnimation(msg.toString());
} else if (playingMusic) {
Flourish* flourish = new Flourish(entertainer, fid);
entertainer->broadcastMessage(flourish, true);
}
//check to see how many flourishes have occurred this tick
if(flourishCount < 5) {
// Add buff
addEntertainerFlourishBuff();
// Grant Experience
if(flourishCount < 2)
flourishXp += performance->getBaseXp() + performance->getFlourishXpMod();
flourishCount++;
}
entertainer->notifyObservers(ObserverEventType::FLOURISH, entertainer, fid);
entertainer->sendSystemMessage("@performance:flourish_perform");
}
}