Exemplo n.º 1
0
        public static double ParseRolloutCostFormula(KCT_BuildListVessel vessel)
        {
            if (!KCT_PresetManager.Instance.ActivePreset.generalSettings.Enabled || !KCT_PresetManager.Instance.ActivePreset.generalSettings.ReconditioningTimes)
            {
                return(0);
            }

            double loadedMass, emptyMass, loadedCost, emptyCost;

            loadedCost = vessel.GetTotalCost();
            emptyCost  = vessel.emptyCost;
            loadedMass = vessel.GetTotalMass();
            emptyMass  = vessel.emptyMass;

            int EditorLevel = 0, LaunchSiteLvl = 0, EditorMax = 0, LaunchSiteMax = 0;
            int isVABVessel = 0;

            if (vessel.type == KCT_BuildListVessel.ListType.None)
            {
                vessel.FindTypeFromLists();
            }
            if (vessel.type == KCT_BuildListVessel.ListType.VAB)
            {
                EditorLevel   = KCT_Utilities.BuildingUpgradeLevel(SpaceCenterFacility.VehicleAssemblyBuilding);
                LaunchSiteLvl = KCT_GameStates.ActiveKSC.ActiveLPInstance.level;//KCT_Utilities.BuildingUpgradeLevel(SpaceCenterFacility.LaunchPad);
                EditorMax     = KCT_Utilities.BuildingUpgradeMaxLevel(SpaceCenterFacility.VehicleAssemblyBuilding);
                LaunchSiteMax = KCT_Utilities.BuildingUpgradeMaxLevel(SpaceCenterFacility.LaunchPad);
                isVABVessel   = 1;
            }
            else if (vessel.type == KCT_BuildListVessel.ListType.SPH)
            {
                EditorLevel   = KCT_Utilities.BuildingUpgradeLevel(SpaceCenterFacility.SpaceplaneHangar);
                LaunchSiteLvl = KCT_Utilities.BuildingUpgradeLevel(SpaceCenterFacility.Runway);
                EditorMax     = KCT_Utilities.BuildingUpgradeMaxLevel(SpaceCenterFacility.SpaceplaneHangar);
                LaunchSiteMax = KCT_Utilities.BuildingUpgradeMaxLevel(SpaceCenterFacility.Runway);
            }
            double BP = vessel.buildPoints;

            Dictionary <string, string> variables = new Dictionary <string, string>();

            variables.Add("M", loadedMass.ToString());
            variables.Add("m", emptyMass.ToString());
            variables.Add("C", loadedCost.ToString());
            variables.Add("c", emptyCost.ToString());
            variables.Add("VAB", isVABVessel.ToString());
            variables.Add("BP", BP.ToString());
            variables.Add("L", LaunchSiteLvl.ToString());
            variables.Add("LM", LaunchSiteMax.ToString());
            variables.Add("EL", EditorLevel.ToString());
            variables.Add("ELM", EditorMax.ToString());
            variables.Add("SN", vessel.numStages.ToString());
            variables.Add("SP", vessel.numStageParts.ToString());
            variables.Add("SC", vessel.stagePartCost.ToString());

            AddCrewVariables(variables);

            return(GetStandardFormulaValue("RolloutCost", variables));
        }
Exemplo n.º 2
0
        private static Dictionary <string, string> GetIntegrationRolloutVariables(KCT_BuildListVessel vessel)
        {
            double loadedMass, emptyMass, loadedCost, emptyCost;

            loadedCost = vessel.cost;
            emptyCost  = vessel.emptyCost;
            loadedMass = vessel.GetTotalMass();
            emptyMass  = vessel.emptyMass;

            int EditorLevel = 0, LaunchSiteLvl = 0, EditorMax = 0, LaunchSiteMax = 0;
            int isVABVessel = 0;

            if (vessel.type == KCT_BuildListVessel.ListType.None)
            {
                vessel.FindTypeFromLists();
            }
            if (vessel.type == KCT_BuildListVessel.ListType.VAB)
            {
                EditorLevel   = KCT_Utilities.BuildingUpgradeLevel(SpaceCenterFacility.VehicleAssemblyBuilding);
                LaunchSiteLvl = KCT_GameStates.ActiveKSC.ActiveLPInstance.level;//KCT_Utilities.BuildingUpgradeLevel(SpaceCenterFacility.LaunchPad);
                EditorMax     = KCT_Utilities.BuildingUpgradeMaxLevel(SpaceCenterFacility.VehicleAssemblyBuilding);
                LaunchSiteMax = KCT_Utilities.BuildingUpgradeMaxLevel(SpaceCenterFacility.LaunchPad);
                isVABVessel   = 1;
            }
            else if (vessel.type == KCT_BuildListVessel.ListType.SPH)
            {
                EditorLevel   = KCT_Utilities.BuildingUpgradeLevel(SpaceCenterFacility.SpaceplaneHangar);
                LaunchSiteLvl = KCT_Utilities.BuildingUpgradeLevel(SpaceCenterFacility.Runway);
                EditorMax     = KCT_Utilities.BuildingUpgradeMaxLevel(SpaceCenterFacility.SpaceplaneHangar);
                LaunchSiteMax = KCT_Utilities.BuildingUpgradeMaxLevel(SpaceCenterFacility.Runway);
            }
            double BP          = vessel.buildPoints;
            double OverallMult = KCT_PresetManager.Instance.ActivePreset.timeSettings.OverallMultiplier;

            Dictionary <string, string> variables = new Dictionary <string, string>();

            variables.Add("M", loadedMass.ToString());
            variables.Add("m", emptyMass.ToString());
            variables.Add("C", loadedCost.ToString());
            variables.Add("c", emptyCost.ToString());
            variables.Add("VAB", isVABVessel.ToString());
            variables.Add("E", vessel.effectiveCost.ToString());
            variables.Add("BP", BP.ToString());
            variables.Add("L", LaunchSiteLvl.ToString());
            variables.Add("LM", LaunchSiteMax.ToString());
            variables.Add("EL", EditorLevel.ToString());
            variables.Add("ELM", EditorMax.ToString());
            variables.Add("O", OverallMult.ToString());
            variables.Add("SN", vessel.numStages.ToString());
            variables.Add("SP", vessel.numStageParts.ToString());
            variables.Add("SC", vessel.stagePartCost.ToString());

            AddCrewVariables(variables);

            return(variables);
        }
Exemplo n.º 3
0
        public static double ParseRolloutCostFormula(KCT_BuildListVessel vessel)
        {
            double loadedMass, emptyMass, loadedCost, emptyCost;

            loadedCost = vessel.GetTotalCost();
            emptyCost  = vessel.emptyCost;
            loadedMass = vessel.GetTotalMass();
            emptyMass  = vessel.emptyMass;

            int EditorLevel = 0, LaunchSiteLvl = 0;
            int isVABVessel = 0;

            if (vessel.type == KCT_BuildListVessel.ListType.None)
            {
                vessel.FindTypeFromLists();
            }
            if (vessel.type == KCT_BuildListVessel.ListType.VAB)
            {
                EditorLevel   = KCT_Utilities.BuildingUpgradeLevel(SpaceCenterFacility.VehicleAssemblyBuilding);
                LaunchSiteLvl = KCT_Utilities.BuildingUpgradeLevel(SpaceCenterFacility.LaunchPad);
                isVABVessel   = 1;
            }
            else if (vessel.type == KCT_BuildListVessel.ListType.SPH)
            {
                EditorLevel   = KCT_Utilities.BuildingUpgradeLevel(SpaceCenterFacility.SpaceplaneHangar);
                LaunchSiteLvl = KCT_Utilities.BuildingUpgradeLevel(SpaceCenterFacility.Runway);
            }
            double BP = vessel.buildPoints;

            Dictionary <string, string> variables = new Dictionary <string, string>();

            variables.Add("M", loadedMass.ToString());
            variables.Add("m", emptyMass.ToString());
            variables.Add("C", loadedCost.ToString());
            variables.Add("c", emptyCost.ToString());
            variables.Add("VAB", isVABVessel.ToString());
            variables.Add("BP", BP.ToString());
            variables.Add("L", LaunchSiteLvl.ToString());
            variables.Add("EL", EditorLevel.ToString());

            return(GetStandardFormulaValue("RolloutCost", variables));
        }
Exemplo n.º 4
0
        public static double ParseRolloutCostFormula(KCT_BuildListVessel vessel)
        {
            if (!KCT_PresetManager.Instance.ActivePreset.generalSettings.Enabled || !KCT_PresetManager.Instance.ActivePreset.generalSettings.ReconditioningTimes)
                return 0;

            double loadedMass, emptyMass, loadedCost, emptyCost;
            loadedCost = vessel.GetTotalCost();
            emptyCost = vessel.emptyCost;
            loadedMass = vessel.GetTotalMass();
            emptyMass = vessel.emptyMass;

            int EditorLevel = 0, LaunchSiteLvl = 0;
            int isVABVessel = 0;
            if (vessel.type == KCT_BuildListVessel.ListType.None)
                vessel.FindTypeFromLists();
            if (vessel.type == KCT_BuildListVessel.ListType.VAB)
            {
                EditorLevel = KCT_Utilities.BuildingUpgradeLevel(SpaceCenterFacility.VehicleAssemblyBuilding);
                LaunchSiteLvl = KCT_GameStates.ActiveKSC.ActiveLPInstance.level;//KCT_Utilities.BuildingUpgradeLevel(SpaceCenterFacility.LaunchPad);
                isVABVessel = 1;
            }
            else if (vessel.type == KCT_BuildListVessel.ListType.SPH)
            {
                EditorLevel = KCT_Utilities.BuildingUpgradeLevel(SpaceCenterFacility.SpaceplaneHangar);
                LaunchSiteLvl = KCT_Utilities.BuildingUpgradeLevel(SpaceCenterFacility.Runway);
            }
            double BP = vessel.buildPoints;

            Dictionary<string, string> variables = new Dictionary<string, string>();
            variables.Add("M", loadedMass.ToString());
            variables.Add("m", emptyMass.ToString());
            variables.Add("C", loadedCost.ToString());
            variables.Add("c", emptyCost.ToString());
            variables.Add("VAB", isVABVessel.ToString());
            variables.Add("BP", BP.ToString());
            variables.Add("L", LaunchSiteLvl.ToString());
            variables.Add("EL", EditorLevel.ToString());

            AddCrewVariables(variables);

            return GetStandardFormulaValue("RolloutCost", variables);
        }
Exemplo n.º 5
0
        public static double GetBuildRate(KCT_BuildListVessel ship)
        {
            if (ship.type == KCT_BuildListVessel.ListType.None)
                ship.FindTypeFromLists();

            if (ship.type == KCT_BuildListVessel.ListType.VAB)
                return GetBuildRate(ship.KSC.VABList.IndexOf(ship), ship.type, ship.KSC);
            else if (ship.type == KCT_BuildListVessel.ListType.SPH)
                return GetBuildRate(ship.KSC.SPHList.IndexOf(ship), ship.type, ship.KSC);
            else
                return 0;
        }