private static void AddBuildingAndEffects()
        {
            Utils.AddBuildingToPlanScreen("Furniture", CarouselCentrifugeConfig.ID, EspressoMachineConfig.ID);
            string requiredTech = DlcManager.IsExpansion1Active() ? "SpaceProgram" : "ArtificialFriends";

            Utils.AddBuildingToTechnology(requiredTech, CarouselCentrifugeConfig.ID);

            moraleModifier = new AttributeModifier(
                attribute_id: "QualityOfLife",
                value: CarouselCentrifugeOptions.Instance.MoraleBonus,
                description: STRINGS.DUPLICANTS.MODIFIERS.RIDEONCAROUSEL.NAME,
                is_multiplier: false,
                uiOnly: false,
                is_readonly: false
                );

            specificEffect = new Effect(
                id: CarouselCentrifugeWorkable.specificEffectName,
                name: STRINGS.DUPLICANTS.MODIFIERS.RIDEONCAROUSEL.NAME,
                description: STRINGS.DUPLICANTS.MODIFIERS.RIDEONCAROUSEL.TOOLTIP,
                duration: (CarouselCentrifugeOptions.Instance.SpecificEffectDuration - 0.05f) * Constants.SECONDS_PER_CYCLE,
                show_in_ui: false,
                trigger_floating_text: true,
                is_bad: false
                );
            specificEffect.Add(moraleModifier);

            trackingEffect = new Effect(
                id: CarouselCentrifugeWorkable.trackingEffectName,
                name: "",
                description: "",
                duration: CarouselCentrifugeOptions.Instance.TrackingEffectDuration * Constants.SECONDS_PER_CYCLE,
                show_in_ui: false,
                trigger_floating_text: false,
                is_bad: false
                );

            Db.Get().effects.Add(specificEffect);
            Db.Get().effects.Add(trackingEffect);
        }
Esempio n. 2
0
        /// <summary>
        /// Applied before RefreshMinions runs.
        /// </summary>
        internal static bool Prefix(MeterScreen __instance)
        {
            int living         = Components.LiveMinionIdentities.Count;
            int identities     = __instance.GetWorldMinionIdentities().Count;
            var currentMinions = __instance.currentMinions;
            var tt             = __instance.MinionsTooltip;

            if (identities != __instance.cachedMinionCount && currentMinions != null && tt !=
                null)
            {
                string         ttText;
                WorldContainer activeWorld;
                __instance.cachedMinionCount = identities;
                string alive = living.ToString();
                if (DlcManager.FeatureClusterSpaceEnabled() && (activeWorld = ClusterManager.
                                                                              Instance.activeWorld) != null && activeWorld.TryGetComponent(
                        out ClusterGridEntity world))
                {
                    var    text = CACHED_BUILDER;
                    string ids  = identities.ToString();
                    text.Clear().Append(STRINGS.UI.TOOLTIPS.METERSCREEN_POPULATION_CLUSTER);
                    ttText = text.Replace("{0}", world.Name).Replace("{1}", ids).Replace(
                        "{2}", alive).ToString();
                    text.Clear().Append(ids).Append('/').Append(alive);
                    currentMinions.SetText(text);
                }
                else
                {
                    ttText = STRINGS.UI.TOOLTIPS.METERSCREEN_POPULATION.Format(alive);
                    currentMinions.SetText(alive);
                }
                tt.ClearMultiStringTooltip();
                tt.AddMultiStringTooltip(ttText, __instance.ToolTipStyle_Header);
            }
            return(false);
        }
 public static void OnLoad()
 {
     GVD.VersionAlert(DlcManager.IsExpansion1Active());
     Debug.Log("ResearchRequirements: Loaded DLC version of the mod. Last update: 16.03.2021 for 455509 build.");
     Debug.Log("ResearchRequirements: Loaded from: " + Assembly.GetExecutingAssembly().Location);
 }
Esempio n. 4
0
 internal static bool Prepare()
 {
     return(!string.IsNullOrEmpty(DlcManager.GetActiveDlcId()));
 }
Esempio n. 5
0
 private static bool Prepare()
 {
     return(DlcManager.IsExpansion1Active() && ReBuildableAETNOptions.Instance.SpaceOutPOIChance.Enabled);
 }
Esempio n. 6
0
 private static bool Prepare()
 {
     return(DlcManager.IsExpansion1Active());
 }
Esempio n. 7
0
        public static CarePackageContainer[] GetPackages()
        {
            if (!DlcManager.IsExpansion1Installed())
            {
                List <CarePackageContainer> result = new List <CarePackageContainer>
                {
                    new CarePackageContainer("Niobium", 5f),
                    new CarePackageContainer("Isoresin", 35f),
                    new CarePackageContainer("Fullerene", 1f),
                    new CarePackageContainer("Katairite", 1000f),
                    new CarePackageContainer("Diamond", 500f),
                    new CarePackageContainer(GeneShufflerRechargeConfig.ID, 1f),

                    new CarePackageContainer("SandStone", 1000f),
                    new CarePackageContainer("Dirt", 500f),
                    new CarePackageContainer("Algae", 500f),
                    new CarePackageContainer("OxyRock", 100f),
                    new CarePackageContainer("Water", 2000f),
                    new CarePackageContainer("Sand", 3000f),
                    new CarePackageContainer("Carbon", 3000f),
                    new CarePackageContainer("Fertilizer", 3000f),
                    new CarePackageContainer("Ice", 4000f),
                    new CarePackageContainer("Brine", 2000f),
                    new CarePackageContainer("SaltWater", 2000f),
                    new CarePackageContainer("Rust", 1000f),
                    new CarePackageContainer("Cuprite", 2000f),
                    new CarePackageContainer("GoldAmalgam", 2000f),
                    new CarePackageContainer("Copper", 400f),
                    new CarePackageContainer("Iron", 400f),
                    new CarePackageContainer("Lime", 150f),
                    new CarePackageContainer("Polypropylene", 500f),
                    new CarePackageContainer("Glass", 200f),
                    new CarePackageContainer("Steel", 100f),
                    new CarePackageContainer("Ethanol", 100f),
                    new CarePackageContainer("AluminumOre", 100f),
                    new CarePackageContainer("PrickleGrassSeed", 3f),
                    new CarePackageContainer("LeafyPlantSeed", 3f),
                    new CarePackageContainer("CactusPlantSeed", 3f),
                    new CarePackageContainer("MushroomSeed", 1f),
                    new CarePackageContainer("PrickleFlowerSeed", 2f),
                    new CarePackageContainer("OxyfernSeed", 1f),
                    new CarePackageContainer("ForestTreeSeed", 1f),
                    new CarePackageContainer(BasicFabricMaterialPlantConfig.SEED_ID, 3f),
                    new CarePackageContainer("SwampLilySeed", 1f),
                    new CarePackageContainer("ColdBreatherSeed", 1f),
                    new CarePackageContainer("SpiceVineSeed", 1f),
                    new CarePackageContainer("FieldRation", 5f),
                    new CarePackageContainer("BasicForagePlant", 6f),
                    new CarePackageContainer("CookedEgg", 3f),
                    new CarePackageContainer(PrickleFruitConfig.ID, 3f),
                    new CarePackageContainer("FriedMushroom", 3f),
                    new CarePackageContainer("CookedMeat", 3f),
                    new CarePackageContainer("SpicyTofu", 3f),
                    new CarePackageContainer("LightBugBaby", 1f),
                    new CarePackageContainer("HatchBaby", 1f),
                    new CarePackageContainer("PuftBaby", 1f),
                    new CarePackageContainer("SquirrelBaby", 1f),
                    new CarePackageContainer("CrabBaby", 1f),
                    new CarePackageContainer("DreckoBaby", 1f),
                    new CarePackageContainer("Pacu", 8f),
                    new CarePackageContainer("MoleBaby", 1f),
                    new CarePackageContainer("OilfloaterBaby", 1f),
                    new CarePackageContainer("LightBugEgg", 3f),
                    new CarePackageContainer("HatchEgg", 3f),
                    new CarePackageContainer("PuftEgg", 3f),
                    new CarePackageContainer("OilfloaterEgg", 3f),
                    new CarePackageContainer("MoleEgg", 3f),
                    new CarePackageContainer("DreckoEgg", 3f),
                    new CarePackageContainer("SquirrelEgg", 2f),
                    new CarePackageContainer("BasicCure", 3f),
                    new CarePackageContainer("Funky_Vest", 1f),
                };

                return(result.ToArray());
            }
            else
            {
                List <CarePackageContainer> result = new List <CarePackageContainer>
                {
                    new CarePackageContainer("Niobium", 5f),
                    new CarePackageContainer("Isoresin", 35f),
                    new CarePackageContainer("Fullerene", 1f),
                    new CarePackageContainer("Katairite", 1000f),
                    new CarePackageContainer("Diamond", 500f),
                    new CarePackageContainer(GeneShufflerRechargeConfig.ID, 1f),

                    new CarePackageContainer("SandStone", 1000f),
                    new CarePackageContainer("Dirt", 500f),
                    new CarePackageContainer("Algae", 500f),
                    new CarePackageContainer("OxyRock", 100f),
                    new CarePackageContainer("Water", 2000f),
                    new CarePackageContainer("Sand", 3000f),
                    new CarePackageContainer("Carbon", 3000f),
                    new CarePackageContainer("Fertilizer", 3000f),
                    new CarePackageContainer("Ice", 4000f),
                    new CarePackageContainer("Brine", 2000f),
                    new CarePackageContainer("SaltWater", 2000f),
                    new CarePackageContainer("Rust", 1000f),
                    new CarePackageContainer("Cuprite", 2000f),
                    new CarePackageContainer("GoldAmalgam", 2000f),
                    new CarePackageContainer("Copper", 400f),
                    new CarePackageContainer("Iron", 400f),
                    new CarePackageContainer("Lime", 150f),
                    new CarePackageContainer("Polypropylene", 500f),
                    new CarePackageContainer("Glass", 200f),
                    new CarePackageContainer("Steel", 100f),
                    new CarePackageContainer("Ethanol", 100f),
                    new CarePackageContainer("AluminumOre", 100f),
                    new CarePackageContainer("PrickleGrassSeed", 3f),
                    new CarePackageContainer("LeafyPlantSeed", 3f),
                    new CarePackageContainer("CactusPlantSeed", 3f),
                    new CarePackageContainer("MushroomSeed", 3f),
                    new CarePackageContainer("PrickleFlowerSeed", 3f),
                    new CarePackageContainer("OxyfernSeed", 1f),
                    new CarePackageContainer("ForestTreeSeed", 1f),
                    new CarePackageContainer(BasicFabricMaterialPlantConfig.SEED_ID, 3f),
                    new CarePackageContainer("SwampLilySeed", 1f),
                    new CarePackageContainer("ColdBreatherSeed", 1f),
                    new CarePackageContainer("SpiceVineSeed", 1f),
                    new CarePackageContainer("FieldRation", 5f),
                    new CarePackageContainer("BasicForagePlant", 6f),
                    new CarePackageContainer("ForestForagePlant", 2f),
                    new CarePackageContainer("SwampForagePlant", 2f),
                    new CarePackageContainer("CookedEgg", 3f),
                    new CarePackageContainer(PrickleFruitConfig.ID, 3f),
                    new CarePackageContainer("FriedMushroom", 3f),
                    new CarePackageContainer("CookedMeat", 3f),
                    new CarePackageContainer("SpicyTofu", 3f),
                    new CarePackageContainer("WormSuperFood", 2f),
                    new CarePackageContainer("LightBugBaby", 1f),
                    new CarePackageContainer("HatchBaby", 1f),
                    new CarePackageContainer("PuftBaby", 1f),
                    new CarePackageContainer("SquirrelBaby", 1f),
                    new CarePackageContainer("CrabBaby", 1f),
                    new CarePackageContainer("DreckoBaby", 1f),
                    new CarePackageContainer("Pacu", 8f),
                    new CarePackageContainer("MoleBaby", 1f),
                    new CarePackageContainer("OilfloaterBaby", 1f),
                    new CarePackageContainer("DivergentBeetleBaby", 1f),
                    new CarePackageContainer("StaterpillarBaby", 1f),
                    new CarePackageContainer("LightBugEgg", 3f),
                    new CarePackageContainer("HatchEgg", 3f),
                    new CarePackageContainer("PuftEgg", 3f),
                    new CarePackageContainer("OilfloaterEgg", 3f),
                    new CarePackageContainer("MoleEgg", 3f),
                    new CarePackageContainer("DreckoEgg", 3f),
                    new CarePackageContainer("SquirrelEgg", 2f),
                    new CarePackageContainer("DivergentBeetleEgg", 2f),
                    new CarePackageContainer("StaterpillarEgg", 2f),
                    new CarePackageContainer("BasicCure", 3f),
                    new CarePackageContainer("Funky_Vest", 1f),
                };

                return(result.ToArray());
            }
        }
Esempio n. 8
0
        public override void ConfigureBuildingTemplate(GameObject go, Tag prefab_tag)
        {
            go.AddOrGet <DropAllWorkable>();
            go.AddOrGet <BuildingComplete>().isManuallyOperated = true;
            go.AddOrGet <FabricatorIngredientStatusManager>();
            go.AddOrGet <CopyBuildingSettings>();

            var lcfr = go.AddOrGet <LiquidCooledFueledRefinery>();

            lcfr.duplicantOperated = true;
            lcfr.sideScreenStyle   = ComplexFabricatorSideScreen.StyleSetting.ListQueueHybrid;
            lcfr.keepExcessLiquids = true;
            BuildingTemplates.CreateComplexFabricatorStorage(go, lcfr);
            lcfr.coolantTag            = COOLANT_TAG;
            lcfr.minCoolantMass        = COOLANT_MASS;
            lcfr.maxCoolantMass        = COOLANT_MASS * 3;
            lcfr.outStorage.capacityKg = 2000f;
            lcfr.thermalFudge          = LIQUID_COOLED_HEAT_PORTION;
            lcfr.fuelTag = FUEL_TAG;
            lcfr.inStorage.SetDefaultStoredItemModifiers(RefineryStoredItemModifiers);
            lcfr.buildStorage.SetDefaultStoredItemModifiers(RefineryStoredItemModifiers);
            lcfr.outStorage.SetDefaultStoredItemModifiers(RefineryStoredItemModifiers);
            lcfr.outputOffset      = new Vector3(0.8f, 0.5f);
            lcfr.outputTemperature = OUTPUT_TEMPERATURE;
            lcfr.heatedTemperature = OUTPUT_TEMPERATURE;
            // выставляем выходную температуру. ради одного рецепта
            if (DlcManager.IsExpansion1Active())
            {
                lcfr.heatedTemperature = ElementLoader.FindElementByHash(SimHashes.Resin).highTemp;
            }

            var manualDeliveryKG = go.AddOrGet <ManualDeliveryKG>();

            manualDeliveryKG.SetStorage(lcfr.outStorage);
            manualDeliveryKG.requestedItemTag       = FUEL_TAG;
            manualDeliveryKG.capacity               = FUEL_STORE_CAPACITY;
            manualDeliveryKG.refillMass             = FUEL_STORE_CAPACITY / 2;
            manualDeliveryKG.choreTypeIDHash        = Db.Get().ChoreTypes.MachineFetch.IdHash;
            manualDeliveryKG.operationalRequirement = FetchOrder2.OperationalRequirement.Functional;

            var workable = go.AddOrGet <SmelterWorkable>();

            workable.overrideAnims = new KAnimFile[] { Assets.GetAnim("anim_interacts_smelter_kanim") };
            workable.AnimOffset    = Vector3.left;

            ConduitConsumer conduitConsumer = go.AddOrGet <ConduitConsumer>();

            conduitConsumer.capacityTag          = GameTags.Liquid;
            conduitConsumer.capacityKG           = COOLANT_MASS * 2;
            conduitConsumer.storage              = lcfr.inStorage;
            conduitConsumer.alwaysConsume        = true;
            conduitConsumer.forceAlwaysSatisfied = true;

            var elementConverter = go.AddOrGet <ElementConverter>();

            elementConverter.consumedElements = new ElementConverter.ConsumedElement[]
            {
                new ElementConverter.ConsumedElement(FUEL_TAG, FUEL_CONSUME_RATE)
            };
            elementConverter.outputElements = new ElementConverter.OutputElement[]
            {
                new ElementConverter.OutputElement(CO2_EMIT_RATE, SimHashes.CarbonDioxide, CO2_OUTPUT_TEMPERATURE, false, false, 1f, 2f)
            };

            var smelterWorkableEmpty = go.AddOrGet <SmelterWorkableEmpty>();

            smelterWorkableEmpty.workTime  = BUILDINGS.WORK_TIME_SECONDS.SHORT_WORK_TIME;
            smelterWorkableEmpty.workLayer = Grid.SceneLayer.BuildingFront;

            Prioritizable.AddRef(go);
        }
Esempio n. 9
0
        public void Sim1000ms(float dt)
        {
            int have = 0;

            // Count artifacts discovered
            foreach (var pair in ArtifactConfig.artifactItems)
            {
                foreach (string name in pair.Value)
                {
                    if (DiscoveredResources.Instance.IsDiscovered(Assets.GetPrefab(name).
                                                                  PrefabID()))
                    {
                        have++;
                    }
                }
            }
            ArtifactsObtained = have;
            foreach (var duplicant in Components.LiveMinionIdentities.Items)
            {
                if (duplicant != null)
                {
                    float minValue = float.MaxValue;
                    // Find the worst attribute on this Duplicant for JoaT
                    foreach (var attribute in VarietyAttributes)
                    {
                        float attrValue = attribute.Lookup(duplicant)?.GetTotalValue() ?? 0.0f;
                        if (attrValue < minValue)
                        {
                            minValue = attrValue;
                        }
                    }
                    // If this Duplicant is better than previous jester, update it
                    if (minValue >= BestVarietyValue)
                    {
                        BestVarietyValue = minValue;
                    }
                }
            }
            // For each value requested, update the value if needed
            var keys = ListPool <string, AchievementStateComponent> .Allocate();

            keys.Clear();
            keys.AddRange(BestAttributeValue.Keys);
            foreach (var attribute in keys)
            {
                // Check each duplicant for the best value
                float best = 0.0f;
                var   attr = Db.Get().Attributes.Get(attribute);
                foreach (var duplicant in Components.LiveMinionIdentities.Items)
                {
                    if (duplicant != null)
                    {
                        best = Math.Max(best, attr.Lookup(duplicant).GetTotalValue());
                    }
                }
                BestAttributeValue[attribute] = best;
            }
            keys.Recycle();
            // Mark visited worlds for DLC
            if (DlcManager.IsExpansion1Active())
            {
                foreach (var world in ClusterManager.Instance.WorldContainers)
                {
                    if (world.IsDupeVisited)
                    {
                        PlanetsVisited.Add(world.id);
                    }
                }
            }
        }
Esempio n. 10
0
        protected override void OnSpawn()
        {
            var inst = Game.Instance;

            base.OnSpawn();
            if (BuildingsBuilt == 0)
            {
                // Not yet initialized, fill with number of completed buildings
                BuildingsBuilt = Components.BuildingCompletes.Count;
            }
            if (PlanetsVisited == null)
            {
                PlanetsVisited = new HashSet <int>();
            }
            if (TriggerEvents == null)
            {
                TriggerEvents = new Dictionary <string, bool>(64);
            }
            if (BestAttributeValue == null)
            {
                BestAttributeValue = new Dictionary <string, float>(64);
            }
            if (LastDeath <= 0)
            {
                InitGrimReaper();
            }
            var dbAttr = Db.Get().Attributes;

            VarietyAttributes = new Klei.AI.Attribute[] { dbAttr.Art, dbAttr.Athletics,
                                                          dbAttr.Botanist, dbAttr.Caring, dbAttr.Construction, dbAttr.Cooking,
                                                          dbAttr.Digging, dbAttr.Learning, dbAttr.Machinery, dbAttr.Ranching,
                                                          dbAttr.Strength };
            // Neutronium discovered?
            var neutronium = ElementLoader.FindElementByHash(SimHashes.Unobtanium);

            if (neutronium != null && DiscoveredResources.Instance.IsDiscovered(neutronium.tag))
            {
                Trigger(AchievementStrings.ISEEWHATYOUDIDTHERE.ID);
            }
            if (DlcManager.IsExpansion1Active())
            {
                // DLC STARMAP
                PlanetsRequired = ClusterManager.Instance.worldCount;
            }
            else
            {
                // VANILLA STARMAP
                var dest = SpacecraftManager.instance?.destinations;
                if (dest != null)
                {
                    int count = 0;
                    // Exclude unreachable destinations (earth) but include temporal tear
                    foreach (var destination in dest)
                    {
                        if (destination.GetDestinationType()?.visitable == true)
                        {
                            count++;
                        }
                    }
                    if (count > 0)
                    {
                        PlanetsRequired = count;
                    }
                }
            }
            if (inst != null)
            {
                inst.Subscribe((int)GameHashes.NewBuilding, OnBuildingCompleted);
                inst.Subscribe(DigNTiles.DigComplete, OnDigCompleted);
            }
        }
Esempio n. 11
0
 public static void OnLoad()
 {
     GVD.VersionAlert(DlcManager.IsExpansion1Active(), "OnLoad() version check");
     Debug.Log("RoomsExpanded: Loaded Vanilla version of the mod. Last update: 2021.03.12 for build 449549.");
     Debug.Log("RoomsExpanded: Loaded from: " + Assembly.GetExecutingAssembly().Location);
 }
            internal LastSelectionDetails(GameObject go)
            {
                string tempUnits = GameUtil.GetTemperatureUnitSuffix();

                if (go.TryGetComponent(out BuildingComplete bc))
                {
                    building = bc;
                }
                else
                {
                    go.TryGetComponent(out building);
                }
                buildingComplete   = bc;
                creationTimeCached = null;
                go.TryGetComponent(out operational);
                // Use primary element by default, but allow CellSelectionObject to stand in
                if (go.TryGetComponent(out PrimaryElement pe))
                {
                    element = pe.Element;
                    cso     = null;
                }
                else if (go.TryGetComponent(out cso))
                {
                    element = cso.element;
                }
                else
                {
                    element = null;
                }
                primaryElement = pe;
                // Why these in particular? Clay please
                showUptime = go.TryGetComponent(out LogicPorts _) || go.TryGetComponent(
                    out EnergyConsumer _) || go.TryGetComponent(out Battery _);
                target       = go;
                uptimeCached = null;
                if (element != null)
                {
                    string name = element.name;
                    elementName = new InfoLine(ELEMENTAL.PRIMARYELEMENT.NAME.Format(name),
                                               ELEMENTAL.PRIMARYELEMENT.TOOLTIP.Format(name));
                    insulator = GetTCText(element, building, tempUnits,
                                          out thermalConductivity);
                    GetSHCText(element, tempUnits, out specificHeat);
                    if (DlcManager.FeatureRadiationEnabled())
                    {
                        int cell = Grid.PosToCell(go.transform.position);
                        radiationAbsorption = GameUtil.GetFormattedPercent(GameUtil.
                                                                           GetRadiationAbsorptionPercentage(cell) * 100.0f);
                    }
                    else
                    {
                        radiationAbsorption = null;
                    }
                    PopulatePhase(element, out boil, out freeze, out overheat);
                }
                else
                {
                    boil                = default;
                    elementName         = default;
                    freeze              = default;
                    overheat            = default;
                    insulator           = false;
                    radiationAbsorption = null;
                    specificHeat        = default;
                    thermalConductivity = default;
                }
            }
Esempio n. 13
0
 private static bool Prepare() => DlcManager.IsExpansion1Active();
 public static void OnLoad()
 {
     GVD.VersionAlert(DlcManager.IsExpansion1Active(), "OnLoad() version check");
     Debug.Log("RoomsExpanded: Loaded DLC version of the mod. Last update: 2021.03.07");
 }
Esempio n. 15
0
 public DlcManagerProxy(IDlcManager manager)
 {
     Manager = manager as DlcManager;
 }
Esempio n. 16
0
        public static bool Prefix(MinionStartingStats __instance, bool is_starter_minion, List <ChoreGroup> disabled_chore_groups, string guaranteedAptitudeID = null)
        {
            DUPLICANTSTATS.MAX_TRAITS = 10;

            int           statDelta      = 0;
            List <string> selectedTraits = new List <string>();

            System.Random randSeed = new System.Random();

            Trait trait = Db.Get().traits.Get(__instance.personality.stresstrait);

            __instance.stressTrait = trait;

            if (Always3Interests.Settings.disableStressTrait)
            {
                __instance.stressTrait = Db.Get().traits.Get("None");
            }

            // set joy trait if it is not disable
            Trait joytrait = Db.Get().traits.Get(__instance.personality.joyTrait);

            __instance.joyTrait = joytrait;
            if (Always3Interests.Settings.disableJoyTrait)
            {
                __instance.joyTrait = Db.Get().traits.Get("None");
            }

            Trait trait2 = Db.Get().traits.Get(__instance.personality.congenitaltrait);

            if (trait2.Name == "None")
            {
                __instance.stickerType = __instance.personality.stickerType;
            }
            Trait trait3 = Db.Get().traits.Get(__instance.personality.congenitaltrait);

            if (trait3.Name == "None")
            {
                __instance.congenitaltrait = null;
            }
            else
            {
                __instance.congenitaltrait = trait3;
            }
            Func <List <DUPLICANTSTATS.TraitVal>, bool, bool> func = delegate(List <DUPLICANTSTATS.TraitVal> traitPossibilities, bool positiveTrait)
            {
                if (__instance.Traits.Count > DUPLICANTSTATS.MAX_TRAITS)
                {
                    return(false);
                }
                Mathf.Abs(Util.GaussianRandom(0f, 1f));
                int num6 = traitPossibilities.Count;
                int num7;
                if (!positiveTrait)
                {
                    if (DUPLICANTSTATS.rarityDeckActive.Count < 1)
                    {
                        DUPLICANTSTATS.rarityDeckActive.AddRange(DUPLICANTSTATS.RARITY_DECK);
                    }
                    if (DUPLICANTSTATS.rarityDeckActive.Count == DUPLICANTSTATS.RARITY_DECK.Count)
                    {
                        DUPLICANTSTATS.rarityDeckActive.ShuffleSeeded(new KRandom());
                    }
                    num7 = DUPLICANTSTATS.rarityDeckActive[DUPLICANTSTATS.rarityDeckActive.Count - 1];
                    DUPLICANTSTATS.rarityDeckActive.RemoveAt(DUPLICANTSTATS.rarityDeckActive.Count - 1);
                }
                else
                {
                    List <int> list = new List <int>();
                    if (is_starter_minion)
                    {
                        list.Add(__instance.rarityBalance - 1);
                        list.Add(__instance.rarityBalance);
                        list.Add(__instance.rarityBalance);
                        list.Add(__instance.rarityBalance + 1);
                    }
                    else
                    {
                        list.Add(__instance.rarityBalance - 2);
                        list.Add(__instance.rarityBalance - 1);
                        list.Add(__instance.rarityBalance);
                        list.Add(__instance.rarityBalance + 1);
                        list.Add(__instance.rarityBalance + 2);
                    }
                    list.ShuffleSeeded(new KRandom());
                    num7 = list[0];
                    num7 = Mathf.Max(DUPLICANTSTATS.RARITY_COMMON, num7);
                    num7 = Mathf.Min(DUPLICANTSTATS.RARITY_LEGENDARY, num7);
                }
                List <DUPLICANTSTATS.TraitVal> list2 = new List <DUPLICANTSTATS.TraitVal>(traitPossibilities);
                for (int i = list2.Count - 1; i > -1; i--)
                {
                    if (list2[i].rarity != num7)
                    {
                        list2.RemoveAt(i);
                        num6--;
                    }
                }
                list2.ShuffleSeeded(new KRandom());
                foreach (DUPLICANTSTATS.TraitVal traitVal in list2)
                {
                    if (!DlcManager.IsContentActive(traitVal.dlcId))
                    {
                        num6--;
                    }
                    else if (selectedTraits.Contains(traitVal.id))
                    {
                        num6--;
                    }
                    else
                    {
                        Trait trait4 = Db.Get().traits.TryGet(traitVal.id);
                        if (trait4 == null)
                        {
                            global::Debug.LogWarning("Trying to add nonexistent trait: " + traitVal.id);
                            num6--;
                        }
                        else if (is_starter_minion && !trait4.ValidStarterTrait)
                        {
                            num6--;
                        }
                        else if ((bool)Traverse.Create(__instance).Method("AreTraitAndAptitudesExclusive", new object[] { traitVal, __instance.skillAptitudes }).GetValue())
                        {
                            num6--;
                        }
                        else if (is_starter_minion && guaranteedAptitudeID != null &&
                                 (bool)Traverse.Create(__instance).Method("AreTraitAndArchetypeExclusive", new object[] { traitVal, guaranteedAptitudeID }).GetValue())
                        {
                            num6--;
                        }
                        else
                        {
                            if (!(bool)Traverse.Create(__instance).Method("AreTraitsMutuallyExclusive", new object[] { traitVal, selectedTraits }).GetValue())
                            {
                                selectedTraits.Add(traitVal.id);
                                statDelta += traitVal.statBonus;
                                __instance.rarityBalance += (positiveTrait ? (-traitVal.rarity) : traitVal.rarity);
                                __instance.Traits.Add(trait4);
                                if (trait4.disabledChoreGroups != null)
                                {
                                    for (int j = 0; j < trait4.disabledChoreGroups.Length; j++)
                                    {
                                        disabled_chore_groups.Add(trait4.disabledChoreGroups[j]);
                                    }
                                }
                                return(true);
                            }
                            num6--;
                        }
                    }
                }
                return(false);
            };


            int numberOfGoodTraits = Always3Interests.Settings.numberOfGoodTraits;
            int numberOfBadTraits  = Always3Interests.Settings.numberOfBadTraits;

            if (numberOfGoodTraits > 5)
            {
                numberOfGoodTraits = 5;
            }
            if (numberOfBadTraits > 5)
            {
                numberOfBadTraits = 5;
            }

            for (int i = 0; i < numberOfBadTraits; i++)
            {
                bool isTraitAdded = false;
                while (!isTraitAdded)
                {
                    isTraitAdded = func(DUPLICANTSTATS.BADTRAITS, false);
                }
            }
            for (int i = 0; i < numberOfGoodTraits; i++)
            {
                bool isTraitAdded = false;
                while (!isTraitAdded)
                {
                    isTraitAdded = func(DUPLICANTSTATS.GOODTRAITS, true);
                }
            }

            return(false);
        }
Esempio n. 17
0
        /// <summary>
        /// Initializes the achievement list, after the Db has been initialized.
        /// </summary>
        internal static void InitAchievements()
        {
            var db = Db.Get();
            var dietRequirements = new ColonyAchievementRequirement[] {
                new EatXCaloriesOfFood(AS.ABALANCEDDIET.KCAL, FieldRationConfig.ID),
                new EatXCaloriesOfFood(AS.ABALANCEDDIET.KCAL, MushBarConfig.ID),
                new EatXCaloriesOfFood(AS.ABALANCEDDIET.KCAL, FriedMushBarConfig.ID),
                new EatXCaloriesOfFood(AS.ABALANCEDDIET.KCAL, BasicPlantFoodConfig.ID),
                new EatXCaloriesOfFood(AS.ABALANCEDDIET.KCAL, BasicPlantBarConfig.ID),
                new EatXCaloriesOfFood(AS.ABALANCEDDIET.KCAL, PickledMealConfig.ID),
                new EatXCaloriesOfFood(AS.ABALANCEDDIET.KCAL, PrickleFruitConfig.ID),
                new EatXCaloriesOfFood(AS.ABALANCEDDIET.KCAL, GrilledPrickleFruitConfig.ID),
                new EatXCaloriesOfFood(AS.ABALANCEDDIET.KCAL, SalsaConfig.ID),
                new EatXCaloriesOfFood(AS.ABALANCEDDIET.KCAL, CookedEggConfig.ID),
                new EatXCaloriesOfFood(AS.ABALANCEDDIET.KCAL, MeatConfig.ID),
                new EatXCaloriesOfFood(AS.ABALANCEDDIET.KCAL, CookedMeatConfig.ID),
                new EatXCaloriesOfFood(AS.ABALANCEDDIET.KCAL, FishMeatConfig.ID),
                new EatXCaloriesOfFood(AS.ABALANCEDDIET.KCAL, CookedFishConfig.ID),
                new EatXCaloriesOfFood(AS.ABALANCEDDIET.KCAL, SurfAndTurfConfig.ID),
                new EatXCaloriesOfFood(AS.ABALANCEDDIET.KCAL, ColdWheatBreadConfig.ID),
                new EatXCaloriesOfFood(AS.ABALANCEDDIET.KCAL, SpiceBreadConfig.ID),
                new EatXCaloriesOfFood(AS.ABALANCEDDIET.KCAL, FruitCakeConfig.ID),
                new EatXCaloriesOfFood(AS.ABALANCEDDIET.KCAL, MushroomConfig.ID),
                new EatXCaloriesOfFood(AS.ABALANCEDDIET.KCAL, FriedMushroomConfig.ID),
                new EatXCaloriesOfFood(AS.ABALANCEDDIET.KCAL, MushroomWrapConfig.ID),
                new EatXCaloriesOfFood(AS.ABALANCEDDIET.KCAL, LettuceConfig.ID),
                new EatXCaloriesOfFood(AS.ABALANCEDDIET.KCAL, BurgerConfig.ID)
            };

            // If in DLC, require Grubfruit, Spindly Grubfruit, Roast Grubfruit Nut,
            // Grubfruit Preserve, and Mixed Berry Pie
            if (DlcManager.IsExpansion1Active())
            {
                var dlcDietRequirements = new ColonyAchievementRequirement[] {
                    new EatXCaloriesOfFood(AS.ABALANCEDDIET.KCAL, WormBasicFruitConfig.ID),
                    new EatXCaloriesOfFood(AS.ABALANCEDDIET.KCAL, WormBasicFoodConfig.ID),
                    new EatXCaloriesOfFood(AS.ABALANCEDDIET.KCAL, WormSuperFruitConfig.ID),
                    new EatXCaloriesOfFood(AS.ABALANCEDDIET.KCAL, WormSuperFoodConfig.ID),
                    new EatXCaloriesOfFood(AS.ABALANCEDDIET.KCAL, BerryPieConfig.ID),
                };
                int n1 = dietRequirements.Length, n2 = dlcDietRequirements.Length;
                var temp = new ColonyAchievementRequirement[n1 + n2];
                Array.Copy(dietRequirements, temp, n1);
                Array.Copy(dlcDietRequirements, 0, temp, n1, n2);
                dietRequirements = temp;
            }
            AllAchievements = new AD[] {
                new AD("EmpireBuilder", "build_2500", new BuildNBuildings(AS.EMPIREBUILDER.
                                                                          QUANTITY)),
                new AD("JohnHenry", "dig_10k", new DigNTiles(AS.JOHNHENRY.QUANTITY)),
                new AD("TestOfTime", "reach_cycle1000", new CycleNumber(AS.TESTOFTIME.CYCLE)),
                new AD("ThinkingAhead", "thinking_ahead", new UseGeneShufflerNTimes(AS.
                                                                                    THINKINGAHEAD.QUANTITY)),
                new AD("ChutesAndLadders", "firepole_travel", new TravelXUsingTransitTubes(
                           NavType.Pole, AS.CHUTESANDLADDERS.DISTANCE)),
                new AD("ImGonnaBe", "im_gonna_be", new TravelXUsingTransitTubes(NavType.Floor,
                                                                                AS.IMGONNABE.DISTANCE)),
                new AD("SmallWorld", "small_world", new NumberOfDupes(AS.SMALLWORLD.QUANTITY)),
                new AD("YouMonster", "youmonster", new KillNCritters(AS.YOUMONSTER.QUANTITY)),
                new AD("BelongsInAMuseum", "all_artifacts", new CollectNArtifacts(28)),
                new AD("WholeNewWorlds", "rocket", new VisitAllPlanets()),
                new AD(AS.FINALBREATH.ID, "final_breath", new TriggerEvent(AS.FINALBREATH.ID)),
                new AD(AS.SAVINGMEEP.ID, "saving_meep", new TriggerEvent(AS.SAVINGMEEP.ID)),
                new AD("PowerOverwhelming", "power_overwhelm", new OverloadWire(Wire.
                                                                                WattageRating.Max50000)),
                new AD("IsItHotInHere", "isithot", new HeatBuildingToXKelvin(AS.ISITHOTINHERE.
                                                                             TEMPERATURE)),
                new AD(AS.WATCHTHEWORLDBURN.ID, "burn_gravitas", new TriggerEvent(AS.
                                                                                  WATCHTHEWORLDBURN.ID)),
                new AD("SafeSpace", "safe_space", new NoDeathsForNCycles(AS.SAFESPACE.CYCLES),
                       new CycleNumber(AS.SAFESPACE.CYCLES)),
                new AD("CritterSinger", "Animal_friends",
                       CritterTypeRequirement(HatchConfig.ID, HatchHardConfig.ID,
                                              HatchMetalConfig.ID, HatchVeggieConfig.ID),
                       CritterTypeRequirement(PacuConfig.ID, PacuTropicalConfig.ID,
                                              PacuCleanerConfig.ID),
                       CritterTypeRequirement(LightBugConfig.ID, LightBugBlueConfig.ID,
                                              LightBugOrangeConfig.ID, LightBugPinkConfig.ID, LightBugPurpleConfig.ID,
                                              LightBugCrystalConfig.ID, LightBugBlackConfig.ID),
                       CritterTypeRequirement(PuftConfig.ID, PuftOxyliteConfig.ID,
                                              PuftBleachstoneConfig.ID, PuftAlphaConfig.ID),
                       CritterTypeRequirement(DreckoConfig.ID, DreckoPlasticConfig.ID),
                       CritterTypeRequirement(OilFloaterConfig.ID, OilFloaterDecorConfig.ID,
                                              OilFloaterHighTempConfig.ID),
                       CritterTypeRequirement(MoleConfig.ID),
                       CritterTypeRequirement(MooConfig.ID),
                       CritterTypeRequirement(CrabConfig.ID),
                       CritterTypeRequirement(SquirrelConfig.ID)),
                new AD("MasterOfDisaster", "master_of_disaster",
                       new DeathFromCause(db.Deaths.Overheating.Id),
                       new DeathFromCause(db.Deaths.Slain.Id),
                       new DeathFromCause(db.Deaths.Suffocation.Id),
                       new DeathFromCause(db.Deaths.Starvation.Id)),
                new AD("ABalancedDiet", "balanced_diet", dietRequirements),
                new AD("JackOfAllTrades", "well_rounded", new ReachXAllAttributes(AS.
                                                                                  JACKOFALLTRADES.LEVEL)),
                new AD("DestroyerOfWorlds", "dig_20", new ReachXAttributeValue(db.Attributes.
                                                                               Digging.Id, AS.DESTROYEROFWORLDS.LEVEL)),
                new AD("SmoothOperator", "operate_20", new ReachXAttributeValue(db.Attributes.
                                                                                Machinery.Id, AS.SMOOTHOPERATOR.LEVEL)),
                new AD("Olympian", "athletics_20", new ReachXAttributeValue(db.Attributes.Athletics.
                                                                            Id, AS.OLYMPIAN.LEVEL)),
                new AD("AdaLovelace", "science_20", new ReachXAttributeValue(db.Attributes.
                                                                             Learning.Id, AS.ADALOVELACE.LEVEL)),
                new AD("MasterChef", "cook_20", new ReachXAttributeValue(db.Attributes.
                                                                         Cooking.Id, AS.MASTERCHEF.LEVEL)),
                new AD("MasterBuilder", "build_20", new ReachXAttributeValue(db.Attributes.
                                                                             Construction.Id, AS.MASTERBUILDER.LEVEL)),
                new AD("MountainMover", "athletics_20", new ReachXAttributeValue(db.Attributes.
                                                                                 Strength.Id, AS.MOUNTAINMOVER.LEVEL)),
                new AD("Cowboy", "ranch_20", new ReachXAttributeValue(db.Attributes.
                                                                      Ranching.Id, AS.COWBOY.LEVEL)),
                new AD("MotherEarth", "farm_20", new ReachXAttributeValue(db.Attributes.
                                                                          Botanist.Id, AS.MOTHEREARTH.LEVEL)),
                new AD("Michelangelo", "art_20", new ReachXAttributeValue(db.Attributes.
                                                                          Art.Id, AS.MICHELANGELO.LEVEL)),
                new AD("FirstDoNoHarm", "care_20", new ReachXAttributeValue(db.Attributes.
                                                                            Caring.Id, AS.FIRSTDONOHARM.LEVEL)),
                new AD("TotallyEcstatic", "ecstatic", new ReachXMoraleValue(AS.TOTALLYECSTATIC.
                                                                            MORALE)),
                new AD(AS.HAVEIWONYET.ID, "reach_cycle4000", new CycleNumber(AS.HAVEIWONYET.
                                                                             CYCLE)),
                new AD(AS.ALLTHEDUPLICANTS.ID, "dupes_100", new NumberOfDupes(100)),
                new AD(AS.ISEEWHATYOUDIDTHERE.ID, "cheat", new TriggerEvent(AS.
                                                                            ISEEWHATYOUDIDTHERE.ID)),
            };
            // Meltable props, but unfortunately the IDs are not constants
            POI_PROPS.Add("PropDesk");
            POI_PROPS.Add("PropElevator");
            POI_PROPS.Add("PropFacilityChair");
            POI_PROPS.Add("PropFacilityChairFlip");
            POI_PROPS.Add("PropFacilityChandelier");
            POI_PROPS.Add("PropFacilityCouch");
            POI_PROPS.Add("PropFacilityDesk");
            POI_PROPS.Add("PropFacilityDisplay");
            POI_PROPS.Add("PropFacilityDisplay2");
            POI_PROPS.Add("PropFacilityDisplay3");
            POI_PROPS.Add("PropFacilityGlobeDroors");
            POI_PROPS.Add("PropFacilityHangingLight");
            POI_PROPS.Add("PropFacilityPainting");
            POI_PROPS.Add("PropFacilityStatue");
            POI_PROPS.Add("PropFacilityTable");
            POI_PROPS.Add("PropFacilityWallDegree");
            POI_PROPS.Add("PropGravitasCeilingRobot");
            POI_PROPS.Add("PropGravitasDecorativeWindow");
            POI_PROPS.Add("PropGravitasDisplay4");
            POI_PROPS.Add("PropGravitasFloorRobot");
            POI_PROPS.Add("PropGravitasHandScanner");
            POI_PROPS.Add("PropGravitasJar1");
            POI_PROPS.Add("PropGravitasJar2");
            POI_PROPS.Add("PropGravitasLabTable");
            POI_PROPS.Add("PropGravitasLabWindow");
            POI_PROPS.Add("PropGravitasLabWindowHorizontal");
            POI_PROPS.Add("PropGravitasRobitcTable");
            POI_PROPS.Add("PropGravitasShelf");
            POI_PROPS.Add("PropLight");
            POI_PROPS.Add("PropReceptionDesk");
            POI_PROPS.Add("PropSkeleton");
            POI_PROPS.Add("PropSurfaceSatellite1");
            POI_PROPS.Add("PropSurfaceSatellite2");
            POI_PROPS.Add("PropSurfaceSatellite3");
            POI_PROPS.Add("PropTable");
            POI_PROPS.Add("PropTallPlant");
        }
Esempio n. 18
0
        internal static void ConfigureRecipes()
        {
            const float INPUT_KG = 100f;

            // добавляем переплавку абиссалития в электроплавильню
            if (SmelterOptions.Instance.RecipeKatairiteToTungsten)
            {
                const float PHOSPHORUS             = 10f;
                const float SALT                   = 20f;
                const float TUNGSTEN               = INPUT_KG - PHOSPHORUS - SALT;
                const float SALT_TO_CHLORINE_RATIO = 1f / 3f;
                const float CHLORINEGAS            = SALT * SALT_TO_CHLORINE_RATIO;
                const float MAGMA                  = INPUT_KG - TUNGSTEN - CHLORINEGAS;

                var ingredients = new ComplexRecipe.RecipeElement[]
                {
                    new ComplexRecipe.RecipeElement(SimHashes.Katairite.CreateTag(), TUNGSTEN),
                    new ComplexRecipe.RecipeElement(SimHashes.Salt.CreateTag(), SALT),
                    new ComplexRecipe.RecipeElement(SimHashes.Phosphorus.CreateTag(), PHOSPHORUS)
                };
                var results = new ComplexRecipe.RecipeElement[]
                {
                    new ComplexRecipe.RecipeElement(SimHashes.Tungsten.CreateTag(), TUNGSTEN),
                    new ComplexRecipe.RecipeElement(SimHashes.IgneousRock.CreateTag(), MAGMA),
                    new ComplexRecipe.RecipeElement(SimHashes.ChlorineGas.CreateTag(), CHLORINEGAS)
                };
                string obsolete_id = ComplexRecipeManager.MakeObsoleteRecipeID(MetalRefineryConfig.ID, SimHashes.Katairite.CreateTag());
                string id          = ComplexRecipeManager.MakeRecipeID(MetalRefineryConfig.ID, ingredients, results);
                new ComplexRecipe(id, ingredients, results)
                {
                    time        = BUILDINGS.FABRICATION_TIME_SECONDS.MODERATE,
                    description = string.Format(
                        global::STRINGS.BUILDINGS.PREFABS.METALREFINERY.RECIPE_DESCRIPTION,
                        ElementLoader.FindElementByHash(SimHashes.Tungsten).name,
                        ElementLoader.FindElementByHash(SimHashes.Katairite).name),
                    nameDisplay = ComplexRecipe.RecipeNameDisplay.IngredientToResult,
                    fabricators = new List <Tag> {
                        TagManager.Create(MetalRefineryConfig.ID)
                    }
                };
                ComplexRecipeManager.Get().AddObsoleteIDMapping(obsolete_id, id);
            }

            // добавляем переплавку фосфора в стеклоплавильню
            if (SmelterOptions.Instance.RecipePhosphoriteToPhosphorus)
            {
                var ingredients = new ComplexRecipe.RecipeElement[]
                {
                    new ComplexRecipe.RecipeElement(SimHashes.Phosphorite.CreateTag(), INPUT_KG)
                };
                var results = new ComplexRecipe.RecipeElement[]
                {
                    new ComplexRecipe.RecipeElement(SimHashes.LiquidPhosphorus.CreateTag(), INPUT_KG)
                };
                string obsolete_id = ComplexRecipeManager.MakeObsoleteRecipeID(GlassForgeConfig.ID, SimHashes.Phosphorite.CreateTag());
                string id          = ComplexRecipeManager.MakeRecipeID(GlassForgeConfig.ID, ingredients, results);
                new ComplexRecipe(id, ingredients, results)
                {
                    time        = BUILDINGS.FABRICATION_TIME_SECONDS.SHORT / 2,
                    description = string.Format(
                        global::STRINGS.BUILDINGS.PREFABS.GLASSFORGE.RECIPE_DESCRIPTION,
                        ElementLoader.FindElementByHash(SimHashes.LiquidPhosphorus).name,
                        ElementLoader.FindElementByHash(SimHashes.Phosphorite).name),
                    nameDisplay = ComplexRecipe.RecipeNameDisplay.Result,
                    fabricators = new List <Tag> {
                        TagManager.Create(GlassForgeConfig.ID)
                    }
                };
                ComplexRecipeManager.Get().AddObsoleteIDMapping(obsolete_id, id);
            }

            // добавляем копию рецептов из электроплавильни. кроме стали и наёбия
            var metalrefinery_recipes = ComplexRecipeManager.Get().recipes
                                        .Where((ComplexRecipe recipe) => recipe.fabricators.Contains(TagManager.Create(MetalRefineryConfig.ID)))
                                        .ToList();

            metalrefinery_recipes
            .DoIf(
                condition: (ComplexRecipe recipe) => !recipe.id.Contains(SimHashes.Steel.ToString()) &&
                !recipe.id.Contains(SimHashes.Niobium.ToString()),
                action: (ComplexRecipe recipe) => recipe.fabricators.Add(TagManager.Create(ID))
                );

            // добавляем сталь с увеличенным временем фабрикации
            const float fabricationTimeMultiplier = 1.3f;

            metalrefinery_recipes
            .Where((ComplexRecipe recipe) => recipe.id.Contains(SimHashes.Steel.ToString()))
            .ToList()
            .Do((ComplexRecipe recipe) =>
            {
                string obsolete_id = ComplexRecipeManager.MakeObsoleteRecipeID(ID, recipe.ingredients[0].material);
                string id          = ComplexRecipeManager.MakeRecipeID(ID, recipe.ingredients, recipe.results);
                new ComplexRecipe(id, recipe.ingredients, recipe.results)
                {
                    time        = recipe.time * fabricationTimeMultiplier,
                    description = recipe.description,
                    nameDisplay = recipe.nameDisplay,
                    fabricators = new List <Tag> {
                        TagManager.Create(ID)
                    }
                };
                ComplexRecipeManager.Get().AddObsoleteIDMapping(obsolete_id, id);
            });

            // добавляем копию рецептов из стеклоплавильни с увеличенным временем фабрикации
            var glassforge_recipes = ComplexRecipeManager.Get().recipes
                                     .Where((ComplexRecipe recipe) => recipe.fabricators.Contains(TagManager.Create(GlassForgeConfig.ID)))
                                     .ToList();

            glassforge_recipes
            .Do((ComplexRecipe recipe) =>
            {
                var results = new ComplexRecipe.RecipeElement[] {
                    new ComplexRecipe.RecipeElement(ElementLoader.GetElement(recipe.results[0].material).lowTempTransition.tag, recipe.results[0].amount)
                };
                string obsolete_id = ComplexRecipeManager.MakeObsoleteRecipeID(ID, recipe.ingredients[0].material);
                string id          = ComplexRecipeManager.MakeRecipeID(ID, recipe.ingredients, results);
                new ComplexRecipe(id, recipe.ingredients, results)
                {
                    time        = recipe.time * fabricationTimeMultiplier,
                    description = string.Format(global::STRINGS.BUILDINGS.PREFABS.GLASSFORGE.RECIPE_DESCRIPTION, ElementLoader.GetElement(results[0].material).name, ElementLoader.GetElement(recipe.ingredients[0].material).name),
                    nameDisplay = ComplexRecipe.RecipeNameDisplay.IngredientToResult,
                    fabricators = new List <Tag> {
                        TagManager.Create(ID)
                    }
                };
                ComplexRecipeManager.Get().AddObsoleteIDMapping(obsolete_id, id);
            });

            // добавляем переплавку пластика
            if (SmelterOptions.Instance.RecipePlasticToNaphtha)
            {
                var ingredients = new ComplexRecipe.RecipeElement[]
                {
                    new ComplexRecipe.RecipeElement(SimHashes.Polypropylene.CreateTag(), INPUT_KG)
                };
                var results = new ComplexRecipe.RecipeElement[]
                {
                    new ComplexRecipe.RecipeElement(SimHashes.Naphtha.CreateTag(), INPUT_KG)
                };
                string obsolete_id = ComplexRecipeManager.MakeObsoleteRecipeID(ID, SimHashes.Polypropylene.CreateTag());
                string id          = ComplexRecipeManager.MakeRecipeID(ID, ingredients, results);
                new ComplexRecipe(id, ingredients, results)
                {
                    time        = BUILDINGS.FABRICATION_TIME_SECONDS.SHORT,
                    description = string.Format(
                        global::STRINGS.BUILDINGS.PREFABS.GLASSFORGE.RECIPE_DESCRIPTION,
                        ElementLoader.FindElementByHash(SimHashes.Naphtha).name,
                        ElementLoader.FindElementByHash(SimHashes.Polypropylene).name),
                    nameDisplay = ComplexRecipe.RecipeNameDisplay.IngredientToResult,
                    fabricators = new List <Tag> {
                        TagManager.Create(ID)
                    }
                };
                ComplexRecipeManager.Get().AddObsoleteIDMapping(obsolete_id, id);
            }

            // добавляем варку резины
            if (DlcManager.IsExpansion1Active() && SmelterOptions.Instance.RecipeResinToIsoresin)
            {
                var resin    = ElementLoader.FindElementByHash(SimHashes.Resin);
                var water    = resin.highTempTransition.lowTempTransition;
                var isoresin = resin.highTempTransitionOreID;

                float input   = INPUT_KG * 2;
                float output1 = input * resin.highTempTransitionOreMassConversion;
                float output2 = input - output1;

                // жидкая резина
                // побочный продукт вода сохраняется внутри
                var ingredients = new ComplexRecipe.RecipeElement[]
                {
                    new ComplexRecipe.RecipeElement(resin.tag, input)
                };
                var results = new ComplexRecipe.RecipeElement[]
                {
                    new ComplexRecipe.RecipeElement(isoresin.CreateTag(), output1),
                    new ComplexRecipe.RecipeElement(water.tag, output2, ComplexRecipe.RecipeElement.TemperatureOperation.Heated, true),
                };
                string obsolete_id = ComplexRecipeManager.MakeObsoleteRecipeID(ID, resin.tag);
                string id          = ComplexRecipeManager.MakeRecipeID(ID, ingredients, results);
                new ComplexRecipe(id, ingredients, results)
                {
                    time        = BUILDINGS.FABRICATION_TIME_SECONDS.SHORT,
                    description = string.Format(
                        global::STRINGS.BUILDINGS.PREFABS.GLASSFORGE.RECIPE_DESCRIPTION,
                        ElementLoader.FindElementByHash(isoresin).name,
                        resin.name),
                    nameDisplay = ComplexRecipe.RecipeNameDisplay.IngredientToResult,
                    fabricators = new List <Tag> {
                        TagManager.Create(ID)
                    }
                };
                ComplexRecipeManager.Get().AddObsoleteIDMapping(obsolete_id, id);

                // и замерзшая резина
                var resin_solid  = resin.lowTempTransition;
                var ingredients2 = new ComplexRecipe.RecipeElement[]
                {
                    new ComplexRecipe.RecipeElement(resin_solid.tag, input)
                };
                string obsolete_id2 = ComplexRecipeManager.MakeObsoleteRecipeID(ID, resin_solid.tag);
                string id2          = ComplexRecipeManager.MakeRecipeID(ID, ingredients2, results);
                new ComplexRecipe(id2, ingredients2, results)
                {
                    time        = BUILDINGS.FABRICATION_TIME_SECONDS.SHORT,
                    description = string.Format(
                        global::STRINGS.BUILDINGS.PREFABS.GLASSFORGE.RECIPE_DESCRIPTION,
                        ElementLoader.FindElementByHash(isoresin).name,
                        resin_solid.name),
                    nameDisplay = ComplexRecipe.RecipeNameDisplay.IngredientToResult,
                    fabricators = new List <Tag> {
                        TagManager.Create(ID)
                    }
                };
                ComplexRecipeManager.Get().AddObsoleteIDMapping(obsolete_id2, id2);
            }

            // добавляем древесный уголь в печку
            if (SmelterOptions.Instance.RecipeWoodToCarbon)
            {
                const float WOOD   = 200f;
                const float CARBON = 100f;
                const float CO2    = 60f;

                var ingredients = new ComplexRecipe.RecipeElement[]
                {
                    new ComplexRecipe.RecipeElement(WoodLogConfig.TAG, WOOD)
                };
                var results = new ComplexRecipe.RecipeElement[]
                {
                    new ComplexRecipe.RecipeElement(SimHashes.RefinedCarbon.CreateTag(), CARBON),
                    new ComplexRecipe.RecipeElement(SimHashes.CarbonDioxide.CreateTag(), CO2)
                };
                string obsolete_id = ComplexRecipeManager.MakeObsoleteRecipeID(KilnConfig.ID, WoodLogConfig.TAG);
                string id          = ComplexRecipeManager.MakeRecipeID(KilnConfig.ID, ingredients, results);
                new ComplexRecipe(id, ingredients, results)
                {
                    time        = BUILDINGS.FABRICATION_TIME_SECONDS.SHORT,
                    description = string.Format(
                        global::STRINGS.BUILDINGS.PREFABS.EGGCRACKER.RECIPE_DESCRIPTION,
                        global::STRINGS.UI.FormatAsLink(global::STRINGS.ITEMS.INDUSTRIAL_PRODUCTS.WOOD.NAME, ForestTreeConfig.ID.ToUpperInvariant()),
                        ElementLoader.FindElementByHash(SimHashes.RefinedCarbon).name),
                    nameDisplay = ComplexRecipe.RecipeNameDisplay.IngredientToResult,
                    fabricators = new List <Tag> {
                        TagManager.Create(KilnConfig.ID)
                    }
                };
                ComplexRecipeManager.Get().AddObsoleteIDMapping(obsolete_id, id);
            }
        }