Exemple #1
0
            private static void Prefix(BuildingDef def)
            {
                GameObject go = def.BuildingComplete;

                if (go != null)
                {
                    if (
                        BuildingToMakeAutomatable.Contains(def.PrefabID) ||
                        (go.GetComponent <ManualDeliveryKG>() != null && (go.GetComponent <ElementConverter>() != null || go.GetComponent <EnergyGenerator>() != null) && go.GetComponent <ResearchCenter>() == null) ||
                        (go.GetComponent <ComplexFabricatorWorkable>() != null) ||
                        (go.GetComponent <TinkerStation>() != null)
                        )
                    {
                        go.AddOrGet <Automatable2>();
                    }
                }
            }
Exemple #2
0
        public override void OnLoad(Harmony harmony)
        {
            base.OnLoad(harmony);
            PUtil.InitLibrary();
            new PPatchManager(harmony).RegisterPatchClass(typeof(NoManualDeliveryPatches));
            new POptions().RegisterOptions(this, typeof(NoManualDeliveryOptions));
            NoManualDeliveryOptions.Reload();

            // хак для того чтобы разрешить руке хватать бутылки
            if (NoManualDeliveryOptions.Instance.AllowTransferArmPickupGasLiquid)
            {
                SolidTransferArm.tagBits = new TagBits(STORAGEFILTERS.NOT_EDIBLE_SOLIDS.Concat(STORAGEFILTERS.FOOD)
                                                       .Concat(STORAGEFILTERS.PAYLOADS).Concat(STORAGEFILTERS.GASES).Concat(STORAGEFILTERS.LIQUIDS).ToArray());
                BuildingToMakeAutomatable.AddRange(BuildingToMakeAutomatableWithTransferArmPickupGasLiquid);
            }

            // подготовка хака, чтобы разрешить дупликам забирать жеготных из инкубатора и всегда хватать еду
            AlwaysCouldBePickedUpByMinionTags = new Tag[] { GameTags.Creatures.Deliverable };
            if (NoManualDeliveryOptions.Instance.AllowAlwaysPickupEdible)
            {
                AlwaysCouldBePickedUpByMinionTags = AlwaysCouldBePickedUpByMinionTags.Concat(STORAGEFILTERS.FOOD).AddItem(GameTags.MedicalSupplies).ToArray();
            }
        }