コード例 #1
0
        public virtual void OnFailed()
        {
            if (failLogic == null)
            {
                if (objectiveFailedEventText != null && objectiveFailedEventText.Text != "")
                {
                    if (eventTextCanvas.Equals(EventTextCanvas.BaseState))
                    {
                        mission.MissionHelper.ShowEvent(objectiveFailedEventText);
                    }
                    else if (eventTextCanvas.Equals(EventTextCanvas.MessageBox))
                    {
                        PopupHandler.DisplayMessage(objectiveFailedEventText.Text);
                    }
                }

                MissionManager.MarkMissionAsFailed(mission.MissionID);
                mission.CurrentObjective = null;
            }
            else
            {
                failLogic.Invoke();
            }

            mission.OnFailed();

            if (mission.IsRestartAfterFail())
            {
                MissionManager.ResetMission(mission.MissionID);
            }
        }
コード例 #2
0
        protected override void SetupObjectives()
        {
            objectives.Clear();

            objectives.Add(new ArriveAtLocationObjective(Game, this, ObjectiveDescriptions[0],
                                                         new EventTextCapsule(GetEvent(0), null, EventTextCanvas.BaseState)));

            objectives.Add(new ResponseObjective(Game, this, ObjectiveDescriptions[1],
                                                 new ResponseTextCapsule(GetEvent(1), GetAllResponses(1),
                                                                         new List <System.Action>()
            {
                delegate
                {
                    if (StatsManager.Crebits >= 1000)
                    {
                        missionHelper.ShowEvent(GetEvent(2), true);
                        StatsManager.Crebits -= 1000;
                    }

                    else
                    {
                        missionHelper.ShowEvent(GetEvent(6), false);
                    }
                },

                delegate
                {
                    missionHelper.ShowEvent(GetEvent(3), true);
                    MissionManager.MarkMissionAsFailed(this.MissionID);
                },

                delegate
                {
                    missionHelper.ShowEvent(GetEvent(5), true);
                    missionHelper.ShowEvent(GetEvent(4), true);
                },

                delegate
                {
                    missionHelper.ShowEvent(GetEvent(5), true);
                    missionHelper.ShowEvent(GetEvent(4), true);
                }
            }, EventTextCanvas.BaseState)));
        }