本文整理汇总了C++中OWN_IMPACT类的典型用法代码示例。如果您正苦于以下问题:C++ OWN_IMPACT类的具体用法?C++ OWN_IMPACT怎么用?C++ OWN_IMPACT使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了OWN_IMPACT类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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
}
示例2: SendImpactToUnit
BOOL ImpactCore_T::SendImpactToUnit(Obj_Character& rTar, ID_t nDataIndex, ObjID_t nSender, Time_t nDelayTime, BOOL bCriticalFlag, INT nRefixRate, INT nReserveParam1, INT nReserveParam2) const
{
__ENTER_FUNCTION
OWN_IMPACT impact;
if(INVALID_ID == nDataIndex)
{
return FALSE;
}
//根据nDataIndex对应的效果逻辑初始化rImp
if(TRUE == InitImpactFromData(nDataIndex, impact, rTar, nReserveParam1))
{
//获得逻辑对象
ImpactLogic_T const* pLogic = Impact_GetLogic(impact);
if(NULL==pLogic)
{
Assert(NULL=="[ImpactCore_T::SendImpactToUnit]: Can't find sprcific logic for this impact.");
return FALSE;
}
//设置会心标记
if(TRUE == bCriticalFlag)
{
impact.MarkCriticalFlag();
}
if(0!=nRefixRate)
{
//向效果逻辑设置修正率
pLogic->RefixPowerByRate(impact, nRefixRate);
}
if(0>nDelayTime)
{
nDelayTime = 0;
}
Scene* pScene = rTar.getScene();
Obj_Character* pChar = NULL;
if(NULL!=pScene)
{
Obj* pObj = pScene->GetSpecificObjByID( nSender );
if( IsCharacterObj(pObj->GetObjType()) )
{
pChar = static_cast<Obj_Character*>(pObj);
SkillInfo_T& rSkillInfo = pChar->GetSkillInfo();
impact.SetSkillID( rSkillInfo.GetSkillID() );
rSkillInfo.SetSendSkillImpactID(impact.GetDataIndex());
}
pScene->GetEventCore().RegisterImpactEvent(rTar.GetID(), nSender, impact, nDelayTime);
return TRUE;
}
}
// start to fill impact struct
return TRUE;
__LEAVE_FUNCTION
return FALSE;
}
示例3: GetDamage
VOID StdImpact001_T::CriticalRefix(OWN_IMPACT& rImp) const
{
__ENTER_FUNCTION
SetDamage(rImp, GetDamage(rImp)*2);
rImp.MarkCriticalFlag();
__LEAVE_FUNCTION
}
示例4:
BOOL StdImpact059_T::ScanUnitForTarget( OWN_IMPACT& rImp, Obj_Character& rMe, FLOAT fX,FLOAT fZ, OBJLIST& rTargets) const
{
__ENTER_FUNCTION
UINT uCurrentBallCount = rImp.GetLayerCount();
//初始化搜索需要的基础属性
SkillInfo_T rSkillInfo = rMe.GetSkillInfo();
//为了此类buff可以和其它技能并存,所以给ScanOperatorIniter提供造成此类buff的技能SkillInfo_T
g_SkillCore.InstanceSkill( rSkillInfo, rMe, rImp.GetSkillID() );
TargetingAndDepletingParams_T& rParams = rMe.GetTargetingAndDepletingParams();
Scene* pScene = rMe.getScene();
SCANOPERATOR_SECTORSKILL_INIT ScanOperatorIniter;
ScanOperatorIniter.m_pSkillInfo = &rSkillInfo;
ScanOperatorIniter.m_pMe = &rMe;
ScanOperatorIniter.m_pScene = rMe.getScene();
ScanOperatorIniter.m_pTargets = &rTargets;
ScanOperatorIniter.m_fRadius = rSkillInfo.GetRadius();
ScanOperatorIniter.m_CentrePoint.m_fX = fX;
ScanOperatorIniter.m_CentrePoint.m_fZ = fZ;
//保护
if( rTargets.MAX_OBJ_LIST_SIZE < uCurrentBallCount )
return FALSE;
//搜索人数上限为当前自身实际的小球个数
ScanOperatorIniter.m_nCount = uCurrentBallCount;
//初始化搜索对象
ScanOperator_SectorSkill ScanOperator;
ScanOperator.Init(&ScanOperatorIniter);
//执行搜索
if(NULL!=pScene)
{
if(FALSE==pScene->Scan(&ScanOperator))
{
rParams.SetErrCode(OR_ERROR);
return FALSE;
}
}
else
{
rParams.SetErrCode(OR_ERROR);
return FALSE;
}
return TRUE;
__LEAVE_FUNCTION
return FALSE;
}
示例5: GetSubImpactDataIndexByIndex
VOID StdImpact059_T::ComputeLayerChange( OWN_IMPACT& rImp, Obj_Character& rMe, INT nCount, INT iCurrentLayer ) const
{
__ENTER_FUNCTION
INT iMaxLayerCount = rImp.GetMaxLayerCount();
//获取子效果的DataIndex
INT nDataIndex = GetSubImpactDataIndexByIndex(rImp, 0);
//获取子效果的描述对象
const ImpactData_T* pSubImpactData = Impact_GetDataBlock( nDataIndex );
//获得子效果的总持续时间
Time_t iSubImpactContinuance = pSubImpactData->GetContinuance();
for( INT i=0; i<nCount; ++i )
{
//设置新添加的层的计时
rImp.SetLayerContinuanceByIdx( iMaxLayerCount-iCurrentLayer+i, g_pTimeManager->CurrentTime()+iSubImpactContinuance );
}
__LEAVE_FUNCTION
}
示例6: if
BOOL StdImpact059_T::IsCanSendToUnit( OWN_IMPACT& rImp, Obj_Character& rMe, Obj_Character* pChar ) const
{
//获得技能使用者身上的效果列表
__ENTER_FUNCTION
OWN_IMPACT* pImpact = pChar->Impact_GetFirstImpactOfSpecificSkillID( rImp.GetSkillID() );
if( NULL == pImpact )
{
if( pChar->Impact_IsCanReciveBallImpact( rImp ) )
return TRUE;
}
else if( pImpact->GetCasterObjID()!=rMe.GetID() )
{
return TRUE;
}
return FALSE;
__LEAVE_FUNCTION
return FALSE;
}
示例7: 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
}
示例8: Impact_GetMutexByCasterFlag
BOOL Impact_GetMutexByCasterFlag(OWN_IMPACT& rImp)
{
__ENTER_FUNCTION
ID_t nDataIndex = rImp.GetDataIndex();
ImpactData_T const* pData = Impact_GetDataBlock(nDataIndex);
if(NULL!=pData)
{
return pData->GetMutexByCasterFlag();
}
return 0;
__LEAVE_FUNCTION
return 0;
}
示例9: Impact_GetMutexID
ID_t Impact_GetMutexID(OWN_IMPACT& rImp)
{
__ENTER_FUNCTION
ID_t nDataIndex = rImp.GetDataIndex();
ImpactData_T const* pData = Impact_GetDataBlock(nDataIndex);
if(NULL!=pData)
{
return pData->GetMutexID();
}
return INVALID_ID;
__LEAVE_FUNCTION
return INVALID_ID;
}
示例10: Impact_GetStandFlag
ID_t Impact_GetStandFlag(OWN_IMPACT& rImp)
{
__ENTER_FUNCTION
ID_t nDataIndex = rImp.GetDataIndex();
ImpactData_T const* pData = Impact_GetDataBlock(nDataIndex);
if(NULL!=pData)
{
return pData->GetStandFlag();
}
return BEHAVIOR_TYPE_NEUTRALITY;
__LEAVE_FUNCTION
return BEHAVIOR_TYPE_NEUTRALITY;
}
示例11: Impact_IsFadeOutWhenUnitStartActions
BOOL Impact_IsFadeOutWhenUnitStartActions(OWN_IMPACT& rImp)
{
__ENTER_FUNCTION
ID_t nDataIndex = rImp.GetDataIndex();
ImpactData_T const* pData = Impact_GetDataBlock(nDataIndex);
if(NULL!=pData)
{
return pData->IsFadeOutWhenUnitStartActions();
}
return TRUE;
__LEAVE_FUNCTION
return TRUE;
}
示例12: Impact_NeedChannelSupport
BOOL Impact_NeedChannelSupport(OWN_IMPACT& rImp)
{
__ENTER_FUNCTION
ID_t nDataIndex = rImp.GetDataIndex();
ImpactData_T const* pData = Impact_GetDataBlock(nDataIndex);
if(NULL!=pData)
{
return pData->NeedChannelSupport();
}
return FALSE;
__LEAVE_FUNCTION
return FALSE;
}
示例13: Impact_IsStillTimingWhenUnitOffline
BOOL Impact_IsStillTimingWhenUnitOffline(OWN_IMPACT& rImp)
{
__ENTER_FUNCTION
ID_t nDataIndex = rImp.GetDataIndex();
ImpactData_T const* pData = Impact_GetDataBlock(nDataIndex);
if(NULL!=pData)
{
return pData->IsStillTimingWhenUnitOffline();
}
return FALSE;
__LEAVE_FUNCTION
return FALSE;
}
示例14: Impact_IgnoreFliter
ID_t Impact_IgnoreFliter(OWN_IMPACT& rImp)
{
__ENTER_FUNCTION
ID_t nDataIndex = rImp.GetDataIndex();
ImpactData_T const* pData = Impact_GetDataBlock(nDataIndex);
if(NULL!=pData)
{
return pData->IgnoreFliter();
}
return FALSE;
__LEAVE_FUNCTION
return FALSE;
}
示例15: Impact_GetInterval
Time_t Impact_GetInterval(OWN_IMPACT& rImp)
{
__ENTER_FUNCTION
ID_t nDataIndex = rImp.GetDataIndex();
ImpactData_T const* pData = Impact_GetDataBlock(nDataIndex);
if(NULL!=pData)
{
return pData->GetInterval();
}
return 0;
__LEAVE_FUNCTION
return 0;
}