protected override void OnDragTool(int cell, int distFromOrigin) { if (!((Object)sourceGameObject == (Object)null) && Grid.IsValidCell(cell)) { CopyBuildingSettings.ApplyCopy(cell, sourceGameObject); } }
public override void DoPostConfigureComplete(GameObject go) { Door door = go.AddOrGet <Door>(); door.unpoweredAnimSpeed = 1f; door.doorType = Door.DoorType.Internal; door.doorOpeningSoundEventName = "Open_DoorInternal"; door.doorClosingSoundEventName = "Close_DoorInternal"; AccessControl accessControl = go.AddOrGet <AccessControl>(); accessControl.controlEnabled = true; CopyBuildingSettings copyBuildingSettings = go.AddOrGet <CopyBuildingSettings>(); copyBuildingSettings.copyGroupTag = GameTags.Door; Workable workable = go.AddOrGet <Workable>(); workable.workTime = 3f; KBatchedAnimController component = go.GetComponent <KBatchedAnimController>(); component.initialAnim = "closed"; go.AddOrGet <ZoneTile>(); go.AddOrGet <KBoxCollider2D>(); Prioritizable.AddRef(go); GeneratedBuildings.RegisterLogicPorts(go, INPUT_PORTS_0_0); Object.DestroyImmediate(go.GetComponent <BuildingEnabledButton>()); }
public override void DoPostConfigureComplete(GameObject go) { Door door = go.AddOrGet <Door>(); door.hasComplexUserControls = true; door.unpoweredAnimSpeed = 0.9f; door.poweredAnimSpeed = 6f; door.doorClosingSoundEventName = "MechanizedAirlock_closing"; door.doorOpeningSoundEventName = "MechanizedAirlock_opening"; go.AddOrGet <ZoneTile>(); go.AddOrGet <AccessControl>(); go.AddOrGet <KBoxCollider2D>(); Prioritizable.AddRef(go); CopyBuildingSettings copyBuildingSettings = go.AddOrGet <CopyBuildingSettings>(); copyBuildingSettings.copyGroupTag = GameTags.Door; Workable workable = go.AddOrGet <Workable>(); workable.workTime = 10f; UnityEngine.Object.DestroyImmediate(go.GetComponent <BuildingEnabledButton>()); AccessControl component = go.GetComponent <AccessControl>(); component.controlEnabled = true; KBatchedAnimController component2 = go.GetComponent <KBatchedAnimController>(); component2.initialAnim = "closed"; }
public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag) { go.AddOrGet <Filterable>().filterElementState = Filterable.ElementState.Solid; go.AddOrGet <InfiniteSourceFlowControl>(); go.AddOrGet <InfiniteSource>().Type = ConduitType.Solid; SoundEventVolumeCache.instance.AddVolume("conveyorin_kanim", "StorageLocker_Hit_metallic_low", NOISE_POLLUTION.NOISY.TIER1); Prioritizable.AddRef(go); Storage storage = go.AddOrGet <Storage>(); storage.showInUI = true; storage.allowItemRemoval = false; storage.showDescriptor = true; storage.fetchCategory = Storage.FetchCategory.GeneralStorage; List <Tag> tagList = new List <Tag>(); tagList.AddRange((IEnumerable <Tag>)STORAGEFILTERS.NOT_EDIBLE_SOLIDS); tagList.AddRange((IEnumerable <Tag>)STORAGEFILTERS.FOOD); storage.storageFilters = tagList; CopyBuildingSettings copyBuildingSettings = go.AddOrGet <CopyBuildingSettings>(); copyBuildingSettings.copyGroupTag = GameTags.StorageLocker; go.AddOrGet <SolidConduitDispenser>(); }
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 bool ApplyCopy(int targetCell, GameObject sourceGameObject) { ObjectLayer layer = ObjectLayer.Building; Building component = sourceGameObject.GetComponent <BuildingComplete>(); if ((UnityEngine.Object)component != (UnityEngine.Object)null) { layer = component.Def.ObjectLayer; } GameObject gameObject = Grid.Objects[targetCell, (int)layer]; if ((UnityEngine.Object)gameObject == (UnityEngine.Object)null) { return(false); } if ((UnityEngine.Object)gameObject == (UnityEngine.Object)sourceGameObject) { return(false); } KPrefabID component2 = sourceGameObject.GetComponent <KPrefabID>(); if ((UnityEngine.Object)component2 == (UnityEngine.Object)null) { return(false); } KPrefabID component3 = gameObject.GetComponent <KPrefabID>(); if ((UnityEngine.Object)component3 == (UnityEngine.Object)null) { return(false); } CopyBuildingSettings component4 = sourceGameObject.GetComponent <CopyBuildingSettings>(); if ((UnityEngine.Object)component4 == (UnityEngine.Object)null) { return(false); } CopyBuildingSettings component5 = gameObject.GetComponent <CopyBuildingSettings>(); if ((UnityEngine.Object)component5 == (UnityEngine.Object)null) { return(false); } if (component4.copyGroupTag != Tag.Invalid) { if (component4.copyGroupTag != component5.copyGroupTag) { return(false); } } else if (component3.PrefabID() != component2.PrefabID()) { return(false); } component3.Trigger(-905833192, sourceGameObject); PopFXManager.Instance.SpawnFX(PopFXManager.Instance.sprite_Plus, UI.COPIED_SETTINGS, gameObject.transform, new Vector3(0f, 0.5f, 0f), 1.5f, false, false); return(true); }
public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag) { SoundEventVolumeCache.instance.AddVolume("storagelocker_kanim", "StorageLocker_Hit_metallic_low", NOISE_POLLUTION.NOISY.TIER1); Prioritizable.AddRef(go); Storage storage = go.AddOrGet <Storage>(); storage.showInUI = true; storage.allowItemRemoval = true; storage.showDescriptor = true; storage.storageFilters = STORAGEFILTERS.NOT_EDIBLE_SOLIDS; storage.storageFullMargin = 1500f; storage.fetchCategory = Storage.FetchCategory.GeneralStorage; CopyBuildingSettings copyBuildingSettings = go.AddOrGet <CopyBuildingSettings>(); copyBuildingSettings.copyGroupTag = GameTags.StorageLocker; go.AddOrGet <StorageLocker>(); }
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) { Door door = go.AddOrGet <Door>(); door.hasComplexUserControls = true; door.unpoweredAnimSpeed = 1f; door.doorType = Door.DoorType.ManualPressure; go.AddOrGet <ZoneTile>(); go.AddOrGet <AccessControl>(); go.AddOrGet <KBoxCollider2D>(); Prioritizable.AddRef(go); CopyBuildingSettings copyBuildingSettings = go.AddOrGet <CopyBuildingSettings>(); copyBuildingSettings.copyGroupTag = GameTags.Door; Workable workable = go.AddOrGet <Workable>(); workable.workTime = 10f; UnityEngine.Object.DestroyImmediate(go.GetComponent <BuildingEnabledButton>()); }
public override void DoPostConfigureComplete(GameObject go) { ObjectDispenser objectDispenser = go.AddOrGet <ObjectDispenser>(); objectDispenser.dropOffset = new CellOffset(1, 0); Prioritizable.AddRef(go); Storage storage = go.AddOrGet <Storage>(); storage.showInUI = true; storage.allowItemRemoval = false; storage.showDescriptor = true; storage.storageFilters = STORAGEFILTERS.NOT_EDIBLE_SOLIDS; storage.storageFullMargin = STORAGE.STORAGE_LOCKER_FILLED_MARGIN; storage.fetchCategory = Storage.FetchCategory.GeneralStorage; CopyBuildingSettings copyBuildingSettings = go.AddOrGet <CopyBuildingSettings>(); copyBuildingSettings.copyGroupTag = GameTags.StorageLocker; GeneratedBuildings.RegisterLogicPorts(go, INPUT_PORTS); Object.DestroyImmediate(go.GetComponent <LogicOperationalController>()); }
// Token: 0x0600641F RID: 25631 RVA: 0x001EE62C File Offset: 0x001ECA2C public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag) { SoundEventVolumeCache.instance.AddVolume("storagelocker_kanim", "StorageLocker_Hit_metallic_low", NOISE_POLLUTION.NOISY.TIER1); Prioritizable.AddRef(go); Storage storage = go.AddOrGet <Storage>(); storage.showInUI = true; storage.allowItemRemoval = true; storage.showDescriptor = true; storage.capacityKg = BigStorageConfigMod._configManager.Config.BigBeautifulStorageLockerCapacity; storage.storageFilters = STORAGEFILTERS.NOT_EDIBLE_SOLIDS; storage.storageFullMargin = STORAGE.STORAGE_LOCKER_FILLED_MARGIN; storage.fetchCategory = Storage.FetchCategory.GeneralStorage; storage.showCapacityStatusItem = true; storage.showCapacityAsMainStatus = true; CopyBuildingSettings copyBuildingSettings = go.AddOrGet <CopyBuildingSettings>(); copyBuildingSettings.copyGroupTag = GameTags.StorageLocker; go.AddOrGet <StorageLocker>(); go.AddOrGet <UserNameable>(); go.AddOrGetDef <RocketUsageRestriction.Def>(); }
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); }
public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag) { List <Tag> mod = new List <Tag>(); mod.AddRange((IEnumerable <Tag>)STORAGEFILTERS.BAGABLE_CREATURES); mod.AddRange((IEnumerable <Tag>)STORAGEFILTERS.SWIMMING_CREATURES); SoundEventVolumeCache.instance.AddVolume("storagelocker_kanim", "StorageLocker_Hit_metallic_low", NOISE_POLLUTION.NOISY.TIER1); Prioritizable.AddRef(go); Storage storage = go.AddOrGet <Storage>(); storage.capacityKg = 1000000f; storage.showInUI = true; storage.allowItemRemoval = true; storage.showDescriptor = true; storage.storageFilters = mod; storage.storageFullMargin = STORAGE.STORAGE_LOCKER_FILLED_MARGIN; storage.fetchCategory = Storage.FetchCategory.GeneralStorage; CopyBuildingSettings copyBuildingSettings = go.AddOrGet <CopyBuildingSettings>(); copyBuildingSettings.copyGroupTag = GameTags.StorageLocker; go.AddOrGet <StorageLocker>(); }
public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag) { SoundEventVolumeCache.instance.AddVolume("storagelocker_kanim", "StorageLocker_Hit_metallic_low", NOISE_POLLUTION.NOISY.TIER1); Prioritizable.AddRef(go); Storage storage = go.AddOrGet <Storage>(); storage.capacityKg = 20000 * (8) * (5) * (3) * (2); // 10, 6, 3, 2 // 10, 5, 4, 2 storage.showInUI = true; storage.allowItemRemoval = true; storage.showDescriptor = true; List <Tag> tags = new List <Tag>(); tags.AddRange(STORAGEFILTERS.BAGABLE_CREATURES); tags.AddRange(STORAGEFILTERS.NOT_EDIBLE_SOLIDS); storage.storageFilters = tags; storage.storageFullMargin = STORAGE.STORAGE_LOCKER_FILLED_MARGIN; storage.fetchCategory = Storage.FetchCategory.GeneralStorage; CopyBuildingSettings copyBuildingSettings = go.AddOrGet <CopyBuildingSettings>(); copyBuildingSettings.copyGroupTag = GameTags.StorageLocker; go.AddOrGet <StorageLocker>(); }