Ejemplo n.º 1
0
        public override string GetProgress(bool complete)
        {
            float num = 0f;
            IUtilityNetworkMgr networkManager = Conduit.GetNetworkManager(ConduitType.Gas);

            foreach (UtilityNetwork network in networkManager.GetNetworks())
            {
                FlowUtilityNetwork flowUtilityNetwork = network as FlowUtilityNetwork;
                if (flowUtilityNetwork != null)
                {
                    foreach (FlowUtilityNetwork.IItem sink in flowUtilityNetwork.sinks)
                    {
                        Vent component = sink.GameObject.GetComponent <Vent>();
                        if ((Object)component != (Object)null)
                        {
                            num += component.GetVentedMass(element);
                        }
                    }
                }
            }
            return(string.Format(COLONY_ACHIEVEMENTS.MISC_REQUIREMENTS.STATUS.VENTED_MASS, GameUtil.GetFormattedMass((!complete) ? num : kilogramsToVent, GameUtil.TimeSlice.None, GameUtil.MetricMassFormat.Kilogram, true, "{0:0.#}"), GameUtil.GetFormattedMass(kilogramsToVent, GameUtil.TimeSlice.None, GameUtil.MetricMassFormat.Kilogram, true, "{0:0.#}")));
        }
Ejemplo n.º 2
0
        public override bool Success()
        {
            float num = 0f;
            IUtilityNetworkMgr networkManager = Conduit.GetNetworkManager(ConduitType.Gas);

            foreach (UtilityNetwork network in networkManager.GetNetworks())
            {
                FlowUtilityNetwork flowUtilityNetwork = network as FlowUtilityNetwork;
                if (flowUtilityNetwork != null)
                {
                    foreach (FlowUtilityNetwork.IItem sink in flowUtilityNetwork.sinks)
                    {
                        Vent component = sink.GameObject.GetComponent <Vent>();
                        if ((Object)component != (Object)null)
                        {
                            num += component.GetVentedMass(element);
                        }
                    }
                }
            }
            return(num >= kilogramsToVent);
        }
        public static List <string> VentXKGFormatter(ColonyAchievementStatus cas)
        {
            //This references a "GetVentedMass" function that doesn't show up in my version of the decompiled source.
            //Not sure if this is actually working!
            List <string> outStrings = new List <string>();

            VentXKG __instance = (VentXKG)cas.Requirements.Find(s => s is VentXKG);


            var priv = Traverse.Create(__instance);

            float toVent = (float)priv.Field("kilogramsToVent").GetValue();

            float num = 0.0f;

            foreach (UtilityNetwork network in (IEnumerable <UtilityNetwork>)Conduit.GetNetworkManager(ConduitType.Gas).GetNetworks())
            {
                if (network is FlowUtilityNetwork flowUtilityNetwork)
                {
                    foreach (FlowUtilityNetwork.IItem sink in flowUtilityNetwork.sinks)
                    {
                        Vent component = sink.GameObject.GetComponent <Vent>();
                        if ((UnityEngine.Object)component != (UnityEngine.Object)null)
                        {
                            num += component.GetVentedMass(SimHashes.Oxygen);
                        }
                    }
                }
            }

            string output = string.Format("Oxygen Vented: {0} / {1}", (double)num, (double)toVent);

            outStrings.Add(output);

            return(outStrings);
        }