Exemplo n.º 1
0
        internal void RecordNewScience(string title, float baseval, float scv, float sci, float cap)
        {
            DMScienceData DMData = new DMScienceData(title, baseval, scv, sci, cap);

            recoveredScienceList.Add(DMData);
            DMUtils.DebugLog("Adding new DMData to list");
        }
Exemplo n.º 2
0
        private void registerDMScience(DMAsteroidScience newAst, ScienceSubject sub)
        {
            if (HighLogic.CurrentGame.Mode == Game.Modes.SANDBOX)
            {
                return;
            }

            DMScienceData DMData    = null;
            DMScienceData DMScience = DMScienceScenario.SciScenario.getDMScience(sub.title);

            if (DMScience != null)
            {
                sub.scientificValue *= DMScience.SciVal;
                DMData = DMScience;
            }

            if (DMData == null)
            {
                float astSciCap = exp.scienceCap * 25f;
                DMScienceScenario.SciScenario.RecordNewScience(sub.title, exp.baseValue, 1f, 0f, astSciCap);
                sub.scientificValue = 1f;
            }
            sub.subjectValue = newAst.SciMult;
            sub.scienceCap   = exp.scienceCap * sub.subjectValue;
            sub.science      = Math.Max(0f, Math.Min(sub.scienceCap, sub.scienceCap - (sub.scienceCap * sub.scientificValue)));
        }
Exemplo n.º 3
0
 internal void submitDMScience(DMScienceData DMData, float science)
 {
     DMData.science = Math.Min(DMData.science + science, DMData.cap);
     DMData.scival  = ScienceValue(DMData.science, DMData.cap);
     UpdateNewScience(DMData);
     if (HighLogic.LoadedSceneIsFlight && FlightGlobals.ready)
     {
         updateRemainingData();
     }
 }
Exemplo n.º 4
0
 private void UpdateNewScience(DMScienceData DMData)
 {
     foreach (DMScienceData DMSci in recoveredScienceList)
     {
         if (DMSci.title == DMData.title)
         {
             DMSci.science = DMData.science;
             DMSci.scival  = DMData.scival;
             break;
         }
     }
 }
Exemplo n.º 5
0
        /// <summary>
        /// Get the science cap for a certain asteroid type and experiment. This represents the total available science, and is analogous to the science subject scienceCap value.
        /// </summary>
        /// <param name="title">The Science Subject title (not the ID) for the asteroid type and experiment.</param>
        /// <returns>A float representing the total science available for an asteroid type and experiment. Returns 0 if no valid subject is found.</returns>
        public static float getDMScienceCap(string title)
        {
            if (DMScienceScenario.SciScenario == null)
            {
                return(0);
            }

            DMScienceData DMS = DMScienceScenario.SciScenario.getDMScience(title);

            if (DMS == null)
            {
                return(0);
            }

            return(DMS.Cap);
        }
Exemplo n.º 6
0
        /// <summary>
        /// Get the science amount recovered from a certain astroid type and experiment.
        /// </summary>
        /// <param name="title">The Science Subject title (not the ID) for the asteroid type and experiment.</param>
        /// <returns>Returns the amount of science already recovered; does not included science that has not been transmitted or recovered; returns 0 if no results for this subjuect are found.</returns>
        public static float getDMScienceRecoveredValue(string title)
        {
            if (DMScienceScenario.SciScenario == null)
            {
                return(0);
            }

            DMScienceData DMS = DMScienceScenario.SciScenario.getDMScience(title);

            if (DMS == null)
            {
                return(0);
            }

            return(DMS.Science);
        }
Exemplo n.º 7
0
 internal void RemoveDMScience(DMScienceData DMdata)
 {
     recoveredScienceList.Remove(DMdata);
 }