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; }
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; }
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; }