Kerbal Space Program  1.12.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Public Member Functions | Static Public Member Functions | Static Public Attributes | Properties | List of all members
ResearchAndDevelopment Class Reference
Inheritance diagram for ResearchAndDevelopment:
ScenarioModule IConfigNode

Public Member Functions

void AddScience (float value, TransactionReasons reason)
 Add Science the the player Science total More...
 
void CheatAddScience (float sci)
 
void CheatTechnology ()
 
ProtoTechNode GetTechState (string techID)
 Get the protoNode representation of this tech node. Will be null if the tech is still unavailable. More...
 
override void OnAwake ()
 
void OnDestroy ()
 
override void OnLoad (ConfigNode node)
 
override void OnSave (ConfigNode node)
 
void SetScience (float value, TransactionReasons reason)
 
void SetTechState (string techID, ProtoTechNode techNode)
 Sets the protoNode representation of the given tech node. Used to save a new tech after it's been unlocked. More...
 
void Start ()
 
float SubmitScienceData (float dataAmount, ScienceSubject subject, float xmitScalar=1.0f, ProtoVessel source=null, bool reverseEngineered=false)
 Submit Data to be converted into science. More...
 
float SubmitScienceData (float dataAmount, float scienceValueRatio, ScienceSubject subject, float xmitScalar=1.0f, ProtoVessel source=null, bool reverseEngineered=false)
 Submit Data to be converted into science. More...
 
void UnlockProtoTechNode (ProtoTechNode node)
 
- Public Member Functions inherited from ScenarioModule
void Load (ConfigNode node)
 
void Save (ConfigNode node)
 

Static Public Member Functions

static void AddExperimentalPart (AvailablePart ap)
 
static bool CanAfford (float amount)
 Check the the player can afford the amount of Science passed in More...
 
static string CheckForMissingParts ()
 
static string CountUniversalScience ()
 
static List< string > GetBiomeTags (CelestialBody cb, bool includeMiniBiomes)
 Returns a list of the Biome Tags in English for a given CelestialBody More...
 
static List< string > GetBiomeTagsLocalized (CelestialBody cb, bool includeMiniBiomes)
 Returns a list of the Biome Tags in localized format for a given CelestialBody More...
 
static ScienceExperiment GetExperiment (string experimentID)
 Get a ScienceExperiment from known experiments More...
 
static List< string > GetExperimentIDs ()
 
static ScienceSubject GetExperimentSubject (ScienceExperiment experiment, ExperimentSituations situation, CelestialBody body, string biome, string displaybiome)
 Returns a reference to the science subject concerning this experiment at the given circumstances. More...
 
static ScienceSubject GetExperimentSubject (ScienceExperiment experiment, ExperimentSituations situation, string sourceUId, string sourceTitle, CelestialBody body, string biome, string displaybiome)
 Returns a science subject concerning this experiment and source at the given circumstances. More...
 
static string GetMiniBiomedisplayNameByScienceID (string TagID, bool formatted)
 Returns a mini biome displayName by passed in ScienceID (LandedAt string with no spaces) More...
 
static string GetMiniBiomedisplayNameByUnityTag (string TagID, bool formatted)
 Returns a mini biome displayName by passed in Unity Tag More...
 
static List< string > GetMiniBiomeTags (CelestialBody cb)
 Returns a list of the MiniBiome Tags in English for a given CelestialBody More...
 
static List< string > GetMiniBiomeTagsLocalized (CelestialBody cb)
 Returns a list of the MiniBiome Tags in English for a given CelestialBody More...
 
static float GetNextScienceValue (float dataAmount, ScienceSubject subject, float xmitScalar=1.0f)
 Returns the scientific output of submitting the given amount of data on a subject a second time around. Use for previewing devaluation taking into account transmission loss.

Parameters
dataAmountThe Data Amount
subjectThe ScienceSubject
xmitScalarThe transmission value. Omit if not transmitting
More...
 
static float GetReferenceDataValue (float dataAmount, ScienceSubject subject)
 Returns the 'reference' value for the given amount of data on a subject. Useful for progress bars and such. More...
 
static string GetResults (string subjectID)
 
static float GetScienceValue (float dataAmount, ScienceSubject subject, float xmitScalar=1.0f)
 Returns the scientific value of the given amount of data on a subject, taking into account its transmission yield More...
 
static float GetScienceValue (float dataAmount, float scienceValueRatio, ScienceSubject subject, float xmitScalar=1.0f)
 Returns the scientific value of the given amount of data on a subject, taking into account its transmission yield More...
 
static List< string > GetSituationTags ()
 Returns a list of the valid Experiment Situations More...
 
static List< string > GetSituationTagsDescriptions ()
 Returns a list of Situation Tags Description attributes (localized strings of the Experiment Situations). More...
 
static ScienceSubject GetSubjectByID (string subjectID)
 
static List< ScienceSubjectGetSubjects ()
 
static float GetSubjectValue (float subjectScience, ScienceSubject subject)
 Returns the scientific value of a subject for the given amount of science done in it. Does not actually modify the subject's value. Use for previewing devaluation and such. More...
 
static RDTech.State GetTechnologyState (string techID)
 Find if the given tech is available More...
 
static string GetTechnologyTitle (string techID)
 Returns localized tech title string More...
 
static bool IsExperimentalPart (AvailablePart ap)
 
static string PartAssignmentSummary ()
 
static bool PartModelPurchased (AvailablePart ap)
 
static bool PartTechAvailable (AvailablePart ap)
 
static void RefreshTechTreeUI ()
 
static void RemoveExperimentalPart (AvailablePart ap)
 
static bool ResearchedValidContractObjectives (params string[] objectiveTypes)
 
static bool ResearchedValidContractObjectives (List< string > objectiveTypes, bool copy=true)
 
static string ScienceTransmissionRewardString (float amount, TransactionReasons reason=TransactionReasons.ScienceTransmission)
 

Static Public Attributes

static Func< float,
ScienceSubject, float > 
GetReferenceDataValueFunc
 Overridable function for getting the reference data value of a science subject. More...
 
static Func< float,
ScienceSubject, float > 
GetSubjectValueFunc
 Overridable function for getting the value of the given science subject, given the current amount of science done for it. More...
 
static ResearchAndDevelopment Instance
 

Properties

float Science [get]
 
- Properties inherited from ScenarioModule
int ClassID [get]
 
string ClassName [get]
 
BaseEventList Events [get]
 
BaseFieldList Fields [get]
 

Additional Inherited Members

- Public Attributes inherited from ScenarioModule
ScenarioRunner runner
 
ProtoScenarioModule snapshot
 
List< GameScenestargetScenes
 

Member Function Documentation

static void ResearchAndDevelopment.AddExperimentalPart ( AvailablePart  ap)
inlinestatic
void ResearchAndDevelopment.AddScience ( float  value,
TransactionReasons  reason 
)
inline

Add Science the the player Science total

Parameters
value
reason

< bottom out at a round 0. Rounding to places could leave us at up to -0.99 in the red.

static bool ResearchAndDevelopment.CanAfford ( float  amount)
inlinestatic

Check the the player can afford the amount of Science passed in

Parameters
amount
Returns
void ResearchAndDevelopment.CheatAddScience ( float  sci)
inline
void ResearchAndDevelopment.CheatTechnology ( )
inline
static string ResearchAndDevelopment.CheckForMissingParts ( )
inlinestatic
static string ResearchAndDevelopment.CountUniversalScience ( )
inlinestatic
static List<string> ResearchAndDevelopment.GetBiomeTags ( CelestialBody  cb,
bool  includeMiniBiomes 
)
inlinestatic

Returns a list of the Biome Tags in English for a given CelestialBody

Parameters
cbThe CB to query
includeMiniBiomesTrue to return the minibiomes as well
Returns
static List<string> ResearchAndDevelopment.GetBiomeTagsLocalized ( CelestialBody  cb,
bool  includeMiniBiomes 
)
inlinestatic

Returns a list of the Biome Tags in localized format for a given CelestialBody

Parameters
cbThe CB to query
includeMiniBiomesTrue to return the minibiomes as well
Returns
static ScienceExperiment ResearchAndDevelopment.GetExperiment ( string  experimentID)
inlinestatic

Get a ScienceExperiment from known experiments

Parameters
experimentID
Returns
static List<string> ResearchAndDevelopment.GetExperimentIDs ( )
inlinestatic
static ScienceSubject ResearchAndDevelopment.GetExperimentSubject ( ScienceExperiment  experiment,
ExperimentSituations  situation,
CelestialBody  body,
string  biome,
string  displaybiome 
)
inlinestatic

Returns a reference to the science subject concerning this experiment at the given circumstances.

Parameters
experiment
situation
body
Returns
static ScienceSubject ResearchAndDevelopment.GetExperimentSubject ( ScienceExperiment  experiment,
ExperimentSituations  situation,
string  sourceUId,
string  sourceTitle,
CelestialBody  body,
string  biome,
string  displaybiome 
)
inlinestatic

Returns a science subject concerning this experiment and source at the given circumstances.

Parameters
experimentScienceExperiment for the subject
situationSituation string
sourceUIdPart UId
sourceTitleTitle of the Subject
bodyCelestial Body involved
biomeThe Biome name
displaybiomeThe localized Biome name
Returns
static string ResearchAndDevelopment.GetMiniBiomedisplayNameByScienceID ( string  TagID,
bool  formatted 
)
inlinestatic

Returns a mini biome displayName by passed in ScienceID (LandedAt string with no spaces)

Parameters
TagIDScienceID (IE:no spaces etc from the science ID format experiment
formattedIf true will return localized text, if false will return the localized tag field text
Returns
MiniBiome displayName or passed in string if not found
static string ResearchAndDevelopment.GetMiniBiomedisplayNameByUnityTag ( string  TagID,
bool  formatted 
)
inlinestatic

Returns a mini biome displayName by passed in Unity Tag

Parameters
TagIDUnity Tag name
formattedIf true will return localized text, if false will return the localized tag field text
Returns
static List<string> ResearchAndDevelopment.GetMiniBiomeTags ( CelestialBody  cb)
inlinestatic

Returns a list of the MiniBiome Tags in English for a given CelestialBody

Parameters
cb
Returns
static List<string> ResearchAndDevelopment.GetMiniBiomeTagsLocalized ( CelestialBody  cb)
inlinestatic

Returns a list of the MiniBiome Tags in English for a given CelestialBody

Parameters
cbThe CB to query
includeMiniBiomesTrue to return the minibiomes as well
Returns
static float ResearchAndDevelopment.GetNextScienceValue ( float  dataAmount,
ScienceSubject  subject,
float  xmitScalar = 1.0f 
)
inlinestatic

Returns the scientific output of submitting the given amount of data on a subject a second time around. Use for previewing devaluation taking into account transmission loss.

Parameters
dataAmountThe Data Amount
subjectThe ScienceSubject
xmitScalarThe transmission value. Omit if not transmitting

static float ResearchAndDevelopment.GetReferenceDataValue ( float  dataAmount,
ScienceSubject  subject 
)
inlinestatic

Returns the 'reference' value for the given amount of data on a subject. Useful for progress bars and such.

Parameters
dataAmount
scienceValueRatio
subject
Returns
static string ResearchAndDevelopment.GetResults ( string  subjectID)
inlinestatic

< prioritized search to find experiment results.

static float ResearchAndDevelopment.GetScienceValue ( float  dataAmount,
ScienceSubject  subject,
float  xmitScalar = 1.0f 
)
inlinestatic

Returns the scientific value of the given amount of data on a subject, taking into account its transmission yield

Parameters
dataAmountThe amount of data
subjectThe subject the data is about

///

Parameters
xmitScalarThe transmission value. Omit if not transmitting.
Returns
static float ResearchAndDevelopment.GetScienceValue ( float  dataAmount,
float  scienceValueRatio,
ScienceSubject  subject,
float  xmitScalar = 1.0f 
)
inlinestatic

Returns the scientific value of the given amount of data on a subject, taking into account its transmission yield

Parameters
dataAmountThe amount of data
scienceValueRatioA Maximum scienceValue percentage to apply to the science data.
subjectThe subject the data is about

///

Parameters
xmitScalarThe transmission value. Omit if not transmitting.
Returns
static List<string> ResearchAndDevelopment.GetSituationTags ( )
inlinestatic

Returns a list of the valid Experiment Situations

Returns
static List<string> ResearchAndDevelopment.GetSituationTagsDescriptions ( )
inlinestatic

Returns a list of Situation Tags Description attributes (localized strings of the Experiment Situations).

Returns
static ScienceSubject ResearchAndDevelopment.GetSubjectByID ( string  subjectID)
inlinestatic
static List<ScienceSubject> ResearchAndDevelopment.GetSubjects ( )
inlinestatic
static float ResearchAndDevelopment.GetSubjectValue ( float  subjectScience,
ScienceSubject  subject 
)
inlinestatic

Returns the scientific value of a subject for the given amount of science done in it. Does not actually modify the subject's value. Use for previewing devaluation and such.

static RDTech.State ResearchAndDevelopment.GetTechnologyState ( string  techID)
inlinestatic

Find if the given tech is available

Parameters
techID
Returns
static string ResearchAndDevelopment.GetTechnologyTitle ( string  techID)
inlinestatic

Returns localized tech title string

Parameters
techID
Returns
ProtoTechNode ResearchAndDevelopment.GetTechState ( string  techID)
inline

Get the protoNode representation of this tech node. Will be null if the tech is still unavailable.

Parameters
techID
Returns
static bool ResearchAndDevelopment.IsExperimentalPart ( AvailablePart  ap)
inlinestatic
override void ResearchAndDevelopment.OnAwake ( )
inlinevirtual

< this will be overwritten by loaded data if any exists. If not, we can assume this is a newly started game.

Reimplemented from ScenarioModule.

void ResearchAndDevelopment.OnDestroy ( )
inline
override void ResearchAndDevelopment.OnLoad ( ConfigNode  node)
inlinevirtual

< start it off with enough science to get the first node.

Reimplemented from ScenarioModule.

override void ResearchAndDevelopment.OnSave ( ConfigNode  node)
inlinevirtual

Reimplemented from ScenarioModule.

static string ResearchAndDevelopment.PartAssignmentSummary ( )
inlinestatic
static bool ResearchAndDevelopment.PartModelPurchased ( AvailablePart  ap)
inlinestatic
static bool ResearchAndDevelopment.PartTechAvailable ( AvailablePart  ap)
inlinestatic
static void ResearchAndDevelopment.RefreshTechTreeUI ( )
inlinestatic
static void ResearchAndDevelopment.RemoveExperimentalPart ( AvailablePart  ap)
inlinestatic
static bool ResearchAndDevelopment.ResearchedValidContractObjectives ( params string[]  objectiveTypes)
inlinestatic
static bool ResearchAndDevelopment.ResearchedValidContractObjectives ( List< string >  objectiveTypes,
bool  copy = true 
)
inlinestatic
static string ResearchAndDevelopment.ScienceTransmissionRewardString ( float  amount,
TransactionReasons  reason = TransactionReasons.ScienceTransmission 
)
inlinestatic
void ResearchAndDevelopment.SetScience ( float  value,
TransactionReasons  reason 
)
inline
void ResearchAndDevelopment.SetTechState ( string  techID,
ProtoTechNode  techNode 
)
inline

Sets the protoNode representation of the given tech node. Used to save a new tech after it's been unlocked.

Parameters
techID
techNode
void ResearchAndDevelopment.Start ( )
inline
float ResearchAndDevelopment.SubmitScienceData ( float  dataAmount,
ScienceSubject  subject,
float  xmitScalar = 1.0f,
ProtoVessel  source = null,
bool  reverseEngineered = false 
)
inline

Submit Data to be converted into science.

Parameters
dataAmountThe amount of data being sent.
subjectThe subject the data is about.
xmitScalarThe transmission multiplier, omit if not transmitting.
sourceThe source ProtoVessel the science data came from on recovery
reverseEngineeredIf the science data was reverse engineered on vessel recovery
Returns
The amount of science earned.
float ResearchAndDevelopment.SubmitScienceData ( float  dataAmount,
float  scienceValueRatio,
ScienceSubject  subject,
float  xmitScalar = 1.0f,
ProtoVessel  source = null,
bool  reverseEngineered = false 
)
inline

Submit Data to be converted into science.

Parameters
dataAmountThe amount of data being sent.
scienceValueRatioA Maximum scienceValue percentage to apply to the science data.
subjectThe subject the data is about.
xmitScalarThe transmission multiplier, omit if not transmitting.
sourceThe source ProtoVessel the science data came from on recovery
reverseEngineeredIf the science data was reverse engineered on vessel recovery
Returns
The amount of science earned.

< Only post a message if in flight. All other scenes will show a complete dialog.

void ResearchAndDevelopment.UnlockProtoTechNode ( ProtoTechNode  node)
inline

Member Data Documentation

Func<float, ScienceSubject, float> ResearchAndDevelopment.GetReferenceDataValueFunc
static
Initial value:
= (float dataAmount, ScienceSubject subject) =>
{
return dataAmount / subject.dataScale * subject.subjectValue;
}

Overridable function for getting the reference data value of a science subject.

Func<float, ScienceSubject, float> ResearchAndDevelopment.GetSubjectValueFunc
static
Initial value:
= (float subjectScience, ScienceSubject subject) =>
{
return Mathf.Max(0f, 1f - subjectScience / subject.scienceCap);
}

Overridable function for getting the value of the given science subject, given the current amount of science done for it.

ResearchAndDevelopment ResearchAndDevelopment.Instance
static

Property Documentation

float ResearchAndDevelopment.Science
get

The documentation for this class was generated from the following file: