コード例 #1
0
 public void Activate(MissionOriginType originType, string originName)
 {
     //if we're not completed and we're not active...
     if (!State.ObjectivesCompleted && !Flags.Check((uint)State.Status, (uint)MissionStatus.Active, Flags.CheckType.MatchAny))
     {
         State.OriginType    = originType;
         State.OriginName    = originName;
         State.TimeActivated = WorldClock.AdjustedRealTime;
         State.Status        = MissionStatus.Active;
         //if we have a mission to force-complete, do that here
         if (!string.IsNullOrEmpty(State.ForceCompleteOnStart))
         {
             Missions.Get.ForceCompleteMission(State.ForceCompleteOnStart);
         }
         //create and activate the first objective
         for (int i = 0; i < FirstObjectives.Count; i++)
         {
             FirstObjectives [i].OnActivateMission();
         }
         Player.Get.AvatarActions.ReceiveAction((AvatarAction.MissionActivate), WorldClock.AdjustedRealTime);
         Player.Get.AvatarActions.ReceiveAction((AvatarAction.MissionUpdated), WorldClock.AdjustedRealTime);
         GUIManager.PostGainedItem(this);
         State.GetPlayerAttention = true;
         Save();
     }
 }
コード例 #2
0
ファイル: Missions.cs プロジェクト: yazici/FRONTIERS
        public void ActivateObjective(string missionName, string objectiveName, MissionOriginType originType, string originName)
        {
            Mission mission = null;

            if (MissionByName(missionName, out mission))
            {
                mission.ActivateObjective(objectiveName, originType, originName);
            }
        }
コード例 #3
0
        public void ActivateObjective(string objectiveName, MissionOriginType originType, string originName)
        {
            if (!Flags.Check((uint)State.Status, (uint)MissionStatus.Active, Flags.CheckType.MatchAny))
            {
                Activate(originType, originName);
            }
            MissionObjective objective = null;

            if (mObjectiveLookup.TryGetValue(objectiveName, out objective))
            {
                objective.ActivateObjective(ObjectiveActivation.Manual, originType, originName);
            }
            State.GetPlayerAttention = true;
            Save();
        }
コード例 #4
0
        public void ActivateObjective(ObjectiveActivation activation, MissionOriginType originType, string originName)
        {
            //if the attempted activation type is the same as our activation type
            if (!Flags.Check((uint)State.Status, (uint)(MissionStatus.Active | MissionStatus.Completed), Flags.CheckType.MatchAny))                     //activate and announce activation
            {
                State.OriginType = originType;
                State.OriginName = originName;
                //if the new mission description isn't empty, update our parent mission
                if (!Flags.Check((uint)State.Status, (uint)MissionStatus.Ignored, Flags.CheckType.MatchAny))                    //if we HAVEN'T ignored this mission then we'll update
                //if we have just pretend it doesn't exist
                {
                    if (!string.IsNullOrEmpty(State.NewMissionDescription))
                    {
                        mission.State.Description = State.NewMissionDescription;
                    }
                    if (!string.IsNullOrEmpty(State.IntrospectionOnActivate))
                    {
                        GUIManager.PostIntrospection(State.IntrospectionOnActivate);
                    }
                }

                for (int i = 0; i < State.Scripts.Count; i++)
                {
                    State.Scripts [i].OnActivated();
                }

                State.Status        = MissionStatus.Active;
                State.TimeActivated = WorldClock.AdjustedRealTime;

                try {
                    //wrap this in a try catch to prevent random stuff listening from screwing up mission completion
                    Player.Get.AvatarActions.ReceiveAction((AvatarAction.MissionObjectiveActiveate), WorldClock.AdjustedRealTime);
                    Player.Get.AvatarActions.ReceiveAction((AvatarAction.MissionUpdated), WorldClock.AdjustedRealTime);
                } catch (Exception e) {
                    Debug.LogError(e.ToString());
                }
            }
        }