예제 #1
0
        public void Notify_Interacted(FactionDef def, TravelMode mode, int profit)
        {
            IEnumerable <Objective> objectives = GetObjectives.Where(o => o.CurrentState == MOState.Active && o.def.type == ObjectiveType.Travel);

            foreach (Objective objective in objectives)
            {
                objective.travelTracker.Notify_Interacted(def, mode, profit);
            }
        }
예제 #2
0
        public void Notify_Explored(int tile)
        {
            IEnumerable <Objective> objectives = GetObjectives.Where(o => o.CurrentState == MOState.Active && o.def.type == ObjectiveType.Travel);

            foreach (Objective objective in objectives)
            {
                objective.travelTracker.TryExplore(tile);
            }
        }
예제 #3
0
        public void Notify_IncidentFired(IncidentDef def)
        {
            UpdateMissionList(null, def);
            IEnumerable <Objective> objectives = GetObjectives.Where(o => o.CurrentState == MOState.Inactive && (o.def.requisites?.incidents.Contains(def) ?? false));

            foreach (Objective objective in objectives)
            {
                if (objective.parentMission.def.chronological)
                {
                    return;
                }
                if (objective.def.requisites?.IsFulfilled(null, def) ?? true)
                {
                    objective.Notify_Start();
                }
            }
        }
예제 #4
0
        public void Notify_JobStarted(JobDef def, Pawn worker = null)
        {
            UpdateMissionList(def);
            IEnumerable <Objective> objectives = GetObjectives.Where(o => o.CurrentState == MOState.Inactive && (o.def.requisites?.jobs.Contains(def) ?? false));

            foreach (Objective objective in objectives)
            {
                if (objective.parentMission.def.chronological)
                {
                    return;
                }
                if (objective.def.requisites?.IsFulfilled(def) ?? true)
                {
                    objective.Notify_Start();
                    objective.lastTarget = worker;
                }
            }
        }