本文整理汇总了C++中Ousters::setAlignment方法的典型用法代码示例。如果您正苦于以下问题:C++ Ousters::setAlignment方法的具体用法?C++ Ousters::setAlignment怎么用?C++ Ousters::setAlignment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Ousters
的用法示例。
在下文中一共展示了Ousters::setAlignment方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: affect
void EffectAlignmentRecovery::affect(Creature* pCreature)
throw(Error)
{
__BEGIN_TRY
Assert(pCreature != NULL);
Assert(pCreature->isPC());
Timeval CurrentTime;
getCurrentTime(CurrentTime);
GCModifyInformation gcModifyInformation;
Alignment_t CurrentAlignment = 0;
Alignment_t NewAlignment = 0;
if (pCreature->isSlayer())
{
Slayer* pSlayer = dynamic_cast<Slayer*>(pCreature);
Assert(pSlayer != NULL);
if (m_Period != 0)
{
// 플레그 걸귀
pSlayer->setFlag(Effect::EFFECT_CLASS_ALIGNMENT_RECOVERY);
// 한 턴에 얼마나 회복 시킬 것인가.
CurrentAlignment = pSlayer->getAlignment();
NewAlignment = min(10000, (int)(CurrentAlignment + m_AlignmentQuantity));
pSlayer->setAlignment(NewAlignment);
gcModifyInformation.addLongData(MODIFY_ALIGNMENT, NewAlignment);
pSlayer->getPlayer()->sendPacket(&gcModifyInformation);
WORD AlignmentSaveCount = pSlayer->getAlignmentSaveCount();
if (AlignmentSaveCount > ALIGNMENT_SAVE_PERIOD)
{
StringStream msg;
msg << "Alignment = " << NewAlignment;
pSlayer->tinysave(msg.toString());
AlignmentSaveCount = 0;
}
else AlignmentSaveCount++;
pSlayer->setAlignmentSaveCount(AlignmentSaveCount);
}
else
{
// unaffect하면서 패킷이 날아갈 테니까....
setDeadline(0);
}
m_Period--;
}
else if (pCreature->isVampire())
{
Vampire* pVampire = dynamic_cast<Vampire*>(pCreature);
Assert(pVampire != NULL);
if (m_Period != 0)
{
// 플레그 걸귀
pVampire->setFlag(Effect::EFFECT_CLASS_ALIGNMENT_RECOVERY);
// 한 턴에 얼마나 회복 시킬 것인가.
CurrentAlignment = pVampire->getAlignment();
NewAlignment = min(10000, CurrentAlignment + m_AlignmentQuantity);
pVampire->setAlignment(NewAlignment);
gcModifyInformation.addLongData(MODIFY_ALIGNMENT, NewAlignment);
pVampire->getPlayer()->sendPacket(&gcModifyInformation);
WORD AlignmentSaveCount = pVampire->getAlignmentSaveCount();
if (AlignmentSaveCount > ALIGNMENT_SAVE_PERIOD)
{
StringStream msg;
msg << "Alignment = " << NewAlignment;
pVampire->tinysave(msg.toString());
AlignmentSaveCount = 0;
}
else AlignmentSaveCount++;
pVampire->setAlignmentSaveCount(AlignmentSaveCount);
}
else
{
// unaffect하면서 패킷이 날아갈 테니까....
setDeadline(0);
}
m_Period--;
}
else if (pCreature->isOusters())
{
Ousters* pOusters = dynamic_cast<Ousters*>(pCreature);
Assert(pOusters != NULL);
if (m_Period != 0)
//.........这里部分代码省略.........