private void changeSettings(DifficultySetting diff, bool initialSet)
        {
            if (diff == BioMassDifficulty)
            {
                return;
            }

            this.Log_DebugOnly("Change Difficulty FROM " + BioMassDifficulty.ToString() + " TO " + diff);
            ClassicSettings = false;
            EasySettings    = false;
            NormalSettings  = false;
            HardSettings    = false;

            BioMassDifficulty = diff;

            switch (BioMassDifficulty)
            {
            case DifficultySetting.Classic:
                ClassicSettings = true;
                thePath         = IOUtils.GetFilePathFor(this.GetType(), "Classic.txt");
                this.Log(thePath);
                theDirectoryPath = System.IO.Path.GetDirectoryName(thePath);
                System.IO.File.Copy(thePath, System.IO.Path.Combine(theDirectoryPath, "BioMassDifficulty_MM.cfg"), true);
                break;

            case DifficultySetting.Easy:
                EasySettings = true;
                thePath      = IOUtils.GetFilePathFor(this.GetType(), "Easy.txt");
                this.Log(thePath);
                theDirectoryPath = System.IO.Path.GetDirectoryName(thePath);
                System.IO.File.Copy(thePath, System.IO.Path.Combine(theDirectoryPath, "BioMassDifficulty_MM.cfg"), true);
                break;

            case DifficultySetting.Normal:
                NormalSettings = true;
                thePath        = IOUtils.GetFilePathFor(this.GetType(), "Moderate.txt");
                this.Log(thePath);
                theDirectoryPath = System.IO.Path.GetDirectoryName(thePath);
                System.IO.File.Copy(thePath, System.IO.Path.Combine(theDirectoryPath, "BioMassDifficulty_MM.cfg"), true);
                break;

            case DifficultySetting.Hard:
                HardSettings = true;
                thePath      = IOUtils.GetFilePathFor(this.GetType(), "Hard.txt");
                this.Log(thePath);
                theDirectoryPath = System.IO.Path.GetDirectoryName(thePath);
                System.IO.File.Copy(thePath, System.IO.Path.Combine(theDirectoryPath, "BioMassDifficulty_MM.cfg"), true);
                break;

            default:
                break;
            }

            if (!initialSet)
            {
                globalSettings.setDifficultySettings(BioMassDifficulty);
            }
        }
Exemplo n.º 2
0
 private void LoadFromNode(ConfigNode node)
 {
     if (node.HasNode(configNodeName))
     {
         ConfigNode settingsNode = node.GetNode(configNodeName);
         DifficultyBioMass = Utilities.GetValue(settingsNode, "DifficultySettings", DifficultyBioMass);
         this.LogWarning("Difficulty read " + DifficultyBioMass.ToString());
     }
 }
Exemplo n.º 3
0
 private void LoadFromNode(ConfigNode node)
 {
     if (node.HasNode(configNodeName))
     {
         ConfigNode settingsNode = node.GetNode(configNodeName);
         DifficultyBioMass = Utilities.GetValue(settingsNode, "DifficultySettings",DifficultyBioMass);
         this.LogWarning("Difficulty read "+DifficultyBioMass.ToString());
     }
 }
Exemplo n.º 4
0
        private void LoadFromNode(ConfigNode node)
        {
            if (node.HasNode(configNodeName))
            {
                ConfigNode settingsNode = node.GetNode(configNodeName);

                MaxDeltaTime = Utilities.GetValue(settingsNode, "MaxDeltaTime", MaxDeltaTime);
                ElectricityMaxDeltaTime = Utilities.GetValue(settingsNode, "ElectricityMaxDeltaTime", ElectricityMaxDeltaTime);

                Food = Utilities.GetValue(settingsNode, "FoodResource", Food);
                Water = Utilities.GetValue(settingsNode, "WaterRes4600urce", Water);
                Oxygen = Utilities.GetValue(settingsNode, "OxygenResource", Oxygen);
                CO2 = Utilities.GetValue(settingsNode, "CarbonDioxideResource", CO2);
                Waste = Utilities.GetValue(settingsNode, "WasteResource", Waste);
                WasteWater = Utilities.GetValue(settingsNode, "WasteWaterResource", WasteWater);

                Seeds = Utilities.GetValue(settingsNode, "SeedsResource", Seeds);
                BioMass = Utilities.GetValue(settingsNode, "BioMassResource", BioMass);
                Light = Utilities.GetValue(settingsNode, "LightResource", Light);
                BioCake = Utilities.GetValue(settingsNode, "BioCakeResource", BioCake);
                CompressedCO2 = Utilities.GetValue(settingsNode, "CompressedCO2Resource", CompressedCO2);
                Hydrogen = Utilities.GetValue(settingsNode, "HydrogenResource", Hydrogen);

                WasteWaterConsumptionRate = Utilities.GetValue(settingsNode, "WasteWaterConsumptionRate", WasteWaterConsumptionRate) / MaxDeltaTime;
                WaterConsumptionRate = Utilities.GetValue(settingsNode, "WaterConsumptionRate", WaterConsumptionRate) / MaxDeltaTime;
                OxygenConsumptionRate = Utilities.GetValue(settingsNode, "OxygenConsumptionRate", OxygenConsumptionRate) / MaxDeltaTime;
                CO2ConsumptionRate = Utilities.GetValue(settingsNode, "CO2ConsumptionRate", CO2ConsumptionRate) / MaxDeltaTime;

                CO2ProductionRate = Utilities.GetValue(settingsNode, "CO2ProductionRate", CO2ProductionRate) / MaxDeltaTime;
                OxygenProductionRate = Utilities.GetValue(settingsNode, "OxygenProductionRate", OxygenProductionRate) / MaxDeltaTime;
                WaterProductionRate = Utilities.GetValue(settingsNode, "WaterProductionRate", WaterProductionRate) / MaxDeltaTime;
                DifficultyBioMass = Utilities.GetValue(settingsNode, "DifficultySettings",DifficultyBioMass);
                this.LogWarning("Difficulty read "+DifficultyBioMass.ToString());
            }
        }