Ejemplo n.º 1
0
	BOOL ActionDelegator_T::RegisterChargeActionForSkill(Obj_Character& rActor, ActionID_t nAction, Time_t nContinuance) const
	{
		__ENTER_FUNCTION
		ActionParams_T&	rActionParams = rActor.GetActionParams();
		if(FALSE==CanDoNextAction(rActor))
		{
			return FALSE;
		}
		rActionParams.Reset();
		rActionParams.SetActor(&rActor);
		rActionParams.SetContinuance(nContinuance);
		rActionParams.SetCallBackFunctor(GetGlobalSkillCallBackFunctor());
		rActor.SetActionLogic(&(GetGlobalChargeActionLogic()));
		//info client Charge action start
		rActor.AddLogicCount();
		BroadcastUnitStartChargeAction(rActor,nAction, nContinuance);
		if(0==rActor.GetActionTime())
		{
			rActor.SetActionTime(MIN_ACTION_TIME);
		}
		rActor.OnActionStarted();
		return TRUE;
		__LEAVE_FUNCTION
		return FALSE;
	}
Ejemplo n.º 2
0
	BOOL ActionDelegator_T::IsPerformingTheSpecificScript(Obj_Character& rActor, ScriptID_t nScriptID) const
	{
		__ENTER_FUNCTION
		ActionLogic_T const * pActionLogic = rActor.GetActionLogic();
		ActionParams_T&	rActionParams = rActor.GetActionParams();
		if(NULL==pActionLogic)
		{
			return FALSE;
		}
		return pActionLogic->IsPerformingSpecificScript(rActionParams, nScriptID);
		__LEAVE_FUNCTION
		return FALSE;
	}
Ejemplo n.º 3
0
	BOOL ActionDelegator_T::IsChanneling(Obj_Character& rActor) const
	{
		__ENTER_FUNCTION
		ActionLogic_T const * pActionLogic = rActor.GetActionLogic();
		ActionParams_T&	rActionParams = rActor.GetActionParams();
		if(NULL==pActionLogic)
		{
			return FALSE;
		}
		if(ACTION_CHANNEL!=pActionLogic->GetLogicID())
		{
			return FALSE;
		}
		return TRUE;
		__LEAVE_FUNCTION
		return FALSE;
	}
Ejemplo n.º 4
0
	BOOL ActionDelegator_T::RegisterInstantActionForScript(Obj_Character& rActor, ActionID_t nAction, Time_t nActionTime) const
	{
		__ENTER_FUNCTION
		ActionParams_T&	rActionParams = rActor.GetActionParams();
		if(FALSE==CanDoNextAction(rActor))
		{
			return FALSE;
		}
		rActionParams.Reset();
		rActionParams.SetActor(&rActor);
		rActor.SetActionLogic(NULL);
		//info client Charge action start
		rActor.AddLogicCount();
		BroadcastUnitStartInstantAction(rActor,nAction, nActionTime);
		if(0==rActor.GetActionTime())
		{
			rActor.SetActionTime(MIN_ACTION_TIME);
		}
		rActor.OnActionStarted();
		return TRUE;
		__LEAVE_FUNCTION
		return FALSE;
	}
Ejemplo n.º 5
0
	BOOL ActionDelegator_T::RegisterChannelActionForScript(Obj_Character& rActor, ActionID_t nAction, Time_t nContinuance, Time_t nInterval) const
	{
		__ENTER_FUNCTION
		ActionParams_T&	rActionParams = rActor.GetActionParams();
		if(FALSE==CanDoNextAction(rActor))
		{
			return FALSE;
		}
		rActionParams.Reset();
		rActionParams.SetActor(&rActor);
		if(500>nContinuance)
		{
			AssertEx(FALSE,"[ActionDelegator_T::RegisterChannelActionForScript] illegal nCountinuance found!!");
			nContinuance = 2000;
		}
		rActionParams.SetContinuance(nContinuance);
		if(500>nInterval)
		{
			AssertEx(FALSE,"[ActionDelegator_T::RegisterChannelActionForScript] illegal interval found!!");
			nInterval = 2000;
		}
		rActionParams.SetInterval(nInterval);
		rActionParams.SetCallBackFunctor(GetGlobalScriptCallBackFunctor());
		rActor.SetActionLogic(&(GetGlobalChannelActionLogic()));
		//info client Channel action start
		rActor.AddLogicCount();
		BroadcastUnitStartChannelAction(rActor,nAction, nContinuance);
		if(0==rActor.GetActionTime())
		{
			rActor.SetActionTime(MIN_ACTION_TIME);
		}
		rActor.OnActionStarted();
		return TRUE;
		__LEAVE_FUNCTION
		return FALSE;
	}