Ejemplo n.º 1
0
        public RoomTypeLaboratoryData()
        {
            Id                   = RoomId;
            Name                 = STRINGS.ROOMS.TYPES.LABORATORY.NAME;
            Tooltip              = STRINGS.ROOMS.TYPES.LABORATORY.TOOLTIP;
            Effect               = STRINGS.ROOMS.TYPES.LABORATORY.EFFECT;
            Catergory            = Db.Get().RoomTypeCategories.Recreation;
            ConstraintPrimary    = RoomConstraints.RESEARCH_STATION;
            ConstrantsAdditional = new RoomConstraints.Constraint[4]
            {
                RoomConstraints.LIGHT,
                RoomConstraints.DECORATIVE_ITEM,
                RoomConstraints.MINIMUM_SIZE_12,
                RoomConstraintTags.GetMaxSizeConstraint(Settings.Instance.Laboratory.MaxSize)
            };

            RoomDetails = new RoomDetails.Detail[2]
            {
                new RoomDetails.Detail((Func <Room, string>)(room => string.Format((string)ROOMS.DETAILS.SIZE.NAME, (object)room.cavity.numCells))),
                new RoomDetails.Detail((Func <Room, string>)(room => string.Format((string)ROOMS.DETAILS.BUILDING_COUNT.NAME, (object)room.buildings.Count)))
            };

            Priority       = 0;
            Upgrades       = null;
            SingleAssignee = false;
            PriorityUse    = false;
            Effects        = null;
            SortKey        = SortingCounter.GetAndIncrement(0);
        }
        public static void ResizeRooms(ref Database.RoomTypes __instance)
        {
            for (int i = 0; i < __instance.Count; i++)
            {
                if (__instance[i] == null || __instance[i].additional_constraints == null)
                {
                    continue;
                }

                for (int add = 0; add < __instance[i].additional_constraints.Length; add++)
                {
                    if (__instance[i].additional_constraints[add] == RoomConstraints.MAXIMUM_SIZE_64)
                    {
                        __instance[i].additional_constraints[add] = RoomConstraintTags.GetMaxSizeConstraint(Settings.Instance.ResizeMaxRoomSize64);
                    }
                    else if (__instance[i].additional_constraints[add] == RoomConstraints.MAXIMUM_SIZE_96)
                    {
                        __instance[i].additional_constraints[add] = RoomConstraintTags.GetMaxSizeConstraint(Settings.Instance.ResizeMaxRoomSize96);
                    }
                    else if (__instance[i].additional_constraints[add] == RoomConstraints.MAXIMUM_SIZE_120)
                    {
                        __instance[i].additional_constraints[add] = RoomConstraintTags.GetMaxSizeConstraint(Settings.Instance.ResizeMaxRoomSize120);
                    }
                }
            }
        }
Ejemplo n.º 3
0
        public RoomTypeGraveyardData()
        {
            Id                = RoomId;
            Name              = STRINGS.ROOMS.TYPES.GRAVEYARD.NAME;
            Tooltip           = STRINGS.ROOMS.TYPES.GRAVEYARD.TOOLTIP;
            Effect            = STRINGS.ROOMS.TYPES.GRAVEYARD.EFFECT;
            Catergory         = Db.Get().RoomTypeCategories.Park;
            ConstraintPrimary = new RoomConstraints.Constraint((Func <KPrefabID, bool>)(bc => bc.HasTag(RoomConstraintTags.GravestoneTag)),
                                                               (Func <Room, bool>)null,
                                                               name: STRINGS.ROOMS.CRITERIA.GRAVE.NAME,
                                                               description: STRINGS.ROOMS.CRITERIA.GRAVE.DESCRIPTION);
            ConstrantsAdditional = new RoomConstraints.Constraint[4]
            {
                RoomConstraints.WILDPLANT,
                RoomConstraints.NO_INDUSTRIAL_MACHINERY,
                RoomConstraints.MINIMUM_SIZE_12,
                RoomConstraintTags.GetMaxSizeConstraint(Settings.Instance.Graveyard.MaxSize)
            };

            RoomDetails = new RoomDetails.Detail[2]
            {
                new RoomDetails.Detail((Func <Room, string>)(room => string.Format((string)ROOMS.DETAILS.SIZE.NAME, (object)room.cavity.numCells))),
                new RoomDetails.Detail((Func <Room, string>)(room => string.Format((string)ROOMS.DETAILS.BUILDING_COUNT.NAME, (object)room.buildings.Count)))
            };

            Priority       = 0;
            Upgrades       = null;
            SingleAssignee = false;
            PriorityUse    = false;
            Effects        = null;
            SortKey        = SortingCounter.GetAndIncrement(SortingCounter.ParkSortKey);
        }
        public RoomTypeIndustrialData(RoomType[] upgr = null)
        {
            Id                = RoomId;
            Name              = STRINGS.ROOMS.TYPES.INDUSTRIAL.NAME;
            Tooltip           = STRINGS.ROOMS.TYPES.INDUSTRIAL.TOOLTIP;
            Effect            = STRINGS.ROOMS.TYPES.INDUSTRIAL.EFFECT;
            Catergory         = Db.Get().RoomTypeCategories.Industrial;
            ConstraintPrimary = new RoomConstraints.Constraint((Func <KPrefabID, bool>)(bc => bc.HasTag(RoomConstraints.ConstraintTags.IndustrialMachinery)),
                                                               (Func <Room, bool>)null,
                                                               name: STRINGS.ROOMS.CRITERIA.INDUSTRIAL.NAME,
                                                               description: STRINGS.ROOMS.CRITERIA.INDUSTRIAL.DESCRIPTION);
            ConstrantsAdditional = new RoomConstraints.Constraint[2]
            {
                RoomConstraints.MINIMUM_SIZE_12,
                RoomConstraintTags.GetMaxSizeConstraint(Settings.Instance.Industrial.MaxSize)
            };

            RoomDetails = new RoomDetails.Detail[2]
            {
                new RoomDetails.Detail((Func <Room, string>)(room => string.Format((string)ROOMS.DETAILS.SIZE.NAME, (object)room.cavity.numCells))),
                new RoomDetails.Detail((Func <Room, string>)(room => string.Format((string)ROOMS.DETAILS.BUILDING_COUNT.NAME, (object)room.buildings.Count)))
            };

            Priority = -1;

            Upgrades       = upgr;
            SingleAssignee = true;
            PriorityUse    = true;
            Effects        = null;
            SortKey        = SortingCounter.GetAndIncrement();
        }
Ejemplo n.º 5
0
        public RoomTypeAquariumData()
        {
            Id                = RoomId;
            Name              = STRINGS.ROOMS.TYPES.AQUARIUM.NAME;
            Tooltip           = STRINGS.ROOMS.TYPES.AQUARIUM.TOOLTIP;
            Effect            = STRINGS.ROOMS.TYPES.AQUARIUM.EFFECT;
            Catergory         = Db.Get().RoomTypeCategories.Bathroom;
            ConstraintPrimary = new RoomConstraints.Constraint((Func <KPrefabID, bool>)(bc => bc.HasTag(RoomConstraintTags.AquariumFeederTag)),
                                                               (Func <Room, bool>)null,
                                                               name: STRINGS.ROOMS.CRITERIA.FISHFEEDER.NAME,
                                                               description: STRINGS.ROOMS.CRITERIA.FISHFEEDER.DESCRIPTION);
            ConstrantsAdditional = new RoomConstraints.Constraint[4]
            {
                new RoomConstraints.Constraint((Func <KPrefabID, bool>)(bc => bc.HasTag(RoomConstraintTags.AquariumReleaseTag)),
                                               (Func <Room, bool>)null,
                                               name: STRINGS.ROOMS.CRITERIA.FISHRELEASE.NAME,
                                               description: STRINGS.ROOMS.CRITERIA.FISHRELEASE.DESCRIPTION),
                RoomConstraints.DECORATIVE_ITEM,
                RoomConstraints.MINIMUM_SIZE_12,
                RoomConstraintTags.GetMaxSizeConstraint(Settings.Instance.Aquarium.MaxSize)
            };

            RoomDetails = new RoomDetails.Detail[2]
            {
                new RoomDetails.Detail((Func <Room, string>)(room => string.Format((string)ROOMS.DETAILS.SIZE.NAME, (object)room.cavity.numCells))),
                new RoomDetails.Detail((Func <Room, string>)(room => string.Format((string)ROOMS.DETAILS.CREATURE_COUNT.NAME, (object)(room.cavity.creatures.Count + room.cavity.eggs.Count))))
            };

            Priority       = 0;
            Upgrades       = null;
            SingleAssignee = false;
            PriorityUse    = false;
            Effects        = null;
            SortKey        = SortingCounter.GetAndIncrement(SortingCounter.RecreationRoom);
        }
        public RoomTypeKitchenData()
        {
            Id                = RoomId;
            Name              = STRINGS.ROOMS.TYPES.KITCHEN.NAME;
            Tooltip           = STRINGS.ROOMS.TYPES.KITCHEN.TOOLTIP;
            Effect            = STRINGS.ROOMS.TYPES.KITCHEN.EFFECT;
            Catergory         = Db.Get().RoomTypeCategories.Agricultural;
            ConstraintPrimary = new RoomConstraints.Constraint((Func <KPrefabID, bool>)(bc => bc.HasTag(RoomConstraintTags.KitchenBuildingTag)),
                                                               (Func <Room, bool>)null,
                                                               name: STRINGS.ROOMS.CRITERIA.COOKING.NAME,
                                                               description: STRINGS.ROOMS.CRITERIA.COOKING.DESCRIPTION);
            ConstrantsAdditional = new RoomConstraints.Constraint[4]
            {
                new RoomConstraints.Constraint((Func <KPrefabID, bool>)(bc => bc.GetComponent <Refrigerator>() != null),
                                               (Func <Room, bool>)null,
                                               name: STRINGS.ROOMS.CRITERIA.FRIDGE.NAME,
                                               description: STRINGS.ROOMS.CRITERIA.FRIDGE.DESCRIPTION),
                RoomConstraints.DECORATIVE_ITEM,
                RoomConstraints.MINIMUM_SIZE_12,
                RoomConstraintTags.GetMaxSizeConstraint(Settings.Instance.Kitchen.MaxSize)
            };

            RoomDetails = new RoomDetails.Detail[2]
            {
                new RoomDetails.Detail((Func <Room, string>)(room => string.Format((string)ROOMS.DETAILS.SIZE.NAME, (object)room.cavity.numCells))),
                new RoomDetails.Detail((Func <Room, string>)(room => string.Format((string)ROOMS.DETAILS.BUILDING_COUNT.NAME, (object)room.buildings.Count)))
            };

            Priority       = 1;
            Upgrades       = null;
            SingleAssignee = false;
            PriorityUse    = false;
            Effects        = null;
            SortKey        = SortingCounter.GetAndIncrement(SortingCounter.CreaturePenSortKey + 1);
        }
Ejemplo n.º 7
0
        public RoomTypePrivateRoomData()
        {
            Id                = RoomId;
            Name              = STRINGS.ROOMS.TYPES.PRIVATEROOM.NAME;
            Tooltip           = STRINGS.ROOMS.TYPES.PRIVATEROOM.TOOLTIP;
            Effect            = STRINGS.ROOMS.TYPES.PRIVATEROOM.EFFECT;
            Catergory         = Db.Get().RoomTypeCategories.Sleep;
            ConstraintPrimary = new RoomConstraints.Constraint((Func <KPrefabID, bool>)(bc => bc.HasTag(RoomConstraints.ConstraintTags.Bed) ||
                                                                                        bc.HasTag(RoomConstraints.ConstraintTags.LuxuryBed)),
                                                               (Func <Room, bool>)null,
                                                               name: STRINGS.ROOMS.CRITERIA.ANYBED.NAME,
                                                               description: STRINGS.ROOMS.CRITERIA.ANYBED.DESCRIPTION);
            ConstrantsAdditional = new RoomConstraints.Constraint[6]
            {
                new RoomConstraints.Constraint(
                    (Func <KPrefabID, bool>)null,
                    (Func <Room, bool>)(room =>
                {
                    int count = 0;
                    if (room != null)
                    {
                        foreach (KPrefabID building in room.buildings)
                        {
                            if (building != null)
                            {
                                Bed bed = building.GetComponent <Bed>();
                                if (bed != null)
                                {
                                    count++;
                                }
                            }
                        }
                    }
                    return(count == 1);
                }),
                    name: STRINGS.ROOMS.CRITERIA.ONLYONEBED.NAME,
                    description: STRINGS.ROOMS.CRITERIA.ONLYONEBED.DESCRIPTION),

                RoomConstraints.DECORATIVE_ITEM_20,
                RoomConstraints.NO_INDUSTRIAL_MACHINERY,
                RoomConstraints.CEILING_HEIGHT_4,
                RoomConstraints.MINIMUM_SIZE_12,
                RoomConstraintTags.GetMaxSizeConstraint(Settings.Instance.PrivateBedroom.MaxSize)
            };

            RoomDetails = new RoomDetails.Detail[2]
            {
                new RoomDetails.Detail((Func <Room, string>)(room => string.Format((string)ROOMS.DETAILS.SIZE.NAME, (object)room.cavity.numCells))),
                new RoomDetails.Detail((Func <Room, string>)(room => string.Format((string)ROOMS.DETAILS.BUILDING_COUNT.NAME, (object)room.buildings.Count)))
            };

            Priority       = 2;
            Upgrades       = null;
            SingleAssignee = false;
            PriorityUse    = false;
            Effects        = null;
            SortKey        = SortingCounter.GetAndIncrement(SortingCounter.BedroomSortKey + 1);
        }
Ejemplo n.º 8
0
        public RoomTypeNurseryData()
        {
            Id                = RoomId;
            Name              = STRINGS.ROOMS.TYPES.NURSERY.NAME;
            Tooltip           = STRINGS.ROOMS.TYPES.NURSERY.TOOLTIP;
            Effect            = STRINGS.ROOMS.TYPES.NURSERY.EFFECT;
            Catergory         = Db.Get().RoomTypeCategories.Agricultural;
            ConstraintPrimary = new RoomConstraints.Constraint((Func <KPrefabID, bool>)(bc => bc.HasTag(RoomConstraintTags.NurseryPlanterBoxTag)),
                                                               (Func <Room, bool>)null,
                                                               name: STRINGS.ROOMS.CRITERIA.PLANTERBOX.NAME,
                                                               description: STRINGS.ROOMS.CRITERIA.PLANTERBOX.DESCRIPTION);

            ConstrantsAdditional = new RoomConstraints.Constraint[4] {
                new RoomConstraints.Constraint((Func <KPrefabID, bool>)null,
                                               (Func <Room, bool>)(room =>
                {
                    List <string> seedIds = new List <string>();
                    foreach (var plant in room.cavity.plants)
                    {
                        if (plant == null)
                        {
                            continue;
                        }
                        SeedProducer seedProd = plant.GetComponent <SeedProducer>();
                        WiltCondition wiltCon = plant.GetComponent <WiltCondition>();
                        if (seedProd == null)
                        {
                            continue;
                        }
                        if (!seedIds.Contains(seedProd.seedInfo.seedId) &&
                            seedProd.seedInfo.productionType == SeedProducer.ProductionType.Harvest)
                        {
                            seedIds.Add(seedProd.seedInfo.seedId);
                        }
                    }
                    return(seedIds.Count >= requiredNumberOfPlants);
                }),
                                               name: string.Format(STRINGS.ROOMS.CRITERIA.SEEDPLANTS.NAME, requiredNumberOfPlants),
                                               description: string.Format(STRINGS.ROOMS.CRITERIA.SEEDPLANTS.DESCRIPTION, requiredNumberOfPlants)),
                RoomConstraints.LIGHT,
                RoomConstraints.MINIMUM_SIZE_12,
                RoomConstraintTags.GetMaxSizeConstraint(Settings.Instance.Nursery.MaxSize)
            };

            RoomDetails = new RoomDetails.Detail[2]
            {
                new RoomDetails.Detail((Func <Room, string>)(room => string.Format((string)ROOMS.DETAILS.SIZE.NAME, (object)room.cavity.numCells))),
                new RoomDetails.Detail((Func <Room, string>)(room => string.Format((string)ROOMS.DETAILS.PLANT_COUNT.NAME, (object)room.plants.Count)))
            };

            Priority       = 0;
            Upgrades       = null;
            SingleAssignee = false;
            PriorityUse    = false;
            Effects        = null;
            SortKey        = SortingCounter.GetAndIncrement(SortingCounter.FarmSortKey - 1);
        }
Ejemplo n.º 9
0
        public RoomTypeMuseumData()
        {
            Id                = RoomId;
            Name              = STRINGS.ROOMS.TYPES.MUSEUM.NAME;
            Tooltip           = STRINGS.ROOMS.TYPES.MUSEUM.TOOLTIP;
            Effect            = STRINGS.ROOMS.TYPES.MUSEUM.EFFECT;
            Catergory         = Db.Get().RoomTypeCategories.Hospital;
            ConstraintPrimary = new RoomConstraints.Constraint((Func <KPrefabID, bool>)(bc => bc.HasTag(RoomConstraintTags.ItemPedestalTag)),
                                                               (Func <Room, bool>)null,
                                                               name: STRINGS.ROOMS.CRITERIA.PEDESTAL.NAME,
                                                               description: STRINGS.ROOMS.CRITERIA.PEDESTAL.DESCRIPTION);
            ConstrantsAdditional = new RoomConstraints.Constraint[5]
            {
                new RoomConstraints.Constraint((Func <KPrefabID, bool>)null,
                                               (Func <Room, bool>)(room =>
                {
                    int count = 0;
                    foreach (KPrefabID building in room.buildings)
                    {
                        Artable art = building.GetComponent <Artable>();
                        if (art == null)
                        {
                            continue;
                        }
                        if (art.CurrentStatus == Artable.Status.Great)
                        {
                            count++;
                        }
                    }
                    return(count >= requiredMasterpieces);
                }),
                                               name: string.Format(STRINGS.ROOMS.CRITERIA.MASTERPIECES.NAME, requiredMasterpieces),
                                               description: string.Format(STRINGS.ROOMS.CRITERIA.MASTERPIECES.DESCRIPTION, requiredMasterpieces)),
                RoomConstraints.LIGHT,
                RoomConstraints.NO_INDUSTRIAL_MACHINERY,
                RoomConstraints.MINIMUM_SIZE_32,
                RoomConstraintTags.GetMaxSizeConstraint(Settings.Instance.Museum.MaxSize)
            };

            RoomDetails = new RoomDetails.Detail[2]
            {
                new RoomDetails.Detail((Func <Room, string>)(room => string.Format((string)ROOMS.DETAILS.SIZE.NAME, (object)room.cavity.numCells))),
                new RoomDetails.Detail((Func <Room, string>)(room => string.Format((string)ROOMS.DETAILS.BUILDING_COUNT.NAME, (object)room.buildings.Count)))
            };

            Priority       = 1;
            Upgrades       = null;
            SingleAssignee = false;
            PriorityUse    = false;
            Effects        = null;
            SortKey        = SortingCounter.GetAndIncrement(SortingCounter.CreaturePenSortKey + 1);
        }
Ejemplo n.º 10
0
 public static void ModifyRoom(ref RoomTypes __instance)
 {
     if (Settings.Instance.Agricultural.IncludeRoom)
     {
         for (int i = 0; i < __instance.CreaturePen.additional_constraints.Length; i++)
         {
             if (__instance.CreaturePen.additional_constraints[i].name.Contains("Maximum size:"))
             {
                 __instance.CreaturePen.additional_constraints[i] = RoomConstraintTags.GetMaxSizeConstraint(Settings.Instance.Agricultural.MaxSize);
             }
         }
     }
 }
        public static void AddRoom(ref RoomTypes __instance)
        {
            if (Settings.Instance.Nursery.IncludeRoom)
            {
                __instance.Add(RoomTypes_AllModded.Nursery);

                RoomConstraintTags.AddStompInConflict(__instance.Farm, RoomTypes_AllModded.Nursery);
                RoomConstraintTags.AddStompInConflict(__instance.CreaturePen, RoomTypes_AllModded.Nursery);

                if (Settings.Instance.Botanical.IncludeRoom)
                {
                    RoomConstraintTags.AddStompInConflict(RoomTypes_AllModded.Botanical, RoomTypes_AllModded.Nursery);
                }
            }
        }
 public static void UpdateRoom(ref RoomTypes __instance)
 {
     if (Settings.Instance.HospitalUpdate.IncludeRoom)
     {
         for (int i = 0; i < __instance.Hospital.additional_constraints.Length; i++)
         {
             if (__instance.Hospital.additional_constraints[i] == RoomConstraints.TOILET)
             {
                 __instance.Hospital.additional_constraints[i] = RoomConstraints.ADVANCED_WASH_STATION;
             }
             if (__instance.Hospital.additional_constraints[i] == RoomConstraints.MESS_STATION_SINGLE)
             {
                 __instance.Hospital.additional_constraints[i] = RoomConstraints.DECORATIVE_ITEM;
             }
             if (__instance.Hospital.additional_constraints[i] == RoomConstraints.MAXIMUM_SIZE_96)
             {
                 __instance.Hospital.additional_constraints[i] = RoomConstraintTags.GetMaxSizeConstraint(Settings.Instance.HospitalUpdate.MaxSize);
             }
         }
     }
 }
        public static void AddRoom(ref RoomTypes __instance)
        {
            if (!Settings.Instance.Museum.IncludeRoom)
            {
                return;
            }

            __instance.Add(RoomTypes_AllModded.Museum);

            RoomConstraintTags.AddStompInConflict(__instance.Barracks, RoomTypes_AllModded.Museum);
            RoomConstraintTags.AddStompInConflict(__instance.Bedroom, RoomTypes_AllModded.Museum);
            RoomConstraintTags.AddStompInConflict(__instance.MessHall, RoomTypes_AllModded.Museum);
            RoomConstraintTags.AddStompInConflict(__instance.GreatHall, RoomTypes_AllModded.Museum);
            RoomConstraintTags.AddStompInConflict(__instance.Hospital, RoomTypes_AllModded.Museum);
            RoomConstraintTags.AddStompInConflict(__instance.MassageClinic, RoomTypes_AllModded.Museum);
            RoomConstraintTags.AddStompInConflict(__instance.RecRoom, RoomTypes_AllModded.Museum);
            RoomConstraintTags.AddStompInConflict(__instance.Farm, RoomTypes_AllModded.Museum);
            RoomConstraintTags.AddStompInConflict(__instance.CreaturePen, RoomTypes_AllModded.Museum);

            if (Settings.Instance.Aquarium.IncludeRoom)
            {
                RoomConstraintTags.AddStompInConflict(RoomTypes_AllModded.Aquarium, RoomTypes_AllModded.Museum);
            }
            if (Settings.Instance.Bathroom.IncludeRoom)
            {
                RoomConstraintTags.AddStompInConflict(RoomTypes_AllModded.BathroomRoom, RoomTypes_AllModded.Museum);
            }
            if (Settings.Instance.Gym.IncludeRoom)
            {
                RoomConstraintTags.AddStompInConflict(RoomTypes_AllModded.GymRoom, RoomTypes_AllModded.Museum);
            }
            if (Settings.Instance.Kitchen.IncludeRoom)
            {
                RoomConstraintTags.AddStompInConflict(RoomTypes_AllModded.KitchenRoom, RoomTypes_AllModded.Museum);
            }
            if (Settings.Instance.Laboratory.IncludeRoom)
            {
                RoomConstraintTags.AddStompInConflict(RoomTypes_AllModded.LaboratoryRoom, RoomTypes_AllModded.Museum);
            }
        }
Ejemplo n.º 14
0
            public static void Postfix(ref RoomTypes __instance)
            {
                SortingCounter.Init();

                RoomsExpanded_Patches_Laboratory.AddRoom(ref __instance);
                RoomsExpanded_Patches_Bathroom.AddRoom(ref __instance);
                RoomsExpanded_Patches_Kitchen.AddRoom(ref __instance);
                RoomsExpanded_Patches_Nursery.AddRoom(ref __instance);
                RoomsExpanded_Patches_Gym.AddRoom(ref __instance);
                RoomsExpanded_Patches_Agricultural.ModifyRoom(ref __instance);
                RoomsExpanded_Patches_Aquarium.AddRoom(ref __instance);
                RoomsExpanded_Patches_Botanical.AddRoom(ref __instance);
                RoomsExpanded_Patches_Graveyard.AddRoom(ref __instance);
                RoomsExpanded_Patches_Hospital.UpdateRoom(ref __instance);
                RoomsExpanded_Patches_Industrial.AddRoom(ref __instance);
                RoomsExpanded_Patches_Museum.AddRoom(ref __instance);

                // Temporary "Room Size" mod functionality restored for DLC
                // Must be removed once "Room Size" is updated for DLC
                // Original mod by trevis can be found here: https://steamcommunity.com/sharedfiles/filedetails/?id=1715802131
                RoomConstraintTags.ResizeRooms(ref __instance);
            }
Ejemplo n.º 15
0
        public RoomTypeGymData()
        {
            Id                = RoomId;
            Name              = STRINGS.ROOMS.TYPES.GYMROOM.NAME;
            Tooltip           = STRINGS.ROOMS.TYPES.GYMROOM.TOOLTIP;
            Effect            = STRINGS.ROOMS.TYPES.GYMROOM.EFFECT;
            Catergory         = Db.Get().RoomTypeCategories.Recreation;
            ConstraintPrimary = new RoomConstraints.Constraint((Func <KPrefabID, bool>)(bc => bc.HasTag(RoomConstraintTags.RunningWheelGeneratorTag)),
                                                               (Func <Room, bool>)null,
                                                               name: STRINGS.ROOMS.CRITERIA.MANUALGENERATOR.NAME,
                                                               description: STRINGS.ROOMS.CRITERIA.MANUALGENERATOR.DESCRIPTION,
                                                               stomp_in_conflict: new List <RoomConstraints.Constraint>()
            {
                RoomConstraints.REC_BUILDING
            });
            ConstrantsAdditional = new RoomConstraints.Constraint[4]
            {
                new RoomConstraints.Constraint((Func <KPrefabID, bool>)(bc => bc.HasTag(RoomConstraintTags.WaterCoolerTag)),
                                               (Func <Room, bool>)null,
                                               name: STRINGS.ROOMS.CRITERIA.WATERCOOLER.NAME,
                                               description: STRINGS.ROOMS.CRITERIA.WATERCOOLER.DESCRIPTION),
                RoomConstraints.DECORATIVE_ITEM,
                RoomConstraints.MINIMUM_SIZE_12,
                RoomConstraintTags.GetMaxSizeConstraint(Settings.Instance.Gym.MaxSize)
            };

            RoomDetails = new RoomDetails.Detail[2]
            {
                new RoomDetails.Detail((Func <Room, string>)(room => string.Format((string)ROOMS.DETAILS.SIZE.NAME, (object)room.cavity.numCells))),
                new RoomDetails.Detail((Func <Room, string>)(room => string.Format((string)ROOMS.DETAILS.BUILDING_COUNT.NAME, (object)room.buildings.Count)))
            };

            Priority       = 0;
            Upgrades       = null;
            SingleAssignee = false;
            PriorityUse    = false;
            Effects        = null;
            SortKey        = SortingCounter.GetAndIncrement(SortingCounter.RecreationRoom);
        }
Ejemplo n.º 16
0
        public static void AddRoom(ref RoomTypes __instance)
        {
            if (Settings.Instance.PrivateBedroom.IncludeRoom)
            {
                __instance.Add(RoomTypes_AllModded.PrivateRoom);

                RoomConstraintTags.AddStompInConflict(RoomTypes_AllModded.PrivateRoom, __instance.Barracks);
                RoomConstraintTags.AddStompInConflict(RoomTypes_AllModded.PrivateRoom, __instance.Bedroom);
                RoomConstraintTags.AddStompInConflict(RoomTypes_AllModded.PrivateRoom, __instance.MassageClinic);
                RoomConstraintTags.AddStompInConflict(RoomTypes_AllModded.PrivateRoom, __instance.RecRoom);
                RoomConstraintTags.AddStompInConflict(RoomTypes_AllModded.PrivateRoom, __instance.PlumbedBathroom);
                RoomConstraintTags.AddStompInConflict(__instance.Hospital, RoomTypes_AllModded.PrivateRoom);

                if (Settings.Instance.Bathroom.IncludeRoom)
                {
                    RoomConstraintTags.AddStompInConflict(RoomTypes_AllModded.PrivateRoom, RoomTypes_AllModded.BathroomRoom);
                }

                if (Settings.Instance.Museum.IncludeRoom)
                {
                    RoomConstraintTags.AddStompInConflict(RoomTypes_AllModded.PrivateRoom, RoomTypes_AllModded.Museum);
                }
            }
        }
        public RoomTypeBotanicalData()
        {
            Id                = RoomId;
            Name              = STRINGS.ROOMS.TYPES.BOTANICAL.NAME;
            Tooltip           = STRINGS.ROOMS.TYPES.BOTANICAL.TOOLTIP;
            Effect            = STRINGS.ROOMS.TYPES.BOTANICAL.EFFECT;
            Catergory         = Db.Get().RoomTypeCategories.Park;
            ConstraintPrimary = RoomConstraints.PARK_BUILDING;

            ConstrantsAdditional = new RoomConstraints.Constraint[5]
            {
                new RoomConstraints.Constraint((Func <KPrefabID, bool>)null,
                                               (Func <Room, bool>)(room =>
                {
                    List <string> names = new List <string>();
                    foreach (var plant in room.cavity.plants)
                    {
                        if (plant == null)
                        {
                            continue;
                        }
                        if (!DecorativeNames.Contains(plant.name))
                        {
                            continue;
                        }
                        if (!names.Contains(plant.name))
                        {
                            names.Add(plant.name);
                        }
                    }
                    return(names.Count >= requiredDecorative);
                }),
                                               name: string.Format(STRINGS.ROOMS.CRITERIA.DECORPLANTS.NAME, requiredDecorative),
                                               description: string.Format(STRINGS.ROOMS.CRITERIA.DECORPLANTS.DESCRIPTION, requiredDecorative)),
                new RoomConstraints.Constraint((Func <KPrefabID, bool>)null,
                                               (Func <Room, bool>)(room => room.cavity.plants.Count >= requiredPlants),
                                               name: string.Format(STRINGS.ROOMS.CRITERIA.PLANTCOUNT.NAME, requiredPlants),
                                               description: string.Format(STRINGS.ROOMS.CRITERIA.PLANTCOUNT.DESCRIPTION, requiredPlants)),
                new RoomConstraints.Constraint((Func <KPrefabID, bool>)null,
                                               (Func <Room, bool>)(room =>
                {
                    foreach (KPrefabID plant in room.cavity.plants)
                    {
                        if ((UnityEngine.Object)plant != (UnityEngine.Object)null)
                        {
                            BasicForagePlantPlanted component1 = plant.GetComponent <BasicForagePlantPlanted>();
                            ReceptacleMonitor component2       = plant.GetComponent <ReceptacleMonitor>();
                            if ((UnityEngine.Object)component2 != (UnityEngine.Object)null && !component2.Replanted)
                            {
                                return(false);
                            }
                            else if ((UnityEngine.Object)component1 != (UnityEngine.Object)null)
                            {
                                return(false);
                            }
                        }
                    }
                    return(true);
                }),
                                               name: STRINGS.ROOMS.CRITERIA.NOWILDPLANTS.NAME,
                                               description: STRINGS.ROOMS.CRITERIA.NOWILDPLANTS.DESCRIPTION),
                RoomConstraints.MINIMUM_SIZE_32,
                RoomConstraintTags.GetMaxSizeConstraint(Settings.Instance.Botanical.MaxSize)
            };

            RoomDetails = new RoomDetails.Detail[2]
            {
                new RoomDetails.Detail((Func <Room, string>)(room => string.Format((string)ROOMS.DETAILS.SIZE.NAME, (object)room.cavity.numCells))),
                new RoomDetails.Detail((Func <Room, string>)(room => string.Format((string)ROOMS.DETAILS.BUILDING_COUNT.NAME, (object)room.buildings.Count)))
            };

            Priority       = 1;
            Upgrades       = null;
            SingleAssignee = false;
            PriorityUse    = false;
            Effects        = new string[1] {
                "RoomNatureReserve"
            };
            SortKey = SortingCounter.GetAndIncrement(SortingCounter.ParkSortKey + 1);
        }