本文整理汇总了C++中OWN_IMPACT::GetContinuance方法的典型用法代码示例。如果您正苦于以下问题:C++ OWN_IMPACT::GetContinuance方法的具体用法?C++ OWN_IMPACT::GetContinuance怎么用?C++ OWN_IMPACT::GetContinuance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OWN_IMPACT
的用法示例。
在下文中一共展示了OWN_IMPACT::GetContinuance方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
VOID StdImpact059_T::SendLayerChangeMsg( OWN_IMPACT& rImp, Obj_Character& rMe ) const
{
__ENTER_FUNCTION
//通知客户端层数改变
// Info Other Impact
//通知其它客户端效果生效
Scene * pScene = rMe.getScene();
if(NULL==pScene||FALSE==rMe.IsActiveObj())
{
return;
}
GCCharBuff Msg2Other;
Msg2Other.SetReceiverID(rImp.GetCasterObjID());
Msg2Other.SetSenderID(rImp.GetCasterObjID());
Msg2Other.SetEnable(TRUE);
Msg2Other.SetSN(rImp.GetSN());
Msg2Other.SetBuffID(Impact_GetImpactID(rImp));
Msg2Other.SetSenderLogicCount(rImp.GetCasterLogicCount());
Msg2Other.SetSkillID( rImp.GetSkillID() );
Msg2Other.SetLayerCount( rImp.GetLayerCount() );
// 设置技能效果的持续时间 20100531 BLL
Msg2Other.SetContinuance( rImp.GetContinuance() );
if(INVALID_ID!=Impact_GetImpactID(rImp))
{
pScene->BroadCast(&Msg2Other, &rMe, TRUE);
}
__LEAVE_FUNCTION
}
示例2: ContinuanceCalc
VOID ImpactLogic_T::ContinuanceCalc(OWN_IMPACT& rImp, Obj_Character& rMe, INT nDeltaTime) const
{
__ENTER_FUNCTION
//取得总持续时间
INT const nContinuance = rImp.GetContinuance();
//取得逝去的持续时间
INT nContinuanceElapsed = rImp.GetContinuanceElapsed();
//如果不是消散状态
if(FALSE == rImp.IsFadeOut())
{
//如果是持续性效果
if(TRUE == IsOverTimed())
{
if(-1==nContinuance)
{
return; //-1为持续时间无限长
}
if(nContinuanceElapsed<=nContinuance)
{
nContinuanceElapsed += nDeltaTime;
}
//如果超时,则消散
if(nContinuanceElapsed>nContinuance)
{
// prepare delete this impact
rMe.Impact_OnImpactFadeOut(rImp);
}
//更新逝去时间
rImp.SetContinuanceElapsed(nContinuanceElapsed);
}
}
__LEAVE_FUNCTION
}
示例3: IntervalCalc
VOID ImpactLogic_T::IntervalCalc(OWN_IMPACT& rImp, Obj_Character& rMe, INT nDeltaTime) const
{
__ENTER_FUNCTION
//process interval
INT nElapsedInterval = rImp.GetIntervalElapsed();
INT nContinuance = rImp.GetContinuance();
if(nDeltaTime>nContinuance && 0<=nContinuance)
{
nDeltaTime = nContinuance;
}
nElapsedInterval += nDeltaTime;
INT const nInterval = Impact_GetInterval(rImp);
while (nElapsedInterval >= nInterval)
{
// Impact activited
OnIntervalOver(rImp, rMe);
nElapsedInterval -= nInterval;
}
rImp.SetIntervalElapsed(nElapsedInterval);
__LEAVE_FUNCTION
}