Esempio n. 1
0
        private static void GetRecommendedJobRooms(this Staff staff, QualificationSlot qualificationSlot, List <RoomDefinition.Type> recommendedRooms)
        {
            if (qualificationSlot.Definition.RequiredRoomUnlocked != null)
            {
                recommendedRooms.Add(qualificationSlot.Definition.RequiredRoomUnlocked.Instance._type);
            }

            if (qualificationSlot.Definition.RequiredIllnessWithTreatmentRoom != null)
            {
                recommendedRooms.Add(qualificationSlot.Definition.RequiredIllnessWithTreatmentRoom.Instance._type);
            }

            foreach (var modifier in qualificationSlot.Definition.Modifiers)
            {
                var validRooms = new List <RoomDefinition.Type>();
                if (modifier is QualificationBaseModifier baseModifier)
                {
                    var roomDefinition = Traverse.Create(baseModifier).Field("_validRooms").GetValue <SharedInstance <RoomDefinition>[]>();
                    if (roomDefinition.Length > 0)
                    {
                        validRooms.AddRange(roomDefinition.Select(x => x.Instance._type));
                    }
                }

                if (validRooms.Count > 0)
                {
                    recommendedRooms.AddRange(validRooms);
                }
                else
                {
                    if (modifier is QualificationDiagnosisModifier)
                    {
                        recommendedRooms.AddRange(Main.settings.DiagnosisRooms);
                    }
                    else if (modifier is QualificationTreatmentModifier)
                    {
                        recommendedRooms.AddRange(Main.settings.TreatmentRooms);
                    }
                    else if (modifier is QualificationResearchModifier)
                    {
                        recommendedRooms.Add(RoomDefinition.Type.Research);
                    }
                    else if (modifier is QualificationServiceModifier)
                    {
                        recommendedRooms.AddRange(Main.settings.CustomerServiceRooms);
                    }
                    else if (modifier is QualificationMarketModifier)
                    {
                        recommendedRooms.Add(RoomDefinition.Type.Marketing);
                    }
                }
            }
        }
Esempio n. 2
0
 private static void GetRecommendedJobs(this Staff staff, QualificationSlot qualificationSlot, List <JobMaintenance.JobDescription> recommendedJobs)
 {
     foreach (CharacterModifier characterModifier in qualificationSlot.Definition.Modifiers)
     {
         if (characterModifier is QualificationMaintenanceModifier)
         {
             recommendedJobs.AddRange(Main.settings.MaintenanceJobs);
         }
         else
         {
             if (!(characterModifier is QualificationUpgradeItemModifier))
             {
                 LocalisedString nameLocalised = qualificationSlot.Definition.NameLocalised;
                 if (!nameLocalised.ToString().ToLowerInvariant().StartsWith("mechanics"))
                 {
                     if (characterModifier is CharacterModifierIgnoreStatusEffect)
                     {
                         recommendedJobs.AddRange(Main.settings.GhostJobs);
                     }
                     else
                     {
                         recommendedJobs.AddRange(Main.settings.MiscJobs);
                     }
                 }
             }
             else
             {
                 recommendedJobs.AddRange(Main.settings.UpgradeJobs);
             }
         }
     }
     if (qualificationSlot.Definition.Modifiers.Count <CharacterModifier>() == 0 && qualificationSlot.Definition.ToString().ToLowerInvariant().StartsWith("mechanics"))
     {
         recommendedJobs.AddRange(Main.settings.UpgradeJobs);
     }
 }
Esempio n. 3
0
        public static List <RoomDefinition.Type> GetRecommendedJobRooms(this Staff staff, QualificationSlot qualificationSlot)
        {
            var recommendedRooms = new List <RoomDefinition.Type>();

            staff.GetRecommendedJobRooms(qualificationSlot, recommendedRooms);
            return(recommendedRooms);
        }
Esempio n. 4
0
        public static List <JobMaintenance.JobDescription> GetRecommendedJobs(this Staff staff, QualificationSlot qualificationSlot)
        {
            List <JobMaintenance.JobDescription> list = new List <JobMaintenance.JobDescription>();

            if (staff.Definition._type != StaffDefinition.Type.Janitor)
            {
                return(list);
            }
            staff.GetRecommendedJobs(qualificationSlot, list);
            return(list);
        }
Esempio n. 5
0
        public static List <RoomDefinition.Type> GetRecommendedJobRooms(this Staff staff, QualificationSlot qualificationSlot)
        {
            List <RoomDefinition.Type> list = new List <RoomDefinition.Type>();

            if (staff.Definition._type == StaffDefinition.Type.Janitor)
            {
                return(list);
            }
            staff.GetRecommendedJobRooms(qualificationSlot, list);
            return(list);
        }