Ejemplo n.º 1
0
 public void SetBP(double cost)
 {
     // BP = Math.Sqrt(cost) * 2000 * KCT_GameStates.timeSettings.OverallMultiplier;
     BP = KCT_MathParsing.GetStandardFormulaValue("KSCUpgrade", new Dictionary <string, string>()
     {
         { "C", cost.ToString() }, { "O", KCT_PresetManager.Instance.ActivePreset.timeSettings.OverallMultiplier.ToString() }
     });
 }
Ejemplo n.º 2
0
        public static double CalculateBP(double cost)
        {
            double bp = KCT_MathParsing.GetStandardFormulaValue("KSCUpgrade", new Dictionary <string, string>()
            {
                { "C", cost.ToString() }, { "O", KCT_PresetManager.Instance.ActivePreset.timeSettings.OverallMultiplier.ToString() }
            });

            if (bp <= 0)
            {
                bp = 1;
            }

            return(bp);
        }
Ejemplo n.º 3
0
 public KCT_Recon_Rollout(Vessel vessel, RolloutReconType type, string id)
 {
     RRType       = type;
     associatedID = id;
     //BP = vessel.GetTotalMass() * KCT_GameStates.timeSettings.ReconditioningEffect * KCT_GameStates.timeSettings.OverallMultiplier; //1 day per 50 tons (default) * overall multiplier
     BP = KCT_MathParsing.GetStandardFormulaValue("Reconditioning", new Dictionary <string, string>()
     {
         { "M", vessel.GetTotalMass().ToString() }, { "O", KCT_GameStates.timeSettings.OverallMultiplier.ToString() },
         { "E", KCT_GameStates.timeSettings.ReconditioningEffect.ToString() }, { "X", KCT_GameStates.timeSettings.MaxReconditioning.ToString() }
     });
     //if (BP > KCT_GameStates.timeSettings.MaxReconditioning) BP = KCT_GameStates.timeSettings.MaxReconditioning;
     progress = 0;
     if (type == RolloutReconType.Reconditioning)
     {
         BP  *= (1 - KCT_GameStates.timeSettings.RolloutReconSplit);
         name = "LaunchPad Reconditioning";
     }
     else if (type == RolloutReconType.Rollout)
     {
         BP  *= KCT_GameStates.timeSettings.RolloutReconSplit;
         name = "Vessel Rollout";
     }
     else if (type == RolloutReconType.Rollback)
     {
         BP      *= KCT_GameStates.timeSettings.RolloutReconSplit;
         name     = "Vessel Rollback";
         progress = BP;
     }
     else if (type == RolloutReconType.Recovery)
     {
         BP  *= KCT_GameStates.timeSettings.RolloutReconSplit;
         name = "Vessel Recovery";
         double KSCDistance = (float)SpaceCenter.Instance.GreatCircleDistance(SpaceCenter.Instance.cb.GetRelSurfaceNVector(vessel.latitude, vessel.longitude));
         double maxDist     = SpaceCenter.Instance.cb.Radius * Math.PI;
         BP += BP * (KSCDistance / maxDist);
     }
 }
Ejemplo n.º 4
0
        public override void OnDecodeFromConfigNode()
        {
            KCT_GameStates.PartTracker   = ListToDict(PartTracker);
            KCT_GameStates.PartInventory = ListToDict(PartInventory);
            KCT_GameStates.BodiesVisited = BodiesVisited;

            /*  KCT_GameStates.ActiveKSC.VABUpgrades = VABUpgrades;
             * KCT_GameStates.ActiveKSC.SPHUpgrades = SPHUpgrades;
             * KCT_GameStates.ActiveKSC.RDUpgrades = RDUpgrades;*/
            KCT_GameStates.PurchasedUpgrades   = PurchasedUpgrades;
            KCT_GameStates.FundsGivenForVessel = fundsFromSimulation;
            KCT_GameStates.activeKSCName       = activeKSC;
            KCT_GUI.simLength = SimulationTime;
            KCT_GameStates.InventorySalesFigures = SalesFigures;
            KCT_GameStates.InventorySaleUpgrades = (float)KCT_MathParsing.GetStandardFormulaValue("InventorySales", new Dictionary <string, string> {
                { "V", "0" }, { "P", SalesFigures.ToString() }
            });
            KCT_GameStates.UpgradesResetCounter = UpgradesResetCounter;
            KCT_GameStates.TechUpgradesTotal    = TechUpgrades;
            KCT_GameStates.PermanentModAddedUpgradesButReallyWaitForTheAPI = SavedUpgradePointsPreAPI;

            SetSettings();
            //KCT_GameStates.firstStart = firstStart;
        }
Ejemplo n.º 5
0
        public static double CalculateBP(double cost, SpaceCenterFacility facilityType)
        {
            int isAdm = 0, isAC = 0, isLP = 0, isMC = 0, isRD = 0, isRW = 0, isTS = 0, isSPH = 0, isVAB = 0;

            switch (facilityType)
            {
            case SpaceCenterFacility.Administration:
                isAdm = 1;
                break;

            case SpaceCenterFacility.AstronautComplex:
                isAC = 1;
                break;

            case SpaceCenterFacility.LaunchPad:
                isLP = 1;
                break;

            case SpaceCenterFacility.MissionControl:
                isMC = 1;
                break;

            case SpaceCenterFacility.ResearchAndDevelopment:
                isRD = 1;
                break;

            case SpaceCenterFacility.Runway:
                isRW = 1;
                break;

            case SpaceCenterFacility.TrackingStation:
                isTS = 1;
                break;

            case SpaceCenterFacility.SpaceplaneHangar:
                isSPH = 1;
                break;

            case SpaceCenterFacility.VehicleAssemblyBuilding:
                isVAB = 1;
                break;

            default:
                break;
            }
            var variables = new Dictionary <string, string>()
            {
                { "C", cost.ToString() },
                { "O", KCT_PresetManager.Instance.ActivePreset.timeSettings.OverallMultiplier.ToString() },
                { "Adm", isAdm.ToString() },
                { "AC", isAC.ToString() },
                { "LP", isLP.ToString() },
                { "MC", isMC.ToString() },
                { "RD", isRD.ToString() },
                { "RW", isRW.ToString() },
                { "TS", isTS.ToString() },
                { "SPH", isSPH.ToString() },
                { "VAB", isVAB.ToString() }
            };

            double bp = KCT_MathParsing.GetStandardFormulaValue("KSCUpgrade", variables);

            if (bp <= 0)
            {
                bp = 1;
            }

            return(bp);
        }