Ejemplo n.º 1
0
		VOID StdImpact021_T::OnUseSkillSuccessfully(OWN_IMPACT& rImp, Obj_Character& rMe, SkillInfo_T& rSkill) const
		{
			__ENTER_FUNCTION
			BOOL bFound = FALSE;
			INT nActiveTimes=GetActivateTimes(rImp);
			if(0==nActiveTimes)
			{
				return;
			}
			if(FALSE == Skill_IsSkillInCollection(rSkill, GetTargetCollection(rImp)))
			{
				return;
			}
			SkillLogic_T const* pSkillLogic = Skill_GetLogic(rSkill);
			if(NULL==pSkillLogic)
			{
				return;
			}
			if(0<nActiveTimes)
			{
				--nActiveTimes;
				if(0==nActiveTimes)
				{
					rMe.Impact_OnImpactFadeOut(rImp);
				}
				SetActivateTimes(rImp, nActiveTimes);
				return;
			}
			__LEAVE_FUNCTION
		}
Ejemplo n.º 2
0
		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
		}