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); }
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); }
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); }
public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag) { go.AddOrGet <Storage>(); Prioritizable.AddRef(go); PlantablePlot plantablePlot = go.AddOrGet <PlantablePlot>(); plantablePlot.AddDepositTag(GameTags.DecorSeed); plantablePlot.occupyingObjectVisualOffset = new Vector3(0f, -0.25f, 0f); go.GetComponent <KPrefabID>().AddTag(GameTags.Decoration, false); }
public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag) { go.AddOrGet <Storage>(); Prioritizable.AddRef(go); PlantablePlot plantablePlot = go.AddOrGet <PlantablePlot>(); plantablePlot.AddDepositTag(GameTags.DecorSeed); go.AddOrGet <FlowerVase>(); go.GetComponent <KPrefabID>().AddTag(GameTags.Decoration, false); }
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); }
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); }
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); }
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); }