Пример #1
0
        private KolonizationConfig LoadKolonizationConfig()
        {
            var kolonyNodes   = GameDatabase.Instance.GetConfigNodes("KOLONIZATION_SETTINGS");
            var finalSettings = new KolonizationConfig
            {
                OrbitMultiplier      = 0.1f,
                EfficiencyMultiplier = 0f,
                MinBaseBonus         = 0.1f,
                StartingBaseBonus    = 1f,
                ScienceMultiplier    = 0.000005f,
                RepMultiplier        = 0.00001f,
                FundsMultiplier      = 0.025f,
                PointsPerStar        = 0f
            };

            foreach (var node in kolonyNodes)
            {
                var settings = ResourceUtilities.LoadNodeProperties <KolonizationConfig>(node);
                finalSettings.OrbitMultiplier      = Math.Min(settings.OrbitMultiplier, finalSettings.OrbitMultiplier);
                finalSettings.EfficiencyMultiplier = Math.Max(settings.EfficiencyMultiplier, finalSettings.EfficiencyMultiplier);
                finalSettings.MinBaseBonus         = Math.Min(settings.MinBaseBonus, finalSettings.MinBaseBonus);
                finalSettings.StartingBaseBonus    = Math.Min(settings.StartingBaseBonus, finalSettings.StartingBaseBonus);
                finalSettings.ScienceMultiplier    = Math.Min(settings.ScienceMultiplier, finalSettings.ScienceMultiplier);
                finalSettings.RepMultiplier        = Math.Min(settings.RepMultiplier, finalSettings.RepMultiplier);
                finalSettings.FundsMultiplier      = Math.Min(settings.FundsMultiplier, finalSettings.FundsMultiplier);
                finalSettings.PointsPerStar        = Math.Max(settings.PointsPerStar, finalSettings.PointsPerStar);
            }
            return(finalSettings);
        }
Пример #2
0
        private Configuration GetConfiguration()
        {
            var configNodes                = GameDatabase.Instance.GetConfigNodes("WOLF_CONFIGURATION");
            var allowedResources           = new List <string>();
            var blacklistedResources       = new List <string>();
            var assembledResourcesFilter   = new List <string>();
            var lifeSupportResourcesFilter = new List <string>();
            var refinedResourcesFilter     = new List <string>();

            foreach (var node in configNodes)
            {
                var configFromFile       = ResourceUtilities.LoadNodeProperties <ConfigurationFromFile>(node);
                var harvestableResources = Configuration.ParseHarvestableResources(configFromFile.AllowedHarvestableResources);
                var blacklist            = Configuration.ParseHarvestableResources(configFromFile.BlacklistedHomeworldResources);
                var assembledResources   = Configuration.ParseHarvestableResources(configFromFile.AssembledResourcesFilter);
                var lifeSupportResources = Configuration.ParseHarvestableResources(configFromFile.LifeSupportResourcesFilter);
                var refinedResources     = Configuration.ParseHarvestableResources(configFromFile.RefinedResourcesFilter);

                allowedResources.AddRange(harvestableResources);
                blacklistedResources.AddRange(blacklist);
                assembledResourcesFilter.AddRange(assembledResources);
                lifeSupportResourcesFilter.AddRange(lifeSupportResources);
                refinedResourcesFilter.AddRange(refinedResources);
            }

            var config = new Configuration();

            config.SetHarvestableResources(allowedResources);
            config.SetBlacklistedHomeworldResources(blacklistedResources);
            config.SetAssembledResourcesFilter(assembledResourcesFilter);
            config.SetLifeSupportResourcesFilter(lifeSupportResourcesFilter);
            config.SetRefinedResourcesFilter(refinedResourcesFilter);

            return(config);
        }
Пример #3
0
    private LifeSupportConfig LoadLifeSupportConfig()
    {
        var lsNode   = GameDatabase.Instance.GetConfigNodes("LIFE_SUPPORT_SETTINGS").FirstOrDefault();
        var settings = ResourceUtilities.LoadNodeProperties <LifeSupportConfig>(lsNode);

        return(settings);
    }
        public static List <KolonizationEntry> ImportStatusNodeList(ConfigNode[] nodes)
        {
            var nList = new List <KolonizationEntry>();

            foreach (ConfigNode node in nodes)
            {
                var res = ResourceUtilities.LoadNodeProperties <KolonizationEntry>(node);
                nList.Add(res);
            }
            return(nList);
        }
Пример #5
0
        public static List <VesselSupplyStatus> ImportVesselNodeList(ConfigNode[] nodes)
        {
            var nList = new List <VesselSupplyStatus>();

            foreach (ConfigNode node in nodes)
            {
                var res = ResourceUtilities.LoadNodeProperties <VesselSupplyStatus>(node);
                nList.Add(res);
            }
            return(nList);
        }
        private List <KonstructionModuleResource> LoadModuleResources()
        {
            var configNodes = GameDatabase.Instance.GetConfigNodes("KONSTRUCTION_MODULE_COST");
            var nodeList    = new List <KonstructionModuleResource>();

            foreach (var n in configNodes)
            {
                var node = ResourceUtilities.LoadNodeProperties <KonstructionModuleResource>(n);
                nodeList.Add(node);
            }
            return(nodeList);
        }
Пример #7
0
        private void LoadAutoConverters()
        {
            var converterNodes = GameDatabase.Instance.GetConfigNodes("AUTOCONVERTER_SETTINGS");

            _autoCon = new List <AutoConverterConfig>();

            foreach (var node in converterNodes)
            {
                var con = ResourceUtilities.LoadNodeProperties <AutoConverterConfig>(node);
                _autoCon.Add(con);
            }
        }
Пример #8
0
        public static List <VesselSupplyStatus> ImportVesselNodeList(ConfigNode[] nodes)
        {
            var nList = new List <VesselSupplyStatus>();
            var count = nodes.Length;

            for (int i = 0; i < count; ++i)
            {
                var node = nodes[i];
                var res  = ResourceUtilities.LoadNodeProperties <VesselSupplyStatus>(node);
                nList.Add(res);
            }
            return(nList);
        }
        public static List <KonstructionModuleResource> ImportModuleNodeList(ConfigNode[] nodes)
        {
            var nList = new List <KonstructionModuleResource>();
            var count = nodes.Length;

            for (int i = 0; i < count; ++i)
            {
                var node = nodes[i];
                var res  = ResourceUtilities.LoadNodeProperties <KonstructionModuleResource>(node);
                nList.Add(res);
            }
            return(nList);
        }
Пример #10
0
        private LifeSupportConfig LoadLifeSupportConfig()
        {
            var lsNodes       = GameDatabase.Instance.GetConfigNodes("LIFE_SUPPORT_SETTINGS");
            var finalSettings = new LifeSupportConfig
            {
                HabMultiplier         = int.MaxValue,
                BaseHabTime           = double.MaxValue,
                ECAmount              = 0f,
                EVAEffect             = 0,
                EVAEffectVets         = 0,
                EVATime               = float.MaxValue,
                HomeWorldAltitude     = int.MaxValue,
                NoHomeEffect          = 0,
                NoHomeEffectVets      = 0,
                NoSupplyEffect        = 0,
                NoSupplyEffectVets    = 0,
                SupplyTime            = float.MaxValue,
                SupplyAmount          = 0f,
                WasteAmount           = 0f,
                ReplacementPartAmount = 0f,
                EnableRecyclers       = false,
                HabRange              = 2000
            };

            foreach (var lsNode in lsNodes)
            {
                var settings = ResourceUtilities.LoadNodeProperties <LifeSupportConfig>(lsNode);
                finalSettings.HabMultiplier         = Math.Min(settings.HabMultiplier, finalSettings.HabMultiplier);
                finalSettings.BaseHabTime           = Math.Min(settings.BaseHabTime, finalSettings.BaseHabTime);
                finalSettings.ECAmount              = Math.Max(settings.ECAmount, finalSettings.ECAmount);
                finalSettings.HomeWorldAltitude     = Math.Min(settings.HomeWorldAltitude, finalSettings.HomeWorldAltitude);
                finalSettings.NoHomeEffect          = Math.Max(settings.NoHomeEffect, finalSettings.NoHomeEffect);
                finalSettings.NoHomeEffectVets      = Math.Max(settings.NoHomeEffectVets, finalSettings.NoHomeEffectVets);
                finalSettings.NoSupplyEffect        = Math.Max(settings.NoSupplyEffect, finalSettings.NoSupplyEffect);
                finalSettings.NoSupplyEffectVets    = Math.Max(settings.NoSupplyEffectVets, finalSettings.NoSupplyEffectVets);
                finalSettings.SupplyTime            = Math.Min(settings.SupplyTime, finalSettings.SupplyTime);
                finalSettings.EVATime               = Math.Min(settings.EVATime, finalSettings.EVATime);
                finalSettings.SupplyAmount          = Math.Max(settings.SupplyAmount, finalSettings.SupplyAmount);
                finalSettings.WasteAmount           = Math.Max(settings.WasteAmount, finalSettings.WasteAmount);
                finalSettings.ReplacementPartAmount = Math.Max(settings.ReplacementPartAmount, finalSettings.ReplacementPartAmount);
                finalSettings.EVAEffect             = Math.Max(settings.EVAEffect, finalSettings.EVAEffect);
                finalSettings.EVAEffectVets         = Math.Max(settings.EVAEffectVets, finalSettings.EVAEffectVets);
                finalSettings.VetNames             += settings.VetNames + ",";
                finalSettings.HabRange              = Math.Min(settings.HabRange, finalSettings.HabRange);
                if (settings.EnableRecyclers)
                {
                    finalSettings.EnableRecyclers = true;
                }
            }
            return(finalSettings);
        }
        private KonstructionConfig LoadKonstructionConfig()
        {
            var kNodes        = GameDatabase.Instance.GetConfigNodes("KONSTRUCTION_SETTINGS");
            var finalSettings = new KonstructionConfig
            {
                massResourceName = "MaterialKits",
                massMultiplier   = 2,
                costResourceName = "SpecializedParts"
            };

            foreach (var node in kNodes)
            {
                var settings = ResourceUtilities.LoadNodeProperties <KonstructionConfig>(node);
                finalSettings.massResourceName = settings.massResourceName;
                finalSettings.massMultiplier   = settings.massMultiplier;
                finalSettings.costResourceName = settings.costResourceName;
            }
            return(finalSettings);
        }
Пример #12
0
        private LogisticsConfig LoadConfig()
        {
            var lsNodes       = GameDatabase.Instance.GetConfigNodes("LOGISTICS_SETTINGS");
            var finalSettings = new LogisticsConfig
            {
                ScavangeRange    = 150,
                LogisticsTime    = 5,
                WarehouseTime    = 10,
                MaintenanceRange = 150
            };

            foreach (var lsNode in lsNodes)
            {
                var settings = ResourceUtilities.LoadNodeProperties <LogisticsConfig>(lsNode);
                finalSettings.WarehouseTime    = Math.Max(settings.WarehouseTime, finalSettings.WarehouseTime);
                finalSettings.LogisticsTime    = Math.Max(settings.LogisticsTime, finalSettings.LogisticsTime);
                finalSettings.ScavangeRange    = Math.Max(settings.ScavangeRange, finalSettings.ScavangeRange);
                finalSettings.MaintenanceRange = Math.Max(settings.MaintenanceRange, finalSettings.MaintenanceRange);
            }
            return(finalSettings);
        }
        public void Start()
        {
            try
            {
                if (makeInactive)
                {
                    return;
                }
                if (!hasRun)
                {
                    hasRun = true;
                    if (AssemblyLoader.loadedAssemblies.ToList().Exists(lA => lA.dllName == "AmbientLightAdjustment"))
                    {
                        var txt = "Disabling TrackingStationAmbientlight, since AmbientLightAdjustment is installed";
                        print(txt);
                        ScreenMessages.PostScreenMessage(txt, 5, ScreenMessageStyle.UPPER_RIGHT);
                        makeInactive = true;
                        return;
                    }
                    var cfg = GameDatabase.Instance.GetConfigNodes("TRACKING_STATION_AMBIENTLIGHT_CONFIG").FirstOrDefault();
                    if (cfg != null)
                    {
                        color = ResourceUtilities.LoadNodeProperties <TsaConfig>(cfg);
                    }
                }

                if (color != null && color.active)
                {
                    RenderSettings.ambientLight = new Color(color.red / 256f, color.green / 256f, color.blue / 256f);
                }
            }
            catch (System.Exception x)
            {
                print("Exception in TrackingStationAmbientlight: " + x.ToString());
            }
        }
Пример #14
0
        private LifeSupportConfig LoadLifeSupportConfig()
        {
            var lsNodes       = GameDatabase.Instance.GetConfigNodes("LIFE_SUPPORT_SETTINGS");
            var finalSettings = new LifeSupportConfig
            {
                HabMultiplier         = int.MaxValue,
                BaseHabTime           = double.MaxValue,
                ECAmount              = 0f,
                EVAEffect             = 0,
                EVAEffectVets         = 0,
                EVATime               = float.MaxValue,
                HomeWorldAltitude     = int.MaxValue,
                NoHomeEffect          = 0,
                NoHomeEffectVets      = 0,
                NoSupplyEffect        = 0,
                NoSupplyEffectVets    = 0,
                SupplyTime            = float.MaxValue,
                ECTime                = float.MaxValue,
                NoECEffectVets        = 0,
                NoECEffect            = 0,
                SupplyAmount          = 0f,
                WasteAmount           = 0f,
                ReplacementPartAmount = 0f,
                EnableRecyclers       = false,
                ScoutHabTime          = 9180000,
                PermaHabTime          = 459000000,
                HabRange              = 2000,
                VetNames              = ""
            };

            var count = lsNodes.Length;

            for (int i = 0; i < count; ++i)
            {
                var lsNode   = lsNodes[i];
                var settings = ResourceUtilities.LoadNodeProperties <LifeSupportConfig>(lsNode);
                finalSettings.HabMultiplier      = Math.Min(settings.HabMultiplier, finalSettings.HabMultiplier);
                finalSettings.BaseHabTime        = Math.Min(settings.BaseHabTime, finalSettings.BaseHabTime);
                finalSettings.HomeWorldAltitude  = Math.Min(settings.HomeWorldAltitude, finalSettings.HomeWorldAltitude);
                finalSettings.NoHomeEffect       = Math.Max(settings.NoHomeEffect, finalSettings.NoHomeEffect);
                finalSettings.NoHomeEffectVets   = Math.Max(settings.NoHomeEffectVets, finalSettings.NoHomeEffectVets);
                finalSettings.NoSupplyEffect     = Math.Max(settings.NoSupplyEffect, finalSettings.NoSupplyEffect);
                finalSettings.NoSupplyEffectVets = Math.Max(settings.NoSupplyEffectVets, finalSettings.NoSupplyEffectVets);

                if (settings.ECTime > ResourceUtilities.FLOAT_TOLERANCE)
                {
                    finalSettings.ECTime = Math.Min(settings.ECTime, finalSettings.ECTime);
                }
                if (settings.EVATime > ResourceUtilities.FLOAT_TOLERANCE)
                {
                    finalSettings.EVATime = Math.Min(settings.EVATime, finalSettings.EVATime);
                }
                if (settings.SupplyTime > ResourceUtilities.FLOAT_TOLERANCE)
                {
                    finalSettings.SupplyTime = Math.Min(settings.SupplyTime, finalSettings.SupplyTime);
                }
                if (settings.ScoutHabTime > 1000d)
                {
                    finalSettings.ScoutHabTime = Math.Min(settings.ScoutHabTime, finalSettings.ScoutHabTime);
                }
                if (settings.PermaHabTime > 1000d)
                {
                    finalSettings.PermaHabTime = Math.Min(settings.PermaHabTime, finalSettings.PermaHabTime);
                }

                finalSettings.SupplyAmount          = Math.Max(settings.SupplyAmount, finalSettings.SupplyAmount);
                finalSettings.ECAmount              = Math.Max(settings.ECAmount, finalSettings.ECAmount);
                finalSettings.NoECEffect            = Math.Max(settings.NoECEffect, finalSettings.NoECEffect);
                finalSettings.NoECEffectVets        = Math.Max(settings.NoECEffectVets, finalSettings.NoECEffectVets);
                finalSettings.WasteAmount           = Math.Max(settings.WasteAmount, finalSettings.WasteAmount);
                finalSettings.ReplacementPartAmount = Math.Max(settings.ReplacementPartAmount, finalSettings.ReplacementPartAmount);
                finalSettings.EVAEffect             = Math.Max(settings.EVAEffect, finalSettings.EVAEffect);
                finalSettings.EVAEffectVets         = Math.Max(settings.EVAEffectVets, finalSettings.EVAEffectVets);
                finalSettings.VetNames             += settings.VetNames + ",";
                finalSettings.HabRange              = Math.Min(settings.HabRange, finalSettings.HabRange);
                if (settings.EnableRecyclers)
                {
                    finalSettings.EnableRecyclers = true;
                }
            }
            return(finalSettings);
        }
Пример #15
0
        public LifeSupportConfig ImportConfig(ConfigNode node)
        {
            var config = ResourceUtilities.LoadNodeProperties <LifeSupportConfig>(node);

            return(config);
        }
        public KonstructionConfig ImportConfig(ConfigNode node)
        {
            var config = ResourceUtilities.LoadNodeProperties <KonstructionConfig>(node);

            return(config);
        }