예제 #1
0
        private void SetAbilityRequest(ActorData actor, AbilityData.ActionType actionType, List <AbilityTarget> targets)
        {
            List <ActorTargeting.AbilityRequestData> abilityRequest;
            Ability ability = actor.GetAbilityData().GetAbilityOfActionType(actionType);

            if (!ability.IsFreeAction())
            {
                abilityRequest = new List <ActorTargeting.AbilityRequestData>();
                // If this ability isn't free, remove previous non-free ability request, if any
                foreach (var prevAbilityRequest in actor.TeamSensitiveData_authority.GetAbilityRequestData())
                {
                    if (actor.GetAbilityData().GetAbilityOfActionType(prevAbilityRequest.m_actionType).IsFreeAction())
                    {
                        abilityRequest.Add(prevAbilityRequest);
                    }
                    else
                    {
                        actor.TeamSensitiveData_authority.SetToggledAction(actionType, false); // seems unused
                        actor.TeamSensitiveData_authority.SetQueuedAction(actionType, false);
                    }
                }
            }
            else
            {
                abilityRequest = new List <ActorTargeting.AbilityRequestData>(actor.TeamSensitiveData_authority.GetAbilityRequestData());
            }
            actor.TeamSensitiveData_authority.SetToggledAction(actionType, true); // seems unused
            actor.TeamSensitiveData_authority.SetQueuedAction(actionType, true);

            if (targets != null)
            {
                abilityRequest.Add(new ActorTargeting.AbilityRequestData(actionType, targets));
            }
            actor.TeamSensitiveData_authority.SetAbilityRequestData(abilityRequest);
        }
예제 #2
0
        private void CmdSelectAbilityRequest(ActorController actorController, int actionTypeInt)
        {
            ActorData actor = actorController.gameObject.GetComponent <ActorData>();

            AbilityData.ActionType actionType = (AbilityData.ActionType)actionTypeInt;

            if (!GameFlowData.Get().IsInDecisionState())
            {
                Log.Info($"Recieved CmdSelectAbilityRequest not in desicion state! {actor.DisplayName} {actionType}");
                return;
            }

            Log.Info($"CmdSelectAbilityRequest {actor.DisplayName} {actionType}");

            if (!actor.QueuedMovementAllowsAbility &&
                actor.GetAbilityData().GetAbilityOfActionType(actionType).GetMovementAdjustment() != Ability.MovementAdjustment.FullMovement)
            {
                Log.Info($"CmdSelectAbilityRequest - Clearing movement for {actor.DisplayName}");
                ArtemisServerMovementManager.Get().ClearMovementRequest(actor, true);
            }

            AbilityData abilityData = actor.gameObject.GetComponent <AbilityData>();

            abilityData.Networkm_selectedActionForTargeting = actionType;
            SetAbilityRequest(actor, actionType, null);
        }