public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag) { go.AddOrGet <DropAllWorkable>(); go.AddOrGet <BuildingComplete>().isManuallyOperated = true; GlassForge inductor = go.AddOrGet <GlassForge>(); inductor.sideScreenStyle = ComplexFabricatorSideScreen.StyleSetting.ListQueueHybrid; go.AddOrGet <CopyBuildingSettings>(); ComplexFabricatorWorkable complexFabricatorWorkable = go.AddOrGet <ComplexFabricatorWorkable>(); inductor.duplicantOperated = false; BuildingTemplates.CreateComplexFabricatorStorage(go, inductor); inductor.outStorage.capacityKg = 2000f; inductor.storeProduced = true; inductor.inStorage.SetDefaultStoredItemModifiers(InductorConfig.RefineryStoredItemModifiers); inductor.buildStorage.SetDefaultStoredItemModifiers(InductorConfig.RefineryStoredItemModifiers); inductor.outStorage.SetDefaultStoredItemModifiers(InductorConfig.RefineryStoredItemModifiers); inductor.outputOffset = new Vector3(1f, 0.5f); complexFabricatorWorkable.overrideAnims = new KAnimFile[] { Assets.GetAnim("anim_interacts_metalrefinery_kanim") }; inductor.resultState = ComplexFabricator.ResultState.Melted; ConduitDispenser conduitDispenser = go.AddOrGet <ConduitDispenser>(); conduitDispenser.storage = inductor.outStorage; conduitDispenser.conduitType = ConduitType.Liquid; conduitDispenser.elementFilter = null; conduitDispenser.alwaysDispense = true; this.ConfigureRecipes(); Prioritizable.AddRef(go); }
protected override void OnSpawn() { base.OnSpawn(); base.workable.requiredSkillPerk = Db.Get().SkillPerks.CanElectricGrill.Id; base.workable.WorkerStatusItem = Db.Get().DuplicantStatusItems.Cooking; base.workable.overrideAnims = new KAnimFile[1] { Assets.GetAnim("anim_interacts_cookstation_kanim") }; base.workable.AttributeConverter = Db.Get().AttributeConverters.CookingSpeed; base.workable.AttributeExperienceMultiplier = DUPLICANTSTATS.ATTRIBUTE_LEVELING.MOST_DAY_EXPERIENCE; base.workable.SkillExperienceSkillGroup = Db.Get().SkillGroups.Cooking.Id; base.workable.SkillExperienceMultiplier = SKILLS.MOST_DAY_EXPERIENCE; ComplexFabricatorWorkable workable = base.workable; workable.OnWorkTickActions = (Action <Worker, float>) Delegate.Combine(workable.OnWorkTickActions, (Action <Worker, float>) delegate(Worker worker, float dt) { Debug.Assert((UnityEngine.Object)worker != (UnityEngine.Object)null, "How did we get a null worker?"); if (diseaseCountKillRate > 0) { PrimaryElement component = GetComponent <PrimaryElement>(); int num = Math.Max(1, (int)((float)diseaseCountKillRate * dt)); component.ModifyDiseaseCount(-num, "CookingStation"); } }); }
public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag) { go.AddOrGet <DropAllWorkable>(); go.AddOrGet <BuildingComplete>().isManuallyOperated = true; ComplexFabricator complexFabricator = go.AddOrGet <ComplexFabricator>(); complexFabricator.resultState = ComplexFabricator.ResultState.Heated; complexFabricator.heatedTemperature = OUTPUT_TEMPERATURE; complexFabricator.sideScreenStyle = ComplexFabricatorSideScreen.StyleSetting.ListQueueHybrid; complexFabricator.duplicantOperated = true; go.AddOrGet <FabricatorIngredientStatusManager>(); go.AddOrGet <CopyBuildingSettings>(); ComplexFabricatorWorkable complexFabricatorWorkable = go.AddOrGet <ComplexFabricatorWorkable>(); BuildingTemplates.CreateComplexFabricatorStorage(go, complexFabricator); complexFabricatorWorkable.overrideAnims = new KAnimFile[1] { Assets.GetAnim("anim_interacts_supermaterial_refinery_kanim") }; Prioritizable.AddRef(go); AddRecipes(); }
public override void DoPostConfigureComplete(GameObject go) { go.GetComponent <KPrefabID>().prefabSpawnFn += delegate(GameObject game_object) { ComplexFabricatorWorkable component = game_object.GetComponent <ComplexFabricatorWorkable>(); component.WorkerStatusItem = Db.Get().DuplicantStatusItems.Fabricating; component.AttributeConverter = Db.Get().AttributeConverters.MachinerySpeed; component.AttributeExperienceMultiplier = DUPLICANTSTATS.ATTRIBUTE_LEVELING.PART_DAY_EXPERIENCE; component.SkillExperienceSkillGroup = Db.Get().SkillGroups.Technicals.Id; component.SkillExperienceMultiplier = SKILLS.PART_DAY_EXPERIENCE; }; }
public override void DoPostConfigureComplete(GameObject go) { go.AddOrGetDef <PoweredActiveStoppableController.Def>(); go.GetComponent <KPrefabID>().prefabSpawnFn += delegate(GameObject game_object) { ComplexFabricatorWorkable component = game_object.GetComponent <ComplexFabricatorWorkable>(); component.AttributeConverter = Db.Get().AttributeConverters.CookingSpeed; component.AttributeExperienceMultiplier = DUPLICANTSTATS.ATTRIBUTE_LEVELING.PART_DAY_EXPERIENCE; component.SkillExperienceSkillGroup = Db.Get().SkillGroups.Cooking.Id; component.SkillExperienceMultiplier = SKILLS.PART_DAY_EXPERIENCE; }; }
public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag) { go.AddOrGet <DropAllWorkable>(); go.AddOrGet <BuildingComplete>().isManuallyOperated = true; GlassForge glassForge = go.AddOrGet <GlassForge>(); glassForge.sideScreenStyle = ComplexFabricatorSideScreen.StyleSetting.ListQueueHybrid; go.AddOrGet <FabricatorIngredientStatusManager>(); go.AddOrGet <CopyBuildingSettings>(); ComplexFabricatorWorkable complexFabricatorWorkable = go.AddOrGet <ComplexFabricatorWorkable>(); glassForge.duplicantOperated = true; BuildingTemplates.CreateComplexFabricatorStorage(go, glassForge); glassForge.outStorage.capacityKg = 2000f; glassForge.storeProduced = true; glassForge.inStorage.SetDefaultStoredItemModifiers(RefineryStoredItemModifiers); glassForge.buildStorage.SetDefaultStoredItemModifiers(RefineryStoredItemModifiers); glassForge.outStorage.SetDefaultStoredItemModifiers(RefineryStoredItemModifiers); glassForge.outputOffset = new Vector3(1f, 0.5f); complexFabricatorWorkable.overrideAnims = new KAnimFile[1] { Assets.GetAnim("anim_interacts_metalrefinery_kanim") }; glassForge.resultState = ComplexFabricator.ResultState.Melted; ConduitDispenser conduitDispenser = go.AddOrGet <ConduitDispenser>(); conduitDispenser.storage = glassForge.outStorage; conduitDispenser.conduitType = ConduitType.Liquid; conduitDispenser.elementFilter = null; conduitDispenser.alwaysDispense = true; ComplexRecipe.RecipeElement[] array = new ComplexRecipe.RecipeElement[1] { new ComplexRecipe.RecipeElement(ElementLoader.FindElementByHash(SimHashes.Sand).tag, 100f) }; ComplexRecipe.RecipeElement[] array2 = new ComplexRecipe.RecipeElement[1] { new ComplexRecipe.RecipeElement(ElementLoader.FindElementByHash(SimHashes.MoltenGlass).tag, 25f) }; string obsolete_id = ComplexRecipeManager.MakeObsoleteRecipeID("GlassForge", array[0].material); string text = ComplexRecipeManager.MakeRecipeID("GlassForge", array, array2); ComplexRecipe complexRecipe = new ComplexRecipe(text, array, array2); complexRecipe.time = 40f; complexRecipe.nameDisplay = ComplexRecipe.RecipeNameDisplay.Result; complexRecipe.description = string.Format(STRINGS.BUILDINGS.PREFABS.GLASSFORGE.RECIPE_DESCRIPTION, ElementLoader.GetElement(array2[0].material).name, ElementLoader.GetElement(array[0].material).name); complexRecipe.fabricators = new List <Tag> { TagManager.Create("GlassForge") }; ComplexRecipeManager.Get().AddObsoleteIDMapping(obsolete_id, text); Prioritizable.AddRef(go); }
protected override void OnPrefabInit() { base.OnPrefabInit(); GetRecipes(); simRenderLoadBalance = true; choreType = Db.Get().ChoreTypes.Fabricate; Subscribe(-1957399615, OnDroppedAllDelegate); Subscribe(-592767678, OnOperationalChangedDelegate); Subscribe(-905833192, OnCopySettingsDelegate); Subscribe(-1697596308, OnStorageChangeDelegate); workable = GetComponent <ComplexFabricatorWorkable>(); Components.ComplexFabricators.Add(this); }
public override void DoPostConfigureComplete(GameObject go) { SymbolOverrideControllerUtil.AddToPrefab(go); go.AddOrGetDef <PoweredActiveStoppableController.Def>(); go.GetComponent <KPrefabID>().prefabSpawnFn += delegate(GameObject game_object) { ComplexFabricatorWorkable component = game_object.GetComponent <ComplexFabricatorWorkable>(); component.WorkerStatusItem = Db.Get().DuplicantStatusItems.Processing; component.AttributeConverter = Db.Get().AttributeConverters.MachinerySpeed; component.AttributeExperienceMultiplier = DUPLICANTSTATS.ATTRIBUTE_LEVELING.PART_DAY_EXPERIENCE; component.SkillExperienceSkillGroup = Db.Get().SkillGroups.Technicals.Id; component.SkillExperienceMultiplier = SKILLS.PART_DAY_EXPERIENCE; }; }
protected override void OnSpawn() { base.OnSpawn(); refinery.choreType = Db.Get().ChoreTypes.Cook; refinery.fetchChoreTypeIdHash = Db.Get().ChoreTypes.CookFetch.IdHash; workable.WorkerStatusItem = Db.Get().DuplicantStatusItems.Processing; workable.AttributeConverter = Db.Get().AttributeConverters.CookingSpeed; workable.AttributeExperienceMultiplier = DUPLICANTSTATS.ATTRIBUTE_LEVELING.MOST_DAY_EXPERIENCE; workable.SkillExperienceSkillGroup = Db.Get().SkillGroups.Cooking.Id; workable.SkillExperienceMultiplier = SKILLS.MOST_DAY_EXPERIENCE; ComplexFabricatorWorkable complexFabricatorWorkable = workable; complexFabricatorWorkable.OnWorkableEventCB = (Action <Workable.WorkableEvent>)Delegate.Combine(complexFabricatorWorkable.OnWorkableEventCB, new Action <Workable.WorkableEvent>(OnWorkableEvent)); }
public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag) { go.AddOrGet <DropAllWorkable>(); go.AddOrGet <BuildingComplete>().isManuallyOperated = true; ComplexFabricator fabricator = go.AddOrGet <ComplexFabricator>(); fabricator.resultState = ComplexFabricator.ResultState.Heated; fabricator.heatedTemperature = 313.15f; fabricator.sideScreenStyle = ComplexFabricatorSideScreen.StyleSetting.ListQueueHybrid; fabricator.duplicantOperated = true; go.AddOrGet <FabricatorIngredientStatusManager>(); go.AddOrGet <CopyBuildingSettings>(); ComplexFabricatorWorkable fabricatorWorkable = go.AddOrGet <ComplexFabricatorWorkable>(); BuildingTemplates.CreateComplexFabricatorStorage(go, fabricator); fabricatorWorkable.overrideAnims = new KAnimFile[1] { //Assets.GetAnim((HashedString) "anim_interacts_supermaterial_refinery_kanim") Assets.GetAnim((HashedString)"anim_interacts_metalrefinery_kanim") }; Prioritizable.AddRef(go); //float num7 = 0.35f; ComplexRecipe.RecipeElement[] ingredients4 = new ComplexRecipe.RecipeElement[2] { new ComplexRecipe.RecipeElement((Tag)HatchConfig.EGG_ID, 1f), new ComplexRecipe.RecipeElement((Tag)RawEggConfig.ID, (float)(40 / 8)) }; ComplexRecipe.RecipeElement[] results4 = new ComplexRecipe.RecipeElement[1] { new ComplexRecipe.RecipeElement((Tag)HatchConfig.EGG_ID, 1f) }; var r = new ComplexRecipe(ComplexRecipeManager.MakeRecipeID(ID, (IList <ComplexRecipe.RecipeElement>)ingredients4, (IList <ComplexRecipe.RecipeElement>)results4), ingredients4, results4) { time = 80f / 8, description = RECOMBINATION_RECIPE_DESCRIPTION, nameDisplay = ComplexRecipe.RecipeNameDisplay.Result }; RECIPE_RECOMBINATION = r; r.fabricators = new List <Tag>() { TagManager.Create(ID) }; }
public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag) { go.AddOrGet <DropAllWorkable>(); go.AddOrGet <BuildingComplete>().isManuallyOperated = true; go.AddOrGet <KBatchedAnimController>().SetSymbolVisiblity("snapto_egg", false); ComplexFabricator complexFabricator = go.AddOrGet <ComplexFabricator>(); complexFabricator.labelByResult = false; complexFabricator.sideScreenStyle = ComplexFabricatorSideScreen.StyleSetting.ListQueueHybrid; complexFabricator.duplicantOperated = true; go.AddOrGet <FabricatorIngredientStatusManager>(); go.AddOrGet <CopyBuildingSettings>(); ComplexFabricatorWorkable complexFabricatorWorkable = go.AddOrGet <ComplexFabricatorWorkable>(); BuildingTemplates.CreateComplexFabricatorStorage(go, complexFabricator); complexFabricatorWorkable.overrideAnims = new KAnimFile[1] { Assets.GetAnim("anim_interacts_egg_cracker_kanim") }; complexFabricator.outputOffset = new Vector3(1f, 1f, 0f); Prioritizable.AddRef(go); go.AddOrGet <EggCracker>(); }
private static bool Prefix(RockCrusherConfig __instance, ref GameObject go) { Debug.Log("Refinement Plus - RockCrusherConfig Postfix: "); Prioritizable.AddRef(go); go.AddOrGet <DropAllWorkable>(); go.AddOrGet <BuildingComplete>().isManuallyOperated = true; ComplexFabricator complexFabricator = go.AddOrGet <ComplexFabricator>(); complexFabricator.sideScreenStyle = ComplexFabricatorSideScreen.StyleSetting.ListQueueHybrid; complexFabricator.duplicantOperated = true; go.AddOrGet <FabricatorIngredientStatusManager>(); go.AddOrGet <CopyBuildingSettings>(); ComplexFabricatorWorkable complexFabricatorWorkable = go.AddOrGet <ComplexFabricatorWorkable>(); BuildingTemplates.CreateComplexFabricatorStorage(go, complexFabricator); complexFabricatorWorkable.overrideAnims = new KAnimFile[] { Assets.GetAnim("anim_interacts_rockrefinery_kanim") }; complexFabricatorWorkable.workingPstComplete = "working_pst_complete"; Methods mtd = new Methods(); /* Clay To Slime */ mtd.clayToSlime(); //* Corpses To Meal And Lime */ mtd.corpseToMeal(); /* Eggs To Lime */ mtd.limeCrushing(); /* Fossils To Lime And Sand */ mtd.fossilCrushing(); /* Mafic Rock To Regolith */ mtd.maficToRegolith(); /* Minerals To Sand Overhaul */ mtd.mineralsCrushing(); /* Ores To Refined */ mtd.oresToRefined(); /* Organic To Fert */ mtd.organicToFert(); /* Refined To Ores */ mtd.refinedToOres(); /* Salt To Table Salt */ mtd.saltCrushing(); /* Crush Ice */ mtd.snowCone(); return(false); }
public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag) { go.AddOrGet <DropAllWorkable>(); go.AddOrGet <BuildingComplete>().isManuallyOperated = true; ComplexFabricator complexFabricator = go.AddOrGet <ComplexFabricator>(); complexFabricator.sideScreenStyle = ComplexFabricatorSideScreen.StyleSetting.ListQueueHybrid; complexFabricator.duplicantOperated = true; go.AddOrGet <FabricatorIngredientStatusManager>(); go.AddOrGet <CopyBuildingSettings>(); ComplexFabricatorWorkable complexFabricatorWorkable = go.AddOrGet <ComplexFabricatorWorkable>(); BuildingTemplates.CreateComplexFabricatorStorage(go, complexFabricator); complexFabricatorWorkable.overrideAnims = new KAnimFile[1] { Assets.GetAnim("anim_interacts_rockrefinery_kanim") }; complexFabricatorWorkable.workingPstComplete = "working_pst_complete"; Tag tag = SimHashes.Sand.CreateTag(); List <Element> list = ElementLoader.elements.FindAll((Element e) => e.HasTag(GameTags.Crushable)); ComplexRecipe complexRecipe; foreach (Element item in list) { ComplexRecipe.RecipeElement[] array = new ComplexRecipe.RecipeElement[1] { new ComplexRecipe.RecipeElement(item.tag, 100f) }; ComplexRecipe.RecipeElement[] array2 = new ComplexRecipe.RecipeElement[1] { new ComplexRecipe.RecipeElement(tag, 100f) }; string obsolete_id = ComplexRecipeManager.MakeObsoleteRecipeID("RockCrusher", item.tag); string text = ComplexRecipeManager.MakeRecipeID("RockCrusher", array, array2); complexRecipe = new ComplexRecipe(text, array, array2); complexRecipe.time = 40f; complexRecipe.description = string.Format(STRINGS.BUILDINGS.PREFABS.ROCKCRUSHER.RECIPE_DESCRIPTION, item.name, tag.ProperName()); complexRecipe.nameDisplay = ComplexRecipe.RecipeNameDisplay.IngredientToResult; complexRecipe.fabricators = new List <Tag> { TagManager.Create("RockCrusher") }; ComplexRecipeManager.Get().AddObsoleteIDMapping(obsolete_id, text); } List <Element> list2 = ElementLoader.elements.FindAll((Element e) => e.IsSolid && e.HasTag(GameTags.Metal)); foreach (Element item2 in list2) { Element highTempTransition = item2.highTempTransition; Element lowTempTransition = highTempTransition.lowTempTransition; if (lowTempTransition != item2) { ComplexRecipe.RecipeElement[] array3 = new ComplexRecipe.RecipeElement[1] { new ComplexRecipe.RecipeElement(item2.tag, 100f) }; ComplexRecipe.RecipeElement[] array4 = new ComplexRecipe.RecipeElement[2] { new ComplexRecipe.RecipeElement(lowTempTransition.tag, 50f), new ComplexRecipe.RecipeElement(tag, 50f) }; string obsolete_id2 = ComplexRecipeManager.MakeObsoleteRecipeID("RockCrusher", lowTempTransition.tag); string text2 = ComplexRecipeManager.MakeRecipeID("RockCrusher", array3, array4); complexRecipe = new ComplexRecipe(text2, array3, array4); complexRecipe.time = 40f; complexRecipe.description = string.Format(STRINGS.BUILDINGS.PREFABS.ROCKCRUSHER.METAL_RECIPE_DESCRIPTION, lowTempTransition.name, item2.name); complexRecipe.nameDisplay = ComplexRecipe.RecipeNameDisplay.IngredientToResult; complexRecipe.fabricators = new List <Tag> { TagManager.Create("RockCrusher") }; ComplexRecipeManager.Get().AddObsoleteIDMapping(obsolete_id2, text2); } } Element element = ElementLoader.FindElementByHash(SimHashes.Lime); ComplexRecipe.RecipeElement[] array5 = new ComplexRecipe.RecipeElement[1] { new ComplexRecipe.RecipeElement("EggShell", 5f) }; ComplexRecipe.RecipeElement[] array6 = new ComplexRecipe.RecipeElement[1] { new ComplexRecipe.RecipeElement(ElementLoader.FindElementByHash(SimHashes.Lime).tag, 5f) }; string obsolete_id3 = ComplexRecipeManager.MakeObsoleteRecipeID("RockCrusher", element.tag); string text3 = ComplexRecipeManager.MakeRecipeID("RockCrusher", array5, array6); complexRecipe = new ComplexRecipe(text3, array5, array6); complexRecipe.time = 40f; complexRecipe.description = string.Format(STRINGS.BUILDINGS.PREFABS.ROCKCRUSHER.LIME_RECIPE_DESCRIPTION, SimHashes.Lime.CreateTag().ProperName(), MISC.TAGS.EGGSHELL); complexRecipe.nameDisplay = ComplexRecipe.RecipeNameDisplay.IngredientToResult; complexRecipe.fabricators = new List <Tag> { TagManager.Create("RockCrusher") }; ComplexRecipeManager.Get().AddObsoleteIDMapping(obsolete_id3, text3); Element element2 = ElementLoader.FindElementByHash(SimHashes.Lime); ComplexRecipe.RecipeElement[] array7 = new ComplexRecipe.RecipeElement[1] { new ComplexRecipe.RecipeElement("BabyCrabShell", 1f) }; ComplexRecipe.RecipeElement[] array8 = new ComplexRecipe.RecipeElement[1] { new ComplexRecipe.RecipeElement(element2.tag, 5f) }; string id = ComplexRecipeManager.MakeRecipeID("RockCrusher", array7, array8); complexRecipe = new ComplexRecipe(id, array7, array8); complexRecipe.time = 40f; complexRecipe.description = string.Format(STRINGS.BUILDINGS.PREFABS.ROCKCRUSHER.LIME_RECIPE_DESCRIPTION, SimHashes.Lime.CreateTag().ProperName(), ITEMS.INDUSTRIAL_PRODUCTS.CRAB_SHELL.NAME); complexRecipe.nameDisplay = ComplexRecipe.RecipeNameDisplay.IngredientToResult; complexRecipe.fabricators = new List <Tag> { TagManager.Create("RockCrusher") }; Element element3 = ElementLoader.FindElementByHash(SimHashes.Lime); ComplexRecipe.RecipeElement[] array9 = new ComplexRecipe.RecipeElement[1] { new ComplexRecipe.RecipeElement("CrabShell", 1f) }; ComplexRecipe.RecipeElement[] array10 = new ComplexRecipe.RecipeElement[1] { new ComplexRecipe.RecipeElement(element3.tag, 10f) }; string id2 = ComplexRecipeManager.MakeRecipeID("RockCrusher", array9, array10); complexRecipe = new ComplexRecipe(id2, array9, array10); complexRecipe.time = 40f; complexRecipe.description = string.Format(STRINGS.BUILDINGS.PREFABS.ROCKCRUSHER.LIME_RECIPE_DESCRIPTION, SimHashes.Lime.CreateTag().ProperName(), ITEMS.INDUSTRIAL_PRODUCTS.CRAB_SHELL.NAME); complexRecipe.nameDisplay = ComplexRecipe.RecipeNameDisplay.IngredientToResult; complexRecipe.fabricators = new List <Tag> { TagManager.Create("RockCrusher") }; ComplexRecipe.RecipeElement[] array11 = new ComplexRecipe.RecipeElement[1] { new ComplexRecipe.RecipeElement(ElementLoader.FindElementByHash(SimHashes.Fossil).tag, 100f) }; ComplexRecipe.RecipeElement[] array12 = new ComplexRecipe.RecipeElement[2] { new ComplexRecipe.RecipeElement(ElementLoader.FindElementByHash(SimHashes.Lime).tag, 5f), new ComplexRecipe.RecipeElement(ElementLoader.FindElementByHash(SimHashes.SedimentaryRock).tag, 95f) }; string id3 = ComplexRecipeManager.MakeRecipeID("RockCrusher", array11, array12); complexRecipe = new ComplexRecipe(id3, array11, array12); complexRecipe.time = 40f; complexRecipe.description = string.Format(STRINGS.BUILDINGS.PREFABS.ROCKCRUSHER.LIME_FROM_LIMESTONE_RECIPE_DESCRIPTION, SimHashes.Fossil.CreateTag().ProperName(), SimHashes.SedimentaryRock.CreateTag().ProperName(), SimHashes.Lime.CreateTag().ProperName()); complexRecipe.nameDisplay = ComplexRecipe.RecipeNameDisplay.IngredientToResult; complexRecipe.fabricators = new List <Tag> { TagManager.Create("RockCrusher") }; float num = 5E-05f; ComplexRecipe.RecipeElement[] array13 = new ComplexRecipe.RecipeElement[1] { new ComplexRecipe.RecipeElement(SimHashes.Salt.CreateTag(), 100f) }; ComplexRecipe.RecipeElement[] array14 = new ComplexRecipe.RecipeElement[2] { new ComplexRecipe.RecipeElement(TableSaltConfig.ID.ToTag(), 100f * num), new ComplexRecipe.RecipeElement(SimHashes.Sand.CreateTag(), 100f * (1f - num)) }; string id4 = ComplexRecipeManager.MakeRecipeID("RockCrusher", array13, array14); complexRecipe = new ComplexRecipe(id4, array13, array14); complexRecipe.time = 40f; complexRecipe.description = string.Format(STRINGS.BUILDINGS.PREFABS.ROCKCRUSHER.RECIPE_DESCRIPTION, SimHashes.Salt.CreateTag().ProperName(), ITEMS.INDUSTRIAL_PRODUCTS.TABLE_SALT.NAME); complexRecipe.nameDisplay = ComplexRecipe.RecipeNameDisplay.IngredientToResult; complexRecipe.fabricators = new List <Tag> { TagManager.Create("RockCrusher") }; Prioritizable.AddRef(go); }
public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag) { go.AddOrGet <DropAllWorkable>(); go.AddOrGet <BuildingComplete>().isManuallyOperated = true; LiquidCooledRefinery liquidCooledRefinery = go.AddOrGet <LiquidCooledRefinery>(); liquidCooledRefinery.duplicantOperated = true; liquidCooledRefinery.sideScreenStyle = ComplexFabricatorSideScreen.StyleSetting.ListQueueHybrid; liquidCooledRefinery.keepExcessLiquids = true; go.AddOrGet <FabricatorIngredientStatusManager>(); go.AddOrGet <CopyBuildingSettings>(); ComplexFabricatorWorkable complexFabricatorWorkable = go.AddOrGet <ComplexFabricatorWorkable>(); BuildingTemplates.CreateComplexFabricatorStorage(go, liquidCooledRefinery); liquidCooledRefinery.coolantTag = COOLANT_TAG; liquidCooledRefinery.minCoolantMass = 400f; liquidCooledRefinery.outStorage.capacityKg = 2000f; liquidCooledRefinery.thermalFudge = 0.8f; liquidCooledRefinery.inStorage.SetDefaultStoredItemModifiers(RefineryStoredItemModifiers); liquidCooledRefinery.buildStorage.SetDefaultStoredItemModifiers(RefineryStoredItemModifiers); liquidCooledRefinery.outStorage.SetDefaultStoredItemModifiers(RefineryStoredItemModifiers); liquidCooledRefinery.outputOffset = new Vector3(1f, 0.5f); complexFabricatorWorkable.overrideAnims = new KAnimFile[1] { Assets.GetAnim("anim_interacts_metalrefinery_kanim") }; RequireOutputs requireOutputs = go.AddOrGet <RequireOutputs>(); requireOutputs.ignoreFullPipe = true; ConduitConsumer conduitConsumer = go.AddOrGet <ConduitConsumer>(); conduitConsumer.capacityTag = GameTags.Liquid; conduitConsumer.capacityKG = 800f; conduitConsumer.storage = liquidCooledRefinery.inStorage; conduitConsumer.alwaysConsume = true; conduitConsumer.forceAlwaysSatisfied = true; ConduitDispenser conduitDispenser = go.AddOrGet <ConduitDispenser>(); conduitDispenser.storage = liquidCooledRefinery.outStorage; conduitDispenser.conduitType = ConduitType.Liquid; conduitDispenser.elementFilter = null; conduitDispenser.alwaysDispense = true; List <Element> list = ElementLoader.elements.FindAll((Element e) => e.IsSolid && e.HasTag(GameTags.Metal)); ComplexRecipe complexRecipe; foreach (Element item in list) { Element highTempTransition = item.highTempTransition; Element lowTempTransition = highTempTransition.lowTempTransition; if (lowTempTransition != item) { ComplexRecipe.RecipeElement[] array = new ComplexRecipe.RecipeElement[1] { new ComplexRecipe.RecipeElement(item.tag, 100f) }; ComplexRecipe.RecipeElement[] array2 = new ComplexRecipe.RecipeElement[1] { new ComplexRecipe.RecipeElement(lowTempTransition.tag, 100f) }; string obsolete_id = ComplexRecipeManager.MakeObsoleteRecipeID("MetalRefinery", item.tag); string text = ComplexRecipeManager.MakeRecipeID("MetalRefinery", array, array2); complexRecipe = new ComplexRecipe(text, array, array2); complexRecipe.time = 40f; complexRecipe.description = string.Format(STRINGS.BUILDINGS.PREFABS.METALREFINERY.RECIPE_DESCRIPTION, lowTempTransition.name, item.name); complexRecipe.nameDisplay = ComplexRecipe.RecipeNameDisplay.IngredientToResult; complexRecipe.fabricators = new List <Tag> { TagManager.Create("MetalRefinery") }; ComplexRecipeManager.Get().AddObsoleteIDMapping(obsolete_id, text); } } Element element = ElementLoader.FindElementByHash(SimHashes.Steel); ComplexRecipe.RecipeElement[] array3 = new ComplexRecipe.RecipeElement[3] { new ComplexRecipe.RecipeElement(ElementLoader.FindElementByHash(SimHashes.Iron).tag, 70f), new ComplexRecipe.RecipeElement(ElementLoader.FindElementByHash(SimHashes.RefinedCarbon).tag, 20f), new ComplexRecipe.RecipeElement(ElementLoader.FindElementByHash(SimHashes.Lime).tag, 10f) }; ComplexRecipe.RecipeElement[] array4 = new ComplexRecipe.RecipeElement[1] { new ComplexRecipe.RecipeElement(ElementLoader.FindElementByHash(SimHashes.Steel).tag, 100f) }; string obsolete_id2 = ComplexRecipeManager.MakeObsoleteRecipeID("MetalRefinery", element.tag); string text2 = ComplexRecipeManager.MakeRecipeID("MetalRefinery", array3, array4); complexRecipe = new ComplexRecipe(text2, array3, array4); complexRecipe.time = 40f; complexRecipe.nameDisplay = ComplexRecipe.RecipeNameDisplay.IngredientToResult; complexRecipe.description = string.Format(STRINGS.BUILDINGS.PREFABS.METALREFINERY.RECIPE_DESCRIPTION, ElementLoader.FindElementByHash(SimHashes.Steel).name, ElementLoader.FindElementByHash(SimHashes.Iron).name); complexRecipe.fabricators = new List <Tag> { TagManager.Create("MetalRefinery") }; ComplexRecipeManager.Get().AddObsoleteIDMapping(obsolete_id2, text2); Prioritizable.AddRef(go); }
public static void Postfix(ComplexFabricatorWorkable __instance) { TryAddOwnable(__instance.gameObject); }
private void CreateStatusItems() { Func <string, object, string> resolveStringCallback = delegate(string str, object data) { Workable workable3 = (Workable)data; if ((UnityEngine.Object)workable3 != (UnityEngine.Object)null) { str = str.Replace("{Target}", workable3.GetComponent <KSelectable>().GetName()); } return(str); }; Func <string, object, string> resolveStringCallback2 = delegate(string str, object data) { Workable workable2 = (Workable)data; if ((UnityEngine.Object)workable2 != (UnityEngine.Object)null) { str = str.Replace("{Target}", workable2.GetComponent <KSelectable>().GetName()); ComplexFabricatorWorkable complexFabricatorWorkable = workable2 as ComplexFabricatorWorkable; if ((UnityEngine.Object)complexFabricatorWorkable != (UnityEngine.Object)null) { ComplexRecipe currentWorkingOrder = complexFabricatorWorkable.CurrentWorkingOrder; if (currentWorkingOrder != null) { str = str.Replace("{Item}", currentWorkingOrder.FirstResult.ProperName()); } } } return(str); }; BedUnreachable = CreateStatusItem("BedUnreachable", "DUPLICANTS", string.Empty, StatusItem.IconType.Exclamation, NotificationType.BadMinor, false, OverlayModes.None.ID, true, 2); BedUnreachable.AddNotification(null, null, null, 0f); DailyRationLimitReached = CreateStatusItem("DailyRationLimitReached", "DUPLICANTS", string.Empty, StatusItem.IconType.Exclamation, NotificationType.BadMinor, false, OverlayModes.None.ID, true, 2); DailyRationLimitReached.AddNotification(null, null, null, 0f); HoldingBreath = CreateStatusItem("HoldingBreath", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.BadMinor, false, OverlayModes.None.ID, true, 2); Hungry = CreateStatusItem("Hungry", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.BadMinor, false, OverlayModes.None.ID, true, 2); Unhappy = CreateStatusItem("Unhappy", "DUPLICANTS", string.Empty, StatusItem.IconType.Exclamation, NotificationType.BadMinor, false, OverlayModes.None.ID, true, 2); Unhappy.AddNotification(null, null, null, 0f); NervousBreakdown = CreateStatusItem("NervousBreakdown", "DUPLICANTS", string.Empty, StatusItem.IconType.Exclamation, NotificationType.Bad, false, OverlayModes.None.ID, true, 2); NervousBreakdown.AddNotification(null, null, null, 0f); NoRationsAvailable = CreateStatusItem("NoRationsAvailable", "DUPLICANTS", string.Empty, StatusItem.IconType.Exclamation, NotificationType.Bad, false, OverlayModes.None.ID, true, 2); PendingPacification = CreateStatusItem("PendingPacification", "DUPLICANTS", "status_item_pending_pacification", StatusItem.IconType.Custom, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2); QuarantineAreaUnassigned = CreateStatusItem("QuarantineAreaUnassigned", "DUPLICANTS", string.Empty, StatusItem.IconType.Exclamation, NotificationType.BadMinor, false, OverlayModes.None.ID, true, 2); QuarantineAreaUnassigned.AddNotification(null, null, null, 0f); QuarantineAreaUnreachable = CreateStatusItem("QuarantineAreaUnreachable", "DUPLICANTS", string.Empty, StatusItem.IconType.Exclamation, NotificationType.BadMinor, false, OverlayModes.None.ID, true, 2); QuarantineAreaUnreachable.AddNotification(null, null, null, 0f); Quarantined = CreateStatusItem("Quarantined", "DUPLICANTS", "status_item_quarantined", StatusItem.IconType.Custom, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2); RationsUnreachable = CreateStatusItem("RationsUnreachable", "DUPLICANTS", string.Empty, StatusItem.IconType.Exclamation, NotificationType.BadMinor, false, OverlayModes.None.ID, true, 2); RationsUnreachable.AddNotification(null, null, null, 0f); RationsNotPermitted = CreateStatusItem("RationsNotPermitted", "DUPLICANTS", string.Empty, StatusItem.IconType.Exclamation, NotificationType.BadMinor, false, OverlayModes.None.ID, true, 2); RationsNotPermitted.AddNotification(null, null, null, 0f); Rotten = CreateStatusItem("Rotten", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.BadMinor, false, OverlayModes.None.ID, true, 2); Starving = CreateStatusItem("Starving", "DUPLICANTS", string.Empty, StatusItem.IconType.Exclamation, NotificationType.Bad, false, OverlayModes.None.ID, true, 2); Starving.AddNotification(null, null, null, 0f); Suffocating = CreateStatusItem("Suffocating", "DUPLICANTS", string.Empty, StatusItem.IconType.Exclamation, NotificationType.DuplicantThreatening, false, OverlayModes.None.ID, true, 2); Suffocating.AddNotification(null, null, null, 0f); Tired = CreateStatusItem("Tired", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.BadMinor, false, OverlayModes.None.ID, true, 2); Idle = CreateStatusItem("Idle", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.BadMinor, false, OverlayModes.None.ID, true, 2); Idle.AddNotification(null, null, null, 0f); Pacified = CreateStatusItem("Pacified", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2); Dead = CreateStatusItem("Dead", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.BadMinor, false, OverlayModes.None.ID, true, 2); Dead.resolveStringCallback = delegate(string str, object data) { Death death = (Death)data; return(str.Replace("{Death}", death.Name)); }; MoveToSuitNotRequired = CreateStatusItem("MoveToSuitNotRequired", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2); DroppingUnusedInventory = CreateStatusItem("DroppingUnusedInventory", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2); MovingToSafeArea = CreateStatusItem("MovingToSafeArea", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2); ToiletUnreachable = CreateStatusItem("ToiletUnreachable", "DUPLICANTS", string.Empty, StatusItem.IconType.Exclamation, NotificationType.BadMinor, false, OverlayModes.None.ID, true, 2); ToiletUnreachable.AddNotification(null, null, null, 0f); NoUsableToilets = CreateStatusItem("NoUsableToilets", "DUPLICANTS", string.Empty, StatusItem.IconType.Exclamation, NotificationType.BadMinor, false, OverlayModes.None.ID, true, 2); NoUsableToilets.AddNotification(null, null, null, 0f); NoToilets = CreateStatusItem("NoToilets", "DUPLICANTS", string.Empty, StatusItem.IconType.Exclamation, NotificationType.BadMinor, false, OverlayModes.None.ID, true, 2); NoToilets.AddNotification(null, null, null, 0f); BreathingO2 = CreateStatusItem("BreathingO2", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 130); BreathingO2.resolveStringCallback = delegate(string str, object data) { OxygenBreather oxygenBreather2 = (OxygenBreather)data; float averageRate = Game.Instance.accumulators.GetAverageRate(oxygenBreather2.O2Accumulator); return(str.Replace("{ConsumptionRate}", GameUtil.GetFormattedMass(0f - averageRate, GameUtil.TimeSlice.PerSecond, GameUtil.MetricMassFormat.UseThreshold, true, "{0:0.#}"))); }; EmittingCO2 = CreateStatusItem("EmittingCO2", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 130); EmittingCO2.resolveStringCallback = delegate(string str, object data) { OxygenBreather oxygenBreather = (OxygenBreather)data; return(str.Replace("{EmittingRate}", GameUtil.GetFormattedMass(oxygenBreather.CO2EmitRate, GameUtil.TimeSlice.PerSecond, GameUtil.MetricMassFormat.UseThreshold, true, "{0:0.#}"))); }; Vomiting = CreateStatusItem("Vomiting", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.BadMinor, false, OverlayModes.None.ID, true, 2); Coughing = CreateStatusItem("Coughing", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.BadMinor, false, OverlayModes.None.ID, true, 2); LowOxygen = CreateStatusItem("LowOxygen", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.BadMinor, false, OverlayModes.None.ID, true, 2); LowOxygen.AddNotification(null, null, null, 0f); RedAlert = CreateStatusItem("RedAlert", "DUPLICANTS", string.Empty, StatusItem.IconType.Exclamation, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2); Sleeping = CreateStatusItem("Sleeping", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2); Sleeping.resolveTooltipCallback = delegate(string str, object data) { if (data is SleepChore.StatesInstance) { SleepChore.StatesInstance statesInstance2 = (SleepChore.StatesInstance)data; string stateChangeNoiseSource = statesInstance2.stateChangeNoiseSource; if (!string.IsNullOrEmpty(stateChangeNoiseSource)) { string text5 = DUPLICANTS.STATUSITEMS.SLEEPING.TOOLTIP; text5 = text5.Replace("{Disturber}", stateChangeNoiseSource); str += text5; } } return(str); }; SleepingInterruptedByNoise = CreateStatusItem("SleepingInterruptedByNoise", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2); SleepingInterruptedByLight = CreateStatusItem("SleepingInterruptedByLight", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2); Eating = CreateStatusItem("Eating", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2); Eating.resolveStringCallback = resolveStringCallback; Digging = CreateStatusItem("Digging", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2); Cleaning = CreateStatusItem("Cleaning", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2); Cleaning.resolveStringCallback = resolveStringCallback; PickingUp = CreateStatusItem("PickingUp", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2); PickingUp.resolveStringCallback = resolveStringCallback; Mopping = CreateStatusItem("Mopping", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2); Cooking = CreateStatusItem("Cooking", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2); Cooking.resolveStringCallback = resolveStringCallback2; Mushing = CreateStatusItem("Mushing", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2); Mushing.resolveStringCallback = resolveStringCallback2; Researching = CreateStatusItem("Researching", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2); Researching.resolveStringCallback = delegate(string str, object data) { TechInstance activeResearch = Research.Instance.GetActiveResearch(); if (activeResearch != null) { return(str.Replace("{Tech}", activeResearch.tech.Name)); } return(str); }; Tinkering = CreateStatusItem("Tinkering", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2); Tinkering.resolveStringCallback = delegate(string str, object data) { Tinkerable tinkerable = (Tinkerable)data; if ((UnityEngine.Object)tinkerable != (UnityEngine.Object)null) { return(string.Format(str, tinkerable.tinkerMaterialTag.ProperName())); } return(str); }; Storing = CreateStatusItem("Storing", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2); Storing.resolveStringCallback = delegate(string str, object data) { Workable workable = (Workable)data; if ((UnityEngine.Object)workable != (UnityEngine.Object)null && (UnityEngine.Object)workable.worker != (UnityEngine.Object)null) { KSelectable component = workable.GetComponent <KSelectable>(); if ((bool)component) { str = str.Replace("{Target}", component.GetName()); } Pickupable pickupable = workable.worker.workCompleteData as Pickupable; if ((UnityEngine.Object)workable.worker != (UnityEngine.Object)null && (bool)pickupable) { KSelectable component2 = pickupable.GetComponent <KSelectable>(); if ((bool)component2) { str = str.Replace("{Item}", component2.GetName()); } } } return(str); }; Building = CreateStatusItem("Building", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2); Building.resolveStringCallback = resolveStringCallback; Equipping = CreateStatusItem("Equipping", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2); Equipping.resolveStringCallback = resolveStringCallback; WarmingUp = CreateStatusItem("WarmingUp", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2); WarmingUp.resolveStringCallback = resolveStringCallback; GeneratingPower = CreateStatusItem("GeneratingPower", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2); GeneratingPower.resolveStringCallback = resolveStringCallback; Harvesting = CreateStatusItem("Harvesting", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2); Harvesting.resolveStringCallback = resolveStringCallback; Uprooting = CreateStatusItem("Uprooting", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2); Uprooting.resolveStringCallback = resolveStringCallback; Emptying = CreateStatusItem("Emptying", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2); Emptying.resolveStringCallback = resolveStringCallback; Toggling = CreateStatusItem("Toggling", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2); Toggling.resolveStringCallback = resolveStringCallback; Deconstructing = CreateStatusItem("Deconstructing", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2); Deconstructing.resolveStringCallback = resolveStringCallback; Disinfecting = CreateStatusItem("Disinfecting", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2); Disinfecting.resolveStringCallback = resolveStringCallback; Upgrading = CreateStatusItem("Upgrading", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2); Upgrading.resolveStringCallback = resolveStringCallback; Fabricating = CreateStatusItem("Fabricating", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2); Fabricating.resolveStringCallback = resolveStringCallback2; Processing = CreateStatusItem("Processing", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2); Processing.resolveStringCallback = resolveStringCallback2; Clearing = CreateStatusItem("Clearing", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2); Clearing.resolveStringCallback = resolveStringCallback; GeneratingPower = CreateStatusItem("GeneratingPower", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2); GeneratingPower.resolveStringCallback = resolveStringCallback; Cold = CreateStatusItem("Cold", "DUPLICANTS", string.Empty, StatusItem.IconType.Exclamation, NotificationType.BadMinor, false, OverlayModes.None.ID, true, 2); Cold.resolveTooltipCallback = delegate(string str, object data) { str = str.Replace("{StressModification}", GameUtil.GetFormattedPercent(Db.Get().effects.Get("ColdAir").SelfModifiers[0].Value, GameUtil.TimeSlice.PerCycle)); float dtu_s2 = ((ExternalTemperatureMonitor.Instance)data).temperatureTransferer.average_kilowatts_exchanged.GetWeightedAverage * 1000f; str = str.Replace("{currentTransferWattage}", GameUtil.GetFormattedHeatEnergyRate(dtu_s2, GameUtil.HeatEnergyFormatterUnit.Automatic)); AttributeInstance attributeInstance3 = ((ExternalTemperatureMonitor.Instance)data).attributes.Get("ThermalConductivityBarrier"); string text3 = "<b>" + attributeInstance3.GetFormattedValue() + "</b>"; for (int j = 0; j != attributeInstance3.Modifiers.Count; j++) { AttributeModifier attributeModifier2 = attributeInstance3.Modifiers[j]; text3 += "\n"; string text4 = text3; text3 = text4 + " • " + attributeModifier2.GetDescription() + " <b>" + attributeModifier2.GetFormattedString(attributeInstance3.gameObject) + "</b>"; } str = str.Replace("{conductivityBarrier}", text3); return(str); }; Hot = CreateStatusItem("Hot", "DUPLICANTS", string.Empty, StatusItem.IconType.Exclamation, NotificationType.BadMinor, false, OverlayModes.None.ID, true, 2); Hot.resolveTooltipCallback = delegate(string str, object data) { str = str.Replace("{StressModification}", GameUtil.GetFormattedPercent(Db.Get().effects.Get("WarmAir").SelfModifiers[0].Value, GameUtil.TimeSlice.PerCycle)); float dtu_s = ((ExternalTemperatureMonitor.Instance)data).temperatureTransferer.average_kilowatts_exchanged.GetWeightedAverage * 1000f; str = str.Replace("{currentTransferWattage}", GameUtil.GetFormattedHeatEnergyRate(dtu_s, GameUtil.HeatEnergyFormatterUnit.Automatic)); AttributeInstance attributeInstance2 = ((ExternalTemperatureMonitor.Instance)data).attributes.Get("ThermalConductivityBarrier"); string text = "<b>" + attributeInstance2.GetFormattedValue() + "</b>"; for (int i = 0; i != attributeInstance2.Modifiers.Count; i++) { AttributeModifier attributeModifier = attributeInstance2.Modifiers[i]; text += "\n"; string text2 = text; text = text2 + " • " + attributeModifier.GetDescription() + " <b>" + attributeModifier.GetFormattedString(attributeInstance2.gameObject) + "</b>"; } str = str.Replace("{conductivityBarrier}", text); return(str); }; BodyRegulatingHeating = CreateStatusItem("BodyRegulatingHeating", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2); BodyRegulatingHeating.resolveStringCallback = delegate(string str, object data) { WarmBlooded.StatesInstance statesInstance = (WarmBlooded.StatesInstance)data; return(str.Replace("{TempDelta}", GameUtil.GetFormattedTemperature(statesInstance.TemperatureDelta, GameUtil.TimeSlice.PerSecond, GameUtil.TemperatureInterpretation.Relative, true, false))); }; BodyRegulatingCooling = CreateStatusItem("BodyRegulatingCooling", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2); BodyRegulatingCooling.resolveStringCallback = BodyRegulatingHeating.resolveStringCallback; EntombedChore = CreateStatusItem("EntombedChore", "DUPLICANTS", "status_item_entombed", StatusItem.IconType.Custom, NotificationType.DuplicantThreatening, false, OverlayModes.None.ID, true, 2); EntombedChore.AddNotification(null, null, null, 0f); EarlyMorning = CreateStatusItem("EarlyMorning", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2); NightTime = CreateStatusItem("NightTime", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2); PoorDecor = CreateStatusItem("PoorDecor", "DUPLICANTS", string.Empty, StatusItem.IconType.Exclamation, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2); PoorQualityOfLife = CreateStatusItem("PoorQualityOfLife", "DUPLICANTS", string.Empty, StatusItem.IconType.Exclamation, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2); PoorFoodQuality = CreateStatusItem("PoorFoodQuality", DUPLICANTS.STATUSITEMS.POOR_FOOD_QUALITY.NAME, DUPLICANTS.STATUSITEMS.POOR_FOOD_QUALITY.TOOLTIP, string.Empty, StatusItem.IconType.Exclamation, NotificationType.Neutral, false, OverlayModes.None.ID, 2); GoodFoodQuality = CreateStatusItem("GoodFoodQuality", DUPLICANTS.STATUSITEMS.GOOD_FOOD_QUALITY.NAME, DUPLICANTS.STATUSITEMS.GOOD_FOOD_QUALITY.TOOLTIP, string.Empty, StatusItem.IconType.Exclamation, NotificationType.Neutral, false, OverlayModes.None.ID, 2); Arting = CreateStatusItem("Arting", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2); Arting.resolveStringCallback = resolveStringCallback; SevereWounds = CreateStatusItem("SevereWounds", "DUPLICANTS", "status_item_broken", StatusItem.IconType.Custom, NotificationType.Bad, false, OverlayModes.None.ID, true, 2); SevereWounds.AddNotification(null, null, null, 0f); Incapacitated = CreateStatusItem("Incapacitated", "DUPLICANTS", "status_item_broken", StatusItem.IconType.Custom, NotificationType.DuplicantThreatening, false, OverlayModes.None.ID, true, 2); Incapacitated.AddNotification(null, null, null, 0f); Incapacitated.resolveStringCallback = delegate(string str, object data) { IncapacitationMonitor.Instance instance = (IncapacitationMonitor.Instance)data; float bleedLifeTime = instance.GetBleedLifeTime(instance); str = str.Replace("{CauseOfIncapacitation}", instance.GetCauseOfIncapacitation().Name); return(str.Replace("{TimeUntilDeath}", GameUtil.GetFormattedTime(bleedLifeTime))); }; Relocating = CreateStatusItem("Relocating", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2); Relocating.resolveStringCallback = resolveStringCallback; Fighting = CreateStatusItem("Fighting", "DUPLICANTS", string.Empty, StatusItem.IconType.Exclamation, NotificationType.Bad, false, OverlayModes.None.ID, true, 2); Fighting.AddNotification(null, null, null, 0f); Fleeing = CreateStatusItem("Fleeing", "DUPLICANTS", string.Empty, StatusItem.IconType.Exclamation, NotificationType.Bad, false, OverlayModes.None.ID, true, 2); Fleeing.AddNotification(null, null, null, 0f); Stressed = CreateStatusItem("Stressed", "DUPLICANTS", string.Empty, StatusItem.IconType.Exclamation, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2); Stressed.AddNotification(null, null, null, 0f); LashingOut = CreateStatusItem("LashingOut", "DUPLICANTS", string.Empty, StatusItem.IconType.Exclamation, NotificationType.Bad, false, OverlayModes.None.ID, true, 2); LashingOut.AddNotification(null, null, null, 0f); LowImmunity = CreateStatusItem("LowImmunity", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.BadMinor, false, OverlayModes.None.ID, true, 2); LowImmunity.AddNotification(null, null, null, 0f); Studying = CreateStatusItem("Studying", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, false, OverlayModes.None.ID, true, 2); Socializing = CreateStatusItem("Socializing", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Good, false, OverlayModes.None.ID, true, 2); Dancing = CreateStatusItem("Dancing", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Good, false, OverlayModes.None.ID, true, 2); Gaming = CreateStatusItem("Gaming", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Good, false, OverlayModes.None.ID, true, 2); Mingling = CreateStatusItem("Mingling", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Good, false, OverlayModes.None.ID, true, 2); ContactWithGerms = CreateStatusItem("ContactWithGerms", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, true, OverlayModes.Disease.ID, true, 2); ContactWithGerms.resolveStringCallback = delegate(string str, object data) { GermExposureMonitor.ExposureStatusData exposureStatusData4 = (GermExposureMonitor.ExposureStatusData)data; string name2 = Db.Get().Sicknesses.Get(exposureStatusData4.exposure_type.sickness_id).Name; str = str.Replace("{Sickness}", name2); return(str); }; ContactWithGerms.statusItemClickCallback = delegate(object data) { GermExposureMonitor.ExposureStatusData exposureStatusData3 = (GermExposureMonitor.ExposureStatusData)data; Vector3 lastExposurePosition2 = exposureStatusData3.owner.GetLastExposurePosition(exposureStatusData3.exposure_type.germ_id); CameraController.Instance.CameraGoTo(lastExposurePosition2, 2f, true); if (OverlayScreen.Instance.mode == OverlayModes.None.ID) { OverlayScreen.Instance.ToggleOverlay(OverlayModes.Disease.ID, true); } }; ExposedToGerms = CreateStatusItem("ExposedToGerms", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Neutral, true, OverlayModes.Disease.ID, true, 2); ExposedToGerms.resolveStringCallback = delegate(string str, object data) { GermExposureMonitor.ExposureStatusData exposureStatusData2 = (GermExposureMonitor.ExposureStatusData)data; string name = Db.Get().Sicknesses.Get(exposureStatusData2.exposure_type.sickness_id).Name; AttributeInstance attributeInstance = Db.Get().Attributes.GermResistance.Lookup(exposureStatusData2.owner.gameObject); string lastDiseaseSource = exposureStatusData2.owner.GetLastDiseaseSource(exposureStatusData2.exposure_type.germ_id); GermExposureMonitor.Instance sMI = exposureStatusData2.owner.GetSMI <GermExposureMonitor.Instance>(); float num = (float)exposureStatusData2.exposure_type.base_resistance + GERM_EXPOSURE.EXPOSURE_TIER_RESISTANCE_BONUSES[0]; float totalValue = attributeInstance.GetTotalValue(); float resistanceToExposureType = sMI.GetResistanceToExposureType(exposureStatusData2.exposure_type, -1f); float contractionChance = GermExposureMonitor.GetContractionChance(resistanceToExposureType); float exposureTier = sMI.GetExposureTier(exposureStatusData2.exposure_type.germ_id); float num2 = GERM_EXPOSURE.EXPOSURE_TIER_RESISTANCE_BONUSES[(int)exposureTier - 1] - GERM_EXPOSURE.EXPOSURE_TIER_RESISTANCE_BONUSES[0]; str = str.Replace("{Severity}", DUPLICANTS.STATUSITEMS.EXPOSEDTOGERMS.EXPOSURE_TIERS[(int)exposureTier - 1]); str = str.Replace("{Sickness}", name); str = str.Replace("{Source}", lastDiseaseSource); str = str.Replace("{Base}", GameUtil.GetFormattedSimple(num, GameUtil.TimeSlice.None, null)); str = str.Replace("{Dupe}", GameUtil.GetFormattedSimple(totalValue, GameUtil.TimeSlice.None, null)); str = str.Replace("{Total}", GameUtil.GetFormattedSimple(resistanceToExposureType, GameUtil.TimeSlice.None, null)); str = str.Replace("{ExposureLevelBonus}", GameUtil.GetFormattedSimple(num2, GameUtil.TimeSlice.None, null)); str = str.Replace("{Chance}", GameUtil.GetFormattedPercent(contractionChance * 100f, GameUtil.TimeSlice.None)); return(str); }; ExposedToGerms.statusItemClickCallback = delegate(object data) { GermExposureMonitor.ExposureStatusData exposureStatusData = (GermExposureMonitor.ExposureStatusData)data; Vector3 lastExposurePosition = exposureStatusData.owner.GetLastExposurePosition(exposureStatusData.exposure_type.germ_id); CameraController.Instance.CameraGoTo(lastExposurePosition, 2f, true); if (OverlayScreen.Instance.mode == OverlayModes.None.ID) { OverlayScreen.Instance.ToggleOverlay(OverlayModes.Disease.ID, true); } }; LightWorkEfficiencyBonus = CreateStatusItem("LightWorkEfficiencyBonus", "DUPLICANTS", string.Empty, StatusItem.IconType.Info, NotificationType.Good, false, OverlayModes.None.ID, true, 2); }