public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
    {
        SimCellOccupier simCellOccupier = go.AddOrGet <SimCellOccupier>();

        simCellOccupier.doReplaceElement = true;
        go.AddOrGet <TileTemperature>();
        ConduitConsumer conduitConsumer = go.AddOrGet <ConduitConsumer>();

        conduitConsumer.conduitType        = ConduitType.Liquid;
        conduitConsumer.consumptionRate    = 1f;
        conduitConsumer.capacityKG         = 5f;
        conduitConsumer.capacityTag        = GameTags.Liquid;
        conduitConsumer.wrongElementResult = ConduitConsumer.WrongElementResult.Dump;
        go.AddOrGet <Storage>();
        PlantablePlot plantablePlot = go.AddOrGet <PlantablePlot>();

        plantablePlot.AddDepositTag(GameTags.CropSeed);
        plantablePlot.AddDepositTag(GameTags.WaterSeed);
        plantablePlot.occupyingObjectRelativePosition.y = 1f;
        plantablePlot.SetFertilizationFlags(true, true);
        CopyBuildingSettings copyBuildingSettings = go.AddOrGet <CopyBuildingSettings>();

        copyBuildingSettings.copyGroupTag = GameTags.Farm;
        Storage storage = BuildingTemplates.CreateDefaultStorage(go, false);

        storage.SetDefaultStoredItemModifiers(Storage.StandardSealedStorage);
        go.AddOrGet <PlanterBox>();
        go.AddOrGet <AnimTileable>();
        go.AddOrGet <DropAllWorkable>();
        Prioritizable.AddRef(go);
    }
コード例 #2
0
    public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
    {
        GeneratedBuildings.MakeBuildingAlwaysOperational(go);
        BuildingConfigManager.Instance.IgnoreDefaultKComponent(typeof(RequiresFoundation), prefab_tag);
        SimCellOccupier simCellOccupier = go.AddOrGet <SimCellOccupier>();

        simCellOccupier.doReplaceElement = true;
        simCellOccupier.notifyOnMelt     = true;
        go.AddOrGet <TileTemperature>();
        go.AddOrGet <WildFarmTile>();
        Storage storage = BuildingTemplates.CreateDefaultStorage(go);

        storage.SetDefaultStoredItemModifiers(Storage.StandardSealedStorage);
        PlantablePlot plantablePlot = go.AddOrGet <PlantablePlot>();

        plantablePlot.occupyingObjectRelativePosition = new Vector3(0f, 1f, 0f);
        plantablePlot.AddDepositTag(GameTags.CropSeed);
        plantablePlot.AddDepositTag(GameTags.WaterSeed);
        plantablePlot.SetFertilizationFlags(fertilizer: false, liquid_piping: false);
        CopyBuildingSettings copyBuildingSettings = go.AddOrGet <CopyBuildingSettings>();

        copyBuildingSettings.copyGroupTag = GameTags.Farm;
        go.AddOrGet <AnimTileable>();
        Prioritizable.AddRef(go);

        // turn off irrigation
        FieldInfo fi = typeof(PlantablePlot).GetField("accepts_irrigation", BindingFlags.NonPublic | BindingFlags.Instance);

        fi.SetValue(plantablePlot, false);
    }
コード例 #3
0
        public static void SetPlantablePlotAllTags(GameObject go, bool hasLiquidPiping = false)
        {
            PlantablePlot plantablePlot = go.AddOrGet <PlantablePlot>();

            (AccessTools.Field(typeof(PlantablePlot), "possibleDepositTagsList").GetValue(plantablePlot) as List <Tag>)?.Clear();
            plantablePlot.AddDepositTag(GameTags.CropSeed);
            plantablePlot.AddDepositTag(GameTags.WaterSeed);
            plantablePlot.AddDepositTag(GameTags.DecorSeed);
            plantablePlot.SetFertilizationFlags(true, hasLiquidPiping);
        }
コード例 #4
0
ファイル: TrellisConfig.cs プロジェクト: javisar/ONI-Mods
        public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
        {
            go.AddOrGet <Storage>();
            PlantablePlot plantablePlot = go.AddOrGet <PlantablePlot>();

            plantablePlot.AddDepositTag(Utils.CropSeed2TileWide);
            plantablePlot.occupyingObjectRelativePosition.y = 0f;
            plantablePlot.SetFertilizationFlags(true, false);
            BuildingTemplates.CreateDefaultStorage(go, false).SetDefaultStoredItemModifiers(Storage.StandardSealedStorage);
            go.AddOrGet <AnimTileable>();
            go.AddOrGet <DropAllWorkable>();

            Prioritizable.AddRef(go);
        }
コード例 #5
0
    public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
    {
        Storage       storage       = go.AddOrGet <Storage>();
        PlantablePlot plantablePlot = go.AddOrGet <PlantablePlot>();

        plantablePlot.AddDepositTag(GameTags.CropSeed);
        plantablePlot.SetFertilizationFlags(true, false);
        CopyBuildingSettings copyBuildingSettings = go.AddOrGet <CopyBuildingSettings>();

        copyBuildingSettings.copyGroupTag = GameTags.Farm;
        BuildingTemplates.CreateDefaultStorage(go, false);
        storage.SetDefaultStoredItemModifiers(Storage.StandardSealedStorage);
        go.AddOrGet <DropAllWorkable>();
        go.AddOrGet <PlanterBox>();
        go.AddOrGet <AnimTileable>();
        Prioritizable.AddRef(go);
    }
コード例 #6
0
        public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
        {
            GeneratedBuildings.MakeBuildingAlwaysOperational(go);
            BuildingConfigManager.Instance.IgnoreDefaultKComponent(typeof(RequiresFoundation), prefab_tag);
            SimCellOccupier simCellOccupier = go.AddOrGet <SimCellOccupier>();

            simCellOccupier.doReplaceElement = true;
            simCellOccupier.notifyOnMelt     = true;
            go.AddOrGet <TileTemperature>();
            BuildingTemplates.CreateDefaultStorage(go, false).SetDefaultStoredItemModifiers(Storage.StandardSealedStorage);
            PlantablePlot plantablePlot = go.AddOrGet <PlantablePlot>();

            plantablePlot.occupyingObjectRelativePosition = new Vector3(0.0f, 1f, 0.0f);
            plantablePlot.AddDepositTag(GameTags.CropSeed);
            plantablePlot.AddDepositTag(GameTags.WaterSeed);
            plantablePlot.SetFertilizationFlags(true, false);
            go.AddOrGet <CopyBuildingSettings>().copyGroupTag = GameTags.Farm;
            go.AddOrGet <AnimTileable>();
            Prioritizable.AddRef(go);
        }
コード例 #7
0
    public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
    {
        Storage       storage       = go.AddOrGet <Storage>();
        PlantablePlot plantablePlot = go.AddOrGet <PlantablePlot>();

        plantablePlot.AddDepositTag(GameTags.CropSeed);
        plantablePlot.SetFertilizationFlags(fertilizer: false, liquid_piping: false);
        CopyBuildingSettings copyBuildingSettings = go.AddOrGet <CopyBuildingSettings>();

        copyBuildingSettings.copyGroupTag = GameTags.Farm;
        BuildingTemplates.CreateDefaultStorage(go);
        storage.SetDefaultStoredItemModifiers(Storage.StandardSealedStorage);
        go.AddOrGet <DropAllWorkable>();
        go.AddOrGet <WildPlanterBox>();
        go.AddOrGet <AnimTileable>();
        Prioritizable.AddRef(go);

        // turn off irrigation
        FieldInfo fi = typeof(PlantablePlot).GetField("accepts_irrigation", BindingFlags.NonPublic | BindingFlags.Instance);

        fi.SetValue(plantablePlot, false);
    }