protected override void OnPrefabInit() { base.OnPrefabInit(); IceCooledFan fan = GetComponent <IceCooledFan>(); manualDeliveryKGIce = GetComponent <ManualDeliveryKG>(); manualDeliveryKGIce.requestedItemTag = SimHashes.Ice.CreateTag(); manualDeliveryKGIce.Pause(true, "Filter empty"); manualDeliveryKGDirtyIce = gameObject.AddComponent <ManualDeliveryKG>(); manualDeliveryKGDirtyIce.SetStorage(fan.iceStorage); manualDeliveryKGDirtyIce.Pause(true, "Filter empty"); manualDeliveryKGDirtyIce.requestedItemTag = SimHashes.DirtyIce.CreateTag(); manualDeliveryKGDirtyIce.capacity = ICE_CAPACITY; manualDeliveryKGDirtyIce.refillMass = ICE_CAPACITY * 0.2f; manualDeliveryKGDirtyIce.minimumMass = 10f; manualDeliveryKGDirtyIce.choreTypeIDHash = Db.Get().ChoreTypes.MachineFetch.IdHash; manualDeliveryKGBrineIce = gameObject.AddComponent <ManualDeliveryKG>(); manualDeliveryKGBrineIce.SetStorage(fan.iceStorage); manualDeliveryKGBrineIce.Pause(true, "Filter empty"); manualDeliveryKGBrineIce.requestedItemTag = SimHashes.BrineIce.CreateTag(); manualDeliveryKGBrineIce.capacity = ICE_CAPACITY; manualDeliveryKGBrineIce.refillMass = ICE_CAPACITY * 0.2f; manualDeliveryKGBrineIce.minimumMass = 10f; manualDeliveryKGBrineIce.choreTypeIDHash = Db.Get().ChoreTypes.MachineFetch.IdHash; GetComponent <TreeFilterable>().OnFilterChanged += OnFilterChanged; }
public static void Postfix(GameObject go, Tag prefab_tag) { IceCooledFan fan = go.GetComponent <IceCooledFan>(); fan.iceStorage.storageFilters = new List <Tag>() { GameTags.Liquifiable }; fan.iceStorage.showInUI = true; go.AddComponent <TreeFilterable>(); go.AddComponent <IceFanChoice>(); }
public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag) { Storage storage = go.AddComponent<Storage>(); storage.capacityKg = 50f; storage.SetDefaultStoredItemModifiers(Storage.StandardInsulatedStorage); Storage storage2 = go.AddComponent<Storage>(); storage2.capacityKg = 50f; storage2.SetDefaultStoredItemModifiers(Storage.StandardInsulatedStorage); go.AddOrGet<BuildingComplete>().isManuallyOperated = true; MinimumOperatingTemperature minimumOperatingTemperature = go.AddOrGet<MinimumOperatingTemperature>(); minimumOperatingTemperature.minimumTemperature = 273.15f; go.AddOrGet<LoopingSounds>(); Prioritizable.AddRef(go); IceCooledFan iceCooledFan = go.AddOrGet<IceCooledFan>(); iceCooledFan.coolingRate = COOLING_RATE; iceCooledFan.targetTemperature = TARGET_TEMPERATURE; iceCooledFan.iceStorage = storage; iceCooledFan.liquidStorage = storage2; iceCooledFan.minCooledTemperature = 278.15f; iceCooledFan.minEnvironmentMass = 0.25f; iceCooledFan.minCoolingRange = new Vector2I(-2, 0); iceCooledFan.maxCoolingRange = new Vector2I(2, 4); iceCooledFan.consumptionTag = GameTags.IceOre; ManualDeliveryKG manualDeliveryKG = go.AddComponent<ManualDeliveryKG>(); manualDeliveryKG.SetStorage(storage); manualDeliveryKG.requestedItemTag = GameTags.IceOre; manualDeliveryKG.capacity = ICE_CAPACITY; manualDeliveryKG.refillMass = ICE_CAPACITY * 0.2f; manualDeliveryKG.minimumMass = 10f; manualDeliveryKG.choreTypeIDHash = Db.Get().ChoreTypes.MachineFetch.IdHash; IceCooledFanWorkable iceCooledFanWorkable = go.AddOrGet<IceCooledFanWorkable>(); iceCooledFanWorkable.overrideAnims = new KAnimFile[1] { Assets.GetAnim("anim_interacts_icefan_kanim") }; }