diff --git a/.vs/KSPMOD_Snacks/FileContentIndex/cc8ae838-9813-43c1-b1e8-85e3a6f0f64b.vsidx b/.vs/KSPMOD_Snacks/FileContentIndex/cc8ae838-9813-43c1-b1e8-85e3a6f0f64b.vsidx new file mode 100644 index 0000000..0a254c9 Binary files /dev/null and b/.vs/KSPMOD_Snacks/FileContentIndex/cc8ae838-9813-43c1-b1e8-85e3a6f0f64b.vsidx differ diff --git a/.vs/KSPMOD_Snacks/FileContentIndex/read.lock b/.vs/KSPMOD_Snacks/FileContentIndex/read.lock new file mode 100644 index 0000000..e69de29 diff --git a/.vs/KSPMOD_Snacks/v17/.wsuo b/.vs/KSPMOD_Snacks/v17/.wsuo new file mode 100644 index 0000000..a6b9450 Binary files /dev/null and b/.vs/KSPMOD_Snacks/v17/.wsuo differ diff --git a/.vs/KSPMOD_Snacks/v17/workspaceFileList.bin b/.vs/KSPMOD_Snacks/v17/workspaceFileList.bin new file mode 100644 index 0000000..2bb563a Binary files /dev/null and b/.vs/KSPMOD_Snacks/v17/workspaceFileList.bin differ diff --git a/.vs/ProjectSettings.json b/.vs/ProjectSettings.json new file mode 100644 index 0000000..f8b4888 --- /dev/null +++ b/.vs/ProjectSettings.json @@ -0,0 +1,3 @@ +{ + "CurrentProjectSetting": null +} \ No newline at end of file diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json new file mode 100644 index 0000000..68d8fd2 --- /dev/null +++ b/.vs/VSWorkspaceState.json @@ -0,0 +1,16 @@ +{ + "ExpandedNodes": [ + "", + "\\GameData", + "\\KSPedia\\SnacksKSPedia", + "\\KSPedia\\SnacksKSPedia\\AssetBundles", + "\\KSPedia\\SnacksKSPedia\\Assets", + "\\KSPedia\\SnacksKSPedia\\Assets\\Plugins", + "\\KSPedia\\SnacksKSPedia\\Assets\\SquadCore", + "\\KSPedia\\SnacksKSPedia\\Assets\\Textures", + "\\KSPedia\\SnacksKSPedia\\Library", + "\\KSPedia\\Source" + ], + "SelectedNode": "\\Snacks", + "PreviewInSolutionExplorer": false +} \ No newline at end of file diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite new file mode 100644 index 0000000..264f642 Binary files /dev/null and b/.vs/slnx.sqlite differ diff --git a/GameData/WildBlueIndustries/Snacks/Docs/~$Snacks Trip Planner.xlsx b/GameData/WildBlueIndustries/Snacks/Docs/~$Snacks Trip Planner.xlsx deleted file mode 100644 index ba46186..0000000 Binary files a/GameData/WildBlueIndustries/Snacks/Docs/~$Snacks Trip Planner.xlsx and /dev/null differ diff --git a/GameData/WildBlueIndustries/Snacks/Extras/RenameSoil.cfg b/GameData/WildBlueIndustries/Snacks/Extras/RenameSoil.cfg new file mode 100644 index 0000000..8f88bae --- /dev/null +++ b/GameData/WildBlueIndustries/Snacks/Extras/RenameSoil.cfg @@ -0,0 +1,16 @@ +// For those who want an alternate name for Soil... +@RESOURCE_DEFINITION[Soil] +{ + displayName = #RESOURCE_SOIL + abbreviation = SOL +} +@RESOURCE_DEFINITION[Snacks] +{ + displayName = #RESOURCE_SNACK + abbreviation = SNK +} +@RESOURCE_DEFINITION[Stress] +{ + displayName = #RESOURCE_STRESS + abbreviation = STR +} \ No newline at end of file diff --git a/GameData/WildBlueIndustries/Snacks/Extras/RenameSoil.txt b/GameData/WildBlueIndustries/Snacks/Extras/RenameSoil.txt deleted file mode 100644 index d4d1811..0000000 --- a/GameData/WildBlueIndustries/Snacks/Extras/RenameSoil.txt +++ /dev/null @@ -1,6 +0,0 @@ -// For those who want an alternate name for Soil... -@RESOURCE_DEFINITION[Soil] -{ - displayName = Mulch - abbreviation = ML -} \ No newline at end of file diff --git a/GameData/WildBlueIndustries/Snacks/LifeSupportResources/Snacks.cfg b/GameData/WildBlueIndustries/Snacks/LifeSupportResources/Snacks.cfg index f32e6c1..59c50b3 100644 --- a/GameData/WildBlueIndustries/Snacks/LifeSupportResources/Snacks.cfg +++ b/GameData/WildBlueIndustries/Snacks/LifeSupportResources/Snacks.cfg @@ -108,7 +108,7 @@ SNACKS_RESOURCE_PROCESSOR canBeRandom = true //Message to show to the player. You can omit this for a silent outcome. - playerMessage = faints from a lack of Snacks! + playerMessage = #LOC_INFO_FAINTE //The following fields depend upon the name of the outcome. @@ -125,7 +125,7 @@ SNACKS_RESOURCE_PROCESSOR OUTCOME { name = DeathPenalty - playerMessage = has died from a lack of Snacks! + playerMessage = #LOC_INFO_DEATH resourceName = Snacks cyclesBeforeDeath = 10 } diff --git a/GameData/WildBlueIndustries/Snacks/LifeSupportResources/Stress.cfg b/GameData/WildBlueIndustries/Snacks/LifeSupportResources/Stress.cfg new file mode 100644 index 0000000..da58693 --- /dev/null +++ b/GameData/WildBlueIndustries/Snacks/LifeSupportResources/Stress.cfg @@ -0,0 +1,607 @@ +//This node is used to display a description window describing the new resource being tracked. Its only shown once per game. +SNACKS_RESOURCE_INTRO +{ + name = Stress +} +@SNACKS_RESOURCE_INTRO[Stress]:FOR[SnacksStress] +{ + title = Stress! + description = #LOC_STRESS_DESCRIPTION + //#LOC_STRESS_DESCRIPTION=This addon introduces roster resources in the form of Stress. Unlike resources tied to a vessel, roster resources are characteristics of the kerbals. The SnacksConverter can convert roster resources- the Entertainment Center can reduce Stress, for instance, and SNACKS_RESOURCE_PROCESSOR config can work with roster resources as well.
The addon also introduces the Snacks event system. Events let you apply different outcomes based on one or more preconditions. They let you spice up your game and give it more personality.
As for Stress, kerbals don't like being confined to tiny capsules for long journeys, and they accumulate Stress daily. Additional events, like getting Sick, running out of Snacks, and gasping for Fresh Air cause additional Stress.
The vessel's crew capacity and a kerbal's experience level affect how much Stress they can take. Once they hit their max, they are Stressed Out and will no longer work. They are NOT Tourists! Engineers, Pilots, Scientists, and the like simply lose their skills. They can recover in the various stock crew cabins with a working Entertainment Center, but while recovering they don't use their skills either. Once a kerbal's Stress is below their max and you either turn off the Entertainment Center or they leave the cabin, they'll return to work. +} + +//This resource is added to a kerbals crew roster entry. These arent resources in the traditional sense; they are characteristics of the kerbal itself. +SNACKS_ROSTER_RESOURCE +{ + resourceName = Stress + + displayName = Stress + + //Flag to indicate whether or not to show the resource in the snapshot window. Default: true + showInSnapshot = true + + //A customized format for the status. The following parameters are all optional: + //<>: amount divided by maxAmount. + //<>: Current amount of roster resource. + //<>: Max amount of roster resource. + statusFormat = <> (<>/<> days) + + //Amount to add + amount = 0 + + //Max amount possible. Note that for Stress, the maxAmount will actually depend upon the vessels crew capacity. + maxAmount = 100 + + //Amount to add when the kerbal levels up + experienceBonusAmount = 0 + + //Max amount to add when the kerbal levels up + experienceBonusMaxAmount = 10 +} + +//The OnStrikePenalty removes skill effects from kerbals that experience the penalty, but because more than one event and part and such can also remove crew skills, +//they all need to be coordinated via conditions. The SKILL_LOSS_CONDITION node defines the conditions that remove a kerbal's skill effects. If a kerbal has at least +//one condition that's on this list, then skill effects will be removed. If the kerbals have none of the conditions on the list then they regain use of their skills. +SKILL_LOSS_CONDITION +{ + name = Stressed Out +} + +SKILL_LOSS_CONDITION +{ + name = Relaxing +} + +SKILL_LOSS_CONDITION +{ + name = Stargazing +} + +SKILL_LOSS_CONDITION +{ + name = Gardening +} + +//A lack of air will definitely cause stress... +@SNACKS_RESOURCE_PROCESSOR[Air]:NEEDS[SnacksFreshAir] +{ + OUTCOME + { + name = ResourceProduced + resourceNameProduced = Stress + amount = 1 + } +} + +//Microgravity and low gravity increases Stress, but centrifuges and UFOs with artificial gravity can prevent it. +SNACKS_EVENT +{ + name = microgravityStress + eventCategory = categoryPostProcessCycle + kerbalsAffected = affectsAllAssigned + daysBetweenChecks = 1 + + PRECONDITION + { + name = CheckGravityLevel + checkType = checkLesserOrEqual + valueToCheck = 0.1 + } + + OUTCOME + { + name = ProduceResource + resourceName = Stress + amount = 0.25 + } +} + +//Going hungry increases stress +SNACKS_EVENT +{ + name = stressHunger + eventCategory = categoryPostProcessCycle + kerbalsAffected = affectsAllAssigned + + PRECONDITION + { + name = CheckProcessorResult + type = resultConsumptionFailure + processorName = Snacks! + resourceName = Snacks + cyclesRequired = 1 + } + + OUTCOME + { + name = ProduceResource + resourceName = Stress + amount = 1 + } +} + +//Being lonely causes stress +SNACKS_EVENT +{ + name = lonelinessStress + eventCategory = categoryPostProcessCycle + kerbalsAffected = affectsAllAssigned + daysBetweenChecks = 1 + + PRECONDITION + { + name = CheckCrewCount + valueToCheck = 1 + } + + OUTCOME + { + name = ProduceResource + resourceName = Stress + amount = 0.25 + } +} + +//Lack of a connection to homeworld causes stress +SNACKS_EVENT +{ + name = disconnectedStress + eventCategory = categoryPostProcessCycle + kerbalsAffected = affectsAllAssigned + daysBetweenChecks = 1 + + PRECONDITION + { + name = CheckHomeworldConnection + //Must NOT have a connection to homeworld for the precondition to succeed. + mustExist = false + } + + OUTCOME + { + name = ProduceResource + resourceName = Stress + amount = 0.25 + } +} + +//Stress eating! +SNACKS_EVENT:NEEDS[SnacksStress] +{ + eventCategory = categoryPostProcessCycle + kerbalsAffected = affectsAllAssigned + + PRECONDITION + { + name = CheckCondition + conditionSummary = #LOC_INFO_STRESSOUTNAME + } + + PRECONDITION + { + name = CheckRandomChance + dieRollMin = 1 + dieRollMax = 100 + targetNumber = 95 + } + + OUTCOME + { + name = ConsumeResource + resourceName = Snacks + randomMin = 0.1 + randomMax = 0.5 + showInSnapshot = false + failureResultAppliesOutcomes = true + } + + OUTCOME + { + name = ConsumeResource + resourceName = Stress + randomMin = 0.1 + randomMax = 0.5 + showInSnapshot = false + failureResultAppliesOutcomes = false + } +} + +//Kerbals can catch a cold! +SNACKS_ROSTER_RESOURCE +{ + resourceName = DaysSick + + displayName = Cold Recovery + +// showInSnapshot = true + statusFormat = <> days + + amount = 0 + maxAmount = 100 +} + +SNACKS_EVENT +{ + name = catchACold + eventCategory = categoryPostProcessCycle + kerbalsAffected = affectsRandomAssigned + daysBetweenChecks = 1 + playerMessage = <> caught a cold! + + PRECONDITION + { + name = CheckRandomChance + minDieRoll = 1 + maxDieRoll = 1000 + targetNumber = 995 + } + + OUTCOME + { + name = ProduceResource + resourceName = DaysSick + randomMin = 1 + RandomMax = 12 + } + + OUTCOME + { + name = SetCondition + conditionSummary = #LOC_INFO_SICKNAME + } +} + +SNACKS_EVENT +{ + name = stressFromCold + eventCategory = categoryPostProcessCycle + kerbalsAffected = affectsAllAssigned + daysBetweenChecks = 1 + + PRECONDITION + { + name = CheckCondition + conditionSummary = #LOC_INFO_SICKNAME + } + + OUTCOME + { + name = ProduceResource + resourceName = Stress + amount = 1 + } +} + +SNACKS_EVENT +{ + name = infectCrewMates + eventCategory = categoryPostProcessCycle + kerbalsAffected = affectsAllAssigned + daysBetweenChecks = 1 + + PRECONDITION + { + name = CheckCondition + conditionSummary = #LOC_INFO_SICKNAME + } + + PRECONDITION + { + name = CheckRandomChance + minDieRoll = 1 + maxDieRoll = 100 + targetNumber = 75 + } + + OUTCOME + { + name = ProduceResource + //Select a random crew member to apply the outcome to. + selectRandomCrew = true + playerMessage = <> caught a cold! + resourceName = DaysSick + randomMin = 1 + RandomMax = 12 + + //Nested outcomes are allowed and are applied to the parent outcome�s vessel or kerbal. + OUTCOME + { + name = SetCondition + conditionSummary = #LOC_INFO_SICKNAME + } + } +} + +SNACKS_EVENT +{ + name = immuneSystemRecovery + eventCategory = categoryPostProcessCycle + kerbalsAffected = affectsAllAssigned + daysBetweenChecks = 1 + + PRECONDITION + { + name = CheckCondition + conditionSummary = #LOC_INFO_SICKNAME + } + + OUTCOME + { + name = ConsumeResource + resourceName = DaysSick + amount = 0.5 + } +} + +SNACKS_EVENT +{ + name = restingFromCold + eventCategory = categoryPostProcessCycle + kerbalsAffected = affectsAllAssigned + daysBetweenChecks = 1 + + PRECONDITION + { + name = CheckCondition + conditionSummary = #LOC_INFO_SICKNAME + } + + PRECONDITION + { + name = CheckCondition + conditionSummary = #LOC_INFO_RELAXNAME + } + + OUTCOME + { + name = ConsumeResource + resourceName = DaysSick + amount = 2 + } +} + +//Kerbals back at KSC recover from Stress and illness +SNACKS_EVENT +{ + name = kscRecovery + eventCategory = categoryPostProcessCycle + kerbalsAffected = affectsAllAvailable + daysBetweenChecks = 1 + + OUTCOME + { + name = ConsumeResource + resourceName = Stress + amount = 6 + } + + OUTCOME + { + name = ConsumeResource + resourceName = DaysSick + amount = 3 + } +} + +//Breathing techniques reduce Stress, albiet slowly +SNACKS_EVENT +{ + name = zenMeditation + eventCategory = categoryPostProcessCycle + kerbalsAffected = affectsAllAssigned + daysBetweenChecks = 1 + + PRECONDITION + { + name = CheckCondition + conditionSummary = #LOC_INFO_STRESSOUTNAME + } + + OUTCOME + { + name = ConsumeResource + resourceName = Stress + amount = 0.1 + } +} + +//Just being a badass lets you reduce stress +SNACKS_EVENT +{ + name = bada55 + eventCategory = categoryPostProcessCycle + kerbalsAffected = affectsAllAssigned + daysBetweenChecks = 1 + + PRECONDITION + { + name = CheckBadass + + //You can check for absense of badass too. Default value is true. + mustExist = true + } + + OUTCOME + { + name = ConsumeResource + resourceName = Stress + amount = 0.2 + } +} + +//These parts help kerbals de-stress +@PART[crewCabin,mk2CrewCabin] +{ + MODULE + { + name = SnacksConverter + ConverterName = #LOC_ECCN//#LOC_ECCN=Entertainment Center + StartActionName = #LOC_STARTEC//#LOC_STARTEC=Start Entertainment + StopActionName = #LOC_STOPEC//#LOC_STOPEC= Stop Entertainment + AutoShutdown = false + GeneratesHeat = false + UseSpecialistBonus = false + + //At least one crew needs to be in the part to run the converter. + minimumCrew = 1 + + //Connection back home required to receive entertainment. + requiresHomeConnection = true + + //This condition is set whenever the kerbal enters the part and the converter is active, and + //when the converter is started. Since it's registered as a SKILL_LOSS_CONDITION, the kerbals will lose their + //skills while the converter is running. + conditionSummary = #LOC_INFO_RELAXNAME + + INPUT_RESOURCE + { + ResourceName = ElectricCharge + Ratio = 0.4 + FlowMode = STAGE_PRIORITY_FLOW + } + + //Works like an INPUT_RESOURCE except: + // It applies to individual kerbals. + // You can specify an AmountPerDay or AmountPerSecond. + ROSTER_INPUT_RESOURCE + { + ResourceName = Stress + + //AmountPerDay will be translated into: AmountPerDay / seconds per homeworld day + //This will override AmountPerSecond if it is defined in the node. + AmountPerDay = 2 + } + } +} + +@PART[MK1CrewCabin] +{ + MODULE + { + name = SnacksConverter + ConverterName = #LOC_ECCN//#LOC_ECCN=Entertainment Center + StartActionName = #LOC_STARTEC//#LOC_STARTEC=Start Entertainment + StopActionName = #LOC_STOPEC//#LOC_STOPEC= Stop Entertainment + AutoShutdown = false + GeneratesHeat = false + UseSpecialistBonus = false + + //At least one crew needs to be in the part to run the converter. + minimumCrew = 1 + + //Connection back home required to receive entertainment. + requiresHomeConnection = true + + //This condition is set whenever the kerbal enters the part and the converter is active, and + //when the converter is started. Since it's registered as a SKILL_LOSS_CONDITION, the kerbals will lose their + //skills while the converter is running. + conditionSummary = #LOC_INFO_RELAXNAME + + INPUT_RESOURCE + { + ResourceName = ElectricCharge + Ratio = 0.2 + FlowMode = STAGE_PRIORITY_FLOW + } + + //Works like an INPUT_RESOURCE except: + // It applies to individual kerbals. + // You can specify an AmountPerDay or AmountPerSecond. + ROSTER_INPUT_RESOURCE + { + ResourceName = Stress + + //AmountPerDay will be translated into: AmountPerDay / seconds per homeworld day + //This will override AmountPerSecond if it is defined in the node. + AmountPerDay = 2 + } + } +} + +@PART[mk3CrewCabin] +{ + MODULE + { + name = SnacksConverter + ConverterName = #LOC_ECCN//#LOC_ECCN=Entertainment Center + StartActionName = #LOC_STARTEC//#LOC_STARTEC=Start Entertainment + StopActionName = #LOC_STOPEC//#LOC_STOPEC= Stop Entertainment + AutoShutdown = false + GeneratesHeat = false + UseSpecialistBonus = false + + //At least one crew needs to be in the part to run the converter. + minimumCrew = 1 + + //Connection back home required to receive entertainment. + requiresHomeConnection = true + + //This condition is set whenever the kerbal enters the part and the converter is active, and + //when the converter is started. Since it's registered as a SKILL_LOSS_CONDITION, the kerbals will lose their + //skills while the converter is running. + conditionSummary = #LOC_INFO_RELAXNAME + + INPUT_RESOURCE + { + ResourceName = ElectricCharge + Ratio = 1.6 + FlowMode = STAGE_PRIORITY_FLOW + } + + //Works like an INPUT_RESOURCE except: + // It applies to individual kerbals. + // You can specify an AmountPerDay or AmountPerSecond. + ROSTER_INPUT_RESOURCE + { + ResourceName = Stress + + //AmountPerDay will be translated into: AmountPerDay / seconds per homeworld day + //This will override AmountPerSecond if it is defined in the node. + AmountPerDay = 2 + } + } +} + +@PART[cupola] +{ + MODULE + { + name = SnacksConverter + ConverterName = #LOC_SGCN //#LOC_SGCN=Stargazing + StartActionName = #LOC_STARTSG //#LOC_STARTSG=Start Stargazing + StopActionName = #LOC_STOPSGCN //#LOC_STOPSGCN=Stop Stargazing + AutoShutdown = false + GeneratesHeat = false + UseSpecialistBonus = false + + //At least one crew needs to be in the part to run the converter. + minimumCrew = 1 + + //Connection back home required to receive entertainment. + requiresHomeConnection = false + + //This condition is set whenever the kerbal enters the part and the converter is active, and + //when the converter is started. Since it's registered as a SKILL_LOSS_CONDITION, the kerbals will lose their + //skills while the converter is running. + conditionSummary = #LOC_SGCN + + INPUT_RESOURCE + { + ResourceName = ElectricCharge + Ratio = 0.05 + FlowMode = STAGE_PRIORITY_FLOW + } + + //Works like an INPUT_RESOURCE except: + // It applies to individual kerbals. + // You can specify an AmountPerDay or AmountPerSecond. + ROSTER_INPUT_RESOURCE + { + ResourceName = Stress + + //AmountPerDay will be translated into: AmountPerDay / seconds per homeworld day + //This will override AmountPerSecond if it is defined in the node. + AmountPerDay = 1.5 + } + } +} \ No newline at end of file diff --git a/GameData/WildBlueIndustries/Snacks/LifeSupportResources/Stress.txt b/GameData/WildBlueIndustries/Snacks/LifeSupportResources/Stress.txt index 7f88621..51fdf1d 100644 --- a/GameData/WildBlueIndustries/Snacks/LifeSupportResources/Stress.txt +++ b/GameData/WildBlueIndustries/Snacks/LifeSupportResources/Stress.txt @@ -6,7 +6,8 @@ SNACKS_RESOURCE_INTRO @SNACKS_RESOURCE_INTRO[Stress]:FOR[SnacksStress] { title = Stress! - description = This addon introduces roster resources in the form of Stress. Unlike resources tied to a vessel, roster resources are characteristics of the kerbals. The SnacksConverter can convert roster resources- the Entertainment Center can reduce Stress, for instance, and SNACKS_RESOURCE_PROCESSOR config can work with roster resources as well.
The addon also introduces the Snacks event system. Events let you apply different outcomes based on one or more preconditions. They let you spice up your game and give it more personality.
As for Stress, kerbals don't like being confined to tiny capsules for long journeys, and they accumulate Stress daily. Additional events, like getting Sick, running out of Snacks, and gasping for Fresh Air cause additional Stress.
The vessel's crew capacity and a kerbal's experience level affect how much Stress they can take. Once they hit their max, they are Stressed Out and will no longer work. They are NOT Tourists! Engineers, Pilots, Scientists, and the like simply lose their skills. They can recover in the various stock crew cabins with a working Entertainment Center, but while recovering they don't use their skills either. Once a kerbal's Stress is below their max and you either turn off the Entertainment Center or they leave the cabin, they'll return to work. + description = #LOC_STRESS_DESCRIPTION + //#LOC_STRESS_DESCRIPTION=This addon introduces roster resources in the form of Stress. Unlike resources tied to a vessel, roster resources are characteristics of the kerbals. The SnacksConverter can convert roster resources- the Entertainment Center can reduce Stress, for instance, and SNACKS_RESOURCE_PROCESSOR config can work with roster resources as well.
The addon also introduces the Snacks event system. Events let you apply different outcomes based on one or more preconditions. They let you spice up your game and give it more personality.
As for Stress, kerbals don't like being confined to tiny capsules for long journeys, and they accumulate Stress daily. Additional events, like getting Sick, running out of Snacks, and gasping for Fresh Air cause additional Stress.
The vessel's crew capacity and a kerbal's experience level affect how much Stress they can take. Once they hit their max, they are Stressed Out and will no longer work. They are NOT Tourists! Engineers, Pilots, Scientists, and the like simply lose their skills. They can recover in the various stock crew cabins with a working Entertainment Center, but while recovering they don't use their skills either. Once a kerbal's Stress is below their max and you either turn off the Entertainment Center or they leave the cabin, they'll return to work. } //This resource is added to a kerbals crew roster entry. These arent resources in the traditional sense; they are characteristics of the kerbal itself. diff --git a/GameData/WildBlueIndustries/Snacks/Localization/en-us.cfg b/GameData/WildBlueIndustries/Snacks/Localization/en-us.cfg new file mode 100644 index 0000000..76ac1ed --- /dev/null +++ b/GameData/WildBlueIndustries/Snacks/Localization/en-us.cfg @@ -0,0 +1,260 @@ +// Auto generated by KSPDev Localization tool at: 7/15/2023 12:16:56 AM +// Total strings: 21 +// Total words: 125 +Localization +{ + en-us + { + + + // ********** Part: radialSnackTin + + #radialSnackTin_Part_title = Radial Snack Tin + #radialSnackTin_Part_manufacturer = Jebediah Kerman's Junkyard and Spacecraft Parts Co + #radialSnackTin_Part_description = This tank holds a moderate amount of snacks for your life support needs. + #radialSnackTin_Part_tags = cck-lifesupport snacks + + // ********** Part: snackTin1500 + + #snackTin1500_Part_title = S-1500 Snack Tin + #snackTin1500_Part_manufacturer = Jebediah Kerman's Junkyard and Spacecraft Parts Co + #snackTin1500_Part_description = The S-1500 is just the right size for even more extended stays + #snackTin1500_Part_tags = cck-lifesupport snacks + + // ********** Part: snackTin4500 + + #snackTin4500_Part_title = S-4500 Snack Tin + #snackTin4500_Part_manufacturer = Jebediah Kerman's Junkyard and Spacecraft Parts Co + #snackTin4500_Part_description = The S-4500 contains a huge number of snacks for those wild parties. + #snackTin4500_Part_tags = cck-lifesupport snacks + + // ********** Part: snackTin500 + + #snackTin500_Part_title = S-500 Snack Tin + #snackTin500_Part_manufacturer = Jebediah Kerman's Junkyard and Spacecraft Parts Co + #snackTin500_Part_description = The adorable S-500 Snack Tin is perfect for extended excursions into space or for small supply runs. + #snackTin500_Part_tags = cck-lifesupport snacks + + + // **********Resources + + #RESOURCE_SNACK=Snacks + + #RESOURCE_STRESS=Stress + + #RESOURCE_SOIL=Soil + + + // **********INFO + + #LOC_INFO_INPUTS=Inputs + + #LOC_INFO_OUTPUTS=Outputs + + #LOC_INFO_NOTEPRODUCTIONRATES=Note: Production rates vary depending upon game settings. Consult the Part Action Window for details. + + #LOC_INFO_NOTEIMPROVE=Kerbal(s) that improve production: + + #LOC_GUI_MAXRECY=Max Recycling + + #LOC_INFO_REQSPLASH = \n - Requires vessel to be in water + + #LOC_INFO_REQOXY = \n - Requires vessel to be on a planet with an oxygenated atmosphere + + #LOC_INFO_REQCOMMU = \n - Requires connection to homeworld + + #LOC_INFO_REQCREW = \n - Minimum Crew: + + #LOC_INFO_NEEDSKILL= - Skill Needed: + + #LOC_INFO_PROCESSTIME= - Process Time: + + #LOC_INFO_YELDRES= - Yield Resources + + #LOC_INFO_SOILRECYCAPA=Recycler Capacity: <<1>> kerbals + + #LOC_INFO_SOILPERDAY=<<1>> Soil/day + + #LOC_INFO_FUND = Kerbals are hungry for snacks! You have been fined <<1>> Funds + + #LOC_INFO_BADREP = Kerbals are hungry for snacks! Your reputation has decreased by <<1>> + + #LOC_INFO_DEATH = has died from a lack of Snacks! + + #LOC_INFO_FAINTE = fainted from a lack of Snacks! + + #LOC_INFO_TITLE1 = needs more resources + + #LOC_INFO_MISSINGRESOURCE = Subject: Missing Resources + + #LOC_INFO_PRDUCFAILD1 = There is no more <<1>> available to continue production. Operations cannot continue with the <<2>> until more resource becomes available. + + #LOC_INFO_TITLE2 = Subject: needs a resource + + #LOC_INFO_MISSINGREQRESOURCE = Subject: Missing Resources + + #LOC_INFO_PRDUCFAILD2 = <<1>> needs <<2>> in order to function. Operations halted until the resource becomes available. + + #LOC_INFO_TITLE3 = is out of storage space + + #LOC_INFO_CONTAINERFULL = Subject: Containers Are Full + + #LOC_INFO_PRDUCFAILD3 = There is no more storage space available for <<1>> Operations cannot continue with the <<2>> until more space becomes available. + + #LOC_INFO_TITLE4 = has suffered a critical failure in one of its converters + + #LOC_INFO_PRDUCFAILD4 = A <<1>> has failed! The production yield has been lost. It must be repaired and/or restarted before it can begin production again. + + #LOC_INFO_STRESSOUT=is stressed out and cannot work! + + #LOC_INFO_STRESSOUTRECOVER = recovered from stress. + + + // **********STATUS + + #LOC_STATUS_NOCOMMU=Requires home connection + + #LOC_STATUS_FULL= is full + + #LOC_STATUS_NOCREW=Needs more crew + + #LOC_STATUS_NOOXY=Requires oxygenated atmosphere + + #LOC_STATUS_NOSPLASH=Vessel must be in water + + + // **********GUI + + #LOC_GUI_NEW=New resource added! + + #LOC_GUI_SNACKSTORAGE1=Amount: <<1>>\nMass: <<2>>\nCost: <<3>> + + #LOC_GUI_SIMU1=Vessel has no crewed parts to simulate. + + #LOC_GUI_SIMU2=Vessel needs crew to run simulation. + + #LOC_GUI_SIMU3=Simulation in progress, please wait... + + #LOC_GUI_SIMU4=No crewed vessels found on or around any world or in solar orbit. + + #LOC_GUI_CREW=Crew: + + #LOC_GUI_ASSUMEACTIVE=Assumes converters are active; be sure to turn them on. + + #LOC_GUI_EXEMPTKERB = Exempt Kerbals: separate names by semicolon, first name only + + #LOC_GUI_EXEMPTKERB_INTRO = These kerbals won't consume Snacks and won't suffer penalties from a lack of Snacks. + + #LOC_GUI_SNACKTIME = Snack Time! + + #LOC_GUI_STOPSIM = Stop simulators (Estimates will be unavailable) + + #LOC_GUI_CREWVIEW = Show Crew View + + #LOC_GUI_CREWVIEWA = Show Available Crew + + #LOC_GUI_STRESSSIM = Open Stresstimator + + #LOC_GUI_COF = Cleared for flight + + #LOC_GUI_STATUS = - Status: + + #LOC_GUI_STRESSNOTE = Your kerbals might get Stressed Out if you transfer them to a docked vessel and then undock. Will that happen? Click on the habitable parts of the docked vessel to find out. Parts highlighted in blue will count towards the estimate. + + #LOC_GUI_STRESSCLOSE =Close Stresstimator + + #LOC_GUI_STRESSES =\n Estimated Stress: <<1>>/<<2>> + + #LOC_GUI_STRESSOUT =\n Will likely get Stressed Out + + #LOC_GUI_STRESSMAXES=Estimated Max Stress: A crew of <<1>> will be Stressed Out after <<2>> days. + + #LOC_GUI_STRESSMAXESNOTE=This is based on a kerbal with no experience. Experienced kerbals can last longer. + + #LOC_GUI_RESOURCEOPTION = Resource Options + + #LOC_GUI_VESSELSTATUS=Vessel Status + + #LOC_GUI_RERUNSIMULATOR=Rerun Simulator + + #LOC_GUI_NEEDSMORE=Needs more + + #LOC_GUI_CREWCAPA =Estimated Crew Capacity:<<1>> + + #LOC_GUI_SNACKPERDAY=<<1>> Snacks/day + + #LOC_INFO_STRESSOUTNAME = Stressed Out + + #LOC_INFO_SICKNAME = Sick + + #LOC_INFO_RELAXNAME = Relaxing + + #LOC_GUI_MISSING=Missing + + + + // **********MODULE + + #LOC_SPCN = Snack Processor + + #LOC_STARTSP = Start Snack Processor + + #LOC_STOPSP = Stop Snack Processor + + #LOC_SLRCYCN = Soil Recycler + + #LOC_STARTSLRCY = Start Soil Recycler + + #LOC_STOPSLRCY = Stop Soil Recycler + + #LOC_ECCN=Entertainment Center + + #LOC_STARTEC=Start Entertainment + + #LOC_STOPEC= Stop Entertainment + + #LOC_SGCN=Stargazing + + #LOC_STARTSG=Start Stargazing + + #LOC_STOPSGCN=Stop Stargazing + + + // **********OTHER + + #LOC_TIME_DAY=<<1>>/day + + #LOC_TIME_HR=<<1>>/hr + + #LOC_TIME_SEC=<<1>>/sec + + #LOC_STRESS_DESCRIPTION=This addon introduces roster resources in the form of Stress. Unlike resources tied to a vessel, roster resources are characteristics of the kerbals. The SnacksConverter can convert roster resources- the Entertainment Center can reduce Stress, for instance, and SNACKS_RESOURCE_PROCESSOR config can work with roster resources as well.
The addon also introduces the Snacks event system. Events let you apply different outcomes based on one or more preconditions. They let you spice up your game and give it more personality.
As for Stress, kerbals don't like being confined to tiny capsules for long journeys, and they accumulate Stress daily. Additional events, like getting Sick, running out of Snacks, and gasping for Fresh Air cause additional Stress.
The vessel's crew capacity and a kerbal's experience level affect how much Stress they can take. Once they hit their max, they are Stressed Out and will no longer work. They are NOT Tourists! Engineers, Pilots, Scientists, and the like simply lose their skills. They can recover in the various stock crew cabins with a working Entertainment Center, but while recovering they don't use their skills either. Once a kerbal's Stress is below their max and you either turn off the Entertainment Center or they leave the cabin, they'll return to work. + + #LOC_DURATION1 = Duration: Unavailable + + #LOC_DURATION2 = Duration: Indefinite + + #LOC_DURATION3 = Duration: Calculating... + + #LOC_DURATION4 = Duration: + + #LOC_AOK=A-OK + + #LOC_TIME1=<<1>> Years, + + #LOC_TIME2=<<1>> Days, + + #LOC_TIME3=<<1>> Hours, + + #LOC_TIME4=<<1>> Minutes, + + #LOC_TIME5=<<1>> Seconds, + + #LOC_OP_SNACK=Snacks + + #LOC_OP_SOIL=Soil + + #LOC_OP_SNACKSOIL=Snacks and Soil + + } +} diff --git a/GameData/WildBlueIndustries/Snacks/Localization/zh-cn.cfg b/GameData/WildBlueIndustries/Snacks/Localization/zh-cn.cfg new file mode 100644 index 0000000..4278b98 --- /dev/null +++ b/GameData/WildBlueIndustries/Snacks/Localization/zh-cn.cfg @@ -0,0 +1,259 @@ +// Auto generated by KSPDev Localization tool at: 7/15/2023 12:16:56 AM +// Total strings: 21 +// Total words: 125 +// 对汉化有疑问或建议,请私信b站https://space.bilibili.com/1615801 +Localization +{ + zh-cn + { + + + // ********** Part: radialSnackTin + + #radialSnackTin_Part_title = 径向零食罐 + #radialSnackTin_Part_manufacturer = Jebediah Kerman的垃圾与航天器零件公司 + #radialSnackTin_Part_description = 此罐可容纳适量的零食以满足维生需求 + #radialSnackTin_Part_tags = cck-lifesupport snacks + + // ********** Part: snackTin1500 + + #snackTin1500_Part_title = S-1500零食罐 + #snackTin1500_Part_manufacturer = Jebediah Kerman的垃圾与航天器零件公司 + #snackTin1500_Part_description = S-1500的大小正适合用于较为长期的居住需求 + #snackTin1500_Part_tags = cck-lifesupport snacks + + // ********** Part: snackTin4500 + + #snackTin4500_Part_title = S-4500零食罐 + #snackTin4500_Part_manufacturer = Jebediah Kerman的垃圾与航天器零件公司 + #snackTin4500_Part_description = S-4500的零食容量足以用于供给最为狂野的巨型派对 + #snackTin4500_Part_tags = cck-lifesupport snacks + + // ********** Part: snackTin500 + + #snackTin500_Part_title = S-500零食罐 + #snackTin500_Part_manufacturer = Jebediah Kerman的垃圾与航天器零件公司 + #snackTin500_Part_description = 可爱的 S-500 零食罐非常适合供应长时间太空活动或小规模的补给运输。 + #snackTin500_Part_tags = cck-lifesupport snacks + + + // **********Resources + + #RESOURCE_SNACK=零食 + + #RESOURCE_STRESS=压力 + + #RESOURCE_SOIL=土壤 + + // **********INFO + + #LOC_INFO_INPUTS=输入 + + #LOC_INFO_OUTPUTS=输出 + + #LOC_INFO_NOTEPRODUCTIONRATES=注意: 生产效率根据游戏设置变动。详情请参阅零件操作窗口. + + #LOC_INFO_NOTEIMPROVE=能够改善生产的坎巴拉人: + + #LOC_GUI_MAXRECY=最大回收效率 + + #LOC_INFO_REQSPLASH = \n - 需要载具溅落在水上 + + #LOC_INFO_REQOXY = \n - 需要载具处于含氧大气层内 + + #LOC_INFO_REQCOMMU = \n - 需要与坎星建立通讯 + + #LOC_INFO_REQCREW = \n - 最低乘员数: + + #LOC_INFO_NEEDSKILL= - 技能需求: + + #LOC_INFO_PROCESSTIME= - 处理时间: + + #LOC_INFO_YELDRES= - 收获资源 + + #LOC_INFO_SOILRECYCAPA=回收部件容量: <<1>> 坎巴拉人 + + #LOC_INFO_SOILPERDAY=<<1>>土壤/天 + + #LOC_INFO_FUND = 坎巴拉人正因没有零食可吃而被迫忍饥挨饿!你因此被罚款<<1>>坎币 + + #LOC_INFO_BADREP = 坎巴拉人正因没有零食可吃而被迫忍饥挨饿! 你的声望因此下降了<<1>> + + #LOC_INFO_DEATH = 死于零食戒断综合症 + + #LOC_INFO_FAINTE = 饿到昏厥 + + #LOC_INFO_TITLE1 = 需要更多资源 + + #LOC_INFO_MISSINGRESOURCE = 原因: 缺少资源 + + #LOC_INFO_PRDUCFAILD1 = 已经没有<<1>>可用于生产. 直到获得更多资源前,<<2>>的操作将无法运行. + + #LOC_INFO_TITLE2 = 原因: 缺少特定资源 + + #LOC_INFO_MISSINGREQRESOURCE = 原因: 缺少资源 + + #LOC_INFO_PRDUCFAILD2 = <<1>>需要<<2>>才能正常运转. 直到该资源变得可用为止,操作都将被暂时挂起. + + #LOC_INFO_TITLE3 = 缺少存储空间 + + #LOC_INFO_CONTAINERFULL = 原因: 容器已满 + + #LOC_INFO_PRDUCFAILD3 = 没有足够的空间可以用于存储<<1>>,<<2>>的操作将无法运行直到拥有更多可用的存储空间. + + #LOC_INFO_TITLE4 = 某个转换装置发生了严重故障 + + #LOC_INFO_PRDUCFAILD4 = <<1>>出现严重故障造成产能损失。你必须维修并重启该设备以继续生产。 + + #LOC_INFO_STRESSOUT=因精神压力过大而无法正常工作 + + #LOC_INFO_STRESSOUTRECOVER = 从巨大的精神压力中逐渐康复 + + + // **********STATUS + + #LOC_STATUS_NOCOMMU=需要与坎星建立通讯 + + #LOC_STATUS_FULL= 已满 + + #LOC_STATUS_NOCREW=需要更多乘员 + + #LOC_STATUS_NOOXY=需要含氧大气层 + + #LOC_STATUS_NOSPLASH=需要溅落在水中 + + + // **********GUI + + #LOC_GUI_NEW=新的维生资源! + + #LOC_GUI_SNACKSTORAGE1=数量: <<1>>\n质量: <<2>>\n价格: <<3>> + + #LOC_GUI_SIMU1=载具没有可搭载乘员的部件 + + #LOC_GUI_SIMU2=载具中没有乘员 + + #LOC_GUI_SIMU3=正在模拟,请稍后…… + + #LOC_GUI_SIMU4=找不到任何搭载乘员的载具 + + #LOC_GUI_CREW=乘员: + + #LOC_GUI_ASSUMEACTIVE=此估算默认转换器部件处于开启状态; 请确保他们确实开启。 + + #LOC_GUI_EXEMPTKERB = 设置不吃零食的坎巴拉人:用分号分隔不同坎巴拉人的名称,只写名即可 + + #LOC_GUI_EXEMPTKERB_INTRO = 这些坎巴拉人不需要吃零食,你也不会因此受任何惩罚 + + #LOC_GUI_SNACKTIME = 先搓一顿! + + #LOC_GUI_STOPSIM = 停止模拟 (零食消耗估算功能将不可用) + + #LOC_GUI_CREWVIEW = 乘员面板 + + #LOC_GUI_CREWVIEWA = 可用乘员 + + #LOC_GUI_STRESSSIM = 打开压力模拟器 + + #LOC_GUI_COF = 可以参与飞行! + + #LOC_GUI_STATUS = - 状态: + + #LOC_GUI_STRESSNOTE = 如果您将坎巴拉人将要对接到一个载具上然后再分离对接,您的坎巴拉可能会因此感到压力?单击载具的可居住部件以确认。以蓝色突出显示的部分将计入估算值。 + + #LOC_GUI_STRESSCLOSE =关闭压力模拟器 + + #LOC_GUI_STRESSES =\n 压力估值: <<1>>/<<2>> + + #LOC_GUI_STRESSOUT =\n 可能会感到压力过大 + + #LOC_GUI_STRESSMAXES=最大压力承受估值: <<1>>名乘员会在<<2>>天后达到他们精神承受力的极限。 + + #LOC_GUI_STRESSMAXESNOTE=\n注意:此估值默认乘员没有任何技能,高星级的坎巴拉人能够承受更多压力 + + #LOC_GUI_RESOURCEOPTION = 资源选项 + + #LOC_GUI_VESSELSTATUS=载具状态 + + #LOC_GUI_RERUNSIMULATOR=重新开始模拟计算 + + #LOC_GUI_NEEDSMORE=需要更多 + + #LOC_GUI_CREWCAPA =预估乘员容量: <<1>> + + #LOC_GUI_SNACKPERDAY=<<1>> 零食/天 + + #LOC_INFO_STRESSOUTNAME = 精神压力过大 + + #LOC_INFO_SICKNAME = 不健康 + + #LOC_INFO_RELAXNAME = 放松 + + #LOC_GUI_MISSING= 没有 + + + // **********MODULE + + #LOC_SPCN = 零食生产 + + #LOC_STARTSP = 开始零食生产 + + #LOC_STOPSP = 停止零食生产 + + #LOC_SLRCYCN = 土壤回收 + + #LOC_STARTSLRCY = 开始回收土壤 + + #LOC_STOPSLRCY = 停止回收土壤 + + #LOC_ECCN=娱乐中心 + + #LOC_STARTEC=开始娱乐 + + #LOC_STOPEC= 停止娱乐 + + #LOC_SGCN=观星 + + #LOC_STARTSG=开始观星 + + #LOC_STOPSGCN=停止观星 + + + // **********OTHER + + #LOC_TIME_DAY=<<1>>/天 + + #LOC_TIME_HR=<<1>>/小时 + + #LOC_TIME_SEC=<<1>>/秒 + + #LOC_STRESS_DESCRIPTION=这个插件添加了Stress压力水平作为一种维生资源。和载具上携带的资源不同,压力是坎巴拉人自带的一种属性。SnacksConvert可以转换资源-例如,娱乐中心可以减少压力,SNACKS_RESOURCE_PROCESSOR配置也可以使用维生资源
插件还引入了Snacks事件系统。事件允许您根据一个或多个先决条件应用不同的结果。它们可以让你在游戏中增添趣味,让游戏更有个性
至于压力,坎巴拉人不喜欢被限制在长途旅行的小胶囊里,它们每天都会积累压力。如生病、零食用完和缺少空气等事件会造成额外的压力
船只的船员能力和路缘石的经验水平会影响他们承受的压力。一旦他们达到了极限,他们就会感到压力过大,不再工作。他们是不是游客!工程师、飞行员、科学家等等都会失去他们的技能。他们可以在有工作娱乐中心的各种船员舱里恢复,但在恢复的同时,他们也不使用自己的技能。一旦路边的压力低于最大值,你要么关闭娱乐中心,要么他们离开小屋,他们就会返回工作岗位。 + + #LOC_DURATION1 = 持续时间: 不可用 + + #LOC_DURATION2 = 持续时间: 无期限 + + #LOC_DURATION3 = 持续时间: 正在计算…… + + #LOC_DURATION4 = 持续时间: + + #LOC_AOK=一切正常 + + #LOC_TIME1=<<1>>年, + + #LOC_TIME2=<<1>>天, + + #LOC_TIME3=<<1>>时, + + #LOC_TIME4=<<1>>分, + + #LOC_TIME5=<<1>>秒, + + #LOC_OP_SNACK=零食 + + #LOC_OP_SOIL=土壤 + + #LOC_OP_SNACKSOIL=零食与土壤 + + } +} diff --git a/GameData/WildBlueIndustries/Snacks/ModuleManagerPatches/MM_Stock.cfg b/GameData/WildBlueIndustries/Snacks/ModuleManagerPatches/MM_Stock.cfg index 586ad6d..5815ca5 100644 --- a/GameData/WildBlueIndustries/Snacks/ModuleManagerPatches/MM_Stock.cfg +++ b/GameData/WildBlueIndustries/Snacks/ModuleManagerPatches/MM_Stock.cfg @@ -41,9 +41,9 @@ MODULE { name = SnackProcessor - ConverterName = Snack Processor - StartActionName = Start Snack Processor - StopActionName = Stop Snack Processor + ConverterName = #LOC_SPCN //#LOC_SPCN = Snack Processor + StartActionName = #LOC_STARTSP //#LOC_STARTSP = Start Snack Processor + StopActionName = #LOC_STOPSP //#LOC_STOPSP = Stop Snack Processor AutoShutdown = false GeneratesHeat = false UseSpecialistBonus = true @@ -93,9 +93,9 @@ MODULE { name = SoilRecycler - ConverterName = Soil Recycler - StartActionName = Start Soil Recycler - StopActionName = Stop Soil Recycler + ConverterName = #LOC_SLRCYCN //#LOC_SLRCYCN = Soil Recycler + StartActionName = #LOC_STARTSLRCY //#LOC_STARTSLRCY = Start Soil Recycler + StopActionName = #LOC_STOPSLRCY //#LOC_STOPSLRCY = Stop Soil Recycler AutoShutdown = false GeneratesHeat = false UseSpecialistBonus = true diff --git a/GameData/WildBlueIndustries/Snacks/Parts/@thumbs/radialSnackTin_icon.png b/GameData/WildBlueIndustries/Snacks/Parts/@thumbs/radialSnackTin_icon.png new file mode 100644 index 0000000..ca6b768 Binary files /dev/null and b/GameData/WildBlueIndustries/Snacks/Parts/@thumbs/radialSnackTin_icon.png differ diff --git a/GameData/WildBlueIndustries/Snacks/Parts/@thumbs/snackTin1500_icon.png b/GameData/WildBlueIndustries/Snacks/Parts/@thumbs/snackTin1500_icon.png index 105717d..8b0ae13 100644 Binary files a/GameData/WildBlueIndustries/Snacks/Parts/@thumbs/snackTin1500_icon.png and b/GameData/WildBlueIndustries/Snacks/Parts/@thumbs/snackTin1500_icon.png differ diff --git a/GameData/WildBlueIndustries/Snacks/Parts/@thumbs/snackTin4500_icon.png b/GameData/WildBlueIndustries/Snacks/Parts/@thumbs/snackTin4500_icon.png new file mode 100644 index 0000000..147b3f4 Binary files /dev/null and b/GameData/WildBlueIndustries/Snacks/Parts/@thumbs/snackTin4500_icon.png differ diff --git a/GameData/WildBlueIndustries/Snacks/Parts/@thumbs/snackTin500_icon.png b/GameData/WildBlueIndustries/Snacks/Parts/@thumbs/snackTin500_icon.png new file mode 100644 index 0000000..2ebf2f3 Binary files /dev/null and b/GameData/WildBlueIndustries/Snacks/Parts/@thumbs/snackTin500_icon.png differ diff --git a/GameData/WildBlueIndustries/Snacks/Parts/Payload/radialSnackTin.cfg b/GameData/WildBlueIndustries/Snacks/Parts/Payload/radialSnackTin.cfg index 1f22d84..b722e31 100644 --- a/GameData/WildBlueIndustries/Snacks/Parts/Payload/radialSnackTin.cfg +++ b/GameData/WildBlueIndustries/Snacks/Parts/Payload/radialSnackTin.cfg @@ -15,9 +15,9 @@ PART cost = 450 category = Payload subcategory = 0 - title = Radial Snack Tin - manufacturer = Jebediah Kerman's Junkyard and Spacecraft Parts Co - description = This tank holds a moderate amount of snacks for your life support needs. + title = #radialSnackTin_Part_title + manufacturer = #radialSnackTin_Part_manufacturer + description = #radialSnackTin_Part_description attachRules = 0,1,0,0,1 mass = 0.015 dragModelType = default @@ -32,11 +32,11 @@ PART MODULE { name = SnacksResourceSwitcher - defaultOption = Snacks + defaultOption = #LOC_OP_SNACK //#LOC_OP_SNACK=Snacks OPTION { - name = Snacks + name = #LOC_OP_SNACK RESOURCE { @@ -48,7 +48,7 @@ PART OPTION { - name = Soil + name = #LOC_OP_SOIL //#LOC_OP_SOIL=Soil RESOURCE { @@ -60,7 +60,7 @@ PART OPTION { - name = Snacks and Soil + name = #LOC_OP_SNACKSOIL //#LOC_OP_SNACKSOIL=Snacks and Soil RESOURCE { diff --git a/GameData/WildBlueIndustries/Snacks/Parts/Payload/snackTin1500.cfg b/GameData/WildBlueIndustries/Snacks/Parts/Payload/snackTin1500.cfg index be4bd30..73fa150 100644 --- a/GameData/WildBlueIndustries/Snacks/Parts/Payload/snackTin1500.cfg +++ b/GameData/WildBlueIndustries/Snacks/Parts/Payload/snackTin1500.cfg @@ -12,9 +12,9 @@ PART cost = 800 category = Payload subcategory = 0 - title = S-1500 Snack Tin - manufacturer = Jebediah Kerman's Junkyard and Spacecraft Parts Co - description = The S-1500 is just the right size for even more extended stays + title = #snackTin1500_Part_title + manufacturer = #snackTin1500_Part_manufacturer + description = #snackTin1500_Part_description attachRules = 1,1,1,1,0 mass = 0.15 @@ -37,11 +37,11 @@ PART MODULE { name = SnacksResourceSwitcher - defaultOption = Snacks + defaultOption = #LOC_OP_SNACK //#LOC_OP_SNACK=Snacks OPTION { - name = Snacks + name = #LOC_OP_SNACK //#LOC_OP_SNACK=Snacks RESOURCE { @@ -53,7 +53,7 @@ PART OPTION { - name = Soil + name = #LOC_OP_SOIL //#LOC_OP_SOIL=Soi RESOURCE { @@ -65,7 +65,7 @@ PART OPTION { - name = Snacks and Soil + name = #LOC_OP_SNACKSOIL RESOURCE { diff --git a/GameData/WildBlueIndustries/Snacks/Parts/Payload/snackTin4500.cfg b/GameData/WildBlueIndustries/Snacks/Parts/Payload/snackTin4500.cfg index b9d539c..67594c8 100644 --- a/GameData/WildBlueIndustries/Snacks/Parts/Payload/snackTin4500.cfg +++ b/GameData/WildBlueIndustries/Snacks/Parts/Payload/snackTin4500.cfg @@ -12,9 +12,9 @@ PART cost = 3250 category = Payload subcategory = 0 - title = S-4500 Snack Tin - manufacturer = Jebediah Kerman's Junkyard and Spacecraft Parts Co - description = The S-4500 contains a huge number of snacks for those wild parties. + title = #snackTin4500_Part_title + manufacturer = #snackTin4500_Part_manufacturer + description = #snackTin4500_Part_description attachRules = 1,1,1,1,0 mass = 0.45 @@ -37,11 +37,11 @@ PART MODULE { name = SnacksResourceSwitcher - defaultOption = Snacks + defaultOption = #LOC_OP_SNACK //#LOC_OP_SNACK=Snacks OPTION { - name = Snacks + name = #LOC_OP_SNACK //#LOC_OP_SNACK=Snacks RESOURCE { @@ -53,7 +53,7 @@ PART OPTION { - name = Soil + name = #LOC_OP_SOIL //#LOC_OP_SOIL=Soil RESOURCE { @@ -65,7 +65,7 @@ PART OPTION { - name = Snacks and Soil + name = #LOC_OP_SNACKSOIL //#LOC_OP_SNACKSOIL=Snacks and Soil RESOURCE { diff --git a/GameData/WildBlueIndustries/Snacks/Parts/Payload/snackTin500.cfg b/GameData/WildBlueIndustries/Snacks/Parts/Payload/snackTin500.cfg index c925783..910cc07 100644 --- a/GameData/WildBlueIndustries/Snacks/Parts/Payload/snackTin500.cfg +++ b/GameData/WildBlueIndustries/Snacks/Parts/Payload/snackTin500.cfg @@ -12,9 +12,9 @@ PART cost = 150 category = Payload subcategory = 0 - title = S-500 Snack Tin - manufacturer = Jebediah Kerman's Junkyard and Spacecraft Parts Co - description = The adorable S-500 Snack Tin is perfect for extended excursions into space or for small supply runs. + title = #snackTin500_Part_title + manufacturer = #snackTin500_Part_manufacturer + description = #snackTin500_Part_description attachRules = 1,1,1,1,0 mass = 0.05 @@ -37,11 +37,11 @@ PART MODULE { name = SnacksResourceSwitcher - defaultOption = Snacks + defaultOption = #LOC_OP_SNACK //#LOC_OP_SNACK=Snacks OPTION { - name = Snacks + name = #LOC_OP_SNACK //#LOC_OP_SNACK=Snacks RESOURCE { @@ -53,7 +53,7 @@ PART OPTION { - name = Soil + name = #LOC_OP_SOIL //#LOC_OP_SOIL=Soi RESOURCE { @@ -65,7 +65,7 @@ PART OPTION { - name = Snacks and Soil + name = #LOC_OP_SNACKSOIL //#LOC_OP_SNACKSOIL=Snacks and Soil RESOURCE { diff --git a/GameData/WildBlueIndustries/Snacks/Plugin/SnacksUtils.dll b/GameData/WildBlueIndustries/Snacks/Plugin/SnacksUtils.dll index 7d8d71c..6a5aa22 100644 Binary files a/GameData/WildBlueIndustries/Snacks/Plugin/SnacksUtils.dll and b/GameData/WildBlueIndustries/Snacks/Plugin/SnacksUtils.dll differ diff --git a/GameData/WildBlueIndustries/Snacks/Plugin/SnacksUtils.pdb b/GameData/WildBlueIndustries/Snacks/Plugin/SnacksUtils.pdb index 8f10d37..80e0fe8 100644 Binary files a/GameData/WildBlueIndustries/Snacks/Plugin/SnacksUtils.pdb and b/GameData/WildBlueIndustries/Snacks/Plugin/SnacksUtils.pdb differ diff --git a/GameData/WildBlueIndustries/Snacks/Readme_zh-cn.txt b/GameData/WildBlueIndustries/Snacks/Readme_zh-cn.txt new file mode 100644 index 0000000..de24aec --- /dev/null +++ b/GameData/WildBlueIndustries/Snacks/Readme_zh-cn.txt @@ -0,0 +1,390 @@ +Snacks! + +原作者: Troy Gruetzmacher (tgruetzm) +现更新作者: Angel-125 + +《Snacks》最初由Troy Gruetzmacher(tgruetzm)于2014年8月发行。它为那些不想使用像《TAC生命支持》这样的更复杂的模组的人提供了一种新颖而轻量级的生命支持解决方案。两年后,游戏取得了进展,虽然原作者不再继续提供支持,但是时候给零食更新了。 + +特性: +- 友好的轻量级维生系统 +- 可以自行大幅修改配置以适应您自身的游玩风格 +- 维生失效导致的后果同样也可自行配置,不用担心破坏你当前存档中的载人任务 + +您可以配置每餐消耗的零食、每天吃几餐、启用/禁用回收、回收效率以及对饥饿的坎巴拉人的各种处罚,包括声誉损失、罚款和部分载具控制。如果需要,您甚至可以启用/禁用随机零食。就像Stock CommNet一样,惩罚不会破坏你的任务。所有这些选项都可以在游戏难度设置中找到。如果这是您首次接触Snacks,请查阅KSPedia中的Snacks条目。 + + +LICENSE +Source code: The MIT License (MIT) +Snack Tin artwork by SQUAD/Porkjet: CC-BY-NC 3.0 +Portions of this codebase are CC-BY-NC 3.0 and derived from Taranis Elsu's Window class. + +安装 +删除 GameData/Snacks 中的其他文件 +将压缩文件解压到 GameData/Snacks + +REVISION HISTORY + +1.28.0 +- Buffalo 2 compatibility update + +1.27.5 +- Sandcastle compatibility update + +1.27.3 +- Recompiled for KSP 1.12.2. +- Fixed issue where Snacks events weren't being processed correctly. + +1.27.2 +- Added new SKILL_LOSS_CONDITION named Gardening to the list of conditions that will cause skill loss when a part with an active SnacksConverter is running, it lists Gardening as one of its skill loss conditions, and a kerbal resides inside the part. For example, a kerbal can be working in a greenhouse. +Hint: The greenhouse could also reduce a kerbal's Stress while it is running. +- Fixed issue where too many Snacks were being added to kerbals sitting in external command seats. +- Fixed issue where kerbals sitting in external command seats upon vessel launch weren't receiving EVA resources like FreshAir. +- Fixed NRE generated while opening the Snacks window when a vessel has kerbals in external command seats. +- Fixed issue where crew capacity was incorrectly calculated when kerbals sat in external command seats. Yay for circumventing a KSP bug! + +1.27.1 +- Fixed issue where Snacks weren't being added to crewed parts. + +1.27 + +- Added the ability to store the SOCS Oxium Candle as a cargo part. +- SNACKS_PART_RESOURCE now supports unitsPerDay and daysLifeSupport. They specify the number of units per day that is consumed (per kerbal), and the number of days of life support to add to the part, respectively. If they're specified, then amount and maxAmount are ignored. +- Fixed missing resource infos in the editor's part display window. + +1.26.1 + +- Fixed issue where the PAW would flicker whenever adjusting settings on another part. +- Fixed issue where players could not copy parts with Snacks resources in them. + +1.26.0 + +Changes + +- If a kerbal on EVA consumes a resource and it dips below minimum safe levels, then the player will receive a warning message. +- In Debug mode, the Snack Time button will become available in the Snacks flight app window. +- Fixed Snacks App Window not updating resource values properly after snack time. +- Fixed NRE generated when opening the Snacks window and there is a kerbal on EVA. +- Fixed issue where EVA resources were consumed when the jetpack is used. NOTE: Use the in-flight Snacks window to see the EVA kerbal's resources, they're no longer +visible in the Resources window due to the stock EVA resource consumption bug. +- Fixed crash issue that occurs when placing parts with crew capacity in symmetry. +- Fixed issue in Snacks App Window where kerbals on EVA would display their crew count. + +1.25.2 +- Fix Stresstimator showing up in Space Center window when it shouldn't. +- Fix corrected density of Hydrazine. + +1.25.1 +- Fix SnacksConverter not restoring skills when the converter is activated and a kerbal transfers to another part. +- You can now estimate a vessel's max Stress capacity in the VAB/SPH. Requires Stress to be enabled (rename the Stress.txt file in LifeSupportResources folder to Stress.cfg). + +New Feature +- Stresstimator: If you have Stress enabled, then you'll get a new button in the in-flight Snacks window to open the Stresstimator. This window helps you estimate the max Stress that your crew can take based on the crewable parts that you select. Since kerbals can get Stressed Out when moving from vessels with a lot of available crew capacity to vessels without much available crew capacity, the Stresstimator helps you avoid kerbals getting Stressed Out if they have accumulated Stress, you move them to a docked vessel, and then undock the vessel. Given the game design, it's very difficult to do the Stress estimate automagically, so the Stresstimator is better than nothing... + +1.25.0 +- Fix background converters not respecting locked resources for unloaded vessels. +- Fix resource processors not respecting locked resources for unloaded vessels. +- Fix condition summary not showing Stressed Out condition. +- Fix Stress not recalculated when a vessel docks or undocks. +- Fix SOCS Cannister explosion check not being checked. +- Fix SOCS Cannister automatically shuts down when it runs out of SOCS Fuel. +- Fix SOCS Cannister user messages are more appropriate now. +- If kerbals get Stressed Out they might start stress eating. If you run out of Snacks they'll get even more Stressed Out. +- Kerbals wait to get Stressed Out before they start consuming "Hydrazine." +- You can now disable email notifications of converters running out of resources or storage space via the Snacks Settings menu. +- Background processors no longer consume ElectricCharge for simplicity; it's either that or bog the game down with finding and running power generators. +- You can now customize the SnacksConverter's criticalSuccessMessage, successMessage, failMessage, and criticalFailMessage displayed during yielded resource checks. + +1.24.5 +- Bug fixes + +1.24.4 +- Snacks (and other life support resources) will now be added to vessels that are loaded into the VAB/SPH. + +1.24.3 +- Compatibility update + +1.24.1 +- Updated for KSP 1.8 + +1.23.2 +- Reduced timewarp ElectricCharge cap to 3x. +- New game settings: you can turn on/off ElectricCharge consumption for Snacks converters during background processing. Default is ON. + +1.23.1 +- Fixed issue with kerbals not suffering any penalties when a ship processed in the background has locked snack tins. +- Experienced kerbals can now process inputs and outputs without affecting ElectricCharge consumption. + +1.23.0 +- You can now disable Snacks/Soil resource processing if desired. Just rename Snacks.cfg to Snacks.txt in the LifeSupportResources folder. + +1.22.2 +- Fixed flow mode issues for ElectricCharge consumption. + +1.22.1 +- Removed test code from the simulator. + +1.22 +- Added support for Dynamic Batteries. +- Added ability to interrupt the resource consumption simulator. NOTE: duration estimates will be unavailable. +- Fix Inability to view vessels not on or around the current world. +- Fix Missing roster resource names when added to the kerbal. + +1.21 +- CheckResources can now check resource percent levels. +- Fix Simulator window not running simulations after closing and reopening the window in the same scene. +- Fix NRE generated by FaintPenalty. +- Fix estimated time remaining display showing 1 hour even when out of resources. +- Fix Snacks converters and their derivatives give players a break on ElectricCharge consumption past 100x timewarp. +- Fix background converters honor infinite electricity and infinite propellant debug settings. +- Fix "Hydrazine" Vodka display name. + +1.20.3 +- Fix snack tin symmetry issues. +- Fix NREs when changing resources. + +1.20.1 +- Small update to support the new Hydrazine tutorial. + +1.20 Air and Stress + +When I started reworking Snacks to add in the penalty system, I tried to follow the same design philosophies that Squad did when making KerbNet: make it a challenge but don't brick your game or save. I've kept that philosophy and stuck to the original concept as a lightweight life support system as I've made improvements over the years. This update is the collmination of weeks of work that keeps the simplistic life support out of the box but opens the doors to so much more. All it needs is a bit of legwork on your part, but there are plenty of examples. + +I'm happy to say that Snacks is feature complete! + +Custom Life Support Resources: Snacks now has the ability to define custom life support resources besides just Snacks! All it takes is a config file. With this feature you can: + - Define your own life support resource to consume and/or produce. + - Optionally track its status in the vessel snapshot window- with support in the multithreaded simulator! + - Optionally apply one or more outcomes (like penalties) if the consumed resource runs out, or if space for the produced resource is full. + +As an example of a tracked resource, check out the LifeSupportResources folder for the FreshAir.txt file. Rename it with the .cfg extension to enable it. +NOTE: You can make FreshAir using the stock ISRU and mini ISRU, and all the stock crew cabins have Air Scrubber converters to turn StaleAir into FreshAir. + +New Part: SOCS! Similar to the real-world Solid Fuel Oxygen Generator, the Solid Oxium Candle System burns a solid fuel to produce Fresh Air. Once started it can't be stopped and it might explode... It's available at the Survivability tech tree node, and only available if you enable Air. + +Roster Resource: Roster resources can now be defined via the SNACKS_ROSTER_RESOURCE config node. A roster resource is a characteristic of a kerbal as opposed to a resource stored in a part. Better yet, the SnacksConverter can work with roster resources- with background processing! + +New penalty: The OnStrikePenalty removes a kerbal's skill set without turning him or her into a tourist. That way, should you uninstall the mod for some reason, you won't brick your mission or game. + +Stress: You now have an optional resource to keep track of: Stress! Stress reflects the difficulties of living in confined spaces for extended periods of time. The more space available, reflected in a vessel's crew capacity, the longer a kerbal can live and work without getting stressed out. Events like a lack of food and FreshAir, arguments with other crew members, and low gravity can also cause Stress. And when a kerbal gets stressed out, they'll stop using their skills. You can reduce Stress by letting the kerbal hang out in the Cupola, but you won't gain use of their skills while they're relaxing. To enable Stress, just rename the LifeSupportResources/Stress.txt with the .cfg extension and restart your game. If you already have Kerbal Health then you won't need Stress, but it can serve as an example for how to use roster resources. + +And if you have BARIS installed, part failures and staging failures will cause Stress! + +Events: Random snacking is now reworked into an event system to add flavor to the game. Kerbals might get the munchies, or eat bad food. Maybe a crew member snores and it causes Stress. With a host of preconditions and outcomes, you can make a number of different and entertaining events. Check out the Events.cfg file in the Snacks folder for a couple of examples. + +Wiki: updates describe all the preconditions, outcomes and events along with other API objects. + +1.16.4 +- Fix for kerbals taking too many snacks with them when going on EVA. + +1.16.3 +- Fixed issue where Snacks was being consumed by occupants of vessel that's part of a rescue contract. NOTE: Once the craft is loaded into the scene, they will be tracked by Snacks. + +1.16.2 +- Fixed issue where parts weren't receiving their correct allotment of Snacks for parts where the crew capacity is greater than one kerbal. + +1.16.1 +- Updated Snacks Trip Planner in the Docs folder - new Timewarp Calcs tab. +- SnacksConverter now has new options: + requiresHomeConnection - Requires connection to homeworld to operate. + minimumCrew - Minimum number of crew that must be in the host part in order to run the converter. +NOTE: Snacks Processor and Soil Recycler don't use these. +- Fixed NREs generated when converters are added in the editor. +- Fixed issue where Snacks wasn't being added to parts in the editor. +- Fixed debug info in SnacksProcessor. +- Fixed issue where Snack supply window wasn't being updated when the window is opened and snack time happens. + +1.16 +- Added new celestial bodies filter to the snacks supply window. + +- Snacks will now run simulations on a vessel's supplies and converters to estimate how long the vessel's snacks will last. +NOTE: For the simulator to work properly, be sure to visit all your in-flight vessels that have crews aboard after installing this update. +NOTE: The simulator cannot simulate drill operations. + +- Made some improvements to background converter processing. As a bonus, power production & consumption are also run in the background- with Kopernicus support for solar arrays. + +- SnacksConverter now lists the yield resources in the part info window, and shows yield production time remaining in the PAW. + +- Snacks and other resources consumed per day are now calculated based on the solar day length of the homeworld instead of set to the stock 6hrs/24hrs. I'm looking at you, JNSQ... + +1.15 +- Fixed issue where vessels spawned in game for rescue contracts lacked Snacks. +- Fixed integration issue with WalkAbout. +- The Soil Recycler now uses the Converter Skill from Engineers instead of the Science Skill. Yup, Scientists make Snacks from rocks and (sanitation) Engineers recycle Soil into Snacks. +- The converter and recycler won't automatically shut down if they lack an input resource or an output resource is full. Instead they'll wait until they get what they need. +- Updated the recycler/processor info view in the editor's part description window. + +1.14 +- Fixed restock whitelist + +1.13 +- Fixed recycler and processor efficiency calculations. +- Other bug fixes. + +1.12 +- Updated for KSP 1.7 +- Bug fixes + +1.11.5 +- Fixed empty mass for the radial snack tin to be in line with similar parts. +- Fixed snack resources being locked by default when Snacks are added to in-flight vessels. +- Fixed efficiency processing; processors and recyclers output efficiency should now be 10% to 100% efficient based on their efficiency setting. +- Fixed issue where converters and processors wouldn't run in the background without at least one Kerbal aboard. +- Fixed issue where the Snacks Processor and Soil Recycler wouldn't produce the proper amount of resources while the vessel is in physics range. +- Reduced the amount of Snacks per day produced by the stock Mobile Processing Lab. It was a bit OP... +- Snack tins now tell you what their resource options are in the part info view. +- Added new SnacksConverter part module. It serves as the basis for the existing Snacks Processor and Soil Recycler. It can also produce "YIELD_RESOURCE" units over time just like the greenhouse from Wild Blue Tools. You can even assign effects to the converter! +NOTE: Snacks won't be getting a greenhouse of its own; it's intended to be a lightweight life support system, but I recognize that some players want more sophisticated capabilities. So the tools are there for others to expand upon... + +1.11.1 +- Recompiled for KSP 1.6 + +1.11.0 +- Updated for KSP 1.5.X +- The Snack Processor and Soil Recycler will now automatically shut down if the vessel's ElectricCharge reserves drop below 5%. + +1.10.0 +- Fixed NRE causing the Settings menu to not appear. +- Kerbals can now die from a lack of Snacks! This penalty is trned OFF by default, and you can change the number of skipped meals before a kerbal dies in the settings menu. Kerbals listed as exempt will never starve to death. + +1.9.0 +- Recompiled for KSP 1.4.1 + +1.8.7 +- Fixed NRE and production issues with the SnackProcessor. + +1.8.6 +- Snack consumption now honors resource locks. +- Retextured radial snack tin - Thanks JadeOfMaar! :) +- Removed unneeded catch-all - Thanks JadeOfMaar! :) +- Fixed bulkhead profiles and tags on inline snack tins - Thanks JadeOfMaar! :) +- Add parts to CCK LS category - Thanks JadeOfMaar! :) + +1.8.5 +- Fixed background processing of snacks and soil issues with WBI mods (Pathfinder, Buffalo, etc.). +NOTE: Be sure to visit your spacecraft at least once to ensure that the changes take effect. +- Updated to KSP 1.3.1. + +1.8.0 +- Time estimates are now measured in years and days; months, though accurate, was getting too confusing. +- Snack processors and soil recyclers now run in the background when vessels aren't loaded. + +1.7.0 + +- Adjusted snack production rates for the snack grinder (found on the Hitchhiker). +- Added hooks for Snacks Plus. You can download Snacks Plus from: +- Revised the Snacks Trip Planner spreadsheet. + +1.6.5 +- Added a radial snack tin. It holds 150 snacks, 150 Soil, or 75 Snacks and 75 Soil. + +1.6 +- Plugin renamed to SnacksUtils to alleviate issues with ModuleManager. +- When kerbals faint due to lack of snacks, you now choose from 1 minute, 5 minutes, 10 minutes, 30 minutes, an hour, 2 hours, or a day. +- Snacks now supports 24-hour days in addition to 6-hour days. Snack frequency is calculated accordingly. + +1.5.7 +- Fixed snacks calculations and minor GUI update. Thanks for the patch, bounty123! :) + +1.5.6 +- Fixed NRE's that happen in the editor (VAB/SPH) +- Snacking frequency is correctly calculated now. +- Updated to KSP 1.2.1 +- Added recyclers to the Mk3 shuttle cockpit and the Mk2 crew cabin. + +1.5.5 +- Fixed some NREs. +- Fixed a situation where the ModuleManager patch wasn't adding snacks to crewed parts; Snacks can now dynamically add them when adding parts to vessels in the VAB/SPH. + +1.5.3 +- When kerbals go EVA, they take one day's worth of snacks with them. +- More code cleanup. +- Bug Fixes + +1.5.1 +- Temporarily disable the partial vessel control penalty. +- Added additional checks for vessels created through rescue contracts; any crew listed as "Unowned" will be ignored. + +1.5.0 +- ISnacksPenalty now has a RemovePenalty method. Snacks will call this each time kerbals don't miss any meals. +- ISnacksPenalty now has a GameSettingsApplied method. This is called at startup and when the player changes game settings. +- The partial control loss penalty should work now. +- New penalty: kerbals can pass out if they miss too many meals. +- Updated the KSPedia to improve clarity and to add the new penalty option. + +New events +onBeforeSnackTime: Called before snacking begins. +onSnackTime: Called after snacking. +onSnackTick: called during fixed update right after updating the vessel snapshot. +onConsumeSnacks: Called right after calculating snack consumption but before applying any penalties. Gives you to the ability to alter the snack consumption. +onKerbalsMissedMeal: Called when a vessel with kerbals have missed a meal. + +1.4.5 +- Fixed an issue with snack tins not showing up. +- A single kerbal can now consume up to 12 snacks per meal and up to 12 snacks per day. +- By default, a single kerbal consumes 1 snack per meal and 3 meals per day. +- Reduced Soil storage in the Hitchhiker to 200. This only applies to new vessels. +- Reduced Snacks per crew capacity in non-command pods to 200 per crewmember. This only applies to new vessels. +- Added the SnacksForExistingSaves.cfg file to specify number of Snacks per command pod and snacks per non-command pod. These are used when installing Snacks into existing saves for vessels already in flight. +- Added new ISnacksPenalty interface for mods to use when implementing new penalties. One of the options is to always apply the penalty even with random penalties turned off. Of course the implementation can decide to honor random penalties... +- Added a Snacks Trip Planner Excel spreadsheet. You'll find it in the Docs folder. An in-game planner is in the works. + +1.4.0 + +- Adjusted Snack production in the MPL; it was way too high. Ore -> Snacks is now 1:10 with mass conservation. A 1.25m Small Holding Tank (holds 300 Ore) now produce 3,000 Snacks. +- Added display field to Snack Processor that tells you how the max amount of snacks per day that it can produce. +- Moved Snack Tins to the Payload tab. +- Added option to show time remaining in days. +- When kerbals go hungry, added the option to randomly choose one penalty from the enabled penalties, or to apply all enabled penalties. +- Added lab data/experiment data loss as an optional penalty. +- You can now register/unregister your own custom penalties. This is particularly useful for addons to Snacks. +- Cleaned up some KSPedia issues. +- Fixed an issue with adding Snacks to existing saves. +- Fixed an issue with vessels spawned from rescue contracts incuring penalties due to being out of Snacks. + +1.3.0 + +- Snacks now have mass and volume. One unit of Snacks takes up 1 liter and masses 0.001 metric tons. +- Adjusted the MPL's Snack Processor's Ore to Snacks output to account for mass. +- The Snack Processor's efficiency can be improved by those with the Science skill. +- Added several configurable options to KSP's Game Difficulty screen. +- If recycling is enabled, then kerbals produce Soil when consuming Snacks. Soil is a 1-liter resource that masses 0.001 metric tons. Apparently Soil was part of tgruetzm's original design... +- If recycling is enabled, then the Hitchhiker can convert Soil into Snacks. You can configure recycling efficiency in the Game Difficulty screen. +- New consequences for missing meals: + * Pay fines per kerbal + * Lose partial control of the vessel +- Added three sizes of Snack Tins. They can be switched between storing Snacks, Soil, or both. Models and textures courtesy of SQUAD/Porkjet. +- Added KSPedia entries for Snacks! + +1.2.0 +- Pre-release for KSP 1.2 pre-release. + +1.1.6 +- Minor updates to the MM patch to help with customization + +1.1.5 +- Updated to KSP 1.1.2 + +1.1.4 +- Fixed an issue where snacks weren't provided to non-command crewed parts. +- Rebalananced Snack amounts for non-command modules to 400 per crewmember. +NOTE: This will only apply to new vessels. For existing vessles, temporarily rename patch.cfg to patch.txt, +and rename rebalance.txt to rebalance.cfg. Start your game, load your vessels, and then exit the game and rename +the files back to rebalance.txt and patch.cfg. + +1.1.3 +- Updated to KSP 1.1.1 +- Fixed name in versioning file + +1.1.2 +- Fixed NREs +- Cleaned up the Module Manager patch. Thanks for the hints, Badsector! :) + +1.1.1 +- Re-added missing Snack Grinder +- Module Manager patch fixed to add Snacks to parts with up to 16 crewmembers +- Snacks won't be added to parts that already have Snacks +- Added MiniAVC support + +1.1 +- Updated for KSP 1.1 +- Removed the need for the ModuleManager patch to equip crewed pods with Snacks. diff --git a/README_zh-cn.md b/README_zh-cn.md new file mode 100644 index 0000000..f97fee9 --- /dev/null +++ b/README_zh-cn.md @@ -0,0 +1,7 @@ +Snacks: +---------------------------- +Snacks 是为游戏《坎巴拉太空计划》制作的mod,本mod旨在为游戏添加一项简单而不失趣味的维生系统,使得坎巴拉人变得更加生动并且让空间站,基地与无人飞船在游戏流程中拥有他们原本应有的地位。在本mod中,坎巴拉人会需要食用零食来保证自己能够正常执行任务。准备填满那些零食仓储了吗?小心Jeb,他不太喜欢分享自己的食物。 + +Requirements: +---------------------------- +Snacks 需要依赖 module manager 才能正常使用。如果你是通过正常渠道下载的本mod,那么其中就应该已经包含最新版本的module manager diff --git a/Snacks/.vs/Snacks/FileContentIndex/8a57b5e2-84fa-4d86-b668-b6a98fe88a99.vsidx b/Snacks/.vs/Snacks/FileContentIndex/8a57b5e2-84fa-4d86-b668-b6a98fe88a99.vsidx new file mode 100644 index 0000000..72163b7 Binary files /dev/null and b/Snacks/.vs/Snacks/FileContentIndex/8a57b5e2-84fa-4d86-b668-b6a98fe88a99.vsidx differ diff --git a/Snacks/.vs/Snacks/FileContentIndex/read.lock b/Snacks/.vs/Snacks/FileContentIndex/read.lock new file mode 100644 index 0000000..e69de29 diff --git a/Snacks/.vs/Snacks/v17/.suo b/Snacks/.vs/Snacks/v17/.suo new file mode 100644 index 0000000..a3bd389 Binary files /dev/null and b/Snacks/.vs/Snacks/v17/.suo differ diff --git a/Snacks/Converters/SnackProcessor - Copy.cs b/Snacks/Converters/SnackProcessor - Copy.cs deleted file mode 100644 index a298326..0000000 --- a/Snacks/Converters/SnackProcessor - Copy.cs +++ /dev/null @@ -1,186 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using UnityEngine; -using KSP.IO; - -/** -The MIT License (MIT) -Copyright (c) 2014-2019 by Michael Billard -Original concept by Troy Gruetzmacher - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - * */ -namespace Snacks -{ - public class SnackProcessor : ModuleResourceConverter - { - //Default resource ratios used for background processing. - public const string DefaultProcessorRatios = "Ore,0.002|Snacks,0.01"; - - [KSPField(guiActive = true, guiActiveEditor = true, guiName = "Max Production")] - public string dailyOutput = string.Empty; - - [KSPField] - public int minimumVesselPercentEC = 5; - - [KSPField(isPersistant = true)] - public double lastBackgroundUpdateTime; - - //This string is used for background processing. - [KSPField(isPersistant = true)] - public string resourceRatios = string.Empty; - - [KSPField(isPersistant = true)] - protected double originalSnacksRatio; - - protected double productionEfficiency = 0f; - protected bool hasElectricChargeInput = false; - PartResourceDefinition resourceDef = null; - double minECLevel = 0.0f; - - public virtual double GetDailySnacksOutput() - { - updateProductionEfficiency(); - - return originalSnacksRatio * productionEfficiency * SnacksScenario.GetHoursPerDay(); - } - - public override void OnStart(StartState state) - { - base.OnStart(state); - GameEvents.OnGameSettingsApplied.Add(updateSettings); - - //Build the resource ratios string. It's used for background processing - updateResourceRatios(); - - //Now set up the processor - updateSettings(); - } - - public virtual void Destroy() - { - GameEvents.OnGameSettingsApplied.Remove(updateSettings); - } - - protected void updateResourceRatios() - { - ResourceRatio ratio; - StringBuilder resourceBuilder = new StringBuilder(); - string inputRatios, outputRatios; - - //Inputs - for (int index = 0; index < inputList.Count; index++) - { - ratio = inputList[index]; - if (ratio.ResourceName == "ElectricCharge") - { - hasElectricChargeInput = true; - PartResourceDefinitionList definitions = PartResourceLibrary.Instance.resourceDefinitions; - resourceDef = definitions["ElectricCharge"]; - minECLevel = (double)minimumVesselPercentEC / 100.0f; - continue; - } - - resourceBuilder.Append(ratio.ResourceName); - resourceBuilder.Append(","); - resourceBuilder.Append(ratio.Ratio.ToString()); - resourceBuilder.Append(";"); - } - - //Trim the trailing ";" character. - inputRatios = resourceBuilder.ToString(); - inputRatios = inputRatios.TrimEnd(new char[] { ';' }); - - //Outputs - resourceBuilder = new StringBuilder(); - for (int index = 0; index < outputList.Count; index++) - { - ratio = outputList[index]; - resourceBuilder.Append(ratio.ResourceName); - resourceBuilder.Append(","); - resourceBuilder.Append(ratio.Ratio.ToString()); - resourceBuilder.Append(";"); - - if (ratio.ResourceName == SnacksProperties.SnacksResourceName) - originalSnacksRatio = ratio.Ratio; - } - - //Trim the trailing ";" character. - outputRatios = resourceBuilder.ToString(); - outputRatios = outputRatios.TrimEnd(new char[] { ';' }); - - resourceRatios = inputRatios + "|" + outputRatios; - if (SnacksProperties.DebugLoggingEnabled) - Debug.Log("[" + this.ClassName + "] - resourceRatios: " + resourceRatios); - } - - protected virtual void updateProductionEfficiency() - { - productionEfficiency = SnacksProperties.ProductionEfficiency / 100.0f; - } - - protected virtual void updateSettings() - { - updateProductionEfficiency(); - - //SetEfficiencyBonus((float)productionEfficiency); - - dailyOutput = string.Format("{0:f2} Snacks/day", GetDailySnacksOutput()); - } - - protected override void CheckForShutdown() - { - base.CheckForShutdown(); - - if (hasElectricChargeInput) - { - double amount = 0; - double maxAmount = 0; - this.part.GetConnectedResourceTotals(resourceDef.id, out amount, out maxAmount, true); - if ((amount / maxAmount) < minECLevel) - StopResourceConverter(); - } - } - - protected override ConversionRecipe PrepareRecipe(double deltatime) - { - ConversionRecipe recipe = base.PrepareRecipe(deltatime); - try - { - int count = outputList.Count; - ResourceRatio ratio; - - recipe.Outputs.Clear(); - for (int index = 0; index < count; index++) - { - ratio = new ResourceRatio(outputList[index].ResourceName, outputList[index].Ratio * productionEfficiency, outputList[index].DumpExcess); - ratio.FlowMode = outputList[index].FlowMode; - recipe.Outputs.Add(ratio); - } - } - catch (Exception ex) - { - Debug.Log("[SnackProcessor] - error when preparing recipe: " + ex); - } - return recipe; - } - } -} diff --git a/Snacks/Converters/SnackProcessor.cs b/Snacks/Converters/SnackProcessor.cs index 86817e4..8e78a13 100644 --- a/Snacks/Converters/SnackProcessor.cs +++ b/Snacks/Converters/SnackProcessor.cs @@ -4,6 +4,7 @@ using System.Text; using UnityEngine; using KSP.IO; +using KSP.Localization; /** The MIT License (MIT) @@ -118,7 +119,7 @@ protected virtual void updateSettings() { updateProductionEfficiency(); - dailyOutput = string.Format("{0:f2} Snacks/day", GetDailySnacksOutput()); + dailyOutput = Localizer.Format("#LOC_GUI_SNACKPERDAY", GetDailySnacksOutput().ToString("f2")); } protected override void PreProcessing() @@ -148,7 +149,7 @@ public override string GetInfo() int resourceCount = inputList.Count; if (resourceCount > 0) { - infoBuilder.AppendLine("Inputs"); + infoBuilder.AppendLine(Localizer.Format("#LOC_INFO_INPUTS"));//#LOC_INFO_INPUTS="Inputs" for (int index = 0; index < resourceCount; index++) { if (!definitions.Contains(inputList[index].ResourceName)) @@ -161,7 +162,7 @@ public override string GetInfo() resourceCount = outputList.Count; if (resourceCount > 0) { - infoBuilder.AppendLine("Outputs"); + infoBuilder.AppendLine(Localizer.Format("#LOC_INFO_OUTPUTS"));//#LOC_INFO_OUTPUTS="Outputs" for (int index = 0; index < resourceCount; index++) { if (!definitions.Contains(outputList[index].ResourceName)) @@ -171,7 +172,8 @@ public override string GetInfo() } } infoBuilder.AppendLine(" "); - infoBuilder.AppendLine("Note: Production rates vary depending upon game settings. Consult the Part Action Window for details."); + infoBuilder.AppendLine(Localizer.Format("#LOC_INFO_NOTEPRODUCTIONRATES")); + //#LOC_INFO_NOTEPRODUCTIONRATES="Note: Production rates vary depending upon game settings. Consult the Part Action Window for details." if (!string.IsNullOrEmpty(ExperienceEffect)) { @@ -189,7 +191,7 @@ public override string GetInfo() string traitList = traitBuilder.ToString().TrimEnd(charsToTrim); infoBuilder.AppendLine(" "); - infoBuilder.AppendLine("Kerbal(s) that improve production: "); + infoBuilder.AppendLine(Localizer.Format("#LOC_INFO_NOTEIMPROVE"));//#LOC_INFO_NOTEIMPROVE="Kerbal(s) that improve production: " infoBuilder.AppendLine(traitList); } } diff --git a/Snacks/Converters/SnacksBackgroundConverter.cs b/Snacks/Converters/SnacksBackgroundConverter.cs index 42fd1d2..e96d4cd 100644 --- a/Snacks/Converters/SnacksBackgroundConverter.cs +++ b/Snacks/Converters/SnacksBackgroundConverter.cs @@ -30,6 +30,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE using UnityEngine; using KSP.IO; using KSP.UI.Screens; +using KSP.Localization; namespace Snacks { @@ -935,28 +936,32 @@ protected void emailPlayer(string resourceName, SnacksBackroundEmailTypes emailT { case SnacksBackroundEmailTypes.missingResources: resourceDef = definitions[resourceName]; - titleMessage = " needs more resources"; - resultsMessage.AppendLine("Subject: Missing Resources"); - resultsMessage.AppendLine("There is no more " + resourceDef.displayName + " available to continue production. Operations cannot continue with the " + ConverterName + " until more resource becomes available."); + titleMessage = Localizer.Format("#LOC_INFO_TITLE1");//#LOC_INFO_TITLE1 = needs more resources + resultsMessage.AppendLine(Localizer.Format("#LOC_INFO_MISSINGRESOURCE"));//#LOC_INFO_MISSINGRESOURCE = Subject: Missing Resources + resultsMessage.AppendLine(Localizer.Format("#LOC_INFO_PRDUCFAILD1",resourceDef.displayName, ConverterName)); + //#LOC_INFO_PRDUCFAILD1 = There is no more <<1>> available to continue production. Operations cannot continue with the <<2>> until more resource becomes available. break; case SnacksBackroundEmailTypes.missingRequiredResource: resourceDef = definitions[resourceName]; - titleMessage = " needs a resource"; - resultsMessage.AppendLine("Subject: Missing Required Resource"); - resultsMessage.AppendLine(ConverterName + " needs " + resourceDef.displayName + " in order to function. Operations halted until the resource becomes available."); + titleMessage = Localizer.Format("#LOC_INFO_TITLE2");//#LOC_INFO_TITLE2 = Subject: needs a resource + resultsMessage.AppendLine(Localizer.Format("#LOC_INFO_MISSINGREQRESOURCE"));//#LOC_INFO_MISSINGREQRESOURCE = Subject: Missing Resources + resultsMessage.AppendLine(Localizer.Format("#LOC_INFO_PRDUCFAILD2", ConverterName, resourceDef.displayName)); + //#LOC_INFO_PRDUCFAILD2 = <<1>> needs <<2>> in order to function. Operations halted until the resource becomes available. break; case SnacksBackroundEmailTypes.containerFull: resourceDef = definitions[resourceName]; - titleMessage = " is out of storage space"; - resultsMessage.AppendLine("Subject: Containers Are Full"); - resultsMessage.AppendLine("There is no more storage space available for " + resourceDef.displayName + ". Operations cannot continue with the " + ConverterName + " until more space becomes available."); + titleMessage = Localizer.Format("#LOC_INFO_TITLE3");//#LOC_INFO_TITLE3 = is out of storage space + resultsMessage.AppendLine(Localizer.Format("#LOC_INFO_CONTAINERFULL"));//#LOC_INFO_CONTAINERFULL = Subject: Containers Are Full + resultsMessage.AppendLine(Localizer.Format("#LOC_INFO_PRDUCFAILD3", resourceDef.displayName, ConverterName)); + //#LOC_INFO_PRDUCFAILD3 = There is no more storage space available for <<1>> Operations cannot continue with the <<2>> until more space becomes available. break; case SnacksBackroundEmailTypes.yieldCriticalFail: - titleMessage = " has suffered a critical failure in one of its converters"; - resultsMessage.AppendLine("A " + ConverterName + " has failed! The production yield has been lost. It must be repaired and/or restarted before it can begin production again."); + titleMessage = Localizer.Format("#LOC_INFO_TITLE4");//#LOC_INFO_TITLE4 = has suffered a critical failure in one of its converters + resultsMessage.AppendLine(Localizer.Format("#LOC_INFO_PRDUCFAILD4", ConverterName)); + //#LOC_INFO_PRDUCFAILD4 = A <<1>> has failed! The production yield has been lost. It must be repaired and/or restarted before it can begin production again. break; default: diff --git a/Snacks/Converters/SnacksConverter.cs b/Snacks/Converters/SnacksConverter.cs index 53b3596..b203472 100644 --- a/Snacks/Converters/SnacksConverter.cs +++ b/Snacks/Converters/SnacksConverter.cs @@ -401,20 +401,22 @@ public override string GetInfo() // Splashed if (requiresSplashed) - moduleInfo = moduleInfo.Replace(ConverterName, ConverterName + "\n - Requires vessel to be in water"); + moduleInfo = moduleInfo.Replace(ConverterName, ConverterName + Localizer.Format("#LOC_INFO_REQSPLASH")); + // #LOC_INFO_REQSPLASH = \n - Requires vessel to be in water // Splashed if (requiresOxygen) - moduleInfo = moduleInfo.Replace(ConverterName, ConverterName + "\n - Requires vessel to be on a planet with an oxygenated atmosphere"); + moduleInfo = moduleInfo.Replace(ConverterName, ConverterName + Localizer.Format("#LOC_INFO_REQOXY")); + // #LOC_INFO_REQOXY = \n - Requires vessel to be on a planet with an oxygenated atmosphere //Home connection if (requiresHomeConnection) - moduleInfo = moduleInfo.Replace(ConverterName, ConverterName + "\n - Requires connection to homeworld"); - + moduleInfo = moduleInfo.Replace(ConverterName, ConverterName + Localizer.Format("#LOC_INFO_REQCOMMU")); + // #LOC_INFO_REQCOMMU = \n - Requires connection to homeworld //Minimum crew if (minimumCrew > 0) - moduleInfo = moduleInfo.Replace(ConverterName, ConverterName + "\n - Minimum Crew: " + minimumCrew); - + moduleInfo = moduleInfo.Replace(ConverterName, ConverterName + Localizer.Format("#LOC_INFO_REQCREW") + minimumCrew); + // #LOC_INFO_REQCREW = \n - Minimum Crew: //Roster resources if (rosterInputList.Count == 0 && rosterOutputList.Count == 0) setupRosterResources(); @@ -430,16 +432,16 @@ public override string GetInfo() info.Append(": "); if (ratio.AmountPerDay > 0) { - info.Append(string.Format("{0:f2}/day", ratio.AmountPerDay)); + info.Append(string.Format(Localizer.Format("#LOC_TIME_DAY"), ratio.AmountPerDay));//#LOC_TIME_DAY={0:f2}/day } else { if (ratio.AmountPerSecond < 0.0001) - info.Append(string.Format(": {0:f2}/day", ratio.AmountPerSecond * (double)KSPUtil.dateTimeFormatter.Day)); + info.Append(Localizer.Format("#LOC_TIME_DAY",(ratio.AmountPerSecond * (double)KSPUtil.dateTimeFormatter.Day).ToString()));//#LOC_TIME_DAY=<<1>>/day else if (ratio.AmountPerSecond < 0.01) - info.Append(string.Format(": {0:f2}/hr", ratio.AmountPerSecond * (double)KSPUtil.dateTimeFormatter.Hour)); + info.Append(Localizer.Format("#LOC_TIME_HR",(ratio.AmountPerSecond * (double)KSPUtil.dateTimeFormatter.Hour).ToString("f2")));//#LOC_TIME_HR=<<1>>/hr else - info.Append(string.Format(": {0:f2}/sec", ratio.AmountPerSecond)); + info.Append(Localizer.Format("#LOC_TIME_SEC", ratio.AmountPerSecond.ToString("f2")));//#LOC_TIME_SEC=<<1>>/sec } } @@ -473,16 +475,16 @@ public override string GetInfo() info.Append(": "); if (ratio.AmountPerDay > 0) { - info.Append(string.Format("{0:f2}/day", ratio.AmountPerDay)); + info.Append(string.Format(Localizer.Format("#LOC_TIME_DAY"), ratio.AmountPerDay)); } else { if (ratio.AmountPerSecond < 0.0001) - info.Append(string.Format(": {0:f2}/day", ratio.AmountPerSecond * (double)KSPUtil.dateTimeFormatter.Day)); + info.Append(string.Format(Localizer.Format("#LOC_TIME_DAY"), ratio.AmountPerSecond * (double)KSPUtil.dateTimeFormatter.Day)); else if (ratio.AmountPerSecond < 0.01) - info.Append(string.Format(": {0:f2}/hr", ratio.AmountPerSecond * (double)KSPUtil.dateTimeFormatter.Hour)); + info.Append(string.Format(Localizer.Format("#LOC_TIME_HR"), ratio.AmountPerSecond * (double)KSPUtil.dateTimeFormatter.Hour)); else - info.Append(string.Format(": {0:f2}/sec", ratio.AmountPerSecond)); + info.Append(string.Format(Localizer.Format("#LOC_TIME_SEC"), ratio.AmountPerSecond)); } } @@ -535,13 +537,13 @@ public override string GetInfo() if (node.HasValue("hoursPerCycle")) double.TryParse(node.GetValue("hoursPerCycle"), out processTimeHours); - info.Append(" - Skill Needed: " + ExperienceEffect + "\r\n"); + info.Append(Localizer.Format("#LOC_INFO_NEEDSKILL") + ExperienceEffect + "\r\n"); //#LOC_INFO_NEEDSKILL= - Skill Needed: if (processTimeHours > 0) { - info.Append(" - Process Time: "); - info.Append(string.Format("{0:f1} hours\r\n", processTimeHours)); + info.Append(Localizer.Format("#LOC_INFO_PROCESSTIME"));//#LOC_INFO_PROCESSTIME= - Process Time: + info.Append(string.Format(Localizer.Format("#LOC_TIME_HR") + "\r\n", processTimeHours)); } - info.Append(" - Yield Resources\r\n"); + info.Append(Localizer.Format("#LOC_INFO_YELDRES") + "\r\n");//#LOC_INFO_YELDRES= - Yield Resources for (int yieldIndex = 0; yieldIndex < yieldNodes.Length; yieldIndex++) { yieldNode = yieldNodes[yieldIndex]; @@ -744,7 +746,7 @@ public override void FixedUpdate() bool infiniteElectricity = CheatOptions.InfiniteElectricity; //Do the pre-processing - status = "A-OK"; + status = Localizer.Format("#LOC_AOK"); PreProcessing(); recipe = PrepareRecipe(deltaTime); count = recipe.Inputs.Count; @@ -752,26 +754,26 @@ public override void FixedUpdate() // Requires spashed if (requiresSplashed && !part.vessel.Splashed) { - status = "Vessel must be in water"; + status = Localizer.Format("#LOC_STATUS_NOSPLASH");//#LOC_STATUS_NOSPLASH=Vessel must be in water return; } if (requiresOxygen && !part.vessel.mainBody.atmosphereContainsOxygen) { - status = "Requires oxygenated atmosphere"; + status = Localizer.Format("#LOC_STATUS_NOOXY");//#LOC_STATUS_NOOXY=Requires oxygenated atmosphere return; } //Handle required resources if (requiresHomeConnection && CommNet.CommNetScenario.CommNetEnabled && !this.part.vessel.connection.IsConnectedHome) { - status = "Requires home connection"; + status = Localizer.Format("#LOC_STATUS_NOCOMMU");//#LOC_STATUS_NOCOMMU=Requires home connection return; } if (minimumCrew > 0 && this.part.protoModuleCrew.Count < minimumCrew) { - status = "Needs more crew (" + this.part.protoModuleCrew.Count + "/" + minimumCrew + ")"; + status = Localizer.Format("#LOC_STATUS_NOCREW")+"(" + this.part.protoModuleCrew.Count + "/" + minimumCrew + ")";//#LOC_STATUS_NOCREW=Needs more crew return; } @@ -785,7 +787,7 @@ public override void FixedUpdate() this.part.GetConnectedResourceTotals(resourceDef.id, out amount, out maxAmount, true); if (amount >= maxAmount) { - status = resourceDef.displayName + " is full"; + status = resourceDef.displayName + Localizer.Format("#LOC_STATUS_FULL"); if (AutoShutdown) StopResourceConverter(); return; @@ -807,7 +809,7 @@ public override void FixedUpdate() this.part.GetConnectedResourceTotals(resourceDef.id, out amount, out maxAmount, true); if (amount < resourceRatio.Ratio) { - status = "Missing " + resourceDef.displayName; + status =Localizer.Format("#LOC_GUI_MISSING") + resourceDef.displayName;//#LOC_GUI_MISSING=Missing if (AutoShutdown) StopResourceConverter(); return; @@ -816,7 +818,7 @@ public override void FixedUpdate() //Check for mininum EC else if (resourceRatio.ResourceName == "ElectricCharge" && (amount / maxAmount) <= (minimumVesselPercentEC / 100.0f)) { - status = "Needs more " + resourceDef.displayName; + status = Localizer.Format(Localizer.Format("#LOC_GUI_NEEDSMORE")) + resourceDef.displayName;//#LOC_GUI_NEEDSMORE=Needs more return; } } @@ -844,7 +846,7 @@ public override void FixedUpdate() amountObtained = this.part.RequestResource(resourceDef.id, -resourceRatio.Ratio, resourceRatio.FlowMode); if (amountObtained >= maxAmount) { - status = resourceDef.displayName + " is full"; + status = resourceDef.displayName + Localizer.Format("#LOC_STATUS_NOSPLASH");//#LOC_STATUS_FULL= is full } } @@ -1031,9 +1033,9 @@ protected override void PostProcess(ConverterResults result, double deltaTime) //Update status if (yieldsList.Count > 0) - status = "Progress: " + progress; + status = Localizer.Format("#LOC_STATUS_PROGRESS") + progress;//#LOC_STATUS_PROGRESS=Progress: else if (string.IsNullOrEmpty(status)) - status = "Running"; + status = Localizer.Format("#LOC_STATUS_RUNNING");//#LOC_STATUS_RUNNING=Running } #endregion diff --git a/Snacks/Converters/SoilRecycler.cs b/Snacks/Converters/SoilRecycler.cs index 3037cc9..f0bb90d 100644 --- a/Snacks/Converters/SoilRecycler.cs +++ b/Snacks/Converters/SoilRecycler.cs @@ -4,6 +4,7 @@ using System.Text; using UnityEngine; using KSP.IO; +using KSP.Localization; /** The MIT License (MIT) @@ -49,7 +50,7 @@ public override void OnStart(StartState state) { base.OnStart(state); - Fields["dailyOutput"].guiName = "Max Recycling"; + Fields["dailyOutput"].guiName = Localizer.Format("#LOC_GUI_MAXRECY");//#LOC_GUI_MAXRECY="Max Recycling" } public override string GetInfo() @@ -58,7 +59,7 @@ public override string GetInfo() infoBuilder.AppendLine(base.GetInfo()); infoBuilder.AppendLine(" "); - infoBuilder.AppendLine("Recycler Capacity: " + RecyclerCapacity + " kerbals"); + infoBuilder.AppendLine(Localizer.Format("#LOC_INFO_SOILRECYCAPA", RecyclerCapacity));//#LOC_INFO_SOILRECYCAPA=Recycler Capacity: <<1>> kerbals return infoBuilder.ToString(); } @@ -70,7 +71,7 @@ protected override void updateSettings() //We want the total recycler output, which is based on snacks per meal, meals per day, and recycler capacity. updateProductionEfficiency(); - dailyOutput = string.Format("{0:f2} Soil/day", GetDailySnacksOutput()); + dailyOutput = Localizer.Format("#LOC_INFO_SOILPERDAY", GetDailySnacksOutput().ToString("f2"));//#LOC_INFO_SOILPERDAY=<<1>> Soil/day } protected override void updateProductionEfficiency() diff --git a/Snacks/GUI/SnackAppView.cs b/Snacks/GUI/SnackAppView.cs index 5c87fb7..65f9fe6 100644 --- a/Snacks/GUI/SnackAppView.cs +++ b/Snacks/GUI/SnackAppView.cs @@ -6,6 +6,7 @@ using UnityEngine; using KSP.UI; using Highlighting; +using KSP.Localization; /** The MIT License (MIT) @@ -60,7 +61,7 @@ public class SnackAppView : Window private StressProcessor stressProcessor = null; public SnackAppView() : - base("Vessel Status", 500, 500) + base(Localizer.Format("#LOC_GUI_VESSELSTATUS"), 500, 500)//#LOC_GUI_VESSELSTATUS=Vessel Status { Resizable = false; } @@ -156,7 +157,7 @@ protected override void DrawWindowContents(int windowId) public void drawEditorWindow() { //Rerun sim button - if (GUILayout.Button("Rerun Simulator")) + if (GUILayout.Button(Localizer.Format("#LOC_GUI_RERUNSIMULATOR")))//#LOC_GUI_RERUNSIMULATOR=Rerun Simulator { //Reset crew count so that we'll trigger a rebuild of the simulator. currentCrewCount = -1; @@ -214,13 +215,13 @@ private void setupSimulatorIfNeeded() if (partCount == 0) { snackshots.Clear(); - simulationResults = "Vessel has no crewed parts to simulate."; + simulationResults = Localizer.Format("#LOC_GUI_SIMU1");//#LOC_GUI_SIMU1=Vessel has no crewed parts to simulate. simulationComplete = false; } else if (currentCrewCount == 0) { snackshots.Clear(); - simulationResults = "Vessel needs crew to run simulation."; + simulationResults = Localizer.Format("#LOC_GUI_SIMU2");//#LOC_GUI_SIMU2=Vessel needs crew to run simulation. simulationComplete = false; } @@ -231,7 +232,7 @@ private void setupSimulatorIfNeeded() if (simSnacks != null) { simulationComplete = false; - simulationResults = "Simulation in progress, please wait..."; + simulationResults = Localizer.Format("#LOC_GUI_SIMU3");//#LOC_GUI_SIMU3=Simulation in progress, please wait... snackshots.Clear(); //Get consumer resource lists @@ -291,7 +292,7 @@ private void setupSimulatorIfNeeded() } else { - simulationResults = "Vessel has no crewed parts to simulate."; + simulationResults = Localizer.Format("#LOC_GUI_SIMU1"); } } } @@ -303,7 +304,7 @@ private void formatSimulationResults() Snackshot snackshot; //current/max crew - simResults.AppendLine("Crew: " + currentCrewCount + "/" + crewCapacity + ""); + simResults.AppendLine(""+ Localizer.Format("#LOC_GUI_CREW") + currentCrewCount + "/" + crewCapacity + "");//#LOC_GUI_CREW=Crew: //Snackshot list for (int index = 0; index < count; index++) @@ -321,7 +322,7 @@ private void formatSimulationResults() //Converter assumption if (convertersAssumedActive) - simResults.AppendLine("Assumes converters are active; be sure to turn them on."); + simResults.AppendLine(Localizer.Format("#LOC_GUI_ASSUMEACTIVE"));//#LOC_GUI_ASSUMEACTIVE=Assumes converters are active; be sure to turn them on. simulationResults = simResults.ToString(); } @@ -349,15 +350,15 @@ private void OnSimulationComplete(SimSnacks simSnacks) public void drawSpaceCenterWindow() { - GUILayout.Label("Exempt Kerbals: separate names by semicolon, first name only"); - GUILayout.Label("These kerbals won't consume Snacks and won't suffer penalties from a lack of Snacks."); + GUILayout.Label(Localizer.Format("#LOC_GUI_EXEMPTKERB"));//#LOC_GUI_EXEMPTKERB = Exempt Kerbals: separate names by semicolon, first name only + GUILayout.Label(Localizer.Format("#LOC_GUI_EXEMPTKERB_INTRO"));//#LOC_GUI_EXEMPTKERB_INTRO = These kerbals won't consume Snacks and won't suffer penalties from a lack of Snacks. if (string.IsNullOrEmpty(exemptKerbals)) exemptKerbals = string.Empty; exemptKerbals = GUILayout.TextField(exemptKerbals); if (SnacksProperties.DebugLoggingEnabled) { - if (GUILayout.Button("Snack Time!")) + if (GUILayout.Button(Localizer.Format("#LOC_GUI_SNACKTIME")))//#LOC_GUI_SNACKTIME = Snack Time! { SnacksScenario.Instance.RunSnackCyleImmediately(SnacksScenario.GetSecondsPerDay() / SnacksProperties.MealsPerDay); } @@ -389,7 +390,7 @@ public void drawFlightWindow() GUILayout.EndHorizontal(); //Draw stop simulators button - if (GUILayout.Button("Stop simulators (Estimates will be unavailable)")) + if (GUILayout.Button(Localizer.Format("#LOC_GUI_STOPSIM")))//#LOC_GUI_STOPSIM = Stop simulators (Estimates will be unavailable) { SnacksScenario.Instance.threadPool.StopAllJobs(); for (int index = 0; index < keys.Count; index++) @@ -411,7 +412,7 @@ public void drawFlightWindow() if (SnacksProperties.DebugLoggingEnabled && HighLogic.LoadedSceneIsFlight) { - if (GUILayout.Button("Snack Time!")) + if (GUILayout.Button(Localizer.Format("#LOC_GUI_SNACKTIME"))) { SnacksScenario.Instance.RunSnackCyleImmediately(SnacksScenario.GetSecondsPerDay() / SnacksProperties.MealsPerDay); } @@ -482,7 +483,7 @@ private void drawFlightLeftPane() } else { - GUILayout.Label("No crewed vessels found on or around any world or in solar orbit."); + GUILayout.Label(Localizer.Format("#LOC_GUI_SIMU4"));//#LOC_GUI_SIMU4=No crewed vessels found on or around any world or in solar orbit. } GUILayout.EndScrollView(); @@ -507,14 +508,14 @@ private void drawFlightRightPane() GUILayout.BeginVertical(); if (SnacksScenario.Instance.rosterResources.Count > 0) { - showCrewView = GUILayout.Toggle(showCrewView, "Show Crew View"); + showCrewView = GUILayout.Toggle(showCrewView, Localizer.Format("#LOC_GUI_CREWVIEW"));//#LOC_GUI_CREWVIEW=Show Crew View if (showCrewView) - showAvailableCrew = GUILayout.Toggle(showAvailableCrew, "Show Available Crew"); + showAvailableCrew = GUILayout.Toggle(showAvailableCrew, Localizer.Format("#LOC_GUI_CREWVIEWA"));//#LOC_GUI_CREWVIEWA=Show Available Crew //Stresstimator button if (SnacksScenario.Instance.rosterResources.ContainsKey(StressProcessor.StressResourceName) && HighLogic.LoadedSceneIsFlight) { - if (GUILayout.Button("Open Stresstimator")) + if (GUILayout.Button(Localizer.Format("#LOC_GUI_STRESSSIM")))//#LOC_GUI_STRESSSIM=Open Stresstimator { showStresstimator = true; return; @@ -540,7 +541,7 @@ private void drawFlightRightPane() //Get status statusDisplay = vesselSnackshot.GetStatusDisplay(showCrewView); if (vesselSnackshot.convertersAssumedActive && !showCrewView) - statusDisplay = statusDisplay + "Assumes converters are active; be sure to turn them on."; + statusDisplay = statusDisplay + Localizer.Format("#LOC_GUI_ASSUMEACTIVE"); //Print status GUILayout.Label(statusDisplay); @@ -573,8 +574,8 @@ private void drawFlightRightPane() if (!string.IsNullOrEmpty(astronautData.conditionSummary)) conditionSummary = astronautData.conditionSummary; else - conditionSummary = "Cleared for flight"; - status.AppendLine(" - Status: " + conditionSummary + ""); + conditionSummary = Localizer.Format("#LOC_GUI_COF");//#LOC_GUI_COF = Cleared for flight + status.AppendLine(" "+ Localizer.Format("#LOC_GUI_STATUS") + conditionSummary + "");//#LOC_GUI_STATUS = - Status: string[] rosterResourceKeys = astronautData.rosterResources.Keys.ToArray(); for (int rosterIndex = 0; rosterIndex < rosterResourceKeys.Length; rosterIndex++) @@ -586,8 +587,8 @@ private void drawFlightRightPane() else { status.AppendLine("" + astronaut.name + ""); - conditionSummary = "Cleared for flight"; - status.AppendLine(" - Status: " + conditionSummary + ""); + conditionSummary = Localizer.Format("#LOC_GUI_COF");//#LOC_GUI_COF = Cleared for flight + status.AppendLine(" " + Localizer.Format("#LOC_GUI_STATUS") + conditionSummary + ""); } } GUILayout.Label(status.ToString()); @@ -621,7 +622,7 @@ private void drawStresstimator() GUILayout.BeginVertical(); scrollPos = GUILayout.BeginScrollView(scrollPos, flightWindowRightPaneOptions); - GUILayout.Label("Your kerbals might get Stressed Out if you transfer them to a docked vessel and then undock. Will that happen? Click on the habitable parts of the docked vessel to find out. Parts highlighted in blue will count towards the estimate."); + GUILayout.Label(Localizer.Format("#LOC_GUI_STRESSNOTE"));//#LOC_GUI_STRESSNOTE = Your kerbals might get Stressed Out if you transfer them to a docked vessel and then undock. Will that happen? Click on the habitable parts of the docked vessel to find out. Parts highlighted in blue will count towards the estimate. //Highlight all habitable parts highlightHabitableParts(); @@ -631,7 +632,7 @@ private void drawStresstimator() GUILayout.EndScrollView(); - if (GUILayout.Button("Close Stresstimator")) + if (GUILayout.Button(Localizer.Format("#LOC_GUI_STRESSCLOSE")))//#LOC_GUI_STRESSCLOSE =Close Stresstimator { unhighlightHabitableParts(); showStresstimator = false; @@ -648,7 +649,7 @@ private void drawStressEstimates() AstronautData astronautData = null; //Show crew capacity - GUILayout.Label(string.Format("Estimated Crew Capacity: {0:n0}", crewCapacity)); + GUILayout.Label(Localizer.Format("#LOC_GUI_CREWCAPA",crewCapacity.ToString()));//#LOC_GUI_CREWCAPA =Estimated Crew Capacity:<<1>> //Calculate the total space. float space = stressProcessor.CalculateSpace(activeVesselCrewCount, crewCapacity); @@ -675,9 +676,9 @@ private void drawStressEstimates() amount = resource.amount; if (amount > maxAmount) - GUILayout.Label("" + astronautData.name + string.Format("\n Estimated Stress: {0:n2}/{1:n2}", amount, maxAmount) + "\n Will likely get Stressed Out"); + GUILayout.Label("" + astronautData.name + Localizer.Format("#LOC_GUI_STRESSES", amount.ToString("f2"), maxAmount.ToString("f2")) + ""+ Localizer.Format("#LOC_GUI_STRESSOUT"));//#LOC_GUI_STRESSES =\n Estimated Stress: <<1>>/<<2>> else - GUILayout.Label("" + astronautData.name + string.Format("\n Estimated Stress: {0:n2}/{1:n2}", amount, maxAmount) + ""); + GUILayout.Label("" + astronautData.name + Localizer.Format("#LOC_GUI_STRESSES", amount.ToString("f2"), maxAmount.ToString("f2")) + " ");//#LOC_GUI_STRESSOUT =\n Will likely get Stressed Out } } diff --git a/Snacks/GUI/SnacksIntroScreen.cs b/Snacks/GUI/SnacksIntroScreen.cs index 07935ab..5e06eca 100644 --- a/Snacks/GUI/SnacksIntroScreen.cs +++ b/Snacks/GUI/SnacksIntroScreen.cs @@ -29,6 +29,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE using System.Threading; using UnityEngine; using KSP.UI; +using KSP.Localization; namespace Snacks { @@ -38,7 +39,7 @@ class SnacksIntroScreen : Window public string description = string.Empty; public SnacksIntroScreen(string description) : - base("New resource added!", 300, 500) + base(Localizer.Format("#LOC_GUI_NEW"), 300, 500)//#LOC_GUI_NEW=New resource added! { Resizable = false; this.description = description; diff --git a/Snacks/Processors/SnacksResourceProcessor.cs b/Snacks/Processors/SnacksResourceProcessor.cs index d043b2d..71550c9 100644 --- a/Snacks/Processors/SnacksResourceProcessor.cs +++ b/Snacks/Processors/SnacksResourceProcessor.cs @@ -22,6 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ +using KSP.Localization; using System; using System.Collections.Generic; using System.Linq; @@ -75,13 +76,13 @@ public override void OnGameSettingsApplied() //Outcomes outcomes.Clear(); - outcomes.Add(new FundingPenalty(true, "Kerbals are hungry for snacks! You have been fined {0:N2} Funds", SnacksProperties.FinePerKerbal)); - outcomes.Add(new RepPenalty(true, SnacksProperties.RepLostWhenHungry, "Kerbals are hungry for snacks! Your reputation has decreased by {0:N3}")); + outcomes.Add(new FundingPenalty(true, Localizer.Format("#LOC_INFO_FUND",(SnacksProperties.FinePerKerbal).ToString("n2")), SnacksProperties.FinePerKerbal));//#LOC_INFO_FUND = Kerbals are hungry for snacks! You have been fined <<1>> Funds + outcomes.Add(new RepPenalty(true, SnacksProperties.RepLostWhenHungry, Localizer.Format("#LOC_INFO_BADREP",(SnacksProperties.RepLostWhenHungry).ToString("n3"))));//#LOC_INFO_BADREP = Kerbals are hungry for snacks! Your reputation has decreased by <<1>> outcomes.Add(new SciencePenalty(true)); if (SnacksProperties.CanStarveToDeath) - outcomes.Add(new DeathPenalty(SnacksProperties.SnacksResourceName, SnacksProperties.MealsSkippedBeforeDeath, "has died from a lack of Snacks!")); + outcomes.Add(new DeathPenalty(SnacksProperties.SnacksResourceName, SnacksProperties.MealsSkippedBeforeDeath, Localizer.Format("#LOC_INFO_DEATH")));//#LOC_INFO_DEATH = has died from a lack of Snacks! if (SnacksProperties.FaintWhenHungry) - outcomes.Add(new FaintPenalty(SnacksProperties.SnacksResourceName, SnacksProperties.MealsBeforeFainting, SnacksProperties.NapTime * 60f, "has fainted from a lack of Snacks!")); + outcomes.Add(new FaintPenalty(SnacksProperties.SnacksResourceName, SnacksProperties.MealsBeforeFainting, SnacksProperties.NapTime * 60f, Localizer.Format("#LOC_INFO_FAINTE")));//#LOC_INFO_FAINTE = has fainted from a lack of Snacks! if (SnacksScenario.Instance.rosterResources.ContainsKey(StressProcessor.StressResourceName)) outcomes.Add(new ProduceResource(StressProcessor.StressResourceName, 1.0, false, string.Empty)); diff --git a/Snacks/Processors/StressProcessor.cs b/Snacks/Processors/StressProcessor.cs index 4a23af5..61326bb 100644 --- a/Snacks/Processors/StressProcessor.cs +++ b/Snacks/Processors/StressProcessor.cs @@ -22,6 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ +using KSP.Localization; using System; using System.Collections.Generic; using System.Linq; @@ -58,9 +59,9 @@ public class StressProcessor : BaseResourceProcessor #region Constants public const string StressResourceName = "Stress"; - const string StressConditionName = "Stressed Out"; - const string StressPlayerMessage = "is stressed out and cannot work!"; - const string StressRecoveryMessage = "recovered from stress."; + const string StressConditionName = "Stressed Out";//#LOC_INFO_STRESSOUTNAME = Stressed Out + const string StressPlayerMessage = "is stressed out and cannot work!";//#LOC_INFO_STRESSOUT = is stressed out and cannot work! + const string StressRecoveryMessage = "recovered from stress.";//#LOC_INFO_STRESSOUTRECOVER = recovered from stress. /// /// The first N seats use the multiplier instead of the N^3 formula. @@ -100,7 +101,7 @@ public override void Initialize() secondsPerCycle = SnacksScenario.GetSecondsPerDay(); - outcomes.Add(new OnStrikePenalty(StressConditionName, false, StressPlayerMessage)); + outcomes.Add(new OnStrikePenalty(Localizer.Format("#LOC_INFO_STRESSOUTNAME"), false, Localizer.Format("#LOC_INFO_STRESSOUT")));// SnacksScenario.onRosterResourceUpdated.Add(onRosterResourceUpdated); } @@ -117,8 +118,8 @@ public override void GetRosterResourceEstimatesForEditor(int currentCrewCount, i //Calculate the space available. float space = CalculateSpace(currentCrewCount, crewCapacity); - results.AppendLine("Estimated Max Stress: A crew of " + currentCrewCount.ToString() + string.Format(" will be Stressed Out after {0:n2} days.", space)); - results.AppendLine("This is based on a kerbal with no experience. Experienced kerbals can last longer."); + results.AppendLine(Localizer.Format("#LOC_GUI_STRESSMAXES", currentCrewCount.ToString(),space));//#LOC_GUI_STRESSMAXES=Estimated Max Stress: A crew of <<1>> will be Stressed Out after <<2>> days. + results.AppendLine(Localizer.Format("#LOC_GUI_STRESSMAXESNOTE"));//#LOC_GUI_STRESSMAXESNOTE=This is based on a kerbal with no experience. Experienced kerbals can last longer. results.AppendLine(" "); } @@ -356,7 +357,7 @@ protected void onRosterResourceUpdated(Vessel vessel, SnacksRosterResource roste { astronautData.ClearCondition(StressConditionName); SnacksScenario.Instance.RestoreSkillsIfNeeded(astronaut); - ScreenMessages.PostScreenMessage(astronaut.name + " " + StressRecoveryMessage, 5.0f, ScreenMessageStyle.UPPER_LEFT); + ScreenMessages.PostScreenMessage(astronaut.name + " " + Localizer.Format("#LOC_INFO_STRESSOUTRECOVER"), 5.0f, ScreenMessageStyle.UPPER_LEFT); } //If the resource has maxed out then add the stress condition diff --git a/Snacks/ResourceClasses/SnacksPartResource.cs b/Snacks/ResourceClasses/SnacksPartResource.cs index 35d856c..e92a827 100644 --- a/Snacks/ResourceClasses/SnacksPartResource.cs +++ b/Snacks/ResourceClasses/SnacksPartResource.cs @@ -22,6 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ +using KSP.Localization; using System; using System.Collections.Generic; using System.Linq; @@ -205,7 +206,7 @@ public bool addResourcesIfNeeded(Part part, AvailablePart availablePart = null) AvailablePart.ResourceInfo resourceInfo = new AvailablePart.ResourceInfo(); resourceInfo.resourceName = resourceName; resourceInfo.displayName = def.displayName; - resourceInfo.info = string.Format("Amount: {0:n1}\nMass: {1:n3}\nCost: {2:n1}", unitsToAdd, def.density * unitsToAdd, def.unitCost * unitsToAdd); + resourceInfo.info = Localizer.Format("#LOC_GUI_SNACKSTORAGE1", unitsToAdd.ToString("f2"), (def.density * unitsToAdd).ToString("f2"), (def.unitCost * unitsToAdd).ToString("f2"));//#LOC_GUI_SNACKSTORAGE1=Amount: <<1>>\nMass: <<2>>\nCost: <<3>> availablePart.resourceInfos.Add(resourceInfo); } MonoUtilities.RefreshContextWindows(part); diff --git a/Snacks/ResourceClasses/Snackshot.cs b/Snacks/ResourceClasses/Snackshot.cs index 8d02203..d2b94f6 100644 --- a/Snacks/ResourceClasses/Snackshot.cs +++ b/Snacks/ResourceClasses/Snackshot.cs @@ -22,6 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ +using KSP.Localization; using System; using System.Collections.Generic; using System.Linq; @@ -102,22 +103,22 @@ public virtual string GetStatusDisplay() //Duration if (simulatorInterrupted) { - status.AppendLine("Duration: Unavailable"); + status.AppendLine(Localizer.Format("#LOC_DURATION1"));//#LOC_DURATION1 = Duration: Unavailable } else if (estimatedTimeRemaining < 0) { - status.AppendLine("Duration: Indefinite"); + status.AppendLine(Localizer.Format("#LOC_DURATION2"));//#LOC_DURATION2 = Duration: Indefinite } else if (isSimulatorRunning) { - status.AppendLine("Duration: Calculating..."); + status.AppendLine(Localizer.Format("#LOC_DURATION3"));//#LOC_DURATION3 = Duration: Calculating... } else { string timeString = SnacksScenario.FormatTime(estimatedTimeRemaining); if (amount < 0.0001) timeString = "0 Seconds"; - status.AppendLine(colorTag + "Duration: " + timeString + endTag); + status.AppendLine(colorTag + Localizer.Format("#LOC_DURATION4") + timeString + endTag);//#LOC_DURATION4 = Duration: } return status.ToString(); diff --git a/Snacks/ResourceClasses/VesselSnackshot.cs b/Snacks/ResourceClasses/VesselSnackshot.cs index b985143..1b8a3d8 100644 --- a/Snacks/ResourceClasses/VesselSnackshot.cs +++ b/Snacks/ResourceClasses/VesselSnackshot.cs @@ -22,6 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ +using KSP.Localization; using System; using System.Collections.Generic; using System.Linq; @@ -80,7 +81,7 @@ public virtual string GetStatusDisplay(bool showCrewView = false) //Crew capacity if (!vessel.isEVA) - status.AppendLine("Crew: " + crewCount + "/" + maxCrewCount + ""); + status.AppendLine(" "+Localizer.Format("#LOC_GUI_CREW") + crewCount + "/" + maxCrewCount + ""); //Resource snapshots if (!showCrewView) @@ -109,8 +110,8 @@ public virtual string GetStatusDisplay(bool showCrewView = false) if (!string.IsNullOrEmpty(astronautData.conditionSummary)) conditionSummary = astronautData.conditionSummary; else - conditionSummary = "A-OK"; - status.AppendLine(" - Status: " + conditionSummary + ""); + conditionSummary = Localizer.Format("#LOC_AOK");//#LOC_AOK=A-OK + status.AppendLine(" "+Localizer.Format("#LOC_GUI_STATUS") + conditionSummary + ""); string[] keys = astronautData.rosterResources.Keys.ToArray(); for (int rosterIndex = 0; rosterIndex < keys.Length; rosterIndex++) diff --git a/Snacks/SettingsAndScenario/SnacksProperties.cs b/Snacks/SettingsAndScenario/SnacksProperties.cs index eeed855..7b74b73 100644 --- a/Snacks/SettingsAndScenario/SnacksProperties.cs +++ b/Snacks/SettingsAndScenario/SnacksProperties.cs @@ -28,6 +28,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE using System.Text; using UnityEngine; using KSP.IO; +using KSP.Localization; namespace Snacks { @@ -52,36 +53,47 @@ public enum FaintTime public class SnackPenalties : GameParameters.CustomParameterNode { [GameParameters.CustomParameterUI("Enable random penalties", toolTip = "If enabled, then one of the enabled penalties will be randomly chosen", autoPersistance = true, gameMode = GameParameters.GameMode.CAREER)] + public bool enableRandomPenalties = true; [GameParameters.CustomParameterUI("Hungry kerbals hurt your reputation.", toolTip = "When kerbals go hungry, you lose Reputation", autoPersistance = true, gameMode = GameParameters.GameMode.CAREER)] + public bool loseRepWhenHungry = true; [GameParameters.CustomParameterUI("Rep loss per kerbal per meal", toolTip = "How mad your kerbals will be", autoPersistance = true, gameMode = GameParameters.GameMode.CAREER)] + public RepLoss repLostWhenHungry = RepLoss.Low; [GameParameters.CustomParameterUI("Hungry kerbals hurt your bottom line.", toolTip = "When kerbals go hungry, you lose Funds", autoPersistance = true, gameMode = GameParameters.GameMode.CAREER)] + public bool loseFundsWhenHuntry = true; [GameParameters.CustomIntParameterUI("Fine per kerbal", maxValue = 50000, minValue = 1000, stepSize = 1000, toolTip = "How much is it gonna cost", autoPersistance = true, gameMode = GameParameters.GameMode.CAREER)] + public int finePerKerbal = 10000; [GameParameters.CustomParameterUI("Hungry kerbals ruin science.", toolTip = "When kerbals go hungry, they ruin stored experiment results and data", autoPersistance = true, gameMode = GameParameters.GameMode.CAREER | GameParameters.GameMode.SCIENCE)] + public bool loseScienceWhenHungry = true; [GameParameters.CustomParameterUI("Data lost", toolTip = "What percentage of lab data is lost", autoPersistance = true, gameMode = GameParameters.GameMode.CAREER | GameParameters.GameMode.SCIENCE)] + public RepLoss dataLostWhenHungry = RepLoss.Low; [GameParameters.CustomParameterUI("Hungry kerbals can faint.", toolTip = "When kerbals go hungry, they might pass out and can't be controlled.", autoPersistance = true)] + public bool faintWhenHungry = true; [GameParameters.CustomIntParameterUI("Meals before fainting", maxValue = 24, minValue = 1, stepSize = 1, toolTip = "How many meals can a kerbal miss before fainting", autoPersistance = true)] + public int mealsBeforeFainting = 3; [GameParameters.CustomParameterUI("Nap time when fainted", toolTip = "How long will a kerbal nap for when they faint", autoPersistance = true)] + public FaintTime napTime = FaintTime.OneMinute; [GameParameters.CustomParameterUI("Kerbals can starve to death.", toolTip = "If they skip too many meals, kerbals can starve to death.", autoPersistance = true)] + public bool canStarveToDeath = false; [GameParameters.CustomIntParameterUI("Skipped meals before death", maxValue = 42, minValue = 1, stepSize = 1, toolTip = "How many meals can a kerbal miss before dying", autoPersistance = true)] diff --git a/Snacks/SettingsAndScenario/SnacksScenario.cs b/Snacks/SettingsAndScenario/SnacksScenario.cs index 49b0b3a..874158c 100644 --- a/Snacks/SettingsAndScenario/SnacksScenario.cs +++ b/Snacks/SettingsAndScenario/SnacksScenario.cs @@ -31,6 +31,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE using UnityEngine; using KSP.IO; using KSP.UI.Screens; +using KSP.Localization; namespace Snacks { @@ -1704,15 +1705,15 @@ public static string FormatTime(double secondsToFormat, bool showCompact = false else { if (years > 0) - timeBuilder.Append(string.Format(" {0:n2} Years,", years)); + timeBuilder.Append(Localizer.Format("#LOC_TIME1", years.ToString("f2")));//#LOC_TIME1=<<1>> Years, if (days > 0) - timeBuilder.Append(string.Format(" {0:n2} Days,", days)); + timeBuilder.Append(Localizer.Format("#LOC_TIME2", days.ToString("f2")));//#LOC_TIME2=<<1>> Days, if (hours > 0) - timeBuilder.Append(string.Format(" {0:n2} Hours,", hours)); + timeBuilder.Append(Localizer.Format("#LOC_TIME3", hours.ToString("f2")));//#LOC_TIME3=<<1>> Hours, if (minutes > 0) - timeBuilder.Append(string.Format(" {0:n2} Minutes,", minutes)); + timeBuilder.Append(Localizer.Format("#LOC_TIME4", minutes.ToString("f2")));//#LOC_TIME4=<<1>> Minutes, if (seconds > 0.0001) - timeBuilder.Append(string.Format(" {0:n2} Seconds", seconds)); + timeBuilder.Append(Localizer.Format("#LOC_TIME5", seconds.ToString("f2")));//#LOC_TIME5=<<1>> Seconds, } string timeDisplay = timeBuilder.ToString(); diff --git a/Snacks/Snacks.csproj b/Snacks/Snacks.csproj index 4f1dd8f..45a3ace 100644 --- a/Snacks/Snacks.csproj +++ b/Snacks/Snacks.csproj @@ -34,6 +34,7 @@ prompt 4 false + bin\Release\SnacksUtils.xml @@ -54,6 +55,10 @@ + + False + ..\..\..\..\Program Files\steam\steamapps\common\Kerbal Space Program\KSP_x64_Data\Managed\UnityEngine.dll + ..\..\..\..\..\KSPDev\KSP_x64_Data\Managed\UnityEngine.AnimationModule.dll diff --git a/Snacks/Snacks.sln b/Snacks/Snacks.sln index 6a87d1f..b848940 100644 --- a/Snacks/Snacks.sln +++ b/Snacks/Snacks.sln @@ -1,20 +1,28 @@  -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.6.33829.357 +MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Snacks", "Snacks.csproj", "{3463BA25-163C-4A80-B246-9E807ADABF0B}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU + rele|Any CPU = rele|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {3463BA25-163C-4A80-B246-9E807ADABF0B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {3463BA25-163C-4A80-B246-9E807ADABF0B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3463BA25-163C-4A80-B246-9E807ADABF0B}.rele|Any CPU.ActiveCfg = Release|Any CPU + {3463BA25-163C-4A80-B246-9E807ADABF0B}.rele|Any CPU.Build.0 = Release|Any CPU {3463BA25-163C-4A80-B246-9E807ADABF0B}.Release|Any CPU.ActiveCfg = Release|Any CPU {3463BA25-163C-4A80-B246-9E807ADABF0B}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {D89912E5-59BE-4906-BD2D-91CB5BBB4239} + EndGlobalSection EndGlobal diff --git a/Snacks/Utilities/SnacksResourceSwitcher.cs b/Snacks/Utilities/SnacksResourceSwitcher.cs index a2b48b7..b252a13 100644 --- a/Snacks/Utilities/SnacksResourceSwitcher.cs +++ b/Snacks/Utilities/SnacksResourceSwitcher.cs @@ -27,7 +27,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE using System.Text; using UnityEngine; using KSP.IO; - +using KSP.Localization; namespace Snacks { @@ -60,7 +60,7 @@ public override string GetInfo() StringBuilder info = new StringBuilder(); - info.AppendLine("Resource Options"); + info.AppendLine(Localizer.Format("#LOC_GUI_RESOURCEOPTION"));//#LOC_GUI_RESOURCEOPTION = Resource Options info.AppendLine(" "); ResourceOption option; diff --git a/Snacks/bin/Debug/SnacksUtils.dll b/Snacks/bin/Debug/SnacksUtils.dll index 7d8d71c..0b6d668 100644 Binary files a/Snacks/bin/Debug/SnacksUtils.dll and b/Snacks/bin/Debug/SnacksUtils.dll differ diff --git a/Snacks/bin/Debug/SnacksUtils.pdb b/Snacks/bin/Debug/SnacksUtils.pdb index 8f10d37..5afd4a9 100644 Binary files a/Snacks/bin/Debug/SnacksUtils.pdb and b/Snacks/bin/Debug/SnacksUtils.pdb differ diff --git a/Snacks/bin/Release/API.md b/Snacks/bin/Release/API.md new file mode 100644 index 0000000..0eca0be --- /dev/null +++ b/Snacks/bin/Release/API.md @@ -0,0 +1,2131 @@ +# SnacksUtils + + +# CheckBreathableAir + +This precondition checks to see if a kerbal or vessel is in an environemnt with breathable air, and matches it with the expected parameter. The vessel's celestial body must have an atmosphere with oxygen, and the vessel altitude must be between sea level and half the atmosphere height. Example definition: PRECONDITION { name = CheckBreathableAir mustExist = false } + +## Fields + +### mustExist +Flag to indicate pressence (true) or absence (false) of the value to check. +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. parameters from the class also apply. + + +# CheckSkillLevel + +This precondition checks to see if a kerbal's experience level matches the desired value and type of check to make. For instance you could check to see if a kerbal is above 3 stars. Example definition: PRECONDITION { name = CheckSkillLevel valueToCheck = 3 checkType = checkGreaterOrEqual //Default value } + +## Fields + +### valueToCheck +The value to check for +### checkType +Type of check to make Default: checkGreaterOrEqual +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. parameters from the class also apply. + + +# CheckSkill + +This precondition checks to see if a kerbal's skill matches the desired parameter. For instance, you could check to see if a kerbal has the ScienceSkill. Example definition: PRECONDITION { name = CheckSkill skillToCheck = ScienceSkill mustExist = true } + +## Fields + +### +The value to check for +### +Type of check to make Default: checkGreaterOrEqual +### skillToCheck +Name of the skill to check +### mustExist +Flag to indicate pressence (true) or absence (false) of the value to check. +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. parameters from the class also apply. + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. parameters from the class also apply. + + +# CheckTrait + +This precondition checks to see if a kerbal's trait matches the desired parameter. For instance, you could check to see if a kerbal is an Engineer. Example definition: PRECONDITION { name = CheckTrait traitToCheck = Engineer mustExist = true } + +## Fields + +### traitToCheck +Name of the trait to check +### mustExist +Flag to indicate pressence (true) or absence (false) of the value to check. +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. parameters from the class also apply. + + +# CheckCourage + +This precondition checks to see if a kerbal's courage matches the desired value and type of check to make. Example definition: PRECONDITION { name = CheckCourage valueToCheck = 0.5 checkType = checkEquals //Default value } + +## Fields + +### valueToCheck +The value to check for +### checkType +Type of check to make Default: checkEquals +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. parameters from the class also apply. + + +# CheckStupidity + +This precondition checks to see if a kerbal's stupidity matches the desired value and type of check to make. Example definition: PRECONDITION { name = CheckStupidity valueToCheck = 0.5 checkType = checkEquals //Default value } + +## Fields + +### valueToCheck +The value to check for +### checkType +Type of check to make Default: checkEquals +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. parameters from the class also apply. + + +# CheckCrewCount + +This precondition checks to see if a vessel's crew count matches the desired parameter. Example definition: PRECONDITION { name = CheckCrewCount valueToCheck = 1 checkType = checkEquals //Default value } + +## Fields + +### valueToCheck +The value to check for +### checkType +Type of check to make +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. parameters from the class also apply. + + +# CheckBadass + +This precondition checks to see if a kerbal's badass status against the badassExists flag. Both must match in order for the precondition to be validated. Example definition: PRECONDITION { name = CheckBadass mustExist = true } + +## Fields + +### mustExist +Flag to indicate pressence (true) or absence (false) of the value to check. +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. parameters from the class also apply. + + +# CheckVesselStatus + +This precondition checks the vessel status against the supplied parameters. Example definition: PRECONDITION { name = CheckVesselStatus situation = LANDED situation = SPLASHED } + +## Fields + +### situationsToCheck +List of situations to check the vessel against. In the config file, separate each situation to check on a separate line. Ex: situation = LANDED situation = SPLASHED Valid situations: LANDED, SPLASHED, ESCAPING, FLYING, ORBITING, SUB_ORBITAL, PRELAUNCH +### bodyName +Optional name of the planetary body where the vessel must be located. +### metersAltitude +Optional altitude in meters that the vessel must be at. +### checkType +The type of check to make against metersAltitude. +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. parameters from the class also apply. + + +# CheckGravityLevel + +This precondition checks to see if a vessel or roster resource meets the supplied parameters. Gravity checks can be negated by setting CheckGravityLevel.checkType, where checkType is one of the conditional qualifiers. For instance, CheckGravityLevel.checkLesserOrEqual will disqualify any microgravity event checks and is useful for centrifuges. Example definition: PRECONDITION { name = CheckGravityLevel valueToCheck = 0.1 checkType = checkLesserOrEqual //Default value } + +## Fields + +### valueToCheck +The value to check for +### checkType +The conditional type to use during the validation. +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. parameters from the class also apply. + + +# CheckValueConditionals + +This enum represents the key-value conditionals to check. + +## Fields + +### checkEquals +Key-value must be equal to the supplied value. +### checkNotEqual +Key-value must not be equal to the supplied value. +### checkGreaterThan +Key-value must be greater than the supplied value. +### checkLessThan +Key-value must be less than the supplied value. +### checkGreaterOrEqual +Key-value must be greater than or equal to the supplied value. +### checkLesserOrEqual +Key-value must be less than or equal to the supplied value. + +# CheckKeyValue + +This precondition Checks a kerbal's key-value and validates it against the supplied parameters. Example definition: PRECONDITION { name = CheckKeyValue keyValueName = State checkType = checkEquals stringValue = Bored } + +## Fields + +### keyValueName +Name of the key-value +### stringValue +String value of the key. Takes precedence over the int values. +### intValue +Integer value of the key +### checkType +Type of check to make +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. parameters from the class also apply. + + +# CheckCondition + +This precondition Checks a kerbal's condition summary to see if it exists or not. The precondition is valid if the kerbal's condition summary matches the parameters of the precondition. Example definition: PRECONDITION { name = CheckCondition conditionSummary = Sleepy mustExist = true } + +## Fields + +### conditionSummary +Name of the condition to check +### mustExist +Flag to indicate pressence (true) or absence (false) of the value to check. +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. parameters from the class also apply. + + +# CheckRandomChance + +This precondition rolls a random die between a minimum and maximum value and compares it to a target number. If the roll meets or exceeds the target number then the precondition passes. Example definition: PRECONDITION { name = CheckRandomChance dieRollMin = 1 dieRollMax = 1000 targetNumber = 999 } + +## Fields + +### dieRollMin +Minimum value on the die roll +### dieRollMax +Maximum value on the die roll +### targetNumber +Target number required to declare the precondition valid. +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. parameters from the class also apply. + + +# CheckResultTypes + +Enumerator with the type of results to check. + +## Fields + +### resultConsumptionSuccess +Check for a successful consumption +### resultConsumptionFailure +Check for a consumption failure +### resultProductionSuccess +Check for a production success +### resultProductionFailure +Check for a production failure + +# CheckProcessorResult + +This precondition checks the specified processor for desired results. Example definition: PRECONDITION { name = CheckProcessorResult type = resultConsumptionFailure processorName = Snacks! resourceName = Snacks cyclesRequired = 1 } + +## Fields + +### resultType +The type of result to check +### processorName +The name of the processor to check +### resourceName +The name of the resource to check +### cyclesRequired +The number of process cycles to check +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. parameters from the class also apply. + + +# ClearKeyValue + +This outcome removes the desired key-value from the affected kerbals Example definition: OUTCOME { name = ClearKeyValues conditionSummary = Sick } + +## Fields + +### keyValueName +Name of the key-value +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. Parameters in the class also apply. + + +# ClearCondition + +This outcome removes the desired condition on the affected kerbals Example definition: OUTCOME { name = ClearCondition conditionSummary = Sick } + +## Fields + +### conditionName +Name of the condition to set +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. Parameters in the class also apply. + + +# ConsumeResource + +This outcome consumes the specified resource in the desired amount. It can be a vessel resource or a roster resource. Example definition: OUTCOME { name = ConsumeResource resourceName = Stress amount = 1 } + +## Fields + +### resourceName +Name of the resource to produce +### randomMin +Optional minimum value of random amount to produce. +### randomMax +Optional maximum value of random amount to produce. +### amount +Amount of resource to consume. Takes presedence over randomMin and randomMax +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. Parameters in the class also apply. + + +# BasePrecondition + +A precondition is a check of some type that prevents outcomes from being applied unless the precondition's check suceeds. + +## Fields + +### name +Name of the precondition. +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode specifying the initialization parameters. + + +### IsValid(ProtoCrewMember,Vessel) +Determines if the precondition is valid. +> #### Parameters +> **astronaut:** The ProtoCrewModule to check. + +> **vessel:** The Vessel to check + +> #### Return value +> + +### IsValid(ProtoCrewMember) +Determines if the precondition is valid. +> #### Parameters +> **astronaut:** The ProtoCrewModule to check. + +> #### Return value +> + +# OnStrikePenalty + +This outcome sets a condition on the affected kerbals. If that condition is defined in a SKILL_LOSS_CONDITION config node, then the kerbals' skills will be removed until the condition is cleared. Example definition: OUTCOME { name = ClearCondition conditionSummary = Stressed Out } + +## Fields + +### conditionName +The name of the condition to set. If defined in a SKILL_LOSS_CONDITION node then the affected kerbals will lose their skills until the condition is cleared. +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **conditionName:** The name of the condition to set. It must be added to a SKILL_LOSS_CONDITION config node in order for the kerbal to lose its skills. + +> **canBeRandom:** If set to true it can be randomly selected from the outcomes list. + +> **playerMessage:** A string containing the bad news. + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. Parameters in the class also apply. + + +# ProduceResource + +This outcome produces the specified resource in the desired amount. It can be a vessel resource or a roster resource. Example definition: OUTCOME { name = ProduceResource resourceName = Stress amount = 1 } + +## Fields + +### resourceName +Name of the resource to produce +### randomMin +Optional minimum value of random amount to produce. +### randomMax +Optional maximum value of random amount to produce. +### amount +Amount of resource to produce. Takes presedence over randomMin and randomMax +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. Parameters in the class also apply. + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **resourceName:** The name of the resource to produce. It can be a roster resource. + +> **amount:** The amount of resource to produce + +> **canBeRandom:** If set to true it can be randomly selected from the outcomes list. + +> **playerMessage:** A message for the player. + + +# CheckResource + +This precondition checks to see if a vessel or roster resource meets the supplied parameters. Example definition: PRECONDITION { name = CheckResource resourceName = Stress checkType = checkEquals valueToCheck = 3.0 } + +## Fields + +### resourceName +Name of the resource to check +### checkType +The conditional type to use during the validation. +### valueToCheck +The value to check for +### checkMaxAmount +Flag to indicate whether or not to check the resource's max amount instead of the curren amount; +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. parameters from the class also apply. + + +# ProcessedResource + +This class represents resources consumed or produced by a SnacksResourceProcessor. Consumption and production is applied vessel-wide, or to individual kerbal roster entries depending on the configuration. If applied vessel-wide, the resource can be produced or consumed per kerbal. Finally, the resource can be displayed in the Snapshots view. + +## Fields + +### resourceName +Name of the consumed/produced resource +### dependencyResourceName +Name of the dependency resource if the resource to process depends upon the results of another resource's process result. E.G. 1 unit of Soil is produced for 1 unt of Snacks consumed. +### isRosterResource +Flag to indicate whether or not the resource is applied to roster entries instead of parts and vessels. if set to true, then appliedPerCrew is ignored. Default: false +### showInSnapshot +Flag to indicate whether or not to show the resource in the Snapshots window. Ignored if isRosterResource is set to true. Default: true +### failureResultAppliesOutcomes +Flag to indicate whether or not a failure result applies the processor's outcomes. Default: true +### amount +The amount of resource to consume or produce. If appliedPerCrew is true, then the amount consumed/produced is multiplied by the number of crew aboard the vessel. If isRosterResource is true, then each individual crew member's roster entry will be affected instead. Default: 0 +### clearDataDuringRecovery +Flag to indicate that astronaut data should be cleared when a vessel is recovered. Default: true +## Methods + + +### Load(ConfigNode) +Loads the fields from the config node. +> #### Parameters +> **node:** A ConfigNode containing fields to load. + + +### Save +Saves current values to a ConfigNode. +> #### Return value +> A ConfigNode containing the field data. + +### ConsumeResource(Vessel,System.Double,System.Int32,System.Int32) +Consumes the resource. +> #### Parameters +> **vessel:** The vessel to work on + +> **elapsedTime:** Elapsed seconds + +> **crewCount:** Current crew count + +> **crewCapacity:** Current crew capacity + +> #### Return value +> A SnacksConsumerResult containing the resuls of the consumption. + +### ProduceResource(Vessel,System.Double,System.Int32,System.Int32,System.Collections.Generic.Dictionary{System.String,Snacks.SnacksProcessorResult}) +Produces the resource +> #### Parameters +> **vessel:** The vessel to work on + +> **elapsedTime:** Elapsed seconds + +> **crewCount:** Current crew count + +> **crewCapacity:** Current crew capacity + +> **consumptionResults:** Results of resource consumption. + +> #### Return value +> A SnacksConsumerResult containing the resuls of the production. + +# SnacksProcessorResult + +This is a result that has data regarding what happened during resource consumption or production. + +## Fields + +### resourceName +Name of the resource that was processed. +### resultType +Type of result +### completedSuccessfully +Flag to indicate whether or not the process completed successfully. +### appliedPerCrew +Flag indicating if the process was applied per crew member. +### affectedKerbalCount +Number of kerbals affected by the process. +### currentAmount +Current amount of the resource in the vessel/kerbal. +### maxAmount +Max amount of the resource in the vessel/kerbal. +### crewCount +Current number of crew aboard the vessel +### crewCapacity +Total crew capacity. +### afftectedAstronauts +List of individual astronauts affected by the result. + +# BaseResourceProcessor + +This is the base class for a resource processor. Similar to ModuleResourceConverter, the consumer will consume resources and produce resources, but it happens at the vessel level, not the part level. It's also designed to work with both loaded and unloaded vessels. Another important difference is that consumed/produced resources can occur on a per crewmember basis; a vessel with 5 crew will consume and/or produce 5 times the resources as a vessel with 1 crewmember. The configuration of a BaseResourceProcessor is done through config files. + +## Fields + +### name +Name of the resource processor +### secondsPerCycle +Number of seconds that must pass before running the consumer. +## Methods + + +### onKerbalEVA(ProtoCrewMember,Part) +Handles the situation where the kerbal went on EVA. +> #### Parameters +> **astronaut:** The kerbal that went on EVA. + +> **part:** The part that the kerbal left. + + +### onKerbalBoardedVessel(ProtoCrewMember,Part) +Handles the situation where a kerbal boards a vessel. +> #### Parameters +> **astronaut:** The kerbal boarding a vessel. + +> **part:** The part boarded. + + +### onKerbalAdded(ProtoCrewMember) +Handles adding of a new kerbal, giving the consumer a chance to add custom roster data. +> #### Parameters +> **astronaut:** The kerbal being added. + + +### onKerbalRemoved(ProtoCrewMember) +Handles removal of a kerbal, giving the consumer a chance to update custom data if needed. +> #### Parameters +> **astronaut:** The kerbal being removed. + + +### onKerbalNameChanged(ProtoCrewMember,System.String,System.String) +Handles a kerbal's name change. +> #### Parameters +> **astronaut:** The kerbal whose name has changed. Note that roster data is already being carried over, this event is used to give consumers a chance to update custom data kept outside of the roster. + +> **previousName:** The kerbal's previous name. + +> **newName:** The kerbal's new name. + + +### onVesselLoaded(Vessel) +Handles vessel loaded event, for instance, adding resources that should be on the vessel. +> #### Parameters +> **vessel:** The vessel that was loaded. + + +### onVesselRecovered(ProtoVessel) +Handles the vessel recovery event +> #### Parameters +> **protoVessel:** The ProtoVessel being recovered + + +### onVesselGoOffRails(Vessel) +Handles the situation where the vessel goes off rails. +> #### Parameters +> **vessel:** The Vessel going off rails + + +### OnGameSettingsApplied +Handles changes to game settings. + +### LoadProcessors +Loads the SNACKS_RESOURCE_PROCESSOR config nodes and returns a list of processors. +> #### Return value +> A list of resource processors. + +### Initialize +Initializes the consumer + +### Destroy +Cleanup as processor is about to be destroyed + +### OnLoad(ConfigNode) +De-serializes persistence data +> #### Parameters +> **node:** The ConfigNode with the persistence data + + +### OnSave +Saves persistence data to a ConfigNode and returns it. +> #### Return value +> A ConfigNode containing persistence data, if any. + +### AddConsumedAndProducedResources(Vessel,System.Double,System.Collections.Generic.List{ResourceRatio},System.Collections.Generic.List{ResourceRatio}) +Used primarily for simulations, returns the consumed and produced resources for the given unit of time. +> #### Parameters +> **vessel:** The vessel to query for data. + +> **secondsPerCycle:** The number of seconds to calculate total inputs and outputs. + +> **consumedResources:** The list of consumed resources to add the inputs to. + +> **producedResources:** The list of produced resources to add the outputs to. + + +### AddConsumedAndProducedResources(System.Int32,System.Double,System.Collections.Generic.List{ResourceRatio},System.Collections.Generic.List{ResourceRatio}) +Used primarily for simulations, returns the consumed and produced resources for the given unit of time. +> #### Parameters +> **crewCount:** The number of crew to simulate. + +> **secondsPerCycle:** The number of seconds to calculate total inputs and outputs. + +> **consumedResources:** The list of consumed resources to add the inputs to. + +> **producedResources:** The list of produced resources to add the outputs to. + + +### GetUnloadedResourceTotals(ProtoVessel,System.String,System.Double@,System.Double@) +Returns the amount and max amount of the desired resource in the unloaded vessel. +> #### Parameters +> **protoVessel:** The vessel to query for the resource totals. + +> **resourceName:** The name of the resource to query. + +> **amount:** The amount of the resource that the entire vessel has. + +> **maxAmount:** The max amount of the resource that the entire vessel has. + + +### ProcessResources(Vessel,System.Double,System.Int32,System.Int32) +Runs the processor, consuming input resources, producing output resources, and collating results. +> #### Parameters +> **vessel:** The vessel to run the consumer on. + +> **elapsedTime:** Number of seconds that have passed. + +> **crewCount:** Number of crew aboard the vessel. + +> **crewCapacity:** The vessel's total crew capacity. + + +# AstronautData + +This class contains data related to a kerbal. Information includes roster resources (characteristics of the kerbal akin to Courage and Stupidity), a condition summary specifying what states the kerbal is in, a list of disqualified conditions that will auto-fail precondition checks, a list of processor successes and failures, a key-value map suitable for tracking states in the event system, an exempt flag that exempts the kerbal from all outcomes. + +## Fields + +### name +Name of the kerbal. +### experienceTrait +The kerba's current experience trait. +### lastUpdated +Timestamp of when the astronaut data was last update. +### isExempt +Flag to indicate that the kerbal is exempt from outcomes. +### conditionSummary +Summary of all the conditions that the kerbal currently has. If a condition in the summary is defined in a SKILL_LOSS_CONDITION config node, then the kerbal will lose its skills until the condition is cleared. +### keyValuePairs +A map of key-value pairs. +### processedResourceSuccesses +Map of successful process cycles. The key is the name of the processor, the value is the number of successes. +### processedResourceFailures +Map of unsuccessfull process cycles. The key is the name of the processor, the value is the number of failures. +### rosterResources +A map of roster resources (characteristics of the kerbal), similar to vessel resources. +### disqualifiedPreconditions +Conditions that will automatically disqualify a precondition check. +## Methods + + +### Constructor +Initializes a new instance of the class. + +### Load(ConfigNode) +Loads the astronaut data from the config node supplied. +> #### Parameters +> **node:** The ConfigNode to read data from. + +> #### Return value +> A map keyed kerbal name that contains astronaut data. + +### Save(DictionaryValueList{System.String,Snacks.AstronautData},ConfigNode) +Saves persistent astronaut data to the supplied config node. +> #### Parameters +> **crewData:** A map of astronaut data, keyed by kerbal name. + +> **node:** The ConfigNode to save the data to. + + +### SetDisqualifier(System.String) +Sets a disqualifier that will automatically fail a precondition check. +> #### Parameters +> **disqualifier:** The name of the disqualifier to set. + + +### ClearDisqualifier(System.String) +Clears a disqualifier that will no longer fail a precondition check. +> #### Parameters +> **disqualifier:** The name of the disqualifier to clear. + + +### SetCondition(System.String) +Sets a condition that could result in loss of skills if defined in a SKILL_LOSS_CONDITION config node. The condition will appear in the kerbal's condition summary in the status window. +> #### Parameters +> **condition:** The name of the condition to set. + + +### ClearCondition(System.String) +Clears a condition, removing it from the condition summary display. If the condition is defined in a SKILL_LOSS_CONDITION config node, and the kerbal has no other conditions that result from skill loss, then the kerbal will regain its skills. +> #### Parameters +> **condition:** The name of the condition to clear. + + +# DeathPenalty + +This outcome causes affected kerbals to die. Example definition: OUTCOME { name = DeathPenalty resourceName = Snacks cyclesBeforeDeath = 10 } + +## Fields + +### resourceName +The name of the resource to check for failed processor cycles. +### cyclesBeforeDeath +The number of cycles that must fail before the kerbal dies. +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. Parameters in the class also apply. + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **resourceName:** The name of the resource to check. If no processor has a failed cycle with the resource then the outcome is invalidated. + +> **cyclesBeforeDeath:** The number of failed processor cycles required before applying the outcome. + +> **playerMessage:** A string containing the bad news for the player. + + +# FaintPenalty + +This outcome causes affected kerbals to faint. Example definition: OUTCOME { name = FaintPenalty resourceName = Snacks cyclesBeforeFainting = 3 faintDurationSeconds = 180 } + +## Fields + +### resourceName +The name of the resource to check for failed processor cycles. +### cyclesBeforeFainting +The number of cycles that must fail before the kerbal faints. +### faintDurationSeconds +The number of seconds that the kerbal will faint for. +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. Parameters in the class also apply. + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **resourceName:** The name of the resource to check. If none of the resource processors have failed cycles containing the resource then the outcome is invalidated. + +> **cyclesBeforeFainting:** The number of failed cycles required before applying the outcome.. + +> **faintDurationSeconds:** Faint duration seconds. + +> **playerMessage:** A string containing the bad news for the player. + + +# FundingPenalty + +This outcome fines the space agency by a certain amount per affected kerbal. Example definition: OUTCOME { name = FundingPenalty finePerKerbal = 1000 } + +## Fields + +### finePerKerbal +The amount of Funds to lose per kerbal. +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. Parameters in the class also apply. + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **canBeRandom:** If set to true the outcome can be randomly selected from the outcome list. + +> **playerMessage:** A string containing the bad news. + +> **finePerKerbal:** The amount of Funds lost per affected kerval. + + +# SnacksRosterResource + +This class represents a resource that's tied to individual kerbals instead of a part. One example is Stress, an abstracted habitation mechanic. + +## Fields + +### resourceName +The name of the roster resource. +### displayName +Public display name of the resource. +### showInSnapshot +Flag to indicate whether or not to show the resource in the Snapshots window. Default: true +### amount +The amount of resource available. +### maxAmount +The maximum amount of resource allowed. +### experienceBonusAmount +The amount of resource to add when the kerbal levels up. +### experienceBonusMaxAmount +The maximum amount of resource to add when the kerbal levels up. +## Methods + + +### onKerbalLevelUp(ProtoCrewMember) +Handles the kerbal level up event +> #### Parameters +> **astronaut:** The ProtoCrewMember that has leveled up. + + +### onCrewBoardedVessel(Part,Part) +Handles the crew boarded event. The resource is removed from the kerbal and added to the vessel. +> #### Parameters +> **evaKerbal:** The kerbal that is returning from EVA + +> **boardedPart:** The part that the kerbal boarded + + +### onCrewEVA(Part,Part) +Handles the crew eva event. The kerbal gains the EVA resource and the vessel loses a corresponding amount. +> #### Parameters +> **evaKerbal:** The kerbal that went on EVA + +> **partExited:** The part that the kerbal exited + + +### addResourceIfNeeded(ProtoCrewMember) +Adds the roster resource to the kerbal if needed +> #### Parameters +> **astronaut:** The ProtoCrewMember to check. + + +### addResourceIfNeeded(Vessel) +Adds the roster resource to the vessel's kerbal if needed +> #### Parameters +> **vessel:** The Vessel whose crew to check + + +# StressRosterResource + +This is a helper class to handle the unique conditions of a kerbal leveling up with the Stress resource. + + +# StressProcessor + +The Stress processor is designed to work with the Stress roster resource. Essentially, Stress is an abstracted habitation mechanic that takes into account a variety of different events. The main thing that causes Stress is being aboard a vessel; you don't want to send kerbals to Jool in a Mk1 command pod! NASA allocates 25 m^3 of space per astronaut per year aboard the ISS, and Stress is based off that number. The larger the habitable volume, the greater a kerbal's maximum Stress becomes, and it's dynamically updated whenever a kerbal changes craft. Assuming no other events, a kerbal will accumulate 1 point of Stress per day, and when the kerbal reaches it's maximum Stress, bad things happen. + +## Fields + +### MaxSeatsForMultiplier +The first N seats use the multiplier instead of the N^3 formula. +### SpacePerSeatMultiplier +How much Space a single seat provides, assuming that the vessel's number of seats is less than or equal to MaxSeatsForMultiplier. +## Methods + + +### CalculateSpace(Vessel) +Calculates how much Space a vessel has. It is a function of crew capacity and is influenced by the number of crew currently aboard. +> #### Parameters +> **vessel:** The Vessel to query. + +> #### Return value +> The amount of Space aboard the vessel. + +### CalculateSpace(System.Int32,System.Int32) +Calculates how much Space a vessel has. It is a function of crew capacity and is influenced by the number of crew currently aboard. +> #### Parameters +> **crewCount:** Current crew count aboard the vessel + +> **crewCapacity:** Current crew capacity of the vessel + +> #### Return value +> The amount of Space aboard the vessel. + +# SnacksEventCategories + +Enumerator specifying the different types of events + +## Fields + +### categoryPostProcessCycle +Event is processed after the resource process cycle completes. +### categoryEventCard +The event is chosen at random once per process cycle. +### categoryKerbalLevelUp +The event is processed when a kerbal levels up. + +# KerbalsAffectedTypes + +Enumerator specifying which kerbals are affected by the preconditions. + +## Fields + +### affectsRandomAvailable +A single available kerbal is chosen at random. +### affectsRandomAssigned +A single assigned kerbal is chosen at random. +### affectsAllAvailable +All available kerbals are affected. +### affectsAllAssigned +All assigned kerbals are affected. +### affectsRandomCrewPerVessel +A single random kerbal is chosesn amongst each crewed vessel. + +# SnacksEvent + +This class represents an "event" in Snacks. Events consist of one or more preconditions and one or more outcomes. Preconditions are things like random numbers, the pressence of specific conditions, and the like. All preconditions must be met before the event outcomes can be applied. The outcomes include all the Snacks penalties as well as other things such as setting conditions. + +## Fields + +### +Event is processed after the resource process cycle completes. +### +The event is chosen at random once per process cycle. +### +The event is processed when a kerbal levels up. +### eventCategory +The event's category +### affectedKerbals +The type of kerbals affected by the event. +### secondsBetweenChecks +Number of seconds that must pass before the event can be checked. +### daysBetweenChecks +The number of day that must pass before the event can be checked. Overrides secondsBetweenChecks. +### playerMessage +Player-friendly message to display when outcomes are going to be applied. +### name +Name of the event +## Methods + + +### Constructor +Initializes a new instance of the class. + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode specifying the initialization parameters. + + +### ApplyOutcomes(ProtoCrewMember,Vessel) +Applies outcomes to the supplied astronaut +> #### Parameters +> **astronaut:** The ProtoCrewMember to apply outcomes to. + +> **vessel:** The Vessel to check + + +### ApplyOutcomes(ProtoCrewMember) +Applies outcomes to the supplied astronaut +> #### Parameters +> **astronaut:** The ProtoCrewMember to apply outcomes to. + + +### PreconditionsValid(ProtoCrewMember,Vessel) +Checks all preconditions against the supplied astronaut +> #### Parameters +> **astronaut:** The ProtoCrewMember to check + +> **vessel:** The Vessel to check + +> #### Return value +> + +### PreconditionsValid(ProtoCrewMember) +Checks all preconditions against the supplied astronaut +> #### Parameters +> **astronaut:** The ProtoCrewMember to check + +> #### Return value +> + +### IsTimeToCheck(System.Double) +Determines if the event can be evaluated based on the supplied elapsed time. +> #### Parameters +> **elapsedTime:** The number of seconds that have passed since the last inquiry. + +> #### Return value +> true if it's time to evaluate the event, false if not. + +### ProcessEvent(System.Double) +Processes the event based on elapsed time, event type, and kerbals affected. +> #### Parameters +> **elapsedTime:** The elapsed time since the last process cycle, ignored for event cards. + + +### Load(ConfigNode) +Loads the persistent data. +> #### Parameters +> **node:** A ConfigNode with persistent data. + + +### Save +Saves the persistent data. +> #### Return value +> A ConfigNode with persistent data. + +# SetCondition + +This outcome sets the desired condition on the affected kerbals Example definition: OUTCOME { name = SetCondition conditionSummary = Sick } + +## Fields + +### conditionName +Name of the condition to set +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. Parameters in the class also apply. + + +# SetKeyValue + +This outcome sets the desired key-vale on the affected kerbals Example definition: OUTCOME { name = SetKeyValue keyValueName = DaysBored intValue = 1 } + +## Fields + +### keyValueName +Name of the key-value +### stringValue +String value of the key. Takes precedence over the int values. +### intValue +Integer value of the key +### addIntValue +Integer value to add to the existing key value. If key doesn't exist then it will be set to this value instead. Taks precedence over intValue. +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. Parameters in the class also apply. + + +# SnacksDisqualifier + +This part module is designed to negate one or more preconditions so long as the kerbal resides in the part. An example would be a centrifuge + +## Fields + +### disqualifiedPreconditions +Contains the disqualified preconditions such as CheckGravityLevel.checkLesserOrEqual for low gravity checks. Separate disqualified preconditions by semicolon. Most of the preconditions can be disqualified simply by stating their name. If a precondition requires something different, be sure to check its documentation. + +# RepPenalty + +This outcome reduces the space agency's reputation based on the supplied parameters. Example definition: OUTCOME { name = RepPenalty repLossPerKerbal = 5 } + +## Fields + +### repLossPerKerbal +The rep loss per kerbal. +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. Parameters in the class also apply. + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **canBeRandom:** If set to true it can be randomly selected from the outcomes list. + +> **repLossPerKerbal:** Rep loss per kerbal. + +> **playerMessage:** A string containing the bad news. + + +# SciencePenalty + +This outcome disrupts science experiments aboard a vessel. Example definition: OUTCOME { name = SciencePenalty } + +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. Parameters in the class also apply. + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **canBeRandom:** If set to true it can be randomly selected from the outcomes list. + + +# ISnacksPenalty + +Interface for creating and running penalties when a processor resource runs out or has too much aboard the vessel or kerbal. + +## Methods + + +### IsEnabled +Indicates whether or not the penalty is enabled. +> #### Return value +> true if inabled, false if not. + +### AlwaysApply +Indicates whether or not the penalty is always applied instead of randomly chosen. +> #### Return value +> true if the penalty should always be applied, false if not. + +### ApplyPenalty(System.Int32,Vessel) +Applies the penalty to the affected kerbals +> #### Parameters +> **affectedKerbals:** An int containing the number of kerbals affected by the penalty. + +> **vessel:** The vessel to apply the penalty to. + + +### RemovePenalty(Vessel) +Removes penalty effects. +> #### Parameters +> **vessel:** The vessel to remove the penalt effects from. + + +### GameSettingsApplied +Handles changes in game settings, if any. + +# SnacksScenario + +The SnacksScenario class is the heart of Snacks. It runs all the processes. + +## Fields + +### onSnapshotsUpdated +Tells listeners that snapshots were created. +### onSimulatorCreated +Tells listeners that a simulator was created. Gives mods a chance to add custom converters not covered by Snacks. +### onBackgroundConvertersCreated +Tells listeners that background converters were created. Gives mods a chance to add custom converters not covered by Snacks. +### onSnackTime +Signifies that snacking has occurred. +### onRosterResourceUpdated +Signifies that the roster resource has been updated +### Instance +Instance of the scenario. +### LoggingEnabled +Flag indicating whether or not logging is enabled. +### sciencePenalties +Map of sciecnce penalties sorted by vessel. +### crewData +Map of astronaut data, keyed by astronaut name. +### exemptKerbals +List of kerbals that are exempt from outcome effects. +### cycleStartTime +Last time the processing cycle started. +### backgroundConverters +Map of the background conveters list, keyed by vessel. +### resourceProcessors +List of resource processors that handle life support consumption and waste production. +### snacksPartResources +List of resources that will be added to parts as they are created or loaded. +### snacksEVAResources +List of resources that are added to kerbals when they go on EVA. +### snapshotMap +Map of snapshots, keyed by vessel, that give a status of each vessel's visible life support resources and crew status. +### bodyVesselCountMap +Helper that gives a count, by celestial body id, of how many vessels are on or around the celestial body. +### rosterResources +Map of all roster resources to add to kerbals as they are created. +### lossOfSkillConditions +List of conditions that will cause a skill loss. These conditions are defined via SKILL_LOSS_CONDITION nodes. +### converterWatchlist +List of converters to watch for when creating snapshot simulations. +### simulatorSecondsPerCycle +How many simulated seconds pass per simulator cycle. +### maxSimulatorCycles +Maximum number of simulator cycles to run. +### maxThreads +Max number of simulator threads to create. +## Methods + + +### UpdateSnapshots +Updates the resource snapshots for each vessel in the game that isn't Debris, a Flag, a SpaceObject, or Unknown. + +### GetCrewCapacity(Vessel) +Returns the crew capacity of the vessel +> #### Parameters +> **vessel:** The Vessel to query. + +> #### Return value +> The crew capacity. + +### FixedUpdate +FixedUpdate handles all the processing tasks related to life support resources and event processing. + +### RunSnackCyleImmediately(System.Double) +Runs the snack cyle immediately. +> #### Parameters +> **secondsElapsed:** Seconds elapsed. + + +### FindVessel(ProtoCrewMember) +Finds the vessel that the kerbal is residing in. +> #### Parameters +> **astronaut:** The astronaut to check. + +> #### Return value +> The Vessel where the kerbal resides. + +### ShouldRemoveSkills(ProtoCrewMember) +Determines whether or not the kerbal's skills should be removed. +> #### Parameters +> **astronaut:** the ProtoCrewMember to investigate. + +> #### Return value +> true, if remove skills should be removed, false otherwise. + +### RemoveSkillsIfNeeded(ProtoCrewMember) +Removes the skills if needed. The supplied kerbal must have at least one condition registered in a SKILL_LOSS_CONDITION config node in order to remove the skills. +> #### Parameters +> **astronaut:** The kerbal to check. + + +### RestoreSkillsIfNeeded(ProtoCrewMember) +Restores the skills if needed. The kerbal in question must not have any conditions that would result in a loss of skill. +> #### Parameters +> **astronaut:** The kerbal to query. + + +### RemoveSkills(ProtoCrewMember) +Removes skills from the desired kerbal. Does not check to see if they should be removed based on condition summary. +> #### Parameters +> **astronaut:** The ProtoCrewMember to remove skills from. + + +### RestoreSkills(ProtoCrewMember) +Restores skills to the desired kerbal. Does not check to see if they can be restored based on condition summary. +> #### Parameters +> **astronaut:** + + +### SetExemptCrew(System.String) +Adds the name of the kerbal to the exemptions list. +> #### Parameters +> **exemptedCrew:** The name of the kerbal to add to the list. + + +### RegisterCrew(Vessel) +Registers crew into the astronaut database. +> #### Parameters +> **vessel:** The vessel to search for crew. + + +### UnregisterCrew(ProtoVessel) +Unregisters the crew from the astronaut database. +> #### Parameters +> **protoVessel:** The vessel to search for crew to unregister. + + +### UnregisterCrew(Vessel) +Unregisters the crew from the astronaut database. +> #### Parameters +> **vessel:** The vessel to search for crew to unregister. + + +### RegisterCrew(ProtoCrewMember) +Registers the astronaut into the astronaut database. +> #### Parameters +> **astronaut:** The astronaut to register. + + +### UnregisterCrew(ProtoCrewMember) +Unregisters the astronaut from the astronaut database. +> #### Parameters +> **astronaut:** The astronaut to unregister. + + +### UnregisterCrew(Snacks.AstronautData) +Unregisters the astronaut data from the astronaut database. +> #### Parameters +> **data:** The astronaut data to unregister. + + +### GetNonExemptCrewCount(Vessel) +Returns the number of crew that aren't exempt. +> #### Parameters +> **vessel:** The vessel to query for crew. + +> #### Return value +> The number of victims. Er, number of non-exempt crew. + +### GetNonExemptCrew(Vessel) +Returns the non-exempt crew in the vessel. +> #### Parameters +> **vessel:** The Vessel to query. + +> #### Return value +> An array of ProtoCrewMember objects if there are non-exempt crew, or null if not. + +### GetAstronautData(ProtoCrewMember) +Returns the astronaut data associated with the astronaut. +> #### Parameters +> **astronaut:** The ProtoCrewMember to check for astronaut data. + +> #### Return value +> The AstronautData associated with the kerbal. + +### SetAstronautData(Snacks.AstronautData) +Saves the astronaut data into the database. +> #### Parameters +> **data:** The AstronautData to save. + + +### AddStressToCrew(Vessel,System.Single) +Adds the stress to crew if Stress is enabled. This is primarily used by 3rd party mods like BARIS. +> #### Parameters +> **vessel:** The Vessel to query for crew. + +> **stressAmount:** The amount of Stress to add. + + +### FormatTime(System.Double,System.Boolean) +Formats the supplied seconds into a string. +> #### Parameters +> **secondsToFormat:** The number of seconds to format. + +> **showCompact:** A flag to indicate whether or not to show the compact form. + +> #### Return value +> + +### GetSecondsPerDay +Gets the number of seconds per day on the homeworld. +> #### Return value +> The lenght of the solar day in seconds of the homeworld. + +### GetSolarFlux(Vessel) +Gets the solar flux based on vessel location. +> #### Parameters +> **vessel:** The vessel to query. + +> #### Return value +> The level of solar flux at the vessel's location. + +### CreatePrecondition(ConfigNode) +Creates a new precondition based on the config node data passed in. +> #### Parameters +> **node:** The ConfigNode containing data to parse. + +> #### Return value +> A BasePrecondition containing the precondition object, or null if the config node couldn't be parsed. + +### CreateOutcome(ConfigNode) +Creates a new outcome based on the config node data passed in. +> #### Parameters +> **node:** The ConfigNode containing data to parse. + +> #### Return value +> The outcome corresponding to the desired config. + +# SnackProcessor + +The SnacksProcessor grinds out Snacks from Ore. It is derived from the SnacksConverter. The output of the processor is affected by the game settings. + +## Fields + +### dailyOutput +A status field showing the daily output of Snacks. +### originalSnacksRatio +Helper field describing the original output ratio of Snacks. +### sourceInputRatio +Helper field to describe the original input ratio of Ore +## Methods + + +### GetDailySnacksOutput +Gets the daily snacks output. +> #### Return value +> The amount of Snacks produced daily, subjected to game settings. + +# SnacksBackroundEmailTypes + +This enum specifies the diffent types of emails to send during background processing. + +## Fields + +### missingResources +The processor is missing an input resource. +### missingRequiredResource +The processor is missing a required resource. +### containerFull +The vessel is out of room. +### yieldCriticalFail +The yield experienced a critical failure. +### yieldCriticalSuccess +The yield has had a critical success. +### yieldLower +The yield amount was lower than normal. +### yieldNominal +The yield amount was normal. + +# SnacksBackgroundConverter + +This class runs active converters in the background, consuming inputs, producing outputs, and yielding resources. + +## Fields + +### ConverterName +Name of the converter +### moduleName +Name of the converter part module. +### IsActivated +Flag indicating that the converter is active. +### isMissingResources +Flag indicating that the converter is missing resources. +### isContainerFull +Flag indicating that the container is full. +### inputEfficiency +The input efficiency. +### outputEfficiency +The output efficiency. +## Methods + + +### GetBackgroundConverters +Parses a vessel to find active converters to run in the background. +> #### Return value +> A map keyed by Vessel that has a list of running converters to run in the background. + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **protoPart:** The ProtPartSnapshot that hosts the converter. + +> **protoModule:** The ProtoPartModuleSnapshot representing the converter. + +> **moduleIndex:** The module index. + + +### Constructor +Initializes a new instance of the class. + +### CheckRequiredResources(ProtoVessel,System.Double) +Checks to be sure the vessel has the required resources. +> #### Parameters +> **vessel:** The Vessel to check. + +> **elapsedTime:** The seconds that have elapsed. + + +### ConsumeInputResources(ProtoVessel,System.Double) +Consumes the input resources. +> #### Parameters +> **vessel:** The Vessel to consume resources from. + +> **elapsedTime:** Converter elapsed time. + + +### ProduceOutputResources(ProtoVessel,System.Double) +Produces the output resources. +> #### Parameters +> **vessel:** The Vessel to add resources to. + +> **elapsedTime:** Converter elapsed time. + + +### ProduceyieldsList(ProtoVessel) +Produces the yield resources +> #### Parameters +> **vessel:** The Vessel to add resources to. + + +### PrepareToProcess(ProtoVessel) +Prepares the converter to process. +> #### Parameters +> **vessel:** The Vessel to check for preparations. + + +### PostProcess(ProtoVessel) +Handles post process tasks for the converter. +> #### Parameters +> **vessel:** The Vessel to update. + + +# SnacksRosterRatio + +The SnacksRosterRatio is a helper struct that is similar to a ResourceRatio, but it's designed for use with roster resources (characteristics of a kerbal). + +## Fields + +### ResourceName +The name of the resource. +### AmountPerDay +The amount per day. This value overwrites AmountPerSecond and is based on the homeworld's second per day. +### AmountPerSecond +The amount per second. + +# SnacksConverter + +An enhanced version of ModuleResourceConverter, the SnacksConverter offers a number of enhancements including producing resources after a set number of hours have elapsed (defined by YIELD_RESOURCES nodes), the ability to produce the yield resources based on the result of a random number generation, an optional flag that results in the part exploding as a result of a critical failure roll, an optional flag that can prevent the converter from being shut off, the ability to play effects, and the ability to be run in the background (when the vessel isn't loaded into the scene). + +## Fields + +### startEffect +Name of the effect to play when the converter starts. +### stopEffect +Name of the effect to play when the converter stops. +### runningEffect +Name of the effect to play while the converter is running. +### minimumVesselPercentEC +This is a threshold value to ensure that the converter will shut off if the vessel's ElectricCharge falls below the specified percentage. It is ignored if the converter doesn't use ElectricCharge. +### requiresHomeConnection +This flag tells the converter to check for a connection to the homeworld if set to true. If no connection is present, then the converter operations are suspended. It requires CommNet to be enabled. +### minimumCrew +This field specifies the minimum number of crew required to operate the converter. If the part lacks the minimum required crew, then operations are suspended. +### conditionSummary +This field specifies the condition summary to set when a kerbal enters the part and the converter is running. For example, the kerbal could be Relaxing. The condition summary appears in the kerbal's condition summary display. Certain conditions will result a loss of skills for the duration that the converter is running. For that to happen, be sure to define a SKILL_LOSS_CONDITION config node with the name of the condition. +### canBeShutdown +This field indicates whether or not the converter can be shut down. If set to false, then the converter will remove the shutdown and toggle actions and disable the shutdown button. +### ID +Unique ID of the converter. Used to identify it during background processing. +### dieRollMin +Minimum die roll +### dieRollMax +Maximum die roll +### minimumSuccess +On a roll of dieRollMin - dieRollMax, the minimum roll required to declare a successful resource yield. Set to 0 if you don't want to roll for success. +### criticalSuccess +On a roll of dieRollMin - dieRollMax, minimum roll for a resource yield to be declared a critical success. +### criticalFail +On a roll of dieRollMin - dieRollMax, the maximum roll for a resource yield to be declared a critical failure. +### hoursPerCycle +How many hours to wait before producing resources defined by YIELD_RESOURCE nodes. +### cycleStartTime +The time at which we started a new resource production cycle. +### progress +Current progress of the production cycle +### timeRemainingDisplay +Display field to show time remaining on the production cycle. +### lastAttempt +Results of the last production cycle attempt. +### criticalSuccessMultiplier +If the yield check is a critical success, multiply the units produced by this number. Default is 1.0. +### failureMultiplier +If the yield check is a failure, multiply the units produced by this number. Default is 1.0. +### explodeUponCriticalFail +Flag to indicate whether or not the part explodes if the yield roll critically fails. +### elapsedTime +The amount of time that has passed since the converter was last checked if it should produce yield resources. +### secondsPerCycle +The number of seconds per yield cycle. +### yieldsList +The list of resources to produce after the elapsedTime matches the secondsPerCycle. +### rosterInputList +Similar to an input list, this list contains the roster resources to consume during the converter's processing. +### rosterOutputList +Similar to an output list, this list contains the roster resources to produce during the converter's processing. +### missingResources +The converter is missing resources. If set to true then the converter's operations are suspended. +### crewEfficiencyBonus +The efficieny bonus of the crew. +## Methods + + +### PerformAnalysis +Performs the analysis roll to determine how many yield resources to produce. The roll must meet or exceed the minimumSuccess required in order to produce a nominal yield (the amount specified in a YIELD_RESOURCE's Ratio entry). If the roll fails, then a lower than normal yield is produced. If the roll exceeds the criticalSuccess number, then a higher than normal yield is produced. If the roll falls below the criticalFailure number, then no yield is produced, and the part will explode if the explodeUponCriticalFailure flag is set. + +### CalculateProgress +Calculates and updates the progress of the yield production cycle. + +### RemoveConditionIfNeeded +Removes the summaryCondition from all kerbals in the part if they have it set. + +# SnacksResourceProcessor + +The SnacksResourceProcessor is a specialized version of the BaseResourceProcessor. It has the distict advantage of making use of the game settings for Snacks, whereas BaseResourceProcessor is entirely configured via config files. + + +# SnacksPartResource + +When a part with crew capacity is loaded in the editor and it lacks this resource, or when a vessel is loaded into the scene and its parts with crew capacity lack this resource, add it to the part. Doesn’t apply to kerbals going on EVA. Use SNACKS_EVA_RESOURCE for that. Use the SNACKS_PART_RESOURCE to define resources to add. + +## Fields + +### resourceName +Name of the resource +### amount +Amount to add +### maxAmount +Max amount possible +### capacityAffectingModules +Parts with at least one of the modules on this list affect the part's capacity to store the resource (their equipment takes up additional space, for instance). +### capacityMultiplier +If a part has at least one part module on the capacityAffectingModules list then multiply resource amount and max amount by this multiplier. Default is 1.0 +### isPerKerbal +If true (which is the default), then amount and maxAmount added are multiplied by the part's crew capacity. +## Methods + + +### LoadPartResources +Loads the SNACKS_PART_RESOURCE config nodes, if any, and returns SnacksPartResource objects. +> #### Return value +> A list of SnacksPartResource objects. + +### addResourcesIfNeeded(Part) +If the part with crew capacity doesn't have the resource, then add it. +> #### Parameters +> **part:** + + +### addResourcesIfNeeded(Vessel) +If the loaded vessel's parts with crew capacity don't have the resource, then load it. +> #### Parameters +> **vessel:** + + +# SnacksEVAResource + +When a kerbal goes on EVA, take this resource along and remove a corresponding amount from the vessel. Use the SNACKS_EVA_RESOURCE to define the resource to add. + +## Fields + +### resourceName +Name of the resource +### amount +Amount to add +### maxAmount +Max amount possible +### snacksEVAResource +The EVA resource that defines how many Snacks the kerbal gets. We track this so that we can update its amount and max amount based on game settings. +## Methods + + +### LoadEVAResources +Loads the SNACKS_EVA_RESOURCE config nodes, if any, and returns SnacksEVAResource objects. +> #### Return value +> A list of SnacksEVAResource objects. + +### onCrewBoardedVessel(Part,Part) +Handles the crew boarded event. The resource is removed from the kerbal and added to the vessel. +> #### Parameters +> **evaKerbal:** The kerbal that is returning from EVA + +> **boardedPart:** The part that the kerbal boarded + + +### onCrewEVA(Part,Part) +Handles the crew eva event. The kerbal gains the EVA resource and the vessel loses a corresponding amount. +> #### Parameters +> **evaKerbal:** The kerbal that went on EVA + +> **partExited:** The part that the kerbal exited + + +### addResourcesIfNeeded(Vessel) +If the loaded vessel's parts with crew capacity don't have the resource +> #### Parameters +> **vessel:** + + +# Snackshot + +Represents a snapshot of the current and max units of a particular resource that is displayed in the Snapshots window. + +## Fields + +### resourceName +Name of the resource +### amount +Current amount in the vessel +### maxAmount +Max amount in the vessel +### showTimeRemaining +Flag to indicate whether to include the time remaining estimate in the display. +### isSimulatorRunning +Flag to indicate whether or not simulator is running. +### estimatedTimeRemaining +Estimated time remaining in seconds. + +# SnackSimThread + +This class represents a single simulator job. It will check its job list for jobs to process and synchronize with other simulator jobs. + +## Fields + +### +Max number of threads allowed +### +List of simulator jobs waiting to be run +## Methods + + +### Start +Starts the thread. + +### Stop +Stops all current and pending jobs and kills the thread. + +### AddJob(Snacks.SimSnacks) +Adds a simulator job to the job list. +> #### Parameters +> **simSnacks:** The simulator to add to the jobs list. + + +### ClearJobs +Clears all pending and running jobs. + +### +Handles the completion of a thread's simulation. +> #### Parameters +> **simulator:** The simulator that just finished. + + +### +Handles completion of a thread's simulation cycle. +> #### Parameters +> **simulator:** The simulator that just completed its cycle. + + +### +Handles the exception generated by a simulator. +> #### Parameters +> **simulator:** The simulator that generated the exception. + +> **ex:** The Exception generated. + + +### +Locks the vessel resource durations so that we can query them. Be sure to call UnlockResourceDurations when done. + +### +Unlocks resource durations so that threads can operate on them. + +### +Returns the vessel resource definitions for the requested vessel. Be sure to call LockResourceDurations before calling this method. Be sure to call UnlockResourceDurations after you're done. +> #### Parameters +> **vessel:** The vessel to query + +> #### Return value +> The resource durations for the specified vessel, or null if they don't exist. + +### +Determines whether or not the simulator had to assume that converters were on. +> #### Parameters +> **vessel:** The vessel to query + +> #### Return value +> true if the simulator couldn't determine activation state and had to assume converters were on; false if not. + +### +Removes the vessel resource durations for the specified vessel if they exist. Be sure to call LockResourceDurations before calling this method. Be sure to call UnlockResourceDurations after you're done. +> #### Parameters +> **vessel:** The vessel that will no longer have resource durations. + + +### +Adds a simulator to the job list. +> #### Parameters +> **simulator:** The SimSnacks simulator to add to the list. + + +### +Stops all current and pending jobs. + +# SimResource + +This struct tracks vessel resources in the simulator. For the sake of simplicity, simulated resources aren't locked and are considered flow mode ALL_VESSEL. + + +# SimConverter + +This class is a simulated ModuleResourceConverter. It processes inputs, produces outputs, and when the time's up, generates yield resources. For the sake of simplicity, all vessel resources are available. + +## Methods + + +### ProcessResources(System.Collections.Generic.Dictionary{System.String,Snacks.SimResource},System.Double) +Processes resources, consuming inputs, producing outputs, and when time expires, producing yield resources. For the purposes of simulation, we assume dumpExcess = true, yield resources always suceed, no heat generation, and no crew bonuses. +> #### Parameters +> **resources:** The map of vessel resources to process. + +> **secondsPerSimulatorCycle:** The number of seconds per simulator cycle. + + +# OnConvertersRunCompleteDelegate + +Signifies that the converters have completed their run. + +> **simulator:** The simulator that invoked the delegate method. + + + +# OnConsumersRunCompleteDelegate + +Signifies that the consumers have completed their run. + +> **simulator:** The simulator that invoked the delegate method. + + + +# OnSimulatorCycleCompleteDelegate + +Signifies that the simulation cycle has completed. + +> **simulator:** The simulator that invoked the delegate method. + + + +# OnSimulationCompleteDelegate + +Signifies that the simulation has completed. + +> **simulator:** The simulator that invoked the delegate method. + + + +# OnSimulatorExceptionDelegate + +Signifies that the simulation experienced an error. + +> **simulator:** The simulator generating the error. + + +> **ex:** The Exception that was generated. + + + +# SimulatedVesselTypes + +Type of vessel being simulated + + +# SimulatorContext + +Context for how the simulator is being created. Typically used when Snacks fires an event to give mods a chance to add additional custom converters not covered by Snacks. + +## Fields + +### simulatedVesselType +Type of vessel being simulated. +### vessel +Vessel object for loaded/unloaded vessels being simulated. +### shipConstruct +Ship constructor for editor vessel being simulated. + +# SimSnacks + +This class determines how long consumed resources like Snacks will last by simulating resource consumption and simulating running converters like soil recyclers and snacks processors. It is designed to allow for an arbitrary number of resource production chains and an arbitrary number of consumed resources. Conditions: The only inputs allowed into the system are those consumed by kerbals. Ex: kerbals eat Snacks and produce Soil. Resources aboard the vessel that aren't directly involved in resource consumption are fixed. Ex: Resource harvesters that produce Ore aren't accounted for. Running simulations is computationally expensive. This class should be run in a thread. + +## Methods + + +### CreateSimulator(ShipConstruct) +Creates a simulator from the supplied ship construct +> #### Parameters +> **ship:** A ShipConstruct to simulate + +> #### Return value +> A SimSnacks simulator + +### CreateSimulator(ProtoVessel) +Creates a simulator from the proto vessel +> #### Parameters +> **protoVessel:** The unloaded vessel to query for resources and converters. + +> #### Return value +> A SimSnacks simulator. + +### CreateSimulator(Vessel) +Creates a simulator from a loaded vessel +> #### Parameters +> **vessel:** The Vessel object to query for resources and converters. + +> #### Return value +> A SimSnacks simulator. + +# SnackSimThreadPool + +This class handles simulator thread creation, data synching, and the job list.s + +## Fields + +### maxThreads +Max number of threads allowed +### jobList +List of simulator jobs waiting to be run +## Methods + + +### OnThreadSimulationComplete(Snacks.SimSnacks) +Handles the completion of a thread's simulation. +> #### Parameters +> **simulator:** The simulator that just finished. + + +### OnThreadSimulatorCycleComplete(Snacks.SimSnacks) +Handles completion of a thread's simulation cycle. +> #### Parameters +> **simulator:** The simulator that just completed its cycle. + + +### OnSimulatorException(Snacks.SimSnacks,System.Exception) +Handles the exception generated by a simulator. +> #### Parameters +> **simulator:** The simulator that generated the exception. + +> **ex:** The Exception generated. + + +### LockResourceDurations +Locks the vessel resource durations so that we can query them. Be sure to call UnlockResourceDurations when done. + +### UnlockResourceDurations +Unlocks resource durations so that threads can operate on them. + +### GetVesselResourceDurations(Vessel) +Returns the vessel resource definitions for the requested vessel. Be sure to call LockResourceDurations before calling this method. Be sure to call UnlockResourceDurations after you're done. +> #### Parameters +> **vessel:** The vessel to query + +> #### Return value +> The resource durations for the specified vessel, or null if they don't exist. + +### ConvertersAssumedActive(Vessel) +Determines whether or not the simulator had to assume that converters were on. +> #### Parameters +> **vessel:** The vessel to query + +> #### Return value +> true if the simulator couldn't determine activation state and had to assume converters were on; false if not. + +### RemoveVesselResourceDurations(Vessel) +Removes the vessel resource durations for the specified vessel if they exist. Be sure to call LockResourceDurations before calling this method. Be sure to call UnlockResourceDurations after you're done. +> #### Parameters +> **vessel:** The vessel that will no longer have resource durations. + + +### AddSimulatorJob(Snacks.SimSnacks) +Adds a simulator to the job list. +> #### Parameters +> **simulator:** The SimSnacks simulator to add to the list. + + +### StopAllJobs +Stops all current and pending jobs. + +# SoilRecycler + +The SoilRecycler is designed to recycle Soil into Snacks. It is derived from SnacksProcessor (), which is derived from SnacksConverter. SoilRecycler config nodes should be calibrated to turn 1 Soil into 1 Snacks; game settings will adjust the recycler based on desired difficulty. + +## Fields + +### RecyclerCapacity +The number of kerbals that the recycler supports. + +# BaseOutcome + +The BaseOutcome class is the basis for all outcome processing. An outcome is used with the resource processors as well as by the event system. It represents the consequences (or benefits) of a process result as well as the actions to take when an event's preconditions are met. + +## Fields + +### canBeRandom +Flag to indicate whether or not the outcome can be randomly selected. Requires random outcomes to be turned on. If it isn't then the outcome is always applied. +### selectRandomCrew +Flag to indicate whether or not to select a random crew member for the outcome instead of applying the outcome to the entire crew. +### playerMessage +Optional message to display to the player. +### childOutcomes +Optional list of child outcomes to apply when the parent outcome is applied. Child outcomes use same vessel/kerbal as the parent. +## Methods + + +### Constructor +Initializes a new instance of the class. + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **canBeRandom:** If set to true, the outcome can be randomly selected. + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **canBeRandom:** If set to true, the outcome can be randomly selected. + +> **playerMessage:** A string containing a message to the player that is shown when the outcome is applied.. + + +### Load(ConfigNode) +Loads the configuration +> #### Parameters +> **node:** A ConfigNode containing data to load. + + +### IsEnabled +Indicates whether or not the outcome is enabled. +> #### Return value +> true if inabled, false if not. + +### ApplyOutcome(Vessel,Snacks.SnacksProcessorResult) +Applies the outcome to the vessel's crew +> #### Parameters +> **vessel:** The Vessel being processed. + +> **result:** The Result of the processing attempt. + + +### RemoveOutcome(Vessel) +Removes the outcome from the vessel's crew. +> #### Parameters +> **vessel:** The Vessel to process. diff --git a/Snacks/bin/Release/Assembly-CSharp-firstpass.dll b/Snacks/bin/Release/Assembly-CSharp-firstpass.dll new file mode 100644 index 0000000..cbf268b Binary files /dev/null and b/Snacks/bin/Release/Assembly-CSharp-firstpass.dll differ diff --git a/Snacks/bin/Release/Assembly-CSharp.dll b/Snacks/bin/Release/Assembly-CSharp.dll new file mode 100644 index 0000000..5b37b18 Binary files /dev/null and b/Snacks/bin/Release/Assembly-CSharp.dll differ diff --git a/Snacks/bin/Release/Ionic.Zip.dll b/Snacks/bin/Release/Ionic.Zip.dll new file mode 100644 index 0000000..95fa928 Binary files /dev/null and b/Snacks/bin/Release/Ionic.Zip.dll differ diff --git a/Snacks/bin/Release/KSPAssets.XmlSerializers.dll b/Snacks/bin/Release/KSPAssets.XmlSerializers.dll new file mode 100644 index 0000000..f28444d Binary files /dev/null and b/Snacks/bin/Release/KSPAssets.XmlSerializers.dll differ diff --git a/Snacks/bin/Release/KSPAssets.dll b/Snacks/bin/Release/KSPAssets.dll new file mode 100644 index 0000000..38501d9 Binary files /dev/null and b/Snacks/bin/Release/KSPAssets.dll differ diff --git a/Snacks/bin/Release/KSPTrackIR.dll b/Snacks/bin/Release/KSPTrackIR.dll new file mode 100644 index 0000000..1f876b2 Binary files /dev/null and b/Snacks/bin/Release/KSPTrackIR.dll differ diff --git a/Snacks/bin/Release/MarkdownSeparator.exe b/Snacks/bin/Release/MarkdownSeparator.exe new file mode 100644 index 0000000..5cfe397 Binary files /dev/null and b/Snacks/bin/Release/MarkdownSeparator.exe differ diff --git a/Snacks/bin/Release/Mono.Cecil.dll b/Snacks/bin/Release/Mono.Cecil.dll new file mode 100644 index 0000000..f55f7a5 Binary files /dev/null and b/Snacks/bin/Release/Mono.Cecil.dll differ diff --git a/Snacks/bin/Release/RunMDSeparator.bat b/Snacks/bin/Release/RunMDSeparator.bat new file mode 100644 index 0000000..aeda80a --- /dev/null +++ b/Snacks/bin/Release/RunMDSeparator.bat @@ -0,0 +1 @@ +MarkdownSeparator API.md Wiki \ No newline at end of file diff --git a/Snacks/bin/Release/RunPowershell.bat b/Snacks/bin/Release/RunPowershell.bat new file mode 100644 index 0000000..156d8ec --- /dev/null +++ b/Snacks/bin/Release/RunPowershell.bat @@ -0,0 +1 @@ +Powershell.exe -ExecutionPolicy Unrestricted -file "xmldoc2md.ps1" -xml "xmldoc2md.xml" -xsl "xmldoc2md.xsl" -output "API.md" \ No newline at end of file diff --git a/Snacks/bin/Release/SnacksUtils.dll b/Snacks/bin/Release/SnacksUtils.dll new file mode 100644 index 0000000..6a5aa22 Binary files /dev/null and b/Snacks/bin/Release/SnacksUtils.dll differ diff --git a/Snacks/bin/Release/SnacksUtils.pdb b/Snacks/bin/Release/SnacksUtils.pdb new file mode 100644 index 0000000..80e0fe8 Binary files /dev/null and b/Snacks/bin/Release/SnacksUtils.pdb differ diff --git a/Snacks/bin/Release/SnacksUtils.xml b/Snacks/bin/Release/SnacksUtils.xml new file mode 100644 index 0000000..c2b480b --- /dev/null +++ b/Snacks/bin/Release/SnacksUtils.xml @@ -0,0 +1,2992 @@ + + + + SnacksUtils + + + + + This precondition checks to see if a kerbal or vessel is in an environemnt with breathable air, and matches it with the expected parameter. + The vessel's celestial body must have an atmosphere with oxygen, and the vessel altitude must be between sea level and half the atmosphere height. + Example definition: + PRECONDITION + { + name = CheckBreathableAir + mustExist = false + } + + + + + Flag to indicate pressence (true) or absence (false) of the value to check. + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. parameters from the + class also apply. + + + + This precondition checks to see if a kerbal's experience level matches the desired value and type of check to make. For instance you could check to see if a kerbal is above 3 stars. + Example definition: + PRECONDITION + { + name = CheckSkillLevel + valueToCheck = 3 + checkType = checkGreaterOrEqual //Default value + } + + + + + The value to check for + + + + + Type of check to make + Default: checkGreaterOrEqual + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. parameters from the + class also apply. + + + + This precondition checks to see if a kerbal's skill matches the desired parameter. For instance, you could check to see if a kerbal has the ScienceSkill. + Example definition: + PRECONDITION + { + name = CheckSkill + skillToCheck = ScienceSkill + mustExist = true + } + + + + + Name of the skill to check + + + + + Flag to indicate pressence (true) or absence (false) of the value to check. + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. parameters from the + class also apply. + + + + This precondition checks to see if a kerbal's trait matches the desired parameter. For instance, you could check to see if a kerbal is an Engineer. + Example definition: + PRECONDITION + { + name = CheckTrait + traitToCheck = Engineer + mustExist = true + } + + + + + Name of the trait to check + + + + + Flag to indicate pressence (true) or absence (false) of the value to check. + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. parameters from the + class also apply. + + + + This precondition checks to see if a kerbal's courage matches the desired value and type of check to make. + Example definition: + PRECONDITION + { + name = CheckCourage + valueToCheck = 0.5 + checkType = checkEquals //Default value + } + + + + + The value to check for + + + + + Type of check to make + Default: checkEquals + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. parameters from the + class also apply. + + + + This precondition checks to see if a kerbal's stupidity matches the desired value and type of check to make. + Example definition: + PRECONDITION + { + name = CheckStupidity + valueToCheck = 0.5 + checkType = checkEquals //Default value + } + + + + + The value to check for + + + + + Type of check to make + Default: checkEquals + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. parameters from the + class also apply. + + + + + Flag to indicate pressence (true) or absence (false) of the value to check. + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. parameters from the + class also apply. + + + + This precondition checks to see if a vessel's crew count matches the desired parameter. + Example definition: + PRECONDITION + { + name = CheckCrewCount + valueToCheck = 1 + checkType = checkEquals //Default value + } + + + + + The value to check for + + + + + Type of check to make + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. parameters from the + class also apply. + + + + This precondition checks to see if a kerbal's badass status against the badassExists flag. Both must match in order for the precondition to be validated. + Example definition: + PRECONDITION + { + name = CheckBadass + mustExist = true + } + + + + + Flag to indicate pressence (true) or absence (false) of the value to check. + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. parameters from the + class also apply. + + + + This precondition checks the vessel status against the supplied parameters. + Example definition: + PRECONDITION + { + name = CheckVesselStatus + situation = LANDED + situation = SPLASHED + } + + + + + List of situations to check the vessel against. In the config file, separate each situation to check on + a separate line. + Ex: + situation = LANDED + situation = SPLASHED + Valid situations: LANDED, SPLASHED, ESCAPING, FLYING, ORBITING, SUB_ORBITAL, PRELAUNCH + + + + + Optional name of the planetary body where the vessel must be located. + + + + + Optional altitude in meters that the vessel must be at. + + + + + The type of check to make against metersAltitude. + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. parameters from the + class also apply. + + + + This precondition checks to see if a vessel or roster resource meets the supplied parameters. Gravity checks can be negated by setting CheckGravityLevel.checkType, where checkType is one + of the conditional qualifiers. For instance, CheckGravityLevel.checkLesserOrEqual will disqualify any microgravity event checks and is useful for centrifuges. + Example definition: + PRECONDITION + { + name = CheckGravityLevel + valueToCheck = 0.1 + checkType = checkLesserOrEqual //Default value + } + + + + + The value to check for + + + + + The conditional type to use during the validation. + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. parameters from the + class also apply. + + + + This enum represents the key-value conditionals to check. + + + + + Key-value must be equal to the supplied value. + + + + + Key-value must not be equal to the supplied value. + + + + + Key-value must be greater than the supplied value. + + + + + Key-value must be less than the supplied value. + + + + + Key-value must be greater than or equal to the supplied value. + + + + + Key-value must be less than or equal to the supplied value. + + + + + This precondition Checks a kerbal's key-value and validates it against the supplied parameters. + Example definition: + PRECONDITION + { + name = CheckKeyValue + keyValueName = State + checkType = checkEquals + stringValue = Bored + } + + + + + Name of the key-value + + + + + String value of the key. Takes precedence over the int values. + + + + + Integer value of the key + + + + + Type of check to make + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. parameters from the + class also apply. + + + + This precondition Checks a kerbal's condition summary to see if it exists or not. The precondition is valid if the kerbal's condition summary matches the parameters of the precondition. + Example definition: + PRECONDITION + { + name = CheckCondition + conditionSummary = Sleepy + mustExist = true + } + + + + + Name of the condition to check + + + + + Flag to indicate pressence (true) or absence (false) of the value to check. + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. parameters from the + class also apply. + + + + This precondition rolls a random die between a minimum and maximum value and compares it to a target number. If the roll meets or exceeds the target number then the precondition passes. + Example definition: + PRECONDITION + { + name = CheckRandomChance + dieRollMin = 1 + dieRollMax = 1000 + targetNumber = 999 + } + + + + + Minimum value on the die roll + + + + + Maximum value on the die roll + + + + + Target number required to declare the precondition valid. + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. parameters from the + class also apply. + + + + Enumerator with the type of results to check. + + + + + Check for a successful consumption + + + + + Check for a consumption failure + + + + + Check for a production success + + + + + Check for a production failure + + + + + This precondition checks the specified processor for desired results. + Example definition: + PRECONDITION + { + name = CheckProcessorResult + type = resultConsumptionFailure + processorName = Snacks! + resourceName = Snacks + cyclesRequired = 1 + } + + + + + The type of result to check + + + + + The name of the processor to check + + + + + The name of the resource to check + + + + + The number of process cycles to check + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. parameters from the + class also apply. + + + + This outcome removes the desired key-value from the affected kerbals + Example definition: + OUTCOME + { + name = ClearKeyValues + conditionSummary = Sick + } + + + + + Name of the key-value + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. Parameters in the + class also apply. + + + + This outcome removes the desired condition on the affected kerbals + Example definition: + OUTCOME + { + name = ClearCondition + conditionSummary = Sick + } + + + + + Name of the condition to set + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. Parameters in the + class also apply. + + + + This outcome consumes the specified resource in the desired amount. It can be a vessel resource or a roster resource. + Example definition: + OUTCOME + { + name = ConsumeResource + resourceName = Stress + amount = 1 + } + + + + + Name of the resource to produce + + + + + Optional minimum value of random amount to produce. + + + + + Optional maximum value of random amount to produce. + + + + + Amount of resource to consume. Takes presedence over randomMin and randomMax + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. Parameters in the + class also apply. + + + + A precondition is a check of some type that prevents outcomes from being applied unless the precondition's check suceeds. + + + + + Name of the precondition. + + + + + Initializes a new instance of the class. + + A ConfigNode specifying the initialization parameters. + + + + Determines if the precondition is valid. + + The ProtoCrewModule to check. + The Vessel to check + + + + + Determines if the precondition is valid. + + The ProtoCrewModule to check. + + + + + This outcome sets a condition on the affected kerbals. If that condition is defined in a + SKILL_LOSS_CONDITION config node, then the kerbals' skills will be removed until the + condition is cleared. + Example definition: + OUTCOME + { + name = ClearCondition + conditionSummary = Stressed Out + } + + + + + The name of the condition to set. If defined in a SKILL_LOSS_CONDITION node then the affected kerbals + will lose their skills until the condition is cleared. + + + + + Initializes a new instance of the class. + + The name of the condition to set. It must be added to a SKILL_LOSS_CONDITION + config node in order for the kerbal to lose its skills. + If set to true it can be randomly selected from the outcomes list. + A string containing the bad news. + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. Parameters in the + class also apply. + + + + This outcome produces the specified resource in the desired amount. It can be a vessel resource or a roster resource. + Example definition: + OUTCOME + { + name = ProduceResource + resourceName = Stress + amount = 1 + } + + + + + Name of the resource to produce + + + + + Optional minimum value of random amount to produce. + + + + + Optional maximum value of random amount to produce. + + + + + Amount of resource to produce. Takes presedence over randomMin and randomMax + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. Parameters in the + class also apply. + + + + Initializes a new instance of the class. + + The name of the resource to produce. It can be a roster resource. + The amount of resource to produce + If set to true it can be randomly selected from the outcomes list. + A message for the player. + + + + This precondition checks to see if a vessel or roster resource meets the supplied parameters. + Example definition: + PRECONDITION + { + name = CheckResource + resourceName = Stress + checkType = checkEquals + valueToCheck = 3.0 + } + + + + + Name of the resource to check + + + + + The conditional type to use during the validation. + + + + + The value to check for + + + + + Flag to indicate whether or not to check the resource's max amount instead of the curren amount; + + + + + Flag to indicate whether or not to check the resource levels as a percentage. + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. parameters from the + class also apply. + + + + This class represents resources consumed or produced by a SnacksResourceProcessor. Consumption and production is applied vessel-wide, or to individual kerbal roster entries depending on the configuration. + If applied vessel-wide, the resource can be produced or consumed per kerbal. Finally, the resource can be displayed in the Snapshots view. + + + + + Name of the consumed/produced resource + + + + + Name of the dependency resource if the resource to process depends upon the results of another resource's process result. E.G. 1 unit of Soil is produced for 1 unt of Snacks consumed. + + + + + Flag to indicate whether or not the resource is applied to roster entries instead of parts and vessels. if set to true, then appliedPerCrew is ignored. + Default: false + + + + + Flag to indicate whether or not to show the resource in the Snapshots window. Ignored if isRosterResource is set to true. + Default: true + + + + + Flag to indicate whether or not a failure result applies the processor's outcomes. + Default: true + + + + + The amount of resource to consume or produce. If appliedPerCrew is true, then the amount consumed/produced is multiplied by the number of crew aboard the vessel. + If isRosterResource is true, then each individual crew member's roster entry will be affected instead. + Default: 0 + + + + + Flag to indicate that astronaut data should be cleared when a vessel is recovered. + Default: true + + + + + Loads the fields from the config node. + + A ConfigNode containing fields to load. + + + + Saves current values to a ConfigNode. + + A ConfigNode containing the field data. + + + + Consumes the resource. + + The vessel to work on + Elapsed seconds + Current crew count + Current crew capacity + A SnacksConsumerResult containing the resuls of the consumption. + + + + Produces the resource + + The vessel to work on + Elapsed seconds + Current crew count + Current crew capacity + Results of resource consumption. + A SnacksConsumerResult containing the resuls of the production. + + + + This is a result that has data regarding what happened during resource consumption or production. + + + + + Name of the resource that was processed. + + + + + Type of result + + + + + Flag to indicate whether or not the process completed successfully. + + + + + Flag indicating if the process was applied per crew member. + + + + + Number of kerbals affected by the process. + + + + + Current amount of the resource in the vessel/kerbal. + + + + + Max amount of the resource in the vessel/kerbal. + + + + + Current number of crew aboard the vessel + + + + + Total crew capacity. + + + + + List of individual astronauts affected by the result. + + + + + This is the base class for a resource processor. Similar to ModuleResourceConverter, the consumer will consume resources and produce resources, but it happens at the vessel level, not the part level. + It's also designed to work with both loaded and unloaded vessels. Another important difference is that consumed/produced resources can occur on a per crewmember basis; a vessel with 5 crew will + consume and/or produce 5 times the resources as a vessel with 1 crewmember. The configuration of a BaseResourceProcessor is done through config files. + + + + + Name of the resource processor + + + + + Number of seconds that must pass before running the consumer. + + + + + Handles the situation where the kerbal went on EVA. + + The kerbal that went on EVA. + The part that the kerbal left. + + + + Handles the situation where a kerbal boards a vessel. + + The kerbal boarding a vessel. + The part boarded. + + + + Handles adding of a new kerbal, giving the consumer a chance to add custom roster data. + + The kerbal being added. + + + + Handles removal of a kerbal, giving the consumer a chance to update custom data if needed. + + The kerbal being removed. + + + + Handles a kerbal's name change. + + The kerbal whose name has changed. Note that roster data is already being carried over, this event is used to give consumers a chance to update custom data kept outside of the roster. + The kerbal's previous name. + The kerbal's new name. + + + + Handles vessel loaded event, for instance, adding resources that should be on the vessel. + + The vessel that was loaded. + + + + Handles vessel dock/undock event. + + The vessel that was loaded. + + + + Handles the vessel recovery event + + The ProtoVessel being recovered + + + + Handles the situation where the vessel goes off rails. + + The Vessel going off rails + + + + Handles changes to game settings. + + + + + Retrieves the editor estimates for roster resources, if any. + + An int containing the current crew count. + An int containing the vessel's crew capacity. + A StringBuilder that will hold the results. + A ShipConstruct that is the current ship design in the editor. + + + + Loads the SNACKS_RESOURCE_PROCESSOR config nodes and returns a list of processors. + + A list of resource processors. + + + + Initializes the consumer + + + + + Cleanup as processor is about to be destroyed + + + + + De-serializes persistence data + + The ConfigNode with the persistence data + + + + Saves persistence data to a ConfigNode and returns it. + + A ConfigNode containing persistence data, if any. + + + + Used primarily for simulations, returns the consumed and produced resources for the given unit of time. + + The vessel to query for data. + The number of seconds to calculate total inputs and outputs. + The list of consumed resources to add the inputs to. + The list of produced resources to add the outputs to. + + + + Used primarily for simulations, returns the consumed and produced resources for the given unit of time. + + The number of crew to simulate. + The number of seconds to calculate total inputs and outputs. + The list of consumed resources to add the inputs to. + The list of produced resources to add the outputs to. + + + + Returns the amount and max amount of the desired resource in the unloaded vessel. + + The vessel to query for the resource totals. + The name of the resource to query. + The amount of the resource that the entire vessel has. + The max amount of the resource that the entire vessel has. + + + + Runs the processor, consuming input resources, producing output resources, and collating results. + + The vessel to run the consumer on. + Number of seconds that have passed. + Number of crew aboard the vessel. + The vessel's total crew capacity. + + + + This class contains data related to a kerbal. Information includes + roster resources (characteristics of the kerbal akin to Courage and Stupidity), + a condition summary specifying what states the kerbal is in, + a list of disqualified conditions that will auto-fail precondition checks, + a list of processor successes and failures, + a key-value map suitable for tracking states in the event system, + an exempt flag that exempts the kerbal from all outcomes. + + + + + Name of the kerbal. + + + + + The kerba's current experience trait. + + + + + Timestamp of when the astronaut data was last update. + + + + + Flag to indicate that the kerbal is exempt from outcomes. + + + + + Summary of all the conditions that the kerbal currently has. If a + condition in the summary is defined in a SKILL_LOSS_CONDITION config node, + then the kerbal will lose its skills until the condition is cleared. + + + + + A map of key-value pairs. + + + + + Map of successful process cycles. The key is the name of the processor, + the value is the number of successes. + + + + + Map of unsuccessfull process cycles. The key is the name of the processor, + the value is the number of failures. + + + + + A map of roster resources (characteristics of the kerbal), similar to + vessel resources. + + + + + Conditions that will automatically disqualify a precondition check. + + + + + List of resources that the kerbal uses. + + + + + Initializes a new instance of the class. + + + + + Loads the astronaut data from the config node supplied. + + A map keyed kerbal name that contains astronaut data. + The ConfigNode to read data from. + + + + Saves persistent astronaut data to the supplied config node. + + A map of astronaut data, keyed by kerbal name. + The ConfigNode to save the data to. + + + + Sets a disqualifier that will automatically fail a precondition check. + + The name of the disqualifier to set. + + + + Clears a disqualifier that will no longer fail a precondition check. + + The name of the disqualifier to clear. + + + + Sets a condition that could result in loss of skills if defined in a SKILL_LOSS_CONDITION config node. + The condition will appear in the kerbal's condition summary in the status window. + + The name of the condition to set. + + + + Clears a condition, removing it from the condition summary display. If the condition is defined in + a SKILL_LOSS_CONDITION config node, and the kerbal has no other conditions that result from skill loss, + then the kerbal will regain its skills. + + The name of the condition to clear. + + + + Sets the key/value pair. + + The key to use. + The value of the key. + + + + Returns the value for the desired key. + + A string containing the desired key. + A string with the value, or null if it doesn't exist. + + + + Returns the value for the desired key. + + A string containing the desired key. + A double with the value, or NaN if it doesn't exist. + + + + Removes the key/value pair. + + A string containing the key/value key to remove. + + + + Sets the resource to the desired amount and max amount. + + A string containing the name of the resource. + A double containing the resource amount. + A double containing the resource max amount. + + + + Retrieves the resource's amount and max amount if they exist. + + A string containing the name of the resource. + A double containing the amount of resource. + A double containing the max amount of the resource. + true if the resource was successfully retrieved, false if not. + + + + Removes the desired resource from the map. + + A string containing the name of the resource to remove. + + + + Determines whether or not the resource exists. + + A string containing the name of the resource. + true if the resource exists, false if not. + + + + This outcome causes affected kerbals to die. + Example definition: + OUTCOME + { + name = DeathPenalty + resourceName = Snacks + cyclesBeforeDeath = 10 + } + + + + + The name of the resource to check for failed processor cycles. + + + + + The number of cycles that must fail before the kerbal dies. + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. Parameters in the + class also apply. + + + + Initializes a new instance of the class. + + The name of the resource to check. If no processor has a failed cycle with the resource + then the outcome is invalidated. + The number of failed processor cycles required before applying the outcome. + A string containing the bad news for the player. + + + + This outcome causes affected kerbals to faint. + Example definition: + OUTCOME + { + name = FaintPenalty + resourceName = Snacks + cyclesBeforeFainting = 3 + faintDurationSeconds = 180 + } + + + + + The name of the resource to check for failed processor cycles. + + + + + The number of cycles that must fail before the kerbal faints. + + + + + The number of seconds that the kerbal will faint for. + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. Parameters in the + class also apply. + + + + Initializes a new instance of the class. + + The name of the resource to check. If none of the resource processors have failed cycles + containing the resource then the outcome is invalidated. + The number of failed cycles required before applying the outcome.. + Faint duration seconds. + A string containing the bad news for the player. + + + + This outcome fines the space agency by a certain amount per affected kerbal. + Example definition: + OUTCOME + { + name = FundingPenalty + finePerKerbal = 1000 + } + + + + + The amount of Funds to lose per kerbal. + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. Parameters in the + class also apply. + + + + Initializes a new instance of the class. + + If set to true the outcome can be randomly selected from the outcome list. + A string containing the bad news. + The amount of Funds lost per affected kerval. + + + + This class represents a resource that's tied to individual kerbals instead of a part. One example is Stress, an abstracted habitation mechanic. + + + + + The name of the roster resource. + + + + + Public display name of the resource. + + + + + Flag to indicate whether or not to show the resource in the Snapshots window. + Default: true + + + + + The amount of resource available. + + + + + The maximum amount of resource allowed. + + + + + + The amount of resource to add when the kerbal levels up. + + + + + The maximum amount of resource to add when the kerbal levels up. + + + + + Handles the kerbal level up event + + The ProtoCrewMember that has leveled up. + + + + Handles the crew boarded event. The resource is removed from the kerbal and added to the vessel. + + The kerbal that is returning from EVA + The part that the kerbal boarded + + + + Handles the crew eva event. The kerbal gains the EVA resource and the vessel loses a corresponding amount. + + The kerbal that went on EVA + The part that the kerbal exited + + + + Adds the roster resource to the kerbal if needed + + The ProtoCrewMember to check. + + + + Adds the roster resource to the vessel's kerbal if needed + + The Vessel whose crew to check + + + + This is a helper class to handle the unique conditions of a kerbal leveling up with the Stress resource. + + + + + The Stress processor is designed to work with the Stress roster resource. + Essentially, Stress is an abstracted habitation mechanic that takes + into account a variety of different events. The main thing that causes + Stress is being aboard a vessel; you don't want to send kerbals to Jool + in a Mk1 command pod! NASA allocates 25 m^3 of space per astronaut per + year aboard the ISS, and Stress is based off that number. The larger the + habitable volume, the greater a kerbal's maximum Stress becomes, and it's + dynamically updated whenever a kerbal changes craft. Assuming no other + events, a kerbal will accumulate 1 point of Stress per day, and when the + kerbal reaches it's maximum Stress, bad things happen. + + + + + The first N seats use the multiplier instead of the N^3 formula. + + + + + How much Space a single seat provides, assuming that the vessel's + number of seats is less than or equal to MaxSeatsForMultiplier. + + + + + Calculates how much Space a vessel has. It is a function of + crew capacity and is influenced by the number of crew currently + aboard. + + The amount of Space aboard the vessel. + The Vessel to query. + + + + Calculates how much Space a vessel has. It is a function of + crew capacity and is influenced by the number of crew currently + aboard. + + Current crew count aboard the vessel + Current crew capacity of the vessel + The amount of Space aboard the vessel. + + + + Enumerator specifying the different types of events + + + + + Event is processed after the resource process cycle completes. + + + + + The event is chosen at random once per process cycle. + + + + + The event is processed when a kerbal levels up. + + + + + Enumerator specifying which kerbals are affected by the preconditions. + + + + + A single available kerbal is chosen at random. + + + + + A single assigned kerbal is chosen at random. + + + + + All available kerbals are affected. + + + + + All assigned kerbals are affected. + + + + + A single random kerbal is chosesn amongst each crewed vessel. + + + + + This class represents an "event" in Snacks. Events consist of one or more preconditions and one or more outcomes. Preconditions are things like random numbers, the pressence of specific conditions, and the like. + All preconditions must be met before the event outcomes can be applied. The outcomes include all the Snacks penalties as well as other things such as setting conditions. + + + + + The event's category + + + + + The type of kerbals affected by the event. + + + + + Number of seconds that must pass before the event can be checked. + + + + + The number of day that must pass before the event can be checked. Overrides secondsBetweenChecks. + + + + + Player-friendly message to display when outcomes are going to be applied. + + + + + Name of the event + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + A ConfigNode specifying the initialization parameters. + + + + Applies outcomes to the supplied astronaut + + The ProtoCrewMember to apply outcomes to. + The Vessel to check + + + + Applies outcomes to the supplied astronaut + + The ProtoCrewMember to apply outcomes to. + + + + Checks all preconditions against the supplied astronaut + + The ProtoCrewMember to check + The Vessel to check + + + + + Checks all preconditions against the supplied astronaut + + The ProtoCrewMember to check + + + + + Determines if the event can be evaluated based on the supplied elapsed time. + + The number of seconds that have passed since the last inquiry. + true if it's time to evaluate the event, false if not. + + + + Processes the event based on elapsed time, event type, and kerbals affected. + + The elapsed time since the last process cycle, ignored for event cards. + + + + Loads the persistent data. + + A ConfigNode with persistent data. + + + + Saves the persistent data. + + A ConfigNode with persistent data. + + + + This outcome sets the desired condition on the affected kerbals + Example definition: + OUTCOME + { + name = SetCondition + conditionSummary = Sick + } + + + + + Name of the condition to set + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. Parameters in the + class also apply. + + + + This outcome sets the desired key-vale on the affected kerbals + Example definition: + OUTCOME + { + name = SetKeyValue + keyValueName = DaysBored + intValue = 1 + } + + + + + Name of the key-value + + + + + String value of the key. Takes precedence over the int values. + + + + + Integer value of the key + + + + + Integer value to add to the existing key value. If key doesn't exist then it will be set to this value instead. Taks precedence over intValue. + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. Parameters in the + class also apply. + + + + This part module is designed to negate one or more preconditions so long as the kerbal resides in the part. + An example would be a centrifuge + + + + + Contains the disqualified preconditions such as CheckGravityLevel.checkLesserOrEqual for low gravity checks. Separate disqualified preconditions by semicolon. + Most of the preconditions can be disqualified simply by stating their name. If a precondition requires something different, be sure to check its documentation. + + + + + Number of science penalties to apply when the vessel becomes active. + + + + + This outcome reduces the space agency's reputation based on the supplied parameters. + Example definition: + OUTCOME + { + name = RepPenalty + repLossPerKerbal = 5 + } + + + + + The rep loss per kerbal. + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. Parameters in the + class also apply. + + + + Initializes a new instance of the class. + + If set to true it can be randomly selected from the outcomes list. + Rep loss per kerbal. + A string containing the bad news. + + + + This outcome disrupts science experiments aboard a vessel. + Example definition: + OUTCOME + { + name = SciencePenalty + } + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. Parameters in the + class also apply. + + + + Initializes a new instance of the class. + + If set to true it can be randomly selected from the outcomes list. + + + + Interface for creating and running penalties when a processor resource runs out or has too much aboard the vessel or kerbal. + + + + + Indicates whether or not the penalty is enabled. + + true if inabled, false if not. + + + + Indicates whether or not the penalty is always applied instead of randomly chosen. + + true if the penalty should always be applied, false if not. + + + + Applies the penalty to the affected kerbals + + An int containing the number of kerbals affected by the penalty. + The vessel to apply the penalty to. + + + + Removes penalty effects. + + The vessel to remove the penalt effects from. + + + + Handles changes in game settings, if any. + + + + + The SnacksScenario class is the heart of Snacks. It runs all the processes. + + + + + Tells listeners that snapshots were created. + + + + + Tells listeners that a simulator was created. Gives mods a chance to add custom converters not covered by Snacks. + + + + + Tells listeners that background converters were created. Gives mods a chance to add custom converters not covered by Snacks. + + + + + Signifies that snacking has occurred. + + + + + Signifies that the roster resource has been updated + + + + + Instance of the scenario. + + + + + Flag indicating whether or not logging is enabled. + + + + + Map of sciecnce penalties sorted by vessel. + + + + + Map of astronaut data, keyed by astronaut name. + + + + + List of kerbals that are exempt from outcome effects. + + + + + Last time the processing cycle started. + + + + + Map of the background conveters list, keyed by vessel. + + + + + List of resource processors that handle life support consumption and waste production. + + + + + List of resources that will be added to parts as they are created or loaded. + + + + + List of resources that are added to kerbals when they go on EVA. + + + + + Map of snapshots, keyed by vessel, that give a status of each vessel's visible life support resources and crew status. + + + + + Helper that gives a count, by celestial body id, of how many vessels are on or around the celestial body. + + + + + Map of all roster resources to add to kerbals as they are created. + + + + + List of conditions that will cause a skill loss. These conditions are defined via SKILL_LOSS_CONDITION nodes. + + + + + List of converters to watch for when creating snapshot simulations. + + + + + How many simulated seconds pass per simulator cycle. + + + + + Maximum number of simulator cycles to run. + + + + + Max number of simulator threads to create. + + + + + Updates the resource snapshots for each vessel in the game that isn't Debris, a Flag, a SpaceObject, or Unknown. + + + + + Returns the crew capacity of the vessel + + The crew capacity. + The Vessel to query. + + + + FixedUpdate handles all the processing tasks related to life support resources and event processing. + + + + + Runs the snack cyle immediately. + + Seconds elapsed. + + + + Finds the vessel that the kerbal is residing in. + + The Vessel where the kerbal resides. + The astronaut to check. + + + + Determines whether or not the kerbal's skills should be removed. + + true, if remove skills should be removed, false otherwise. + the ProtoCrewMember to investigate. + + + + Removes the skills if needed. The supplied kerbal must have at least one condition + registered in a SKILL_LOSS_CONDITION config node in order to remove the skills. + + The kerbal to check. + + + + Restores the skills if needed. The kerbal in question must not have any conditions that would result in a loss of skill. + + The kerbal to query. + + + + Removes skills from the desired kerbal. Does not check to see if they should be removed based on condition summary. + + The ProtoCrewMember to remove skills from. + + + + Restores skills to the desired kerbal. Does not check to see if they can be restored based on condition summary. + + + + + + Adds the name of the kerbal to the exemptions list. + + The name of the kerbal to add to the list. + + + + Registers crew into the astronaut database. + + The vessel to search for crew. + + + + Unregisters the crew from the astronaut database. + + The vessel to search for crew to unregister. + + + + Unregisters the crew from the astronaut database. + + The vessel to search for crew to unregister. + + + + Registers the astronaut into the astronaut database. + + The astronaut to register. + + + + Unregisters the astronaut from the astronaut database. + + The astronaut to unregister. + + + + Unregisters the astronaut data from the astronaut database. + + The astronaut data to unregister. + + + + Returns the number of crew that aren't exempt. + + The vessel to query for crew. + The number of victims. Er, number of non-exempt crew. + + + + Returns the non-exempt crew in the vessel. + + The Vessel to query. + An array of ProtoCrewMember objects if there are non-exempt crew, or null if not. + + + + Returns the astronaut data associated with the astronaut. + + The ProtoCrewMember to check for astronaut data. + The AstronautData associated with the kerbal. + + + + Saves the astronaut data into the database. + + The AstronautData to save. + + + + Adds the stress to crew if Stress is enabled. This is primarily + used by 3rd party mods like BARIS. + + The Vessel to query for crew. + The amount of Stress to add. + + + + Formats the supplied seconds into a string. + + The number of seconds to format. + A flag to indicate whether or not to show the compact form. + + + + + Gets the number of seconds per day on the homeworld. + + The lenght of the solar day in seconds of the homeworld. + + + + Gets the solar flux based on vessel location. + + The vessel to query. + The level of solar flux at the vessel's location. + + + + Creates a new precondition based on the config node data passed in. + + The ConfigNode containing data to parse. + A BasePrecondition containing the precondition object, or null if the config node couldn't be parsed. + + + + Creates a new outcome based on the config node data passed in. + + The outcome corresponding to the desired config. + The ConfigNode containing data to parse. + + + + The SnacksProcessor grinds out Snacks from Ore. It is derived from the SnacksConverter. The output of the + processor is affected by the game settings. + + + + + A status field showing the daily output of Snacks. + + + + + Helper field describing the original output ratio of Snacks. + + + + + Helper field to describe the original input ratio of Ore + + + + + Gets the daily snacks output. + + The amount of Snacks produced daily, subjected to game settings. + + + + This enum specifies the diffent types of emails to send during background processing. + + + + + The processor is missing an input resource. + + + + + The processor is missing a required resource. + + + + + The vessel is out of room. + + + + + The yield experienced a critical failure. + + + + + The yield has had a critical success. + + + + + The yield amount was lower than normal. + + + + + The yield amount was normal. + + + + + This class runs active converters in the background, consuming inputs, producing outputs, and yielding resources. + + + + + Name of the converter + + + + + Name of the converter part module. + + + + + Flag indicating that the converter is active. + + + + + Flag indicating that the converter is missing resources. + + + + + Flag indicating that the container is full. + + + + + The input efficiency. + + + + + The output efficiency. + + + + + Flag to indicate that the player has been emailed. Used so we don't spam the player's inbox. + + + + + Parses a vessel to find active converters to run in the background. + + A map keyed by Vessel that has a list of running converters to run in the background. + + + + Initializes a new instance of the class. + + The ProtPartSnapshot that hosts the converter. + The ProtoPartModuleSnapshot representing the converter. + The module index. + + + + Initializes a new instance of the class. + + + + + Checks to be sure the vessel has the required resources. + + The Vessel to check. + The seconds that have elapsed. + + + + Consumes the input resources. + + The Vessel to consume resources from. + Converter elapsed time. + + + + Produces the output resources. + + The Vessel to add resources to. + Converter elapsed time. + + + + Produces the yield resources + + The Vessel to add resources to. + + + + Prepares the converter to process. + + The Vessel to check for preparations. + + + + Handles post process tasks for the converter. + + The Vessel to update. + + + + The SnacksRosterRatio is a helper struct that is similar to a ResourceRatio, + but it's designed for use with roster resources (characteristics of a kerbal). + + + + + The name of the resource. + + + + + The amount per day. This value overwrites AmountPerSecond and is based + on the homeworld's second per day. + + + + + The amount per second. + + + + + An enhanced version of ModuleResourceConverter, the SnacksConverter offers a number of enhancements including + producing resources after a set number of hours have elapsed (defined by YIELD_RESOURCES nodes), the ability to + produce the yield resources based on the result of a random number generation, an optional flag that results in the part + exploding as a result of a critical failure roll, an optional flag that can prevent the converter from being + shut off, the ability to play effects, and the ability to be run in the background (when the vessel isn't loaded + into the scene). + + + + + Name of the effect to play when the converter starts. + + + + + Name of the effect to play when the converter stops. + + + + + Name of the effect to play while the converter is running. + + + + + This field describes how much ElectricCharge is consumed per second. A negative number indicates consumption. + + + + + This is a threshold value to ensure that the converter will shut off if the vessel's + ElectricCharge falls below the specified percentage. It is ignored if the converter doesn't + use ElectricCharge. + + + + + This flag tells the converter to check for a connection to the homeworld if set to true. + If no connection is present, then the converter operations are suspended. It requires + CommNet to be enabled. + + + + + This field specifies the minimum number of crew required to operate the converter. If the part + lacks the minimum required crew, then operations are suspended. + + + + + This field specifies the condition summary to set when a kerbal enters the part and the converter is + running. For example, the kerbal could be Relaxing. The condition summary appears in the kerbal's + condition summary display. Certain conditions will result a loss of skills for the duration that the + converter is running. For that to happen, be sure to define a SKILL_LOSS_CONDITION config node with + the name of the condition. + + + + + This field indicates whether or not the converter can be shut down. If set to false, then the converter + will remove the shutdown and toggle actions and disable the shutdown button. + + + + + Flag to indicate that the converter's part must be splashed in order to function. + + + + + Flag indicating that the converter requires an oxygenated atmosphere in order to run. + + + + + Unique ID of the converter. Used to identify it during background processing. + + + + + Minimum die roll + + + + + Maximum die roll + + + + + On a roll of dieRollMin - dieRollMax, the minimum roll required to declare a successful resource yield. Set to 0 if you don't want to roll for success. + + + + + On a roll of dieRollMin - dieRollMax, minimum roll for a resource yield to be declared a critical success. + + + + + On a roll of dieRollMin - dieRollMax, the maximum roll for a resource yield to be declared a critical failure. + + + + + How many hours to wait before producing resources defined by YIELD_RESOURCE nodes. + + + + + The time at which we started a new resource production cycle. + + + + + Current progress of the production cycle + + + + + Display field to show time remaining on the production cycle. + + + + + Results of the last production cycle attempt. + + + + + If the yield check is a critical success, multiply the units produced by this number. Default is 1.0. + + + + + If the yield check is a failure, multiply the units produced by this number. Default is 1.0. + + + + + Flag to indicate whether or not the part explodes if the yield roll critically fails. + + + + + The amount of time that has passed since the converter was last checked if it should produce yield resources. + + + + + The number of seconds per yield cycle. + + + + + The list of resources to produce after the elapsedTime matches the secondsPerCycle. + + + + + Similar to an input list, this list contains the roster resources to consume during the + converter's processing. + + + + + Similar to an output list, this list contains the roster resources to produce during the converter's processing. + + + + + The converter is missing resources. If set to true then the converter's operations are suspended. + + + + + The efficieny bonus of the crew. + + + + + Performs the analysis roll to determine how many yield resources to produce. + The roll must meet or exceed the minimumSuccess required in order to produce a nominal + yield (the amount specified in a YIELD_RESOURCE's Ratio entry). If the roll fails, + then a lower than normal yield is produced. If the roll exceeds the criticalSuccess number, + then a higher than normal yield is produced. If the roll falls below the criticalFailure number, + then no yield is produced, and the part will explode if the explodeUponCriticalFailure flag is set. + + + + + Calculates and updates the progress of the yield production cycle. + + + + + Removes the summaryCondition from all kerbals in the part if they have it set. + + + + + The SnacksResourceProcessor is a specialized version of the BaseResourceProcessor. It has the distict advantage of making use of the game settings for Snacks, whereas BaseResourceProcessor + is entirely configured via config files. + + + + + When a part with crew capacity is loaded in the editor and it lacks this resource, or when a vessel is loaded into the scene and its parts with crew capacity lack this resource, + add it to the part. Doesn’t apply to kerbals going on EVA. Use SNACKS_EVA_RESOURCE for that. Use the SNACKS_PART_RESOURCE to define resources to add. + + + + + Name of the resource + + + + + Amount to add + + + + + Max amount possible + + + + + How many units per day that will be consumed. Overrides amount and maxAmount. + For Snacks, this is dynamically calculated based on game settings for Snacks per meal and meals per day. + + + + + Specifies how many days of life support to provide. + + + + + Parts with at least one of the modules on this list affect the part's capacity to store the resource (their equipment takes up additional space, for instance). + + + + + If a part has at least one part module on the capacityAffectingModules list then multiply resource amount and max amount by this multiplier. Default is 1.0 + + + + + If true (which is the default), then amount and maxAmount added are multiplied by the part's crew capacity. + + + + + Loads the SNACKS_PART_RESOURCE config nodes, if any, and returns SnacksPartResource objects. + + A list of SnacksPartResource objects. + + + + If the part with crew capacity doesn't have the resource, then add it. + + + + + + If the loaded vessel's parts with crew capacity don't have the resource, then load it. + + + + + + When a kerbal goes on EVA, take this resource along and remove a corresponding amount from the vessel. Use the SNACKS_EVA_RESOURCE to define the resource to add. + + + + + Name of the resource + + + + + Amount to add + + + + + Max amount possible + + + + + When the resource amount drops to or below this value, display the warning message. + + + + + Message to display when the kerbal's resource has dropped to or below the warningAmount. + + + + + The EVA resource that defines how many Snacks the kerbal gets. We track this so that we can update its amount and max amount based on game settings. + + + + + Loads the SNACKS_EVA_RESOURCE config nodes, if any, and returns SnacksEVAResource objects. + + A list of SnacksEVAResource objects. + + + + Handles the crew boarded event. The resource is removed from the kerbal and added to the vessel. + + The kerbal that is returning from EVA + The part that the kerbal boarded + + + + Handles the crew eva event. The kerbal gains the EVA resource and the vessel loses a corresponding amount. + + The kerbal that went on EVA + The part that the kerbal exited + + + + Represents a snapshot of the current and max units of a particular resource that is displayed in the Snapshots window. + + + + + Name of the resource + + + + + Current amount in the vessel + + + + + Max amount in the vessel + + + + + Flag to indicate whether to include the time remaining estimate in the display. + + + + + Flag to indicate whether or not simulator is running. + + + + + Estimated time remaining in seconds. + + + + + Flag to indicate whether or not the simulator was interrupted. + + + + + This class represents a single simulator job. It will check its job list for jobs to process and synchronize with other simulator jobs. + + + + + Starts the thread. + + + + + Stops all current and pending jobs and kills the thread. + + + + + Adds a simulator job to the job list. + + The simulator to add to the jobs list. + + + + Determines whether or not the simulator thread has jobs. + + true if the simulator has job, false if not. + + + + Clears all pending and running jobs. + + + + + This struct tracks vessel resources in the simulator. For the sake of simplicity, simulated resources aren't locked and are considered flow mode ALL_VESSEL. + + + + + This class is a simulated ModuleResourceConverter. It processes inputs, produces outputs, and when the time's up, generates yield resources. For the sake of simplicity, all vessel resources are available. + + + + + Processes resources, consuming inputs, producing outputs, and when time expires, producing yield resources. + For the purposes of simulation, we assume dumpExcess = true, yield resources always suceed, no heat generation, and no crew bonuses. + + The map of vessel resources to process. + The number of seconds per simulator cycle. + + + + Signifies that the converters have completed their run. + + The simulator that invoked the delegate method. + + + + Signifies that the consumers have completed their run. + + The simulator that invoked the delegate method. + + + + Signifies that the simulation cycle has completed. + + The simulator that invoked the delegate method. + + + + Signifies that the simulation has completed. + + The simulator that invoked the delegate method. + + + + Signifies that the simulation experienced an error. + + The simulator generating the error. + The Exception that was generated. + + + + Type of vessel being simulated + + + + + Context for how the simulator is being created. Typically used when Snacks fires an event to give mods a chance to add additional custom converters not covered by Snacks. + + + + + Type of vessel being simulated. + + + + + Vessel object for loaded/unloaded vessels being simulated. + + + + + Ship constructor for editor vessel being simulated. + + + + + This class determines how long consumed resources like Snacks will last by simulating resource consumption and simulating running converters like soil recyclers and snacks processors. + It is designed to allow for an arbitrary number of resource production chains and an arbitrary number of consumed resources. + + Conditions: + The only inputs allowed into the system are those consumed by kerbals. Ex: kerbals eat Snacks and produce Soil. + Resources aboard the vessel that aren't directly involved in resource consumption are fixed. Ex: Resource harvesters that produce Ore aren't accounted for. + Running simulations is computationally expensive. This class should be run in a thread. + + + + + Creates a simulator from the supplied ship construct + + A ShipConstruct to simulate + A SimSnacks simulator + + + + Creates a simulator from the proto vessel + + The unloaded vessel to query for resources and converters. + A SimSnacks simulator. + + + + Creates a simulator from a loaded vessel + + The Vessel object to query for resources and converters. + A SimSnacks simulator. + + + + This class handles simulator thread creation, data synching, and the job list.s + + + + + Max number of threads allowed + + + + + List of simulator jobs waiting to be run + + + + + Handles the completion of a thread's simulation. + + The simulator that just finished. + + + + Handles completion of a thread's simulation cycle. + + The simulator that just completed its cycle. + + + + Handles the exception generated by a simulator. + + The simulator that generated the exception. + The Exception generated. + + + + Locks the vessel resource durations so that we can query them. + Be sure to call UnlockResourceDurations when done. + + + + + Unlocks resource durations so that threads can operate on them. + + + + + Returns the vessel resource definitions for the requested vessel. + Be sure to call LockResourceDurations before calling this method. + Be sure to call UnlockResourceDurations after you're done. + + The vessel to query + The resource durations for the specified vessel, or null if they don't exist. + + + + Determines whether or not the simulator had to assume that converters were on. + + The vessel to query + true if the simulator couldn't determine activation state and had to assume converters were on; false if not. + + + + Removes the vessel resource durations for the specified vessel if they exist. + Be sure to call LockResourceDurations before calling this method. + Be sure to call UnlockResourceDurations after you're done. + + The vessel that will no longer have resource durations. + + + + Adds a simulator to the job list. + + The SimSnacks simulator to add to the list. + + + + Stops all current and pending jobs. + + + + + The SoilRecycler is designed to recycle Soil into Snacks. It is derived from SnacksProcessor (), + which is derived from SnacksConverter. SoilRecycler config nodes should be calibrated + to turn 1 Soil into 1 Snacks; game settings will adjust the recycler based on desired difficulty. + + + + + The number of kerbals that the recycler supports. + + + + + ID of the celestial body where the vessel is located. + + + + + Name of the vessel + + + + + Current number of crew in the vessel + + + + + Max number of crew in the vessel + + + + + Reference to the vessel itself + + + + + List of resource snapshots + + + + + Flag to indicate that the simulator couldn't determine if the converters were active, so it assumed that they were. + + + + + Returns the status of the vessel and its resources. + + A flag to indicate whether to show crew status instead of vessel resource status. + A string containing the vessel's status. + + + + The BaseOutcome class is the basis for all outcome processing. An outcome is used with the resource processors as well as + by the event system. It represents the consequences (or benefits) of a process result as well as the actions + to take when an event's preconditions are met. + + + + + Flag to indicate whether or not the outcome can be randomly selected. + Requires random outcomes to be turned on. If it isn't then the + outcome is always applied. + + + + + Flag to indicate whether or not to select a random crew member for the outcome + instead of applying the outcome to the entire crew. + + + + + Optional message to display to the player. + + + + + Optional list of child outcomes to apply when the parent outcome is applied. + Child outcomes use same vessel/kerbal as the parent. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. + + + + Initializes a new instance of the class. + + If set to true, the outcome can be randomly selected. + + + + Initializes a new instance of the class. + + If set to true, the outcome can be randomly selected. + A string containing a message to the player that is shown when the outcome + is applied.. + + + + Loads the configuration + + A ConfigNode containing data to load. + + + + Indicates whether or not the outcome is enabled. + + true if inabled, false if not. + + + + Applies the outcome to the vessel's crew + + The Vessel being processed. + The Result of the processing attempt. + + + + Removes the outcome from the vessel's crew. + + The Vessel to process. + A Bool indicating whether or not to inform the player. + + + diff --git a/Snacks/bin/Release/TDx.TDxInput.dll b/Snacks/bin/Release/TDx.TDxInput.dll new file mode 100644 index 0000000..b4a8b44 Binary files /dev/null and b/Snacks/bin/Release/TDx.TDxInput.dll differ diff --git a/Snacks/bin/Release/Unity.Analytics.DataPrivacy.dll b/Snacks/bin/Release/Unity.Analytics.DataPrivacy.dll new file mode 100644 index 0000000..cfe4a1a Binary files /dev/null and b/Snacks/bin/Release/Unity.Analytics.DataPrivacy.dll differ diff --git a/Snacks/bin/Release/Unity.Analytics.StandardEvents.dll b/Snacks/bin/Release/Unity.Analytics.StandardEvents.dll new file mode 100644 index 0000000..b8e7ea7 Binary files /dev/null and b/Snacks/bin/Release/Unity.Analytics.StandardEvents.dll differ diff --git a/Snacks/bin/Release/UnityEngine.AIModule.dll b/Snacks/bin/Release/UnityEngine.AIModule.dll new file mode 100644 index 0000000..b6b857d Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.AIModule.dll differ diff --git a/Snacks/bin/Release/UnityEngine.ARModule.dll b/Snacks/bin/Release/UnityEngine.ARModule.dll new file mode 100644 index 0000000..b7b2e9a Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.ARModule.dll differ diff --git a/Snacks/bin/Release/UnityEngine.AccessibilityModule.dll b/Snacks/bin/Release/UnityEngine.AccessibilityModule.dll new file mode 100644 index 0000000..a8bc368 Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.AccessibilityModule.dll differ diff --git a/Snacks/bin/Release/UnityEngine.AndroidJNIModule.dll b/Snacks/bin/Release/UnityEngine.AndroidJNIModule.dll new file mode 100644 index 0000000..a8ca102 Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.AndroidJNIModule.dll differ diff --git a/Snacks/bin/Release/UnityEngine.AnimationModule.dll b/Snacks/bin/Release/UnityEngine.AnimationModule.dll new file mode 100644 index 0000000..34d5ba1 Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.AnimationModule.dll differ diff --git a/Snacks/bin/Release/UnityEngine.AssetBundleModule.dll b/Snacks/bin/Release/UnityEngine.AssetBundleModule.dll new file mode 100644 index 0000000..40f88fa Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.AssetBundleModule.dll differ diff --git a/Snacks/bin/Release/UnityEngine.AudioModule.dll b/Snacks/bin/Release/UnityEngine.AudioModule.dll new file mode 100644 index 0000000..b4f917e Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.AudioModule.dll differ diff --git a/Snacks/bin/Release/UnityEngine.ClothModule.dll b/Snacks/bin/Release/UnityEngine.ClothModule.dll new file mode 100644 index 0000000..f892014 Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.ClothModule.dll differ diff --git a/Snacks/bin/Release/UnityEngine.ClusterInputModule.dll b/Snacks/bin/Release/UnityEngine.ClusterInputModule.dll new file mode 100644 index 0000000..3ddbea1 Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.ClusterInputModule.dll differ diff --git a/Snacks/bin/Release/UnityEngine.ClusterRendererModule.dll b/Snacks/bin/Release/UnityEngine.ClusterRendererModule.dll new file mode 100644 index 0000000..183f91a Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.ClusterRendererModule.dll differ diff --git a/Snacks/bin/Release/UnityEngine.CoreModule.dll b/Snacks/bin/Release/UnityEngine.CoreModule.dll new file mode 100644 index 0000000..57c9308 Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.CoreModule.dll differ diff --git a/Snacks/bin/Release/UnityEngine.CrashReportingModule.dll b/Snacks/bin/Release/UnityEngine.CrashReportingModule.dll new file mode 100644 index 0000000..2370bc2 Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.CrashReportingModule.dll differ diff --git a/Snacks/bin/Release/UnityEngine.DSPGraphModule.dll b/Snacks/bin/Release/UnityEngine.DSPGraphModule.dll new file mode 100644 index 0000000..a56ac00 Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.DSPGraphModule.dll differ diff --git a/Snacks/bin/Release/UnityEngine.DirectorModule.dll b/Snacks/bin/Release/UnityEngine.DirectorModule.dll new file mode 100644 index 0000000..10fe1f8 Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.DirectorModule.dll differ diff --git a/Snacks/bin/Release/UnityEngine.GameCenterModule.dll b/Snacks/bin/Release/UnityEngine.GameCenterModule.dll new file mode 100644 index 0000000..fdf3f46 Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.GameCenterModule.dll differ diff --git a/Snacks/bin/Release/UnityEngine.GridModule.dll b/Snacks/bin/Release/UnityEngine.GridModule.dll new file mode 100644 index 0000000..ad6b7a0 Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.GridModule.dll differ diff --git a/Snacks/bin/Release/UnityEngine.IMGUIModule.dll b/Snacks/bin/Release/UnityEngine.IMGUIModule.dll new file mode 100644 index 0000000..154361b Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.IMGUIModule.dll differ diff --git a/Snacks/bin/Release/UnityEngine.ImageConversionModule.dll b/Snacks/bin/Release/UnityEngine.ImageConversionModule.dll new file mode 100644 index 0000000..371d76a Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.ImageConversionModule.dll differ diff --git a/Snacks/bin/Release/UnityEngine.InputLegacyModule.dll b/Snacks/bin/Release/UnityEngine.InputLegacyModule.dll new file mode 100644 index 0000000..f193a42 Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.InputLegacyModule.dll differ diff --git a/Snacks/bin/Release/UnityEngine.InputModule.dll b/Snacks/bin/Release/UnityEngine.InputModule.dll new file mode 100644 index 0000000..ca01fe8 Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.InputModule.dll differ diff --git a/Snacks/bin/Release/UnityEngine.JSONSerializeModule.dll b/Snacks/bin/Release/UnityEngine.JSONSerializeModule.dll new file mode 100644 index 0000000..5c3c387 Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.JSONSerializeModule.dll differ diff --git a/Snacks/bin/Release/UnityEngine.LocalizationModule.dll b/Snacks/bin/Release/UnityEngine.LocalizationModule.dll new file mode 100644 index 0000000..522bcfb Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.LocalizationModule.dll differ diff --git a/Snacks/bin/Release/UnityEngine.ParticleSystemModule.dll b/Snacks/bin/Release/UnityEngine.ParticleSystemModule.dll new file mode 100644 index 0000000..94c4fc1 Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.ParticleSystemModule.dll differ diff --git a/Snacks/bin/Release/UnityEngine.PerformanceReportingModule.dll b/Snacks/bin/Release/UnityEngine.PerformanceReportingModule.dll new file mode 100644 index 0000000..a9ffe94 Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.PerformanceReportingModule.dll differ diff --git a/Snacks/bin/Release/UnityEngine.Physics2DModule.dll b/Snacks/bin/Release/UnityEngine.Physics2DModule.dll new file mode 100644 index 0000000..107ddb6 Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.Physics2DModule.dll differ diff --git a/Snacks/bin/Release/UnityEngine.PhysicsModule.dll b/Snacks/bin/Release/UnityEngine.PhysicsModule.dll new file mode 100644 index 0000000..1cd1e57 Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.PhysicsModule.dll differ diff --git a/Snacks/bin/Release/UnityEngine.ScreenCaptureModule.dll b/Snacks/bin/Release/UnityEngine.ScreenCaptureModule.dll new file mode 100644 index 0000000..6423a26 Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.ScreenCaptureModule.dll differ diff --git a/Snacks/bin/Release/UnityEngine.SharedInternalsModule.dll b/Snacks/bin/Release/UnityEngine.SharedInternalsModule.dll new file mode 100644 index 0000000..b5eda93 Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.SharedInternalsModule.dll differ diff --git a/Snacks/bin/Release/UnityEngine.SpriteMaskModule.dll b/Snacks/bin/Release/UnityEngine.SpriteMaskModule.dll new file mode 100644 index 0000000..359297a Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.SpriteMaskModule.dll differ diff --git a/Snacks/bin/Release/UnityEngine.SpriteShapeModule.dll b/Snacks/bin/Release/UnityEngine.SpriteShapeModule.dll new file mode 100644 index 0000000..cfe7901 Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.SpriteShapeModule.dll differ diff --git a/Snacks/bin/Release/UnityEngine.StreamingModule.dll b/Snacks/bin/Release/UnityEngine.StreamingModule.dll new file mode 100644 index 0000000..0d5f815 Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.StreamingModule.dll differ diff --git a/Snacks/bin/Release/UnityEngine.SubsystemsModule.dll b/Snacks/bin/Release/UnityEngine.SubsystemsModule.dll new file mode 100644 index 0000000..1d424f9 Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.SubsystemsModule.dll differ diff --git a/Snacks/bin/Release/UnityEngine.TerrainModule.dll b/Snacks/bin/Release/UnityEngine.TerrainModule.dll new file mode 100644 index 0000000..bcca7b3 Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.TerrainModule.dll differ diff --git a/Snacks/bin/Release/UnityEngine.TerrainPhysicsModule.dll b/Snacks/bin/Release/UnityEngine.TerrainPhysicsModule.dll new file mode 100644 index 0000000..7e9275f Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.TerrainPhysicsModule.dll differ diff --git a/Snacks/bin/Release/UnityEngine.TextCoreModule.dll b/Snacks/bin/Release/UnityEngine.TextCoreModule.dll new file mode 100644 index 0000000..79611eb Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.TextCoreModule.dll differ diff --git a/Snacks/bin/Release/UnityEngine.TextRenderingModule.dll b/Snacks/bin/Release/UnityEngine.TextRenderingModule.dll new file mode 100644 index 0000000..7f9629e Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.TextRenderingModule.dll differ diff --git a/Snacks/bin/Release/UnityEngine.TilemapModule.dll b/Snacks/bin/Release/UnityEngine.TilemapModule.dll new file mode 100644 index 0000000..e82de96 Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.TilemapModule.dll differ diff --git a/Snacks/bin/Release/UnityEngine.UI.dll b/Snacks/bin/Release/UnityEngine.UI.dll new file mode 100644 index 0000000..be4a66d Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.UI.dll differ diff --git a/Snacks/bin/Release/UnityEngine.UIElementsModule.dll b/Snacks/bin/Release/UnityEngine.UIElementsModule.dll new file mode 100644 index 0000000..6339de1 Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.UIElementsModule.dll differ diff --git a/Snacks/bin/Release/UnityEngine.UIModule.dll b/Snacks/bin/Release/UnityEngine.UIModule.dll new file mode 100644 index 0000000..ab17cea Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.UIModule.dll differ diff --git a/Snacks/bin/Release/UnityEngine.UNETModule.dll b/Snacks/bin/Release/UnityEngine.UNETModule.dll new file mode 100644 index 0000000..8324fbf Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.UNETModule.dll differ diff --git a/Snacks/bin/Release/UnityEngine.UnityAnalyticsModule.dll b/Snacks/bin/Release/UnityEngine.UnityAnalyticsModule.dll new file mode 100644 index 0000000..78dce87 Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.UnityAnalyticsModule.dll differ diff --git a/Snacks/bin/Release/UnityEngine.UnityConnectModule.dll b/Snacks/bin/Release/UnityEngine.UnityConnectModule.dll new file mode 100644 index 0000000..eadf9ac Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.UnityConnectModule.dll differ diff --git a/Snacks/bin/Release/UnityEngine.UnityWebRequestAssetBundleModule.dll b/Snacks/bin/Release/UnityEngine.UnityWebRequestAssetBundleModule.dll new file mode 100644 index 0000000..bfb0a00 Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.UnityWebRequestAssetBundleModule.dll differ diff --git a/Snacks/bin/Release/UnityEngine.UnityWebRequestAudioModule.dll b/Snacks/bin/Release/UnityEngine.UnityWebRequestAudioModule.dll new file mode 100644 index 0000000..f91c2e5 Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.UnityWebRequestAudioModule.dll differ diff --git a/Snacks/bin/Release/UnityEngine.UnityWebRequestModule.dll b/Snacks/bin/Release/UnityEngine.UnityWebRequestModule.dll new file mode 100644 index 0000000..be87d0d Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.UnityWebRequestModule.dll differ diff --git a/Snacks/bin/Release/UnityEngine.UnityWebRequestTextureModule.dll b/Snacks/bin/Release/UnityEngine.UnityWebRequestTextureModule.dll new file mode 100644 index 0000000..7f36c72 Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.UnityWebRequestTextureModule.dll differ diff --git a/Snacks/bin/Release/UnityEngine.UnityWebRequestWWWModule.dll b/Snacks/bin/Release/UnityEngine.UnityWebRequestWWWModule.dll new file mode 100644 index 0000000..b4cf897 Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.UnityWebRequestWWWModule.dll differ diff --git a/Snacks/bin/Release/UnityEngine.VFXModule.dll b/Snacks/bin/Release/UnityEngine.VFXModule.dll new file mode 100644 index 0000000..c822cfa Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.VFXModule.dll differ diff --git a/Snacks/bin/Release/UnityEngine.VRModule.dll b/Snacks/bin/Release/UnityEngine.VRModule.dll new file mode 100644 index 0000000..fb67ee0 Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.VRModule.dll differ diff --git a/Snacks/bin/Release/UnityEngine.VehiclesModule.dll b/Snacks/bin/Release/UnityEngine.VehiclesModule.dll new file mode 100644 index 0000000..7e04f8c Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.VehiclesModule.dll differ diff --git a/Snacks/bin/Release/UnityEngine.VideoModule.dll b/Snacks/bin/Release/UnityEngine.VideoModule.dll new file mode 100644 index 0000000..ad59a89 Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.VideoModule.dll differ diff --git a/Snacks/bin/Release/UnityEngine.WindModule.dll b/Snacks/bin/Release/UnityEngine.WindModule.dll new file mode 100644 index 0000000..9471279 Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.WindModule.dll differ diff --git a/Snacks/bin/Release/UnityEngine.XRModule.dll b/Snacks/bin/Release/UnityEngine.XRModule.dll new file mode 100644 index 0000000..8677d0c Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.XRModule.dll differ diff --git a/Snacks/bin/Release/UnityEngine.dll b/Snacks/bin/Release/UnityEngine.dll new file mode 100644 index 0000000..bdb34fa Binary files /dev/null and b/Snacks/bin/Release/UnityEngine.dll differ diff --git a/Snacks/bin/Release/Wiki/AstronautData.md b/Snacks/bin/Release/Wiki/AstronautData.md new file mode 100644 index 0000000..9743ba6 --- /dev/null +++ b/Snacks/bin/Release/Wiki/AstronautData.md @@ -0,0 +1,71 @@ + +This class contains data related to a kerbal. Information includes roster resources (characteristics of the kerbal akin to Courage and Stupidity), a condition summary specifying what states the kerbal is in, a list of disqualified conditions that will auto-fail precondition checks, a list of processor successes and failures, a key-value map suitable for tracking states in the event system, an exempt flag that exempts the kerbal from all outcomes. + +## Fields + +### name +Name of the kerbal. +### experienceTrait +The kerba's current experience trait. +### lastUpdated +Timestamp of when the astronaut data was last update. +### isExempt +Flag to indicate that the kerbal is exempt from outcomes. +### conditionSummary +Summary of all the conditions that the kerbal currently has. If a condition in the summary is defined in a SKILL_LOSS_CONDITION config node, then the kerbal will lose its skills until the condition is cleared. +### keyValuePairs +A map of key-value pairs. +### processedResourceSuccesses +Map of successful process cycles. The key is the name of the processor, the value is the number of successes. +### processedResourceFailures +Map of unsuccessfull process cycles. The key is the name of the processor, the value is the number of failures. +### rosterResources +A map of roster resources (characteristics of the kerbal), similar to vessel resources. +### disqualifiedPreconditions +Conditions that will automatically disqualify a precondition check. +## Methods + + +### Constructor +Initializes a new instance of the class. + +### Load(ConfigNode) +Loads the astronaut data from the config node supplied. +> #### Parameters +> **node:** The ConfigNode to read data from. + +> #### Return value +> A map keyed kerbal name that contains astronaut data. + +### Save(DictionaryValueList{System.String,Snacks.AstronautData},ConfigNode) +Saves persistent astronaut data to the supplied config node. +> #### Parameters +> **crewData:** A map of astronaut data, keyed by kerbal name. + +> **node:** The ConfigNode to save the data to. + + +### SetDisqualifier(System.String) +Sets a disqualifier that will automatically fail a precondition check. +> #### Parameters +> **disqualifier:** The name of the disqualifier to set. + + +### ClearDisqualifier(System.String) +Clears a disqualifier that will no longer fail a precondition check. +> #### Parameters +> **disqualifier:** The name of the disqualifier to clear. + + +### SetCondition(System.String) +Sets a condition that could result in loss of skills if defined in a SKILL_LOSS_CONDITION config node. The condition will appear in the kerbal's condition summary in the status window. +> #### Parameters +> **condition:** The name of the condition to set. + + +### ClearCondition(System.String) +Clears a condition, removing it from the condition summary display. If the condition is defined in a SKILL_LOSS_CONDITION config node, and the kerbal has no other conditions that result from skill loss, then the kerbal will regain its skills. +> #### Parameters +> **condition:** The name of the condition to clear. + + diff --git a/Snacks/bin/Release/Wiki/BaseOutcome.md b/Snacks/bin/Release/Wiki/BaseOutcome.md new file mode 100644 index 0000000..bcf5b5d --- /dev/null +++ b/Snacks/bin/Release/Wiki/BaseOutcome.md @@ -0,0 +1,61 @@ + +The BaseOutcome class is the basis for all outcome processing. An outcome is used with the resource processors as well as by the event system. It represents the consequences (or benefits) of a process result as well as the actions to take when an event's preconditions are met. + +## Fields + +### canBeRandom +Flag to indicate whether or not the outcome can be randomly selected. Requires random outcomes to be turned on. If it isn't then the outcome is always applied. +### selectRandomCrew +Flag to indicate whether or not to select a random crew member for the outcome instead of applying the outcome to the entire crew. +### playerMessage +Optional message to display to the player. +### childOutcomes +Optional list of child outcomes to apply when the parent outcome is applied. Child outcomes use same vessel/kerbal as the parent. +## Methods + + +### Constructor +Initializes a new instance of the class. + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **canBeRandom:** If set to true, the outcome can be randomly selected. + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **canBeRandom:** If set to true, the outcome can be randomly selected. + +> **playerMessage:** A string containing a message to the player that is shown when the outcome is applied.. + + +### Load(ConfigNode) +Loads the configuration +> #### Parameters +> **node:** A ConfigNode containing data to load. + + +### IsEnabled +Indicates whether or not the outcome is enabled. +> #### Return value +> true if inabled, false if not. + +### ApplyOutcome(Vessel,Snacks.SnacksProcessorResult) +Applies the outcome to the vessel's crew +> #### Parameters +> **vessel:** The Vessel being processed. + +> **result:** The Result of the processing attempt. + + +### RemoveOutcome(Vessel) +Removes the outcome from the vessel's crew. +> #### \ No newline at end of file diff --git a/Snacks/bin/Release/Wiki/BasePrecondition.md b/Snacks/bin/Release/Wiki/BasePrecondition.md new file mode 100644 index 0000000..3b43efb --- /dev/null +++ b/Snacks/bin/Release/Wiki/BasePrecondition.md @@ -0,0 +1,34 @@ + +A precondition is a check of some type that prevents outcomes from being applied unless the precondition's check suceeds. + +## Fields + +### name +Name of the precondition. +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode specifying the initialization parameters. + + +### IsValid(ProtoCrewMember,Vessel) +Determines if the precondition is valid. +> #### Parameters +> **astronaut:** The ProtoCrewModule to check. + +> **vessel:** The Vessel to check + +> #### Return value +> + +### IsValid(ProtoCrewMember) +Determines if the precondition is valid. +> #### Parameters +> **astronaut:** The ProtoCrewModule to check. + +> #### Return value +> + diff --git a/Snacks/bin/Release/Wiki/BaseResourceProcessor.md b/Snacks/bin/Release/Wiki/BaseResourceProcessor.md new file mode 100644 index 0000000..97b4ebf --- /dev/null +++ b/Snacks/bin/Release/Wiki/BaseResourceProcessor.md @@ -0,0 +1,141 @@ + +This is the base class for a resource processor. Similar to ModuleResourceConverter, the consumer will consume resources and produce resources, but it happens at the vessel level, not the part level. It's also designed to work with both loaded and unloaded vessels. Another important difference is that consumed/produced resources can occur on a per crewmember basis; a vessel with 5 crew will consume and/or produce 5 times the resources as a vessel with 1 crewmember. The configuration of a BaseResourceProcessor is done through config files. + +## Fields + +### name +Name of the resource processor +### secondsPerCycle +Number of seconds that must pass before running the consumer. +## Methods + + +### onKerbalEVA(ProtoCrewMember,Part) +Handles the situation where the kerbal went on EVA. +> #### Parameters +> **astronaut:** The kerbal that went on EVA. + +> **part:** The part that the kerbal left. + + +### onKerbalBoardedVessel(ProtoCrewMember,Part) +Handles the situation where a kerbal boards a vessel. +> #### Parameters +> **astronaut:** The kerbal boarding a vessel. + +> **part:** The part boarded. + + +### onKerbalAdded(ProtoCrewMember) +Handles adding of a new kerbal, giving the consumer a chance to add custom roster data. +> #### Parameters +> **astronaut:** The kerbal being added. + + +### onKerbalRemoved(ProtoCrewMember) +Handles removal of a kerbal, giving the consumer a chance to update custom data if needed. +> #### Parameters +> **astronaut:** The kerbal being removed. + + +### onKerbalNameChanged(ProtoCrewMember,System.String,System.String) +Handles a kerbal's name change. +> #### Parameters +> **astronaut:** The kerbal whose name has changed. Note that roster data is already being carried over, this event is used to give consumers a chance to update custom data kept outside of the roster. + +> **previousName:** The kerbal's previous name. + +> **newName:** The kerbal's new name. + + +### onVesselLoaded(Vessel) +Handles vessel loaded event, for instance, adding resources that should be on the vessel. +> #### Parameters +> **vessel:** The vessel that was loaded. + + +### onVesselRecovered(ProtoVessel) +Handles the vessel recovery event +> #### Parameters +> **protoVessel:** The ProtoVessel being recovered + + +### onVesselGoOffRails(Vessel) +Handles the situation where the vessel goes off rails. +> #### Parameters +> **vessel:** The Vessel going off rails + + +### OnGameSettingsApplied +Handles changes to game settings. + +### LoadProcessors +Loads the SNACKS_RESOURCE_PROCESSOR config nodes and returns a list of processors. +> #### Return value +> A list of resource processors. + +### Initialize +Initializes the consumer + +### Destroy +Cleanup as processor is about to be destroyed + +### OnLoad(ConfigNode) +De-serializes persistence data +> #### Parameters +> **node:** The ConfigNode with the persistence data + + +### OnSave +Saves persistence data to a ConfigNode and returns it. +> #### Return value +> A ConfigNode containing persistence data, if any. + +### AddConsumedAndProducedResources(Vessel,System.Double,System.Collections.Generic.List{ResourceRatio},System.Collections.Generic.List{ResourceRatio}) +Used primarily for simulations, returns the consumed and produced resources for the given unit of time. +> #### Parameters +> **vessel:** The vessel to query for data. + +> **secondsPerCycle:** The number of seconds to calculate total inputs and outputs. + +> **consumedResources:** The list of consumed resources to add the inputs to. + +> **producedResources:** The list of produced resources to add the outputs to. + + +### AddConsumedAndProducedResources(System.Int32,System.Double,System.Collections.Generic.List{ResourceRatio},System.Collections.Generic.List{ResourceRatio}) +Used primarily for simulations, returns the consumed and produced resources for the given unit of time. +> #### Parameters +> **crewCount:** The number of crew to simulate. + +> **secondsPerCycle:** The number of seconds to calculate total inputs and outputs. + +> **consumedResources:** The list of consumed resources to add the inputs to. + +> **producedResources:** The list of produced resources to add the outputs to. + + +### GetUnloadedResourceTotals(ProtoVessel,System.String,System.Double@,System.Double@) +Returns the amount and max amount of the desired resource in the unloaded vessel. +> #### Parameters +> **protoVessel:** The vessel to query for the resource totals. + +> **resourceName:** The name of the resource to query. + +> **amount:** The amount of the resource that the entire vessel has. + +> **maxAmount:** The max amount of the resource that the entire vessel has. + + +### ProcessResources(Vessel,System.Double,System.Int32,System.Int32) +Runs the processor, consuming input resources, producing output resources, and collating results. +> #### Parameters +> **vessel:** The vessel to run the consumer on. + +> **elapsedTime:** Number of seconds that have passed. + +> **crewCount:** Number of crew aboard the vessel. + +> **crewCapacity:** The vessel's total crew capacity. + + diff --git a/Snacks/bin/Release/Wiki/CheckBadass.md b/Snacks/bin/Release/Wiki/CheckBadass.md new file mode 100644 index 0000000..88ac0b6 --- /dev/null +++ b/Snacks/bin/Release/Wiki/CheckBadass.md @@ -0,0 +1,16 @@ + +This precondition checks to see if a kerbal's badass status against the badassExists flag. Both must match in order for the precondition to be validated. Example definition: PRECONDITION { name = CheckBadass mustExist = true } + +## Fields + +### mustExist +Flag to indicate pressence (true) or absence (false) of the value to check. +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. parameters from the class also apply. + + diff --git a/Snacks/bin/Release/Wiki/CheckBreathableAir.md b/Snacks/bin/Release/Wiki/CheckBreathableAir.md new file mode 100644 index 0000000..4340567 --- /dev/null +++ b/Snacks/bin/Release/Wiki/CheckBreathableAir.md @@ -0,0 +1,16 @@ + +This precondition checks to see if a kerbal or vessel is in an environemnt with breathable air, and matches it with the expected parameter. The vessel's celestial body must have an atmosphere with oxygen, and the vessel altitude must be between sea level and half the atmosphere height. Example definition: PRECONDITION { name = CheckBreathableAir mustExist = false } + +## Fields + +### mustExist +Flag to indicate pressence (true) or absence (false) of the value to check. +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. parameters from the class also apply. + + diff --git a/Snacks/bin/Release/Wiki/CheckCondition.md b/Snacks/bin/Release/Wiki/CheckCondition.md new file mode 100644 index 0000000..296eb73 --- /dev/null +++ b/Snacks/bin/Release/Wiki/CheckCondition.md @@ -0,0 +1,18 @@ + +This precondition Checks a kerbal's condition summary to see if it exists or not. The precondition is valid if the kerbal's condition summary matches the parameters of the precondition. Example definition: PRECONDITION { name = CheckCondition conditionSummary = Sleepy mustExist = true } + +## Fields + +### conditionSummary +Name of the condition to check +### mustExist +Flag to indicate pressence (true) or absence (false) of the value to check. +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. parameters from the class also apply. + + diff --git a/Snacks/bin/Release/Wiki/CheckCourage.md b/Snacks/bin/Release/Wiki/CheckCourage.md new file mode 100644 index 0000000..8adb63f --- /dev/null +++ b/Snacks/bin/Release/Wiki/CheckCourage.md @@ -0,0 +1,18 @@ + +This precondition checks to see if a kerbal's courage matches the desired value and type of check to make. Example definition: PRECONDITION { name = CheckCourage valueToCheck = 0.5 checkType = checkEquals //Default value } + +## Fields + +### valueToCheck +The value to check for +### checkType +Type of check to make Default: checkEquals +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. parameters from the class also apply. + + diff --git a/Snacks/bin/Release/Wiki/CheckCrewCount.md b/Snacks/bin/Release/Wiki/CheckCrewCount.md new file mode 100644 index 0000000..ffbb9d4 --- /dev/null +++ b/Snacks/bin/Release/Wiki/CheckCrewCount.md @@ -0,0 +1,18 @@ + +This precondition checks to see if a vessel's crew count matches the desired parameter. Example definition: PRECONDITION { name = CheckCrewCount valueToCheck = 1 checkType = checkEquals //Default value } + +## Fields + +### valueToCheck +The value to check for +### checkType +Type of check to make +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. parameters from the class also apply. + + diff --git a/Snacks/bin/Release/Wiki/CheckGravityLevel.md b/Snacks/bin/Release/Wiki/CheckGravityLevel.md new file mode 100644 index 0000000..02b0636 --- /dev/null +++ b/Snacks/bin/Release/Wiki/CheckGravityLevel.md @@ -0,0 +1,18 @@ + +This precondition checks to see if a vessel or roster resource meets the supplied parameters. Gravity checks can be negated by setting CheckGravityLevel.checkType, where checkType is one of the conditional qualifiers. For instance, CheckGravityLevel.checkLesserOrEqual will disqualify any microgravity event checks and is useful for centrifuges. Example definition: PRECONDITION { name = CheckGravityLevel valueToCheck = 0.1 checkType = checkLesserOrEqual //Default value } + +## Fields + +### valueToCheck +The value to check for +### checkType +The conditional type to use during the validation. +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. parameters from the class also apply. + + diff --git a/Snacks/bin/Release/Wiki/CheckKeyValue.md b/Snacks/bin/Release/Wiki/CheckKeyValue.md new file mode 100644 index 0000000..c0f5fd7 --- /dev/null +++ b/Snacks/bin/Release/Wiki/CheckKeyValue.md @@ -0,0 +1,22 @@ + +This precondition Checks a kerbal's key-value and validates it against the supplied parameters. Example definition: PRECONDITION { name = CheckKeyValue keyValueName = State checkType = checkEquals stringValue = Bored } + +## Fields + +### keyValueName +Name of the key-value +### stringValue +String value of the key. Takes precedence over the int values. +### intValue +Integer value of the key +### checkType +Type of check to make +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. parameters from the class also apply. + + diff --git a/Snacks/bin/Release/Wiki/CheckProcessorResult.md b/Snacks/bin/Release/Wiki/CheckProcessorResult.md new file mode 100644 index 0000000..a4e9423 --- /dev/null +++ b/Snacks/bin/Release/Wiki/CheckProcessorResult.md @@ -0,0 +1,22 @@ + +This precondition checks the specified processor for desired results. Example definition: PRECONDITION { name = CheckProcessorResult type = resultConsumptionFailure processorName = Snacks! resourceName = Snacks cyclesRequired = 1 } + +## Fields + +### resultType +The type of result to check +### processorName +The name of the processor to check +### resourceName +The name of the resource to check +### cyclesRequired +The number of process cycles to check +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. parameters from the class also apply. + + diff --git a/Snacks/bin/Release/Wiki/CheckRandomChance.md b/Snacks/bin/Release/Wiki/CheckRandomChance.md new file mode 100644 index 0000000..35696eb --- /dev/null +++ b/Snacks/bin/Release/Wiki/CheckRandomChance.md @@ -0,0 +1,20 @@ + +This precondition rolls a random die between a minimum and maximum value and compares it to a target number. If the roll meets or exceeds the target number then the precondition passes. Example definition: PRECONDITION { name = CheckRandomChance dieRollMin = 1 dieRollMax = 1000 targetNumber = 999 } + +## Fields + +### dieRollMin +Minimum value on the die roll +### dieRollMax +Maximum value on the die roll +### targetNumber +Target number required to declare the precondition valid. +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. parameters from the class also apply. + + diff --git a/Snacks/bin/Release/Wiki/CheckResource.md b/Snacks/bin/Release/Wiki/CheckResource.md new file mode 100644 index 0000000..1e3339a --- /dev/null +++ b/Snacks/bin/Release/Wiki/CheckResource.md @@ -0,0 +1,22 @@ + +This precondition checks to see if a vessel or roster resource meets the supplied parameters. Example definition: PRECONDITION { name = CheckResource resourceName = Stress checkType = checkEquals valueToCheck = 3.0 } + +## Fields + +### resourceName +Name of the resource to check +### checkType +The conditional type to use during the validation. +### valueToCheck +The value to check for +### checkMaxAmount +Flag to indicate whether or not to check the resource's max amount instead of the curren amount; +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. parameters from the class also apply. + + diff --git a/Snacks/bin/Release/Wiki/CheckResultTypes.md b/Snacks/bin/Release/Wiki/CheckResultTypes.md new file mode 100644 index 0000000..f1723c9 --- /dev/null +++ b/Snacks/bin/Release/Wiki/CheckResultTypes.md @@ -0,0 +1,14 @@ + +Enumerator with the type of results to check. + +## Fields + +### resultConsumptionSuccess +Check for a successful consumption +### resultConsumptionFailure +Check for a consumption failure +### resultProductionSuccess +Check for a production success +### resultProductionFailure +Check for a production failure + diff --git a/Snacks/bin/Release/Wiki/CheckSkill.md b/Snacks/bin/Release/Wiki/CheckSkill.md new file mode 100644 index 0000000..d775cfc --- /dev/null +++ b/Snacks/bin/Release/Wiki/CheckSkill.md @@ -0,0 +1,28 @@ + +This precondition checks to see if a kerbal's skill matches the desired parameter. For instance, you could check to see if a kerbal has the ScienceSkill. Example definition: PRECONDITION { name = CheckSkill skillToCheck = ScienceSkill mustExist = true } + +## Fields + +### +The value to check for +### +Type of check to make Default: checkGreaterOrEqual +### skillToCheck +Name of the skill to check +### mustExist +Flag to indicate pressence (true) or absence (false) of the value to check. +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. parameters from the class also apply. + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. parameters from the class also apply. + + diff --git a/Snacks/bin/Release/Wiki/CheckSkillLevel.md b/Snacks/bin/Release/Wiki/CheckSkillLevel.md new file mode 100644 index 0000000..df3971f --- /dev/null +++ b/Snacks/bin/Release/Wiki/CheckSkillLevel.md @@ -0,0 +1,18 @@ + +This precondition checks to see if a kerbal's experience level matches the desired value and type of check to make. For instance you could check to see if a kerbal is above 3 stars. Example definition: PRECONDITION { name = CheckSkillLevel valueToCheck = 3 checkType = checkGreaterOrEqual //Default value } + +## Fields + +### valueToCheck +The value to check for +### checkType +Type of check to make Default: checkGreaterOrEqual +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. parameters from the class also apply. + + diff --git a/Snacks/bin/Release/Wiki/CheckStupidity.md b/Snacks/bin/Release/Wiki/CheckStupidity.md new file mode 100644 index 0000000..fd1011f --- /dev/null +++ b/Snacks/bin/Release/Wiki/CheckStupidity.md @@ -0,0 +1,18 @@ + +This precondition checks to see if a kerbal's stupidity matches the desired value and type of check to make. Example definition: PRECONDITION { name = CheckStupidity valueToCheck = 0.5 checkType = checkEquals //Default value } + +## Fields + +### valueToCheck +The value to check for +### checkType +Type of check to make Default: checkEquals +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. parameters from the class also apply. + + diff --git a/Snacks/bin/Release/Wiki/CheckTrait.md b/Snacks/bin/Release/Wiki/CheckTrait.md new file mode 100644 index 0000000..925345c --- /dev/null +++ b/Snacks/bin/Release/Wiki/CheckTrait.md @@ -0,0 +1,18 @@ + +This precondition checks to see if a kerbal's trait matches the desired parameter. For instance, you could check to see if a kerbal is an Engineer. Example definition: PRECONDITION { name = CheckTrait traitToCheck = Engineer mustExist = true } + +## Fields + +### traitToCheck +Name of the trait to check +### mustExist +Flag to indicate pressence (true) or absence (false) of the value to check. +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. parameters from the class also apply. + + diff --git a/Snacks/bin/Release/Wiki/CheckValueConditionals.md b/Snacks/bin/Release/Wiki/CheckValueConditionals.md new file mode 100644 index 0000000..889696d --- /dev/null +++ b/Snacks/bin/Release/Wiki/CheckValueConditionals.md @@ -0,0 +1,18 @@ + +This enum represents the key-value conditionals to check. + +## Fields + +### checkEquals +Key-value must be equal to the supplied value. +### checkNotEqual +Key-value must not be equal to the supplied value. +### checkGreaterThan +Key-value must be greater than the supplied value. +### checkLessThan +Key-value must be less than the supplied value. +### checkGreaterOrEqual +Key-value must be greater than or equal to the supplied value. +### checkLesserOrEqual +Key-value must be less than or equal to the supplied value. + diff --git a/Snacks/bin/Release/Wiki/CheckVesselStatus.md b/Snacks/bin/Release/Wiki/CheckVesselStatus.md new file mode 100644 index 0000000..3227590 --- /dev/null +++ b/Snacks/bin/Release/Wiki/CheckVesselStatus.md @@ -0,0 +1,22 @@ + +This precondition checks the vessel status against the supplied parameters. Example definition: PRECONDITION { name = CheckVesselStatus situation = LANDED situation = SPLASHED } + +## Fields + +### situationsToCheck +List of situations to check the vessel against. In the config file, separate each situation to check on a separate line. Ex: situation = LANDED situation = SPLASHED Valid situations: LANDED, SPLASHED, ESCAPING, FLYING, ORBITING, SUB_ORBITAL, PRELAUNCH +### bodyName +Optional name of the planetary body where the vessel must be located. +### metersAltitude +Optional altitude in meters that the vessel must be at. +### checkType +The type of check to make against metersAltitude. +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. parameters from the class also apply. + + diff --git a/Snacks/bin/Release/Wiki/ClearCondition.md b/Snacks/bin/Release/Wiki/ClearCondition.md new file mode 100644 index 0000000..52b88ea --- /dev/null +++ b/Snacks/bin/Release/Wiki/ClearCondition.md @@ -0,0 +1,16 @@ + +This outcome removes the desired condition on the affected kerbals Example definition: OUTCOME { name = ClearCondition conditionSummary = Sick } + +## Fields + +### conditionName +Name of the condition to set +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. Parameters in the class also apply. + + diff --git a/Snacks/bin/Release/Wiki/ClearKeyValue.md b/Snacks/bin/Release/Wiki/ClearKeyValue.md new file mode 100644 index 0000000..6f6fef6 --- /dev/null +++ b/Snacks/bin/Release/Wiki/ClearKeyValue.md @@ -0,0 +1,16 @@ + +This outcome removes the desired key-value from the affected kerbals Example definition: OUTCOME { name = ClearKeyValues conditionSummary = Sick } + +## Fields + +### keyValueName +Name of the key-value +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. Parameters in the class also apply. + + diff --git a/Snacks/bin/Release/Wiki/ConsumeResource.md b/Snacks/bin/Release/Wiki/ConsumeResource.md new file mode 100644 index 0000000..0d6c816 --- /dev/null +++ b/Snacks/bin/Release/Wiki/ConsumeResource.md @@ -0,0 +1,22 @@ + +This outcome consumes the specified resource in the desired amount. It can be a vessel resource or a roster resource. Example definition: OUTCOME { name = ConsumeResource resourceName = Stress amount = 1 } + +## Fields + +### resourceName +Name of the resource to produce +### randomMin +Optional minimum value of random amount to produce. +### randomMax +Optional maximum value of random amount to produce. +### amount +Amount of resource to consume. Takes presedence over randomMin and randomMax +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. Parameters in the class also apply. + + diff --git a/Snacks/bin/Release/Wiki/DeathPenalty.md b/Snacks/bin/Release/Wiki/DeathPenalty.md new file mode 100644 index 0000000..b7c1093 --- /dev/null +++ b/Snacks/bin/Release/Wiki/DeathPenalty.md @@ -0,0 +1,28 @@ + +This outcome causes affected kerbals to die. Example definition: OUTCOME { name = DeathPenalty resourceName = Snacks cyclesBeforeDeath = 10 } + +## Fields + +### resourceName +The name of the resource to check for failed processor cycles. +### cyclesBeforeDeath +The number of cycles that must fail before the kerbal dies. +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. Parameters in the class also apply. + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **resourceName:** The name of the resource to check. If no processor has a failed cycle with the resource then the outcome is invalidated. + +> **cyclesBeforeDeath:** The number of failed processor cycles required before applying the outcome. + +> **playerMessage:** A string containing the bad news for the player. + + diff --git a/Snacks/bin/Release/Wiki/FaintPenalty.md b/Snacks/bin/Release/Wiki/FaintPenalty.md new file mode 100644 index 0000000..1796f6f --- /dev/null +++ b/Snacks/bin/Release/Wiki/FaintPenalty.md @@ -0,0 +1,32 @@ + +This outcome causes affected kerbals to faint. Example definition: OUTCOME { name = FaintPenalty resourceName = Snacks cyclesBeforeFainting = 3 faintDurationSeconds = 180 } + +## Fields + +### resourceName +The name of the resource to check for failed processor cycles. +### cyclesBeforeFainting +The number of cycles that must fail before the kerbal faints. +### faintDurationSeconds +The number of seconds that the kerbal will faint for. +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. Parameters in the class also apply. + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **resourceName:** The name of the resource to check. If none of the resource processors have failed cycles containing the resource then the outcome is invalidated. + +> **cyclesBeforeFainting:** The number of failed cycles required before applying the outcome.. + +> **faintDurationSeconds:** Faint duration seconds. + +> **playerMessage:** A string containing the bad news for the player. + + diff --git a/Snacks/bin/Release/Wiki/FundingPenalty.md b/Snacks/bin/Release/Wiki/FundingPenalty.md new file mode 100644 index 0000000..96bb9d3 --- /dev/null +++ b/Snacks/bin/Release/Wiki/FundingPenalty.md @@ -0,0 +1,26 @@ + +This outcome fines the space agency by a certain amount per affected kerbal. Example definition: OUTCOME { name = FundingPenalty finePerKerbal = 1000 } + +## Fields + +### finePerKerbal +The amount of Funds to lose per kerbal. +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. Parameters in the class also apply. + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **canBeRandom:** If set to true the outcome can be randomly selected from the outcome list. + +> **playerMessage:** A string containing the bad news. + +> **finePerKerbal:** The amount of Funds lost per affected kerval. + + diff --git a/Snacks/bin/Release/Wiki/ISnacksPenalty.md b/Snacks/bin/Release/Wiki/ISnacksPenalty.md new file mode 100644 index 0000000..2f82f4f --- /dev/null +++ b/Snacks/bin/Release/Wiki/ISnacksPenalty.md @@ -0,0 +1,33 @@ + +Interface for creating and running penalties when a processor resource runs out or has too much aboard the vessel or kerbal. + +## Methods + + +### IsEnabled +Indicates whether or not the penalty is enabled. +> #### Return value +> true if inabled, false if not. + +### AlwaysApply +Indicates whether or not the penalty is always applied instead of randomly chosen. +> #### Return value +> true if the penalty should always be applied, false if not. + +### ApplyPenalty(System.Int32,Vessel) +Applies the penalty to the affected kerbals +> #### Parameters +> **affectedKerbals:** An int containing the number of kerbals affected by the penalty. + +> **vessel:** The vessel to apply the penalty to. + + +### RemovePenalty(Vessel) +Removes penalty effects. +> #### Parameters +> **vessel:** The vessel to remove the penalt effects from. + + +### GameSettingsApplied +Handles changes in game settings, if any. + diff --git a/Snacks/bin/Release/Wiki/KerbalsAffectedTypes.md b/Snacks/bin/Release/Wiki/KerbalsAffectedTypes.md new file mode 100644 index 0000000..dc3ff2b --- /dev/null +++ b/Snacks/bin/Release/Wiki/KerbalsAffectedTypes.md @@ -0,0 +1,16 @@ + +Enumerator specifying which kerbals are affected by the preconditions. + +## Fields + +### affectsRandomAvailable +A single available kerbal is chosen at random. +### affectsRandomAssigned +A single assigned kerbal is chosen at random. +### affectsAllAvailable +All available kerbals are affected. +### affectsAllAssigned +All assigned kerbals are affected. +### affectsRandomCrewPerVessel +A single random kerbal is chosesn amongst each crewed vessel. + diff --git a/Snacks/bin/Release/Wiki/OnConsumersRunCompleteDelegate.md b/Snacks/bin/Release/Wiki/OnConsumersRunCompleteDelegate.md new file mode 100644 index 0000000..1b14480 --- /dev/null +++ b/Snacks/bin/Release/Wiki/OnConsumersRunCompleteDelegate.md @@ -0,0 +1,7 @@ + +Signifies that the consumers have completed their run. + +> **simulator:** The simulator that invoked the delegate method. + + + diff --git a/Snacks/bin/Release/Wiki/OnConvertersRunCompleteDelegate.md b/Snacks/bin/Release/Wiki/OnConvertersRunCompleteDelegate.md new file mode 100644 index 0000000..bea1cd6 --- /dev/null +++ b/Snacks/bin/Release/Wiki/OnConvertersRunCompleteDelegate.md @@ -0,0 +1,7 @@ + +Signifies that the converters have completed their run. + +> **simulator:** The simulator that invoked the delegate method. + + + diff --git a/Snacks/bin/Release/Wiki/OnSimulationCompleteDelegate.md b/Snacks/bin/Release/Wiki/OnSimulationCompleteDelegate.md new file mode 100644 index 0000000..515ce57 --- /dev/null +++ b/Snacks/bin/Release/Wiki/OnSimulationCompleteDelegate.md @@ -0,0 +1,7 @@ + +Signifies that the simulation has completed. + +> **simulator:** The simulator that invoked the delegate method. + + + diff --git a/Snacks/bin/Release/Wiki/OnSimulatorCycleCompleteDelegate.md b/Snacks/bin/Release/Wiki/OnSimulatorCycleCompleteDelegate.md new file mode 100644 index 0000000..440a518 --- /dev/null +++ b/Snacks/bin/Release/Wiki/OnSimulatorCycleCompleteDelegate.md @@ -0,0 +1,7 @@ + +Signifies that the simulation cycle has completed. + +> **simulator:** The simulator that invoked the delegate method. + + + diff --git a/Snacks/bin/Release/Wiki/OnSimulatorExceptionDelegate.md b/Snacks/bin/Release/Wiki/OnSimulatorExceptionDelegate.md new file mode 100644 index 0000000..5e00627 --- /dev/null +++ b/Snacks/bin/Release/Wiki/OnSimulatorExceptionDelegate.md @@ -0,0 +1,10 @@ + +Signifies that the simulation experienced an error. + +> **simulator:** The simulator generating the error. + + +> **ex:** The Exception that was generated. + + + diff --git a/Snacks/bin/Release/Wiki/OnStrikePenalty.md b/Snacks/bin/Release/Wiki/OnStrikePenalty.md new file mode 100644 index 0000000..6a5ef37 --- /dev/null +++ b/Snacks/bin/Release/Wiki/OnStrikePenalty.md @@ -0,0 +1,26 @@ + +This outcome sets a condition on the affected kerbals. If that condition is defined in a SKILL_LOSS_CONDITION config node, then the kerbals' skills will be removed until the condition is cleared. Example definition: OUTCOME { name = ClearCondition conditionSummary = Stressed Out } + +## Fields + +### conditionName +The name of the condition to set. If defined in a SKILL_LOSS_CONDITION node then the affected kerbals will lose their skills until the condition is cleared. +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **conditionName:** The name of the condition to set. It must be added to a SKILL_LOSS_CONDITION config node in order for the kerbal to lose its skills. + +> **canBeRandom:** If set to true it can be randomly selected from the outcomes list. + +> **playerMessage:** A string containing the bad news. + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. Parameters in the class also apply. + + diff --git a/Snacks/bin/Release/Wiki/ProcessedResource.md b/Snacks/bin/Release/Wiki/ProcessedResource.md new file mode 100644 index 0000000..0dbe037 --- /dev/null +++ b/Snacks/bin/Release/Wiki/ProcessedResource.md @@ -0,0 +1,63 @@ + +This class represents resources consumed or produced by a SnacksResourceProcessor. Consumption and production is applied vessel-wide, or to individual kerbal roster entries depending on the configuration. If applied vessel-wide, the resource can be produced or consumed per kerbal. Finally, the resource can be displayed in the Snapshots view. + +## Fields + +### resourceName +Name of the consumed/produced resource +### dependencyResourceName +Name of the dependency resource if the resource to process depends upon the results of another resource's process result. E.G. 1 unit of Soil is produced for 1 unt of Snacks consumed. +### isRosterResource +Flag to indicate whether or not the resource is applied to roster entries instead of parts and vessels. if set to true, then appliedPerCrew is ignored. Default: false +### showInSnapshot +Flag to indicate whether or not to show the resource in the Snapshots window. Ignored if isRosterResource is set to true. Default: true +### failureResultAppliesOutcomes +Flag to indicate whether or not a failure result applies the processor's outcomes. Default: true +### amount +The amount of resource to consume or produce. If appliedPerCrew is true, then the amount consumed/produced is multiplied by the number of crew aboard the vessel. If isRosterResource is true, then each individual crew member's roster entry will be affected instead. Default: 0 +### clearDataDuringRecovery +Flag to indicate that astronaut data should be cleared when a vessel is recovered. Default: true +## Methods + + +### Load(ConfigNode) +Loads the fields from the config node. +> #### Parameters +> **node:** A ConfigNode containing fields to load. + + +### Save +Saves current values to a ConfigNode. +> #### Return value +> A ConfigNode containing the field data. + +### ConsumeResource(Vessel,System.Double,System.Int32,System.Int32) +Consumes the resource. +> #### Parameters +> **vessel:** The vessel to work on + +> **elapsedTime:** Elapsed seconds + +> **crewCount:** Current crew count + +> **crewCapacity:** Current crew capacity + +> #### Return value +> A SnacksConsumerResult containing the resuls of the consumption. + +### ProduceResource(Vessel,System.Double,System.Int32,System.Int32,System.Collections.Generic.Dictionary{System.String,Snacks.SnacksProcessorResult}) +Produces the resource +> #### Parameters +> **vessel:** The vessel to work on + +> **elapsedTime:** Elapsed seconds + +> **crewCount:** Current crew count + +> **crewCapacity:** Current crew capacity + +> **consumptionResults:** Results of resource consumption. + +> #### Return value +> A SnacksConsumerResult containing the resuls of the production. + diff --git a/Snacks/bin/Release/Wiki/ProduceResource.md b/Snacks/bin/Release/Wiki/ProduceResource.md new file mode 100644 index 0000000..0974135 --- /dev/null +++ b/Snacks/bin/Release/Wiki/ProduceResource.md @@ -0,0 +1,34 @@ + +This outcome produces the specified resource in the desired amount. It can be a vessel resource or a roster resource. Example definition: OUTCOME { name = ProduceResource resourceName = Stress amount = 1 } + +## Fields + +### resourceName +Name of the resource to produce +### randomMin +Optional minimum value of random amount to produce. +### randomMax +Optional maximum value of random amount to produce. +### amount +Amount of resource to produce. Takes presedence over randomMin and randomMax +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. Parameters in the class also apply. + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **resourceName:** The name of the resource to produce. It can be a roster resource. + +> **amount:** The amount of resource to produce + +> **canBeRandom:** If set to true it can be randomly selected from the outcomes list. + +> **playerMessage:** A message for the player. + + diff --git a/Snacks/bin/Release/Wiki/RepPenalty.md b/Snacks/bin/Release/Wiki/RepPenalty.md new file mode 100644 index 0000000..68f4863 --- /dev/null +++ b/Snacks/bin/Release/Wiki/RepPenalty.md @@ -0,0 +1,26 @@ + +This outcome reduces the space agency's reputation based on the supplied parameters. Example definition: OUTCOME { name = RepPenalty repLossPerKerbal = 5 } + +## Fields + +### repLossPerKerbal +The rep loss per kerbal. +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. Parameters in the class also apply. + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **canBeRandom:** If set to true it can be randomly selected from the outcomes list. + +> **repLossPerKerbal:** Rep loss per kerbal. + +> **playerMessage:** A string containing the bad news. + + diff --git a/Snacks/bin/Release/Wiki/SciencePenalty.md b/Snacks/bin/Release/Wiki/SciencePenalty.md new file mode 100644 index 0000000..d75d73f --- /dev/null +++ b/Snacks/bin/Release/Wiki/SciencePenalty.md @@ -0,0 +1,18 @@ + +This outcome disrupts science experiments aboard a vessel. Example definition: OUTCOME { name = SciencePenalty } + +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. Parameters in the class also apply. + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **canBeRandom:** If set to true it can be randomly selected from the outcomes list. + + diff --git a/Snacks/bin/Release/Wiki/SetCondition.md b/Snacks/bin/Release/Wiki/SetCondition.md new file mode 100644 index 0000000..569d12c --- /dev/null +++ b/Snacks/bin/Release/Wiki/SetCondition.md @@ -0,0 +1,16 @@ + +This outcome sets the desired condition on the affected kerbals Example definition: OUTCOME { name = SetCondition conditionSummary = Sick } + +## Fields + +### conditionName +Name of the condition to set +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. Parameters in the class also apply. + + diff --git a/Snacks/bin/Release/Wiki/SetKeyValue.md b/Snacks/bin/Release/Wiki/SetKeyValue.md new file mode 100644 index 0000000..fe1fa90 --- /dev/null +++ b/Snacks/bin/Release/Wiki/SetKeyValue.md @@ -0,0 +1,22 @@ + +This outcome sets the desired key-vale on the affected kerbals Example definition: OUTCOME { name = SetKeyValue keyValueName = DaysBored intValue = 1 } + +## Fields + +### keyValueName +Name of the key-value +### stringValue +String value of the key. Takes precedence over the int values. +### intValue +Integer value of the key +### addIntValue +Integer value to add to the existing key value. If key doesn't exist then it will be set to this value instead. Taks precedence over intValue. +## Methods + + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode containing initialization parameters. Parameters in the class also apply. + + diff --git a/Snacks/bin/Release/Wiki/SimConverter.md b/Snacks/bin/Release/Wiki/SimConverter.md new file mode 100644 index 0000000..45c0984 --- /dev/null +++ b/Snacks/bin/Release/Wiki/SimConverter.md @@ -0,0 +1,14 @@ + +This class is a simulated ModuleResourceConverter. It processes inputs, produces outputs, and when the time's up, generates yield resources. For the sake of simplicity, all vessel resources are available. + +## Methods + + +### ProcessResources(System.Collections.Generic.Dictionary{System.String,Snacks.SimResource},System.Double) +Processes resources, consuming inputs, producing outputs, and when time expires, producing yield resources. For the purposes of simulation, we assume dumpExcess = true, yield resources always suceed, no heat generation, and no crew bonuses. +> #### Parameters +> **resources:** The map of vessel resources to process. + +> **secondsPerSimulatorCycle:** The number of seconds per simulator cycle. + + diff --git a/Snacks/bin/Release/Wiki/SimResource.md b/Snacks/bin/Release/Wiki/SimResource.md new file mode 100644 index 0000000..7399b5d --- /dev/null +++ b/Snacks/bin/Release/Wiki/SimResource.md @@ -0,0 +1,4 @@ + +This struct tracks vessel resources in the simulator. For the sake of simplicity, simulated resources aren't locked and are considered flow mode ALL_VESSEL. + + diff --git a/Snacks/bin/Release/Wiki/SimSnacks.md b/Snacks/bin/Release/Wiki/SimSnacks.md new file mode 100644 index 0000000..6e7d182 --- /dev/null +++ b/Snacks/bin/Release/Wiki/SimSnacks.md @@ -0,0 +1,30 @@ + +This class determines how long consumed resources like Snacks will last by simulating resource consumption and simulating running converters like soil recyclers and snacks processors. It is designed to allow for an arbitrary number of resource production chains and an arbitrary number of consumed resources. Conditions: The only inputs allowed into the system are those consumed by kerbals. Ex: kerbals eat Snacks and produce Soil. Resources aboard the vessel that aren't directly involved in resource consumption are fixed. Ex: Resource harvesters that produce Ore aren't accounted for. Running simulations is computationally expensive. This class should be run in a thread. + +## Methods + + +### CreateSimulator(ShipConstruct) +Creates a simulator from the supplied ship construct +> #### Parameters +> **ship:** A ShipConstruct to simulate + +> #### Return value +> A SimSnacks simulator + +### CreateSimulator(ProtoVessel) +Creates a simulator from the proto vessel +> #### Parameters +> **protoVessel:** The unloaded vessel to query for resources and converters. + +> #### Return value +> A SimSnacks simulator. + +### CreateSimulator(Vessel) +Creates a simulator from a loaded vessel +> #### Parameters +> **vessel:** The Vessel object to query for resources and converters. + +> #### Return value +> A SimSnacks simulator. + diff --git a/Snacks/bin/Release/Wiki/SimulatedVesselTypes.md b/Snacks/bin/Release/Wiki/SimulatedVesselTypes.md new file mode 100644 index 0000000..f6bf8fc --- /dev/null +++ b/Snacks/bin/Release/Wiki/SimulatedVesselTypes.md @@ -0,0 +1,4 @@ + +Type of vessel being simulated + + diff --git a/Snacks/bin/Release/Wiki/SimulatorContext.md b/Snacks/bin/Release/Wiki/SimulatorContext.md new file mode 100644 index 0000000..38cb6b3 --- /dev/null +++ b/Snacks/bin/Release/Wiki/SimulatorContext.md @@ -0,0 +1,12 @@ + +Context for how the simulator is being created. Typically used when Snacks fires an event to give mods a chance to add additional custom converters not covered by Snacks. + +## Fields + +### simulatedVesselType +Type of vessel being simulated. +### vessel +Vessel object for loaded/unloaded vessels being simulated. +### shipConstruct +Ship constructor for editor vessel being simulated. + diff --git a/Snacks/bin/Release/Wiki/SnackProcessor.md b/Snacks/bin/Release/Wiki/SnackProcessor.md new file mode 100644 index 0000000..cc76c3f --- /dev/null +++ b/Snacks/bin/Release/Wiki/SnackProcessor.md @@ -0,0 +1,19 @@ + +The SnacksProcessor grinds out Snacks from Ore. It is derived from the SnacksConverter. The output of the processor is affected by the game settings. + +## Fields + +### dailyOutput +A status field showing the daily output of Snacks. +### originalSnacksRatio +Helper field describing the original output ratio of Snacks. +### sourceInputRatio +Helper field to describe the original input ratio of Ore +## Methods + + +### GetDailySnacksOutput +Gets the daily snacks output. +> #### Return value +> The amount of Snacks produced daily, subjected to game settings. + diff --git a/Snacks/bin/Release/Wiki/SnackSimThread.md b/Snacks/bin/Release/Wiki/SnackSimThread.md new file mode 100644 index 0000000..afb78a3 --- /dev/null +++ b/Snacks/bin/Release/Wiki/SnackSimThread.md @@ -0,0 +1,84 @@ + +This class represents a single simulator job. It will check its job list for jobs to process and synchronize with other simulator jobs. + +## Fields + +### +Max number of threads allowed +### +List of simulator jobs waiting to be run +## Methods + + +### Start +Starts the thread. + +### Stop +Stops all current and pending jobs and kills the thread. + +### AddJob(Snacks.SimSnacks) +Adds a simulator job to the job list. +> #### Parameters +> **simSnacks:** The simulator to add to the jobs list. + + +### ClearJobs +Clears all pending and running jobs. + +### +Handles the completion of a thread's simulation. +> #### Parameters +> **simulator:** The simulator that just finished. + + +### +Handles completion of a thread's simulation cycle. +> #### Parameters +> **simulator:** The simulator that just completed its cycle. + + +### +Handles the exception generated by a simulator. +> #### Parameters +> **simulator:** The simulator that generated the exception. + +> **ex:** The Exception generated. + + +### +Locks the vessel resource durations so that we can query them. Be sure to call UnlockResourceDurations when done. + +### +Unlocks resource durations so that threads can operate on them. + +### +Returns the vessel resource definitions for the requested vessel. Be sure to call LockResourceDurations before calling this method. Be sure to call UnlockResourceDurations after you're done. +> #### Parameters +> **vessel:** The vessel to query + +> #### Return value +> The resource durations for the specified vessel, or null if they don't exist. + +### +Determines whether or not the simulator had to assume that converters were on. +> #### Parameters +> **vessel:** The vessel to query + +> #### Return value +> true if the simulator couldn't determine activation state and had to assume converters were on; false if not. + +### +Removes the vessel resource durations for the specified vessel if they exist. Be sure to call LockResourceDurations before calling this method. Be sure to call UnlockResourceDurations after you're done. +> #### Parameters +> **vessel:** The vessel that will no longer have resource durations. + + +### +Adds a simulator to the job list. +> #### Parameters +> **simulator:** The SimSnacks simulator to add to the list. + + +### +Stops all current and pending jobs. + diff --git a/Snacks/bin/Release/Wiki/SnackSimThreadPool.md b/Snacks/bin/Release/Wiki/SnackSimThreadPool.md new file mode 100644 index 0000000..bf6eda9 --- /dev/null +++ b/Snacks/bin/Release/Wiki/SnackSimThreadPool.md @@ -0,0 +1,69 @@ + +This class handles simulator thread creation, data synching, and the job list.s + +## Fields + +### maxThreads +Max number of threads allowed +### jobList +List of simulator jobs waiting to be run +## Methods + + +### OnThreadSimulationComplete(Snacks.SimSnacks) +Handles the completion of a thread's simulation. +> #### Parameters +> **simulator:** The simulator that just finished. + + +### OnThreadSimulatorCycleComplete(Snacks.SimSnacks) +Handles completion of a thread's simulation cycle. +> #### Parameters +> **simulator:** The simulator that just completed its cycle. + + +### OnSimulatorException(Snacks.SimSnacks,System.Exception) +Handles the exception generated by a simulator. +> #### Parameters +> **simulator:** The simulator that generated the exception. + +> **ex:** The Exception generated. + + +### LockResourceDurations +Locks the vessel resource durations so that we can query them. Be sure to call UnlockResourceDurations when done. + +### UnlockResourceDurations +Unlocks resource durations so that threads can operate on them. + +### GetVesselResourceDurations(Vessel) +Returns the vessel resource definitions for the requested vessel. Be sure to call LockResourceDurations before calling this method. Be sure to call UnlockResourceDurations after you're done. +> #### Parameters +> **vessel:** The vessel to query + +> #### Return value +> The resource durations for the specified vessel, or null if they don't exist. + +### ConvertersAssumedActive(Vessel) +Determines whether or not the simulator had to assume that converters were on. +> #### Parameters +> **vessel:** The vessel to query + +> #### Return value +> true if the simulator couldn't determine activation state and had to assume converters were on; false if not. + +### RemoveVesselResourceDurations(Vessel) +Removes the vessel resource durations for the specified vessel if they exist. Be sure to call LockResourceDurations before calling this method. Be sure to call UnlockResourceDurations after you're done. +> #### Parameters +> **vessel:** The vessel that will no longer have resource durations. + + +### AddSimulatorJob(Snacks.SimSnacks) +Adds a simulator to the job list. +> #### Parameters +> **simulator:** The SimSnacks simulator to add to the list. + + +### StopAllJobs +Stops all current and pending jobs. + diff --git a/Snacks/bin/Release/Wiki/SnacksBackgroundConverter.md b/Snacks/bin/Release/Wiki/SnacksBackgroundConverter.md new file mode 100644 index 0000000..f10accb --- /dev/null +++ b/Snacks/bin/Release/Wiki/SnacksBackgroundConverter.md @@ -0,0 +1,82 @@ + +This class runs active converters in the background, consuming inputs, producing outputs, and yielding resources. + +## Fields + +### ConverterName +Name of the converter +### moduleName +Name of the converter part module. +### IsActivated +Flag indicating that the converter is active. +### isMissingResources +Flag indicating that the converter is missing resources. +### isContainerFull +Flag indicating that the container is full. +### inputEfficiency +The input efficiency. +### outputEfficiency +The output efficiency. +## Methods + + +### GetBackgroundConverters +Parses a vessel to find active converters to run in the background. +> #### Return value +> A map keyed by Vessel that has a list of running converters to run in the background. + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **protoPart:** The ProtPartSnapshot that hosts the converter. + +> **protoModule:** The ProtoPartModuleSnapshot representing the converter. + +> **moduleIndex:** The module index. + + +### Constructor +Initializes a new instance of the class. + +### CheckRequiredResources(ProtoVessel,System.Double) +Checks to be sure the vessel has the required resources. +> #### Parameters +> **vessel:** The Vessel to check. + +> **elapsedTime:** The seconds that have elapsed. + + +### ConsumeInputResources(ProtoVessel,System.Double) +Consumes the input resources. +> #### Parameters +> **vessel:** The Vessel to consume resources from. + +> **elapsedTime:** Converter elapsed time. + + +### ProduceOutputResources(ProtoVessel,System.Double) +Produces the output resources. +> #### Parameters +> **vessel:** The Vessel to add resources to. + +> **elapsedTime:** Converter elapsed time. + + +### ProduceyieldsList(ProtoVessel) +Produces the yield resources +> #### Parameters +> **vessel:** The Vessel to add resources to. + + +### PrepareToProcess(ProtoVessel) +Prepares the converter to process. +> #### Parameters +> **vessel:** The Vessel to check for preparations. + + +### PostProcess(ProtoVessel) +Handles post process tasks for the converter. +> #### Parameters +> **vessel:** The Vessel to update. + + diff --git a/Snacks/bin/Release/Wiki/SnacksBackroundEmailTypes.md b/Snacks/bin/Release/Wiki/SnacksBackroundEmailTypes.md new file mode 100644 index 0000000..7ef628c --- /dev/null +++ b/Snacks/bin/Release/Wiki/SnacksBackroundEmailTypes.md @@ -0,0 +1,20 @@ + +This enum specifies the diffent types of emails to send during background processing. + +## Fields + +### missingResources +The processor is missing an input resource. +### missingRequiredResource +The processor is missing a required resource. +### containerFull +The vessel is out of room. +### yieldCriticalFail +The yield experienced a critical failure. +### yieldCriticalSuccess +The yield has had a critical success. +### yieldLower +The yield amount was lower than normal. +### yieldNominal +The yield amount was normal. + diff --git a/Snacks/bin/Release/Wiki/SnacksConverter.md b/Snacks/bin/Release/Wiki/SnacksConverter.md new file mode 100644 index 0000000..2bf193e --- /dev/null +++ b/Snacks/bin/Release/Wiki/SnacksConverter.md @@ -0,0 +1,75 @@ + +An enhanced version of ModuleResourceConverter, the SnacksConverter offers a number of enhancements including producing resources after a set number of hours have elapsed (defined by YIELD_RESOURCES nodes), the ability to produce the yield resources based on the result of a random number generation, an optional flag that results in the part exploding as a result of a critical failure roll, an optional flag that can prevent the converter from being shut off, the ability to play effects, and the ability to be run in the background (when the vessel isn't loaded into the scene). + +## Fields + +### startEffect +Name of the effect to play when the converter starts. +### stopEffect +Name of the effect to play when the converter stops. +### runningEffect +Name of the effect to play while the converter is running. +### minimumVesselPercentEC +This is a threshold value to ensure that the converter will shut off if the vessel's ElectricCharge falls below the specified percentage. It is ignored if the converter doesn't use ElectricCharge. +### requiresHomeConnection +This flag tells the converter to check for a connection to the homeworld if set to true. If no connection is present, then the converter operations are suspended. It requires CommNet to be enabled. +### minimumCrew +This field specifies the minimum number of crew required to operate the converter. If the part lacks the minimum required crew, then operations are suspended. +### conditionSummary +This field specifies the condition summary to set when a kerbal enters the part and the converter is running. For example, the kerbal could be Relaxing. The condition summary appears in the kerbal's condition summary display. Certain conditions will result a loss of skills for the duration that the converter is running. For that to happen, be sure to define a SKILL_LOSS_CONDITION config node with the name of the condition. +### canBeShutdown +This field indicates whether or not the converter can be shut down. If set to false, then the converter will remove the shutdown and toggle actions and disable the shutdown button. +### ID +Unique ID of the converter. Used to identify it during background processing. +### dieRollMin +Minimum die roll +### dieRollMax +Maximum die roll +### minimumSuccess +On a roll of dieRollMin - dieRollMax, the minimum roll required to declare a successful resource yield. Set to 0 if you don't want to roll for success. +### criticalSuccess +On a roll of dieRollMin - dieRollMax, minimum roll for a resource yield to be declared a critical success. +### criticalFail +On a roll of dieRollMin - dieRollMax, the maximum roll for a resource yield to be declared a critical failure. +### hoursPerCycle +How many hours to wait before producing resources defined by YIELD_RESOURCE nodes. +### cycleStartTime +The time at which we started a new resource production cycle. +### progress +Current progress of the production cycle +### timeRemainingDisplay +Display field to show time remaining on the production cycle. +### lastAttempt +Results of the last production cycle attempt. +### criticalSuccessMultiplier +If the yield check is a critical success, multiply the units produced by this number. Default is 1.0. +### failureMultiplier +If the yield check is a failure, multiply the units produced by this number. Default is 1.0. +### explodeUponCriticalFail +Flag to indicate whether or not the part explodes if the yield roll critically fails. +### elapsedTime +The amount of time that has passed since the converter was last checked if it should produce yield resources. +### secondsPerCycle +The number of seconds per yield cycle. +### yieldsList +The list of resources to produce after the elapsedTime matches the secondsPerCycle. +### rosterInputList +Similar to an input list, this list contains the roster resources to consume during the converter's processing. +### rosterOutputList +Similar to an output list, this list contains the roster resources to produce during the converter's processing. +### missingResources +The converter is missing resources. If set to true then the converter's operations are suspended. +### crewEfficiencyBonus +The efficieny bonus of the crew. +## Methods + + +### PerformAnalysis +Performs the analysis roll to determine how many yield resources to produce. The roll must meet or exceed the minimumSuccess required in order to produce a nominal yield (the amount specified in a YIELD_RESOURCE's Ratio entry). If the roll fails, then a lower than normal yield is produced. If the roll exceeds the criticalSuccess number, then a higher than normal yield is produced. If the roll falls below the criticalFailure number, then no yield is produced, and the part will explode if the explodeUponCriticalFailure flag is set. + +### CalculateProgress +Calculates and updates the progress of the yield production cycle. + +### RemoveConditionIfNeeded +Removes the summaryCondition from all kerbals in the part if they have it set. + diff --git a/Snacks/bin/Release/Wiki/SnacksDisqualifier.md b/Snacks/bin/Release/Wiki/SnacksDisqualifier.md new file mode 100644 index 0000000..2fda8f8 --- /dev/null +++ b/Snacks/bin/Release/Wiki/SnacksDisqualifier.md @@ -0,0 +1,8 @@ + +This part module is designed to negate one or more preconditions so long as the kerbal resides in the part. An example would be a centrifuge + +## Fields + +### disqualifiedPreconditions +Contains the disqualified preconditions such as CheckGravityLevel.checkLesserOrEqual for low gravity checks. Separate disqualified preconditions by semicolon. Most of the preconditions can be disqualified simply by stating their name. If a precondition requires something different, be sure to check its documentation. + diff --git a/Snacks/bin/Release/Wiki/SnacksEVAResource.md b/Snacks/bin/Release/Wiki/SnacksEVAResource.md new file mode 100644 index 0000000..48dacc0 --- /dev/null +++ b/Snacks/bin/Release/Wiki/SnacksEVAResource.md @@ -0,0 +1,43 @@ + +When a kerbal goes on EVA, take this resource along and remove a corresponding amount from the vessel. Use the SNACKS_EVA_RESOURCE to define the resource to add. + +## Fields + +### resourceName +Name of the resource +### amount +Amount to add +### maxAmount +Max amount possible +### snacksEVAResource +The EVA resource that defines how many Snacks the kerbal gets. We track this so that we can update its amount and max amount based on game settings. +## Methods + + +### LoadEVAResources +Loads the SNACKS_EVA_RESOURCE config nodes, if any, and returns SnacksEVAResource objects. +> #### Return value +> A list of SnacksEVAResource objects. + +### onCrewBoardedVessel(Part,Part) +Handles the crew boarded event. The resource is removed from the kerbal and added to the vessel. +> #### Parameters +> **evaKerbal:** The kerbal that is returning from EVA + +> **boardedPart:** The part that the kerbal boarded + + +### onCrewEVA(Part,Part) +Handles the crew eva event. The kerbal gains the EVA resource and the vessel loses a corresponding amount. +> #### Parameters +> **evaKerbal:** The kerbal that went on EVA + +> **partExited:** The part that the kerbal exited + + +### addResourcesIfNeeded(Vessel) +If the loaded vessel's parts with crew capacity don't have the resource +> #### Parameters +> **vessel:** + + diff --git a/Snacks/bin/Release/Wiki/SnacksEvent.md b/Snacks/bin/Release/Wiki/SnacksEvent.md new file mode 100644 index 0000000..c206b5b --- /dev/null +++ b/Snacks/bin/Release/Wiki/SnacksEvent.md @@ -0,0 +1,92 @@ + +This class represents an "event" in Snacks. Events consist of one or more preconditions and one or more outcomes. Preconditions are things like random numbers, the pressence of specific conditions, and the like. All preconditions must be met before the event outcomes can be applied. The outcomes include all the Snacks penalties as well as other things such as setting conditions. + +## Fields + +### +Event is processed after the resource process cycle completes. +### +The event is chosen at random once per process cycle. +### +The event is processed when a kerbal levels up. +### eventCategory +The event's category +### affectedKerbals +The type of kerbals affected by the event. +### secondsBetweenChecks +Number of seconds that must pass before the event can be checked. +### daysBetweenChecks +The number of day that must pass before the event can be checked. Overrides secondsBetweenChecks. +### playerMessage +Player-friendly message to display when outcomes are going to be applied. +### name +Name of the event +## Methods + + +### Constructor +Initializes a new instance of the class. + +### Constructor +Initializes a new instance of the class. +> #### Parameters +> **node:** A ConfigNode specifying the initialization parameters. + + +### ApplyOutcomes(ProtoCrewMember,Vessel) +Applies outcomes to the supplied astronaut +> #### Parameters +> **astronaut:** The ProtoCrewMember to apply outcomes to. + +> **vessel:** The Vessel to check + + +### ApplyOutcomes(ProtoCrewMember) +Applies outcomes to the supplied astronaut +> #### Parameters +> **astronaut:** The ProtoCrewMember to apply outcomes to. + + +### PreconditionsValid(ProtoCrewMember,Vessel) +Checks all preconditions against the supplied astronaut +> #### Parameters +> **astronaut:** The ProtoCrewMember to check + +> **vessel:** The Vessel to check + +> #### Return value +> + +### PreconditionsValid(ProtoCrewMember) +Checks all preconditions against the supplied astronaut +> #### Parameters +> **astronaut:** The ProtoCrewMember to check + +> #### Return value +> + +### IsTimeToCheck(System.Double) +Determines if the event can be evaluated based on the supplied elapsed time. +> #### Parameters +> **elapsedTime:** The number of seconds that have passed since the last inquiry. + +> #### Return value +> true if it's time to evaluate the event, false if not. + +### ProcessEvent(System.Double) +Processes the event based on elapsed time, event type, and kerbals affected. +> #### Parameters +> **elapsedTime:** The elapsed time since the last process cycle, ignored for event cards. + + +### Load(ConfigNode) +Loads the persistent data. +> #### Parameters +> **node:** A ConfigNode with persistent data. + + +### Save +Saves the persistent data. +> #### Return value +> A ConfigNode with persistent data. + diff --git a/Snacks/bin/Release/Wiki/SnacksEventCategories.md b/Snacks/bin/Release/Wiki/SnacksEventCategories.md new file mode 100644 index 0000000..97b9afa --- /dev/null +++ b/Snacks/bin/Release/Wiki/SnacksEventCategories.md @@ -0,0 +1,12 @@ + +Enumerator specifying the different types of events + +## Fields + +### categoryPostProcessCycle +Event is processed after the resource process cycle completes. +### categoryEventCard +The event is chosen at random once per process cycle. +### categoryKerbalLevelUp +The event is processed when a kerbal levels up. + diff --git a/Snacks/bin/Release/Wiki/SnacksPartResource.md b/Snacks/bin/Release/Wiki/SnacksPartResource.md new file mode 100644 index 0000000..cb39216 --- /dev/null +++ b/Snacks/bin/Release/Wiki/SnacksPartResource.md @@ -0,0 +1,37 @@ + +When a part with crew capacity is loaded in the editor and it lacks this resource, or when a vessel is loaded into the scene and its parts with crew capacity lack this resource, add it to the part. Doesn’t apply to kerbals going on EVA. Use SNACKS_EVA_RESOURCE for that. Use the SNACKS_PART_RESOURCE to define resources to add. + +## Fields + +### resourceName +Name of the resource +### amount +Amount to add +### maxAmount +Max amount possible +### capacityAffectingModules +Parts with at least one of the modules on this list affect the part's capacity to store the resource (their equipment takes up additional space, for instance). +### capacityMultiplier +If a part has at least one part module on the capacityAffectingModules list then multiply resource amount and max amount by this multiplier. Default is 1.0 +### isPerKerbal +If true (which is the default), then amount and maxAmount added are multiplied by the part's crew capacity. +## Methods + + +### LoadPartResources +Loads the SNACKS_PART_RESOURCE config nodes, if any, and returns SnacksPartResource objects. +> #### Return value +> A list of SnacksPartResource objects. + +### addResourcesIfNeeded(Part) +If the part with crew capacity doesn't have the resource, then add it. +> #### Parameters +> **part:** + + +### addResourcesIfNeeded(Vessel) +If the loaded vessel's parts with crew capacity don't have the resource, then load it. +> #### Parameters +> **vessel:** + + diff --git a/Snacks/bin/Release/Wiki/SnacksProcessorResult.md b/Snacks/bin/Release/Wiki/SnacksProcessorResult.md new file mode 100644 index 0000000..6b918af --- /dev/null +++ b/Snacks/bin/Release/Wiki/SnacksProcessorResult.md @@ -0,0 +1,26 @@ + +This is a result that has data regarding what happened during resource consumption or production. + +## Fields + +### resourceName +Name of the resource that was processed. +### resultType +Type of result +### completedSuccessfully +Flag to indicate whether or not the process completed successfully. +### appliedPerCrew +Flag indicating if the process was applied per crew member. +### affectedKerbalCount +Number of kerbals affected by the process. +### currentAmount +Current amount of the resource in the vessel/kerbal. +### maxAmount +Max amount of the resource in the vessel/kerbal. +### crewCount +Current number of crew aboard the vessel +### crewCapacity +Total crew capacity. +### afftectedAstronauts +List of individual astronauts affected by the result. + diff --git a/Snacks/bin/Release/Wiki/SnacksResourceProcessor.md b/Snacks/bin/Release/Wiki/SnacksResourceProcessor.md new file mode 100644 index 0000000..4102121 --- /dev/null +++ b/Snacks/bin/Release/Wiki/SnacksResourceProcessor.md @@ -0,0 +1,4 @@ + +The SnacksResourceProcessor is a specialized version of the BaseResourceProcessor. It has the distict advantage of making use of the game settings for Snacks, whereas BaseResourceProcessor is entirely configured via config files. + + diff --git a/Snacks/bin/Release/Wiki/SnacksRosterRatio.md b/Snacks/bin/Release/Wiki/SnacksRosterRatio.md new file mode 100644 index 0000000..dcd8b22 --- /dev/null +++ b/Snacks/bin/Release/Wiki/SnacksRosterRatio.md @@ -0,0 +1,12 @@ + +The SnacksRosterRatio is a helper struct that is similar to a ResourceRatio, but it's designed for use with roster resources (characteristics of a kerbal). + +## Fields + +### ResourceName +The name of the resource. +### AmountPerDay +The amount per day. This value overwrites AmountPerSecond and is based on the homeworld's second per day. +### AmountPerSecond +The amount per second. + diff --git a/Snacks/bin/Release/Wiki/SnacksRosterResource.md b/Snacks/bin/Release/Wiki/SnacksRosterResource.md new file mode 100644 index 0000000..55f5e6c --- /dev/null +++ b/Snacks/bin/Release/Wiki/SnacksRosterResource.md @@ -0,0 +1,56 @@ + +This class represents a resource that's tied to individual kerbals instead of a part. One example is Stress, an abstracted habitation mechanic. + +## Fields + +### resourceName +The name of the roster resource. +### displayName +Public display name of the resource. +### showInSnapshot +Flag to indicate whether or not to show the resource in the Snapshots window. Default: true +### amount +The amount of resource available. +### maxAmount +The maximum amount of resource allowed. +### experienceBonusAmount +The amount of resource to add when the kerbal levels up. +### experienceBonusMaxAmount +The maximum amount of resource to add when the kerbal levels up. +## Methods + + +### onKerbalLevelUp(ProtoCrewMember) +Handles the kerbal level up event +> #### Parameters +> **astronaut:** The ProtoCrewMember that has leveled up. + + +### onCrewBoardedVessel(Part,Part) +Handles the crew boarded event. The resource is removed from the kerbal and added to the vessel. +> #### Parameters +> **evaKerbal:** The kerbal that is returning from EVA + +> **boardedPart:** The part that the kerbal boarded + + +### onCrewEVA(Part,Part) +Handles the crew eva event. The kerbal gains the EVA resource and the vessel loses a corresponding amount. +> #### Parameters +> **evaKerbal:** The kerbal that went on EVA + +> **partExited:** The part that the kerbal exited + + +### addResourceIfNeeded(ProtoCrewMember) +Adds the roster resource to the kerbal if needed +> #### Parameters +> **astronaut:** The ProtoCrewMember to check. + + +### addResourceIfNeeded(Vessel) +Adds the roster resource to the vessel's kerbal if needed +> #### Parameters +> **vessel:** The Vessel whose crew to check + + diff --git a/Snacks/bin/Release/Wiki/SnacksScenario.md b/Snacks/bin/Release/Wiki/SnacksScenario.md new file mode 100644 index 0000000..d04ca7d --- /dev/null +++ b/Snacks/bin/Release/Wiki/SnacksScenario.md @@ -0,0 +1,233 @@ + +The SnacksScenario class is the heart of Snacks. It runs all the processes. + +## Fields + +### onSnapshotsUpdated +Tells listeners that snapshots were created. +### onSimulatorCreated +Tells listeners that a simulator was created. Gives mods a chance to add custom converters not covered by Snacks. +### onBackgroundConvertersCreated +Tells listeners that background converters were created. Gives mods a chance to add custom converters not covered by Snacks. +### onSnackTime +Signifies that snacking has occurred. +### onRosterResourceUpdated +Signifies that the roster resource has been updated +### Instance +Instance of the scenario. +### LoggingEnabled +Flag indicating whether or not logging is enabled. +### sciencePenalties +Map of sciecnce penalties sorted by vessel. +### crewData +Map of astronaut data, keyed by astronaut name. +### exemptKerbals +List of kerbals that are exempt from outcome effects. +### cycleStartTime +Last time the processing cycle started. +### backgroundConverters +Map of the background conveters list, keyed by vessel. +### resourceProcessors +List of resource processors that handle life support consumption and waste production. +### snacksPartResources +List of resources that will be added to parts as they are created or loaded. +### snacksEVAResources +List of resources that are added to kerbals when they go on EVA. +### snapshotMap +Map of snapshots, keyed by vessel, that give a status of each vessel's visible life support resources and crew status. +### bodyVesselCountMap +Helper that gives a count, by celestial body id, of how many vessels are on or around the celestial body. +### rosterResources +Map of all roster resources to add to kerbals as they are created. +### lossOfSkillConditions +List of conditions that will cause a skill loss. These conditions are defined via SKILL_LOSS_CONDITION nodes. +### converterWatchlist +List of converters to watch for when creating snapshot simulations. +### simulatorSecondsPerCycle +How many simulated seconds pass per simulator cycle. +### maxSimulatorCycles +Maximum number of simulator cycles to run. +### maxThreads +Max number of simulator threads to create. +## Methods + + +### UpdateSnapshots +Updates the resource snapshots for each vessel in the game that isn't Debris, a Flag, a SpaceObject, or Unknown. + +### GetCrewCapacity(Vessel) +Returns the crew capacity of the vessel +> #### Parameters +> **vessel:** The Vessel to query. + +> #### Return value +> The crew capacity. + +### FixedUpdate +FixedUpdate handles all the processing tasks related to life support resources and event processing. + +### RunSnackCyleImmediately(System.Double) +Runs the snack cyle immediately. +> #### Parameters +> **secondsElapsed:** Seconds elapsed. + + +### FindVessel(ProtoCrewMember) +Finds the vessel that the kerbal is residing in. +> #### Parameters +> **astronaut:** The astronaut to check. + +> #### Return value +> The Vessel where the kerbal resides. + +### ShouldRemoveSkills(ProtoCrewMember) +Determines whether or not the kerbal's skills should be removed. +> #### Parameters +> **astronaut:** the ProtoCrewMember to investigate. + +> #### Return value +> true, if remove skills should be removed, false otherwise. + +### RemoveSkillsIfNeeded(ProtoCrewMember) +Removes the skills if needed. The supplied kerbal must have at least one condition registered in a SKILL_LOSS_CONDITION config node in order to remove the skills. +> #### Parameters +> **astronaut:** The kerbal to check. + + +### RestoreSkillsIfNeeded(ProtoCrewMember) +Restores the skills if needed. The kerbal in question must not have any conditions that would result in a loss of skill. +> #### Parameters +> **astronaut:** The kerbal to query. + + +### RemoveSkills(ProtoCrewMember) +Removes skills from the desired kerbal. Does not check to see if they should be removed based on condition summary. +> #### Parameters +> **astronaut:** The ProtoCrewMember to remove skills from. + + +### RestoreSkills(ProtoCrewMember) +Restores skills to the desired kerbal. Does not check to see if they can be restored based on condition summary. +> #### Parameters +> **astronaut:** + + +### SetExemptCrew(System.String) +Adds the name of the kerbal to the exemptions list. +> #### Parameters +> **exemptedCrew:** The name of the kerbal to add to the list. + + +### RegisterCrew(Vessel) +Registers crew into the astronaut database. +> #### Parameters +> **vessel:** The vessel to search for crew. + + +### UnregisterCrew(ProtoVessel) +Unregisters the crew from the astronaut database. +> #### Parameters +> **protoVessel:** The vessel to search for crew to unregister. + + +### UnregisterCrew(Vessel) +Unregisters the crew from the astronaut database. +> #### Parameters +> **vessel:** The vessel to search for crew to unregister. + + +### RegisterCrew(ProtoCrewMember) +Registers the astronaut into the astronaut database. +> #### Parameters +> **astronaut:** The astronaut to register. + + +### UnregisterCrew(ProtoCrewMember) +Unregisters the astronaut from the astronaut database. +> #### Parameters +> **astronaut:** The astronaut to unregister. + + +### UnregisterCrew(Snacks.AstronautData) +Unregisters the astronaut data from the astronaut database. +> #### Parameters +> **data:** The astronaut data to unregister. + + +### GetNonExemptCrewCount(Vessel) +Returns the number of crew that aren't exempt. +> #### Parameters +> **vessel:** The vessel to query for crew. + +> #### Return value +> The number of victims. Er, number of non-exempt crew. + +### GetNonExemptCrew(Vessel) +Returns the non-exempt crew in the vessel. +> #### Parameters +> **vessel:** The Vessel to query. + +> #### Return value +> An array of ProtoCrewMember objects if there are non-exempt crew, or null if not. + +### GetAstronautData(ProtoCrewMember) +Returns the astronaut data associated with the astronaut. +> #### Parameters +> **astronaut:** The ProtoCrewMember to check for astronaut data. + +> #### Return value +> The AstronautData associated with the kerbal. + +### SetAstronautData(Snacks.AstronautData) +Saves the astronaut data into the database. +> #### Parameters +> **data:** The AstronautData to save. + + +### AddStressToCrew(Vessel,System.Single) +Adds the stress to crew if Stress is enabled. This is primarily used by 3rd party mods like BARIS. +> #### Parameters +> **vessel:** The Vessel to query for crew. + +> **stressAmount:** The amount of Stress to add. + + +### FormatTime(System.Double,System.Boolean) +Formats the supplied seconds into a string. +> #### Parameters +> **secondsToFormat:** The number of seconds to format. + +> **showCompact:** A flag to indicate whether or not to show the compact form. + +> #### Return value +> + +### GetSecondsPerDay +Gets the number of seconds per day on the homeworld. +> #### Return value +> The lenght of the solar day in seconds of the homeworld. + +### GetSolarFlux(Vessel) +Gets the solar flux based on vessel location. +> #### Parameters +> **vessel:** The vessel to query. + +> #### Return value +> The level of solar flux at the vessel's location. + +### CreatePrecondition(ConfigNode) +Creates a new precondition based on the config node data passed in. +> #### Parameters +> **node:** The ConfigNode containing data to parse. + +> #### Return value +> A BasePrecondition containing the precondition object, or null if the config node couldn't be parsed. + +### CreateOutcome(ConfigNode) +Creates a new outcome based on the config node data passed in. +> #### Parameters +> **node:** The ConfigNode containing data to parse. + +> #### Return value +> The outcome corresponding to the desired config. + diff --git a/Snacks/bin/Release/Wiki/SnacksUtils.md b/Snacks/bin/Release/Wiki/SnacksUtils.md new file mode 100644 index 0000000..139597f --- /dev/null +++ b/Snacks/bin/Release/Wiki/SnacksUtils.md @@ -0,0 +1,2 @@ + + diff --git a/Snacks/bin/Release/Wiki/Snackshot.md b/Snacks/bin/Release/Wiki/Snackshot.md new file mode 100644 index 0000000..4e1b2da --- /dev/null +++ b/Snacks/bin/Release/Wiki/Snackshot.md @@ -0,0 +1,18 @@ + +Represents a snapshot of the current and max units of a particular resource that is displayed in the Snapshots window. + +## Fields + +### resourceName +Name of the resource +### amount +Current amount in the vessel +### maxAmount +Max amount in the vessel +### showTimeRemaining +Flag to indicate whether to include the time remaining estimate in the display. +### isSimulatorRunning +Flag to indicate whether or not simulator is running. +### estimatedTimeRemaining +Estimated time remaining in seconds. + diff --git a/Snacks/bin/Release/Wiki/SoilRecycler.md b/Snacks/bin/Release/Wiki/SoilRecycler.md new file mode 100644 index 0000000..31b9386 --- /dev/null +++ b/Snacks/bin/Release/Wiki/SoilRecycler.md @@ -0,0 +1,8 @@ + +The SoilRecycler is designed to recycle Soil into Snacks. It is derived from SnacksProcessor (), which is derived from SnacksConverter. SoilRecycler config nodes should be calibrated to turn 1 Soil into 1 Snacks; game settings will adjust the recycler based on desired difficulty. + +## Fields + +### RecyclerCapacity +The number of kerbals that the recycler supports. + diff --git a/Snacks/bin/Release/Wiki/StressProcessor.md b/Snacks/bin/Release/Wiki/StressProcessor.md new file mode 100644 index 0000000..33cc1f7 --- /dev/null +++ b/Snacks/bin/Release/Wiki/StressProcessor.md @@ -0,0 +1,30 @@ + +The Stress processor is designed to work with the Stress roster resource. Essentially, Stress is an abstracted habitation mechanic that takes into account a variety of different events. The main thing that causes Stress is being aboard a vessel; you don't want to send kerbals to Jool in a Mk1 command pod! NASA allocates 25 m^3 of space per astronaut per year aboard the ISS, and Stress is based off that number. The larger the habitable volume, the greater a kerbal's maximum Stress becomes, and it's dynamically updated whenever a kerbal changes craft. Assuming no other events, a kerbal will accumulate 1 point of Stress per day, and when the kerbal reaches it's maximum Stress, bad things happen. + +## Fields + +### MaxSeatsForMultiplier +The first N seats use the multiplier instead of the N^3 formula. +### SpacePerSeatMultiplier +How much Space a single seat provides, assuming that the vessel's number of seats is less than or equal to MaxSeatsForMultiplier. +## Methods + + +### CalculateSpace(Vessel) +Calculates how much Space a vessel has. It is a function of crew capacity and is influenced by the number of crew currently aboard. +> #### Parameters +> **vessel:** The Vessel to query. + +> #### Return value +> The amount of Space aboard the vessel. + +### CalculateSpace(System.Int32,System.Int32) +Calculates how much Space a vessel has. It is a function of crew capacity and is influenced by the number of crew currently aboard. +> #### Parameters +> **crewCount:** Current crew count aboard the vessel + +> **crewCapacity:** Current crew capacity of the vessel + +> #### Return value +> The amount of Space aboard the vessel. + diff --git a/Snacks/bin/Release/Wiki/StressRosterResource.md b/Snacks/bin/Release/Wiki/StressRosterResource.md new file mode 100644 index 0000000..d21294e --- /dev/null +++ b/Snacks/bin/Release/Wiki/StressRosterResource.md @@ -0,0 +1,4 @@ + +This is a helper class to handle the unique conditions of a kerbal leveling up with the Stress resource. + + diff --git a/Snacks/bin/Release/vsE690.tmp b/Snacks/bin/Release/vsE690.tmp new file mode 100644 index 0000000..eecc8ae --- /dev/null +++ b/Snacks/bin/Release/vsE690.tmp @@ -0,0 +1,2982 @@ + + + + SnacksUtils + + + + + This precondition checks to see if a kerbal or vessel is in an environemnt with breathable air, and matches it with the expected parameter. + The vessel's celestial body must have an atmosphere with oxygen, and the vessel altitude must be between sea level and half the atmosphere height. + Example definition: + PRECONDITION + { + name = CheckBreathableAir + mustExist = false + } + + + + + Flag to indicate pressence (true) or absence (false) of the value to check. + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. parameters from the + class also apply. + + + + This precondition checks to see if a kerbal's experience level matches the desired value and type of check to make. For instance you could check to see if a kerbal is above 3 stars. + Example definition: + PRECONDITION + { + name = CheckSkillLevel + valueToCheck = 3 + checkType = checkGreaterOrEqual //Default value + } + + + + + The value to check for + + + + + Type of check to make + Default: checkGreaterOrEqual + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. parameters from the + class also apply. + + + + This precondition checks to see if a kerbal's skill matches the desired parameter. For instance, you could check to see if a kerbal has the ScienceSkill. + Example definition: + PRECONDITION + { + name = CheckSkill + skillToCheck = ScienceSkill + mustExist = true + } + + + + + Name of the skill to check + + + + + Flag to indicate pressence (true) or absence (false) of the value to check. + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. parameters from the + class also apply. + + + + This precondition checks to see if a kerbal's trait matches the desired parameter. For instance, you could check to see if a kerbal is an Engineer. + Example definition: + PRECONDITION + { + name = CheckTrait + traitToCheck = Engineer + mustExist = true + } + + + + + Name of the trait to check + + + + + Flag to indicate pressence (true) or absence (false) of the value to check. + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. parameters from the + class also apply. + + + + This precondition checks to see if a kerbal's courage matches the desired value and type of check to make. + Example definition: + PRECONDITION + { + name = CheckCourage + valueToCheck = 0.5 + checkType = checkEquals //Default value + } + + + + + The value to check for + + + + + Type of check to make + Default: checkEquals + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. parameters from the + class also apply. + + + + This precondition checks to see if a kerbal's stupidity matches the desired value and type of check to make. + Example definition: + PRECONDITION + { + name = CheckStupidity + valueToCheck = 0.5 + checkType = checkEquals //Default value + } + + + + + The value to check for + + + + + Type of check to make + Default: checkEquals + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. parameters from the + class also apply. + + + + + Flag to indicate pressence (true) or absence (false) of the value to check. + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. parameters from the + class also apply. + + + + This precondition checks to see if a vessel's crew count matches the desired parameter. + Example definition: + PRECONDITION + { + name = CheckCrewCount + valueToCheck = 1 + checkType = checkEquals //Default value + } + + + + + The value to check for + + + + + Type of check to make + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. parameters from the + class also apply. + + + + This precondition checks to see if a kerbal's badass status against the badassExists flag. Both must match in order for the precondition to be validated. + Example definition: + PRECONDITION + { + name = CheckBadass + mustExist = true + } + + + + + Flag to indicate pressence (true) or absence (false) of the value to check. + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. parameters from the + class also apply. + + + + This precondition checks the vessel status against the supplied parameters. + Example definition: + PRECONDITION + { + name = CheckVesselStatus + situation = LANDED + situation = SPLASHED + } + + + + + List of situations to check the vessel against. In the config file, separate each situation to check on + a separate line. + Ex: + situation = LANDED + situation = SPLASHED + Valid situations: LANDED, SPLASHED, ESCAPING, FLYING, ORBITING, SUB_ORBITAL, PRELAUNCH + + + + + Optional name of the planetary body where the vessel must be located. + + + + + Optional altitude in meters that the vessel must be at. + + + + + The type of check to make against metersAltitude. + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. parameters from the + class also apply. + + + + This precondition checks to see if a vessel or roster resource meets the supplied parameters. Gravity checks can be negated by setting CheckGravityLevel.checkType, where checkType is one + of the conditional qualifiers. For instance, CheckGravityLevel.checkLesserOrEqual will disqualify any microgravity event checks and is useful for centrifuges. + Example definition: + PRECONDITION + { + name = CheckGravityLevel + valueToCheck = 0.1 + checkType = checkLesserOrEqual //Default value + } + + + + + The value to check for + + + + + The conditional type to use during the validation. + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. parameters from the + class also apply. + + + + This enum represents the key-value conditionals to check. + + + + + Key-value must be equal to the supplied value. + + + + + Key-value must not be equal to the supplied value. + + + + + Key-value must be greater than the supplied value. + + + + + Key-value must be less than the supplied value. + + + + + Key-value must be greater than or equal to the supplied value. + + + + + Key-value must be less than or equal to the supplied value. + + + + + This precondition Checks a kerbal's key-value and validates it against the supplied parameters. + Example definition: + PRECONDITION + { + name = CheckKeyValue + keyValueName = State + checkType = checkEquals + stringValue = Bored + } + + + + + Name of the key-value + + + + + String value of the key. Takes precedence over the int values. + + + + + Integer value of the key + + + + + Type of check to make + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. parameters from the + class also apply. + + + + This precondition Checks a kerbal's condition summary to see if it exists or not. The precondition is valid if the kerbal's condition summary matches the parameters of the precondition. + Example definition: + PRECONDITION + { + name = CheckCondition + conditionSummary = Sleepy + mustExist = true + } + + + + + Name of the condition to check + + + + + Flag to indicate pressence (true) or absence (false) of the value to check. + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. parameters from the + class also apply. + + + + This precondition rolls a random die between a minimum and maximum value and compares it to a target number. If the roll meets or exceeds the target number then the precondition passes. + Example definition: + PRECONDITION + { + name = CheckRandomChance + dieRollMin = 1 + dieRollMax = 1000 + targetNumber = 999 + } + + + + + Minimum value on the die roll + + + + + Maximum value on the die roll + + + + + Target number required to declare the precondition valid. + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. parameters from the + class also apply. + + + + Enumerator with the type of results to check. + + + + + Check for a successful consumption + + + + + Check for a consumption failure + + + + + Check for a production success + + + + + Check for a production failure + + + + + This precondition checks the specified processor for desired results. + Example definition: + PRECONDITION + { + name = CheckProcessorResult + type = resultConsumptionFailure + processorName = Snacks! + resourceName = Snacks + cyclesRequired = 1 + } + + + + + The type of result to check + + + + + The name of the processor to check + + + + + The name of the resource to check + + + + + The number of process cycles to check + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. parameters from the + class also apply. + + + + This outcome removes the desired key-value from the affected kerbals + Example definition: + OUTCOME + { + name = ClearKeyValues + conditionSummary = Sick + } + + + + + Name of the key-value + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. Parameters in the + class also apply. + + + + This outcome removes the desired condition on the affected kerbals + Example definition: + OUTCOME + { + name = ClearCondition + conditionSummary = Sick + } + + + + + Name of the condition to set + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. Parameters in the + class also apply. + + + + This outcome consumes the specified resource in the desired amount. It can be a vessel resource or a roster resource. + Example definition: + OUTCOME + { + name = ConsumeResource + resourceName = Stress + amount = 1 + } + + + + + Name of the resource to produce + + + + + Optional minimum value of random amount to produce. + + + + + Optional maximum value of random amount to produce. + + + + + Amount of resource to consume. Takes presedence over randomMin and randomMax + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. Parameters in the + class also apply. + + + + A precondition is a check of some type that prevents outcomes from being applied unless the precondition's check suceeds. + + + + + Name of the precondition. + + + + + Initializes a new instance of the class. + + A ConfigNode specifying the initialization parameters. + + + + Determines if the precondition is valid. + + The ProtoCrewModule to check. + The Vessel to check + + + + + Determines if the precondition is valid. + + The ProtoCrewModule to check. + + + + + This outcome sets a condition on the affected kerbals. If that condition is defined in a + SKILL_LOSS_CONDITION config node, then the kerbals' skills will be removed until the + condition is cleared. + Example definition: + OUTCOME + { + name = ClearCondition + conditionSummary = Stressed Out + } + + + + + The name of the condition to set. If defined in a SKILL_LOSS_CONDITION node then the affected kerbals + will lose their skills until the condition is cleared. + + + + + Initializes a new instance of the class. + + The name of the condition to set. It must be added to a SKILL_LOSS_CONDITION + config node in order for the kerbal to lose its skills. + If set to true it can be randomly selected from the outcomes list. + A string containing the bad news. + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. Parameters in the + class also apply. + + + + This outcome produces the specified resource in the desired amount. It can be a vessel resource or a roster resource. + Example definition: + OUTCOME + { + name = ProduceResource + resourceName = Stress + amount = 1 + } + + + + + Name of the resource to produce + + + + + Optional minimum value of random amount to produce. + + + + + Optional maximum value of random amount to produce. + + + + + Amount of resource to produce. Takes presedence over randomMin and randomMax + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. Parameters in the + class also apply. + + + + Initializes a new instance of the class. + + The name of the resource to produce. It can be a roster resource. + The amount of resource to produce + If set to true it can be randomly selected from the outcomes list. + A message for the player. + + + + This precondition checks to see if a vessel or roster resource meets the supplied parameters. + Example definition: + PRECONDITION + { + name = CheckResource + resourceName = Stress + checkType = checkEquals + valueToCheck = 3.0 + } + + + + + Name of the resource to check + + + + + The conditional type to use during the validation. + + + + + The value to check for + + + + + Flag to indicate whether or not to check the resource's max amount instead of the curren amount; + + + + + Flag to indicate whether or not to check the resource levels as a percentage. + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. parameters from the + class also apply. + + + + This class represents resources consumed or produced by a SnacksResourceProcessor. Consumption and production is applied vessel-wide, or to individual kerbal roster entries depending on the configuration. + If applied vessel-wide, the resource can be produced or consumed per kerbal. Finally, the resource can be displayed in the Snapshots view. + + + + + Name of the consumed/produced resource + + + + + Name of the dependency resource if the resource to process depends upon the results of another resource's process result. E.G. 1 unit of Soil is produced for 1 unt of Snacks consumed. + + + + + Flag to indicate whether or not the resource is applied to roster entries instead of parts and vessels. if set to true, then appliedPerCrew is ignored. + Default: false + + + + + Flag to indicate whether or not to show the resource in the Snapshots window. Ignored if isRosterResource is set to true. + Default: true + + + + + Flag to indicate whether or not a failure result applies the processor's outcomes. + Default: true + + + + + The amount of resource to consume or produce. If appliedPerCrew is true, then the amount consumed/produced is multiplied by the number of crew aboard the vessel. + If isRosterResource is true, then each individual crew member's roster entry will be affected instead. + Default: 0 + + + + + Flag to indicate that astronaut data should be cleared when a vessel is recovered. + Default: true + + + + + Loads the fields from the config node. + + A ConfigNode containing fields to load. + + + + Saves current values to a ConfigNode. + + A ConfigNode containing the field data. + + + + Consumes the resource. + + The vessel to work on + Elapsed seconds + Current crew count + Current crew capacity + A SnacksConsumerResult containing the resuls of the consumption. + + + + Produces the resource + + The vessel to work on + Elapsed seconds + Current crew count + Current crew capacity + Results of resource consumption. + A SnacksConsumerResult containing the resuls of the production. + + + + This is a result that has data regarding what happened during resource consumption or production. + + + + + Name of the resource that was processed. + + + + + Type of result + + + + + Flag to indicate whether or not the process completed successfully. + + + + + Flag indicating if the process was applied per crew member. + + + + + Number of kerbals affected by the process. + + + + + Current amount of the resource in the vessel/kerbal. + + + + + Max amount of the resource in the vessel/kerbal. + + + + + Current number of crew aboard the vessel + + + + + Total crew capacity. + + + + + List of individual astronauts affected by the result. + + + + + This is the base class for a resource processor. Similar to ModuleResourceConverter, the consumer will consume resources and produce resources, but it happens at the vessel level, not the part level. + It's also designed to work with both loaded and unloaded vessels. Another important difference is that consumed/produced resources can occur on a per crewmember basis; a vessel with 5 crew will + consume and/or produce 5 times the resources as a vessel with 1 crewmember. The configuration of a BaseResourceProcessor is done through config files. + + + + + Name of the resource processor + + + + + Number of seconds that must pass before running the consumer. + + + + + Handles the situation where the kerbal went on EVA. + + The kerbal that went on EVA. + The part that the kerbal left. + + + + Handles the situation where a kerbal boards a vessel. + + The kerbal boarding a vessel. + The part boarded. + + + + Handles adding of a new kerbal, giving the consumer a chance to add custom roster data. + + The kerbal being added. + + + + Handles removal of a kerbal, giving the consumer a chance to update custom data if needed. + + The kerbal being removed. + + + + Handles a kerbal's name change. + + The kerbal whose name has changed. Note that roster data is already being carried over, this event is used to give consumers a chance to update custom data kept outside of the roster. + The kerbal's previous name. + The kerbal's new name. + + + + Handles vessel loaded event, for instance, adding resources that should be on the vessel. + + The vessel that was loaded. + + + + Handles vessel dock/undock event. + + The vessel that was loaded. + + + + Handles the vessel recovery event + + The ProtoVessel being recovered + + + + Handles the situation where the vessel goes off rails. + + The Vessel going off rails + + + + Handles changes to game settings. + + + + + Retrieves the editor estimates for roster resources, if any. + + An int containing the current crew count. + An int containing the vessel's crew capacity. + A StringBuilder that will hold the results. + A ShipConstruct that is the current ship design in the editor. + + + + Loads the SNACKS_RESOURCE_PROCESSOR config nodes and returns a list of processors. + + A list of resource processors. + + + + Initializes the consumer + + + + + Cleanup as processor is about to be destroyed + + + + + De-serializes persistence data + + The ConfigNode with the persistence data + + + + Saves persistence data to a ConfigNode and returns it. + + A ConfigNode containing persistence data, if any. + + + + Used primarily for simulations, returns the consumed and produced resources for the given unit of time. + + The vessel to query for data. + The number of seconds to calculate total inputs and outputs. + The list of consumed resources to add the inputs to. + The list of produced resources to add the outputs to. + + + + Used primarily for simulations, returns the consumed and produced resources for the given unit of time. + + The number of crew to simulate. + The number of seconds to calculate total inputs and outputs. + The list of consumed resources to add the inputs to. + The list of produced resources to add the outputs to. + + + + Returns the amount and max amount of the desired resource in the unloaded vessel. + + The vessel to query for the resource totals. + The name of the resource to query. + The amount of the resource that the entire vessel has. + The max amount of the resource that the entire vessel has. + + + + Runs the processor, consuming input resources, producing output resources, and collating results. + + The vessel to run the consumer on. + Number of seconds that have passed. + Number of crew aboard the vessel. + The vessel's total crew capacity. + + + + This class contains data related to a kerbal. Information includes + roster resources (characteristics of the kerbal akin to Courage and Stupidity), + a condition summary specifying what states the kerbal is in, + a list of disqualified conditions that will auto-fail precondition checks, + a list of processor successes and failures, + a key-value map suitable for tracking states in the event system, + an exempt flag that exempts the kerbal from all outcomes. + + + + + Name of the kerbal. + + + + + The kerba's current experience trait. + + + + + Timestamp of when the astronaut data was last update. + + + + + Flag to indicate that the kerbal is exempt from outcomes. + + + + + Summary of all the conditions that the kerbal currently has. If a + condition in the summary is defined in a SKILL_LOSS_CONDITION config node, + then the kerbal will lose its skills until the condition is cleared. + + + + + A map of key-value pairs. + + + + + Map of successful process cycles. The key is the name of the processor, + the value is the number of successes. + + + + + Map of unsuccessfull process cycles. The key is the name of the processor, + the value is the number of failures. + + + + + A map of roster resources (characteristics of the kerbal), similar to + vessel resources. + + + + + Conditions that will automatically disqualify a precondition check. + + + + + List of resources that the kerbal uses. + + + + + Initializes a new instance of the class. + + + + + Loads the astronaut data from the config node supplied. + + A map keyed kerbal name that contains astronaut data. + The ConfigNode to read data from. + + + + Saves persistent astronaut data to the supplied config node. + + A map of astronaut data, keyed by kerbal name. + The ConfigNode to save the data to. + + + + Sets a disqualifier that will automatically fail a precondition check. + + The name of the disqualifier to set. + + + + Clears a disqualifier that will no longer fail a precondition check. + + The name of the disqualifier to clear. + + + + Sets a condition that could result in loss of skills if defined in a SKILL_LOSS_CONDITION config node. + The condition will appear in the kerbal's condition summary in the status window. + + The name of the condition to set. + + + + Clears a condition, removing it from the condition summary display. If the condition is defined in + a SKILL_LOSS_CONDITION config node, and the kerbal has no other conditions that result from skill loss, + then the kerbal will regain its skills. + + The name of the condition to clear. + + + + Sets the key/value pair. + + The key to use. + The value of the key. + + + + Returns the value for the desired key. + + A string containing the desired key. + A string with the value, or null if it doesn't exist. + + + + Returns the value for the desired key. + + A string containing the desired key. + A double with the value, or NaN if it doesn't exist. + + + + Removes the key/value pair. + + A string containing the key/value key to remove. + + + + Sets the resource to the desired amount and max amount. + + A string containing the name of the resource. + A double containing the resource amount. + A double containing the resource max amount. + + + + Retrieves the resource's amount and max amount if they exist. + + A string containing the name of the resource. + A double containing the amount of resource. + A double containing the max amount of the resource. + true if the resource was successfully retrieved, false if not. + + + + Removes the desired resource from the map. + + A string containing the name of the resource to remove. + + + + Determines whether or not the resource exists. + + A string containing the name of the resource. + true if the resource exists, false if not. + + + + This outcome causes affected kerbals to die. + Example definition: + OUTCOME + { + name = DeathPenalty + resourceName = Snacks + cyclesBeforeDeath = 10 + } + + + + + The name of the resource to check for failed processor cycles. + + + + + The number of cycles that must fail before the kerbal dies. + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. Parameters in the + class also apply. + + + + Initializes a new instance of the class. + + The name of the resource to check. If no processor has a failed cycle with the resource + then the outcome is invalidated. + The number of failed processor cycles required before applying the outcome. + A string containing the bad news for the player. + + + + This outcome causes affected kerbals to faint. + Example definition: + OUTCOME + { + name = FaintPenalty + resourceName = Snacks + cyclesBeforeFainting = 3 + faintDurationSeconds = 180 + } + + + + + The name of the resource to check for failed processor cycles. + + + + + The number of cycles that must fail before the kerbal faints. + + + + + The number of seconds that the kerbal will faint for. + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. Parameters in the + class also apply. + + + + Initializes a new instance of the class. + + The name of the resource to check. If none of the resource processors have failed cycles + containing the resource then the outcome is invalidated. + The number of failed cycles required before applying the outcome.. + Faint duration seconds. + A string containing the bad news for the player. + + + + This outcome fines the space agency by a certain amount per affected kerbal. + Example definition: + OUTCOME + { + name = FundingPenalty + finePerKerbal = 1000 + } + + + + + The amount of Funds to lose per kerbal. + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. Parameters in the + class also apply. + + + + Initializes a new instance of the class. + + If set to true the outcome can be randomly selected from the outcome list. + A string containing the bad news. + The amount of Funds lost per affected kerval. + + + + This class represents a resource that's tied to individual kerbals instead of a part. One example is Stress, an abstracted habitation mechanic. + + + + + The name of the roster resource. + + + + + Public display name of the resource. + + + + + Flag to indicate whether or not to show the resource in the Snapshots window. + Default: true + + + + + The amount of resource available. + + + + + The maximum amount of resource allowed. + + + + + + The amount of resource to add when the kerbal levels up. + + + + + The maximum amount of resource to add when the kerbal levels up. + + + + + Handles the kerbal level up event + + The ProtoCrewMember that has leveled up. + + + + Handles the crew boarded event. The resource is removed from the kerbal and added to the vessel. + + The kerbal that is returning from EVA + The part that the kerbal boarded + + + + Handles the crew eva event. The kerbal gains the EVA resource and the vessel loses a corresponding amount. + + The kerbal that went on EVA + The part that the kerbal exited + + + + Adds the roster resource to the kerbal if needed + + The ProtoCrewMember to check. + + + + Adds the roster resource to the vessel's kerbal if needed + + The Vessel whose crew to check + + + + This is a helper class to handle the unique conditions of a kerbal leveling up with the Stress resource. + + + + + The Stress processor is designed to work with the Stress roster resource. + Essentially, Stress is an abstracted habitation mechanic that takes + into account a variety of different events. The main thing that causes + Stress is being aboard a vessel; you don't want to send kerbals to Jool + in a Mk1 command pod! NASA allocates 25 m^3 of space per astronaut per + year aboard the ISS, and Stress is based off that number. The larger the + habitable volume, the greater a kerbal's maximum Stress becomes, and it's + dynamically updated whenever a kerbal changes craft. Assuming no other + events, a kerbal will accumulate 1 point of Stress per day, and when the + kerbal reaches it's maximum Stress, bad things happen. + + + + + The first N seats use the multiplier instead of the N^3 formula. + + + + + How much Space a single seat provides, assuming that the vessel's + number of seats is less than or equal to MaxSeatsForMultiplier. + + + + + Calculates how much Space a vessel has. It is a function of + crew capacity and is influenced by the number of crew currently + aboard. + + The amount of Space aboard the vessel. + The Vessel to query. + + + + Calculates how much Space a vessel has. It is a function of + crew capacity and is influenced by the number of crew currently + aboard. + + Current crew count aboard the vessel + Current crew capacity of the vessel + The amount of Space aboard the vessel. + + + + Enumerator specifying the different types of events + + + + + Event is processed after the resource process cycle completes. + + + + + The event is chosen at random once per process cycle. + + + + + The event is processed when a kerbal levels up. + + + + + Enumerator specifying which kerbals are affected by the preconditions. + + + + + A single available kerbal is chosen at random. + + + + + A single assigned kerbal is chosen at random. + + + + + All available kerbals are affected. + + + + + All assigned kerbals are affected. + + + + + A single random kerbal is chosesn amongst each crewed vessel. + + + + + This class represents an "event" in Snacks. Events consist of one or more preconditions and one or more outcomes. Preconditions are things like random numbers, the pressence of specific conditions, and the like. + All preconditions must be met before the event outcomes can be applied. The outcomes include all the Snacks penalties as well as other things such as setting conditions. + + + + + The event's category + + + + + The type of kerbals affected by the event. + + + + + Number of seconds that must pass before the event can be checked. + + + + + The number of day that must pass before the event can be checked. Overrides secondsBetweenChecks. + + + + + Player-friendly message to display when outcomes are going to be applied. + + + + + Name of the event + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + A ConfigNode specifying the initialization parameters. + + + + Applies outcomes to the supplied astronaut + + The ProtoCrewMember to apply outcomes to. + The Vessel to check + + + + Applies outcomes to the supplied astronaut + + The ProtoCrewMember to apply outcomes to. + + + + Checks all preconditions against the supplied astronaut + + The ProtoCrewMember to check + The Vessel to check + + + + + Checks all preconditions against the supplied astronaut + + The ProtoCrewMember to check + + + + + Determines if the event can be evaluated based on the supplied elapsed time. + + The number of seconds that have passed since the last inquiry. + true if it's time to evaluate the event, false if not. + + + + Processes the event based on elapsed time, event type, and kerbals affected. + + The elapsed time since the last process cycle, ignored for event cards. + + + + Loads the persistent data. + + A ConfigNode with persistent data. + + + + Saves the persistent data. + + A ConfigNode with persistent data. + + + + This outcome sets the desired condition on the affected kerbals + Example definition: + OUTCOME + { + name = SetCondition + conditionSummary = Sick + } + + + + + Name of the condition to set + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. Parameters in the + class also apply. + + + + This outcome sets the desired key-vale on the affected kerbals + Example definition: + OUTCOME + { + name = SetKeyValue + keyValueName = DaysBored + intValue = 1 + } + + + + + Name of the key-value + + + + + String value of the key. Takes precedence over the int values. + + + + + Integer value of the key + + + + + Integer value to add to the existing key value. If key doesn't exist then it will be set to this value instead. Taks precedence over intValue. + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. Parameters in the + class also apply. + + + + This part module is designed to negate one or more preconditions so long as the kerbal resides in the part. + An example would be a centrifuge + + + + + Contains the disqualified preconditions such as CheckGravityLevel.checkLesserOrEqual for low gravity checks. Separate disqualified preconditions by semicolon. + Most of the preconditions can be disqualified simply by stating their name. If a precondition requires something different, be sure to check its documentation. + + + + + Number of science penalties to apply when the vessel becomes active. + + + + + This outcome reduces the space agency's reputation based on the supplied parameters. + Example definition: + OUTCOME + { + name = RepPenalty + repLossPerKerbal = 5 + } + + + + + The rep loss per kerbal. + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. Parameters in the + class also apply. + + + + Initializes a new instance of the class. + + If set to true it can be randomly selected from the outcomes list. + Rep loss per kerbal. + A string containing the bad news. + + + + This outcome disrupts science experiments aboard a vessel. + Example definition: + OUTCOME + { + name = SciencePenalty + } + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. Parameters in the + class also apply. + + + + Initializes a new instance of the class. + + If set to true it can be randomly selected from the outcomes list. + + + + Interface for creating and running penalties when a processor resource runs out or has too much aboard the vessel or kerbal. + + + + + Indicates whether or not the penalty is enabled. + + true if inabled, false if not. + + + + Indicates whether or not the penalty is always applied instead of randomly chosen. + + true if the penalty should always be applied, false if not. + + + + Applies the penalty to the affected kerbals + + An int containing the number of kerbals affected by the penalty. + The vessel to apply the penalty to. + + + + Removes penalty effects. + + The vessel to remove the penalt effects from. + + + + Handles changes in game settings, if any. + + + + + The SnacksScenario class is the heart of Snacks. It runs all the processes. + + + + + Tells listeners that snapshots were created. + + + + + Tells listeners that a simulator was created. Gives mods a chance to add custom converters not covered by Snacks. + + + + + Tells listeners that background converters were created. Gives mods a chance to add custom converters not covered by Snacks. + + + + + Signifies that snacking has occurred. + + + + + Signifies that the roster resource has been updated + + + + + Instance of the scenario. + + + + + Flag indicating whether or not logging is enabled. + + + + + Map of sciecnce penalties sorted by vessel. + + + + + Map of astronaut data, keyed by astronaut name. + + + + + List of kerbals that are exempt from outcome effects. + + + + + Last time the processing cycle started. + + + + + Map of the background conveters list, keyed by vessel. + + + + + List of resource processors that handle life support consumption and waste production. + + + + + List of resources that will be added to parts as they are created or loaded. + + + + + List of resources that are added to kerbals when they go on EVA. + + + + + Map of snapshots, keyed by vessel, that give a status of each vessel's visible life support resources and crew status. + + + + + Helper that gives a count, by celestial body id, of how many vessels are on or around the celestial body. + + + + + Map of all roster resources to add to kerbals as they are created. + + + + + List of conditions that will cause a skill loss. These conditions are defined via SKILL_LOSS_CONDITION nodes. + + + + + List of converters to watch for when creating snapshot simulations. + + + + + How many simulated seconds pass per simulator cycle. + + + + + Maximum number of simulator cycles to run. + + + + + Max number of simulator threads to create. + + + + + Updates the resource snapshots for each vessel in the game that isn't Debris, a Flag, a SpaceObject, or Unknown. + + + + + Returns the crew capacity of the vessel + + The crew capacity. + The Vessel to query. + + + + FixedUpdate handles all the processing tasks related to life support resources and event processing. + + + + + Runs the snack cyle immediately. + + Seconds elapsed. + + + + Finds the vessel that the kerbal is residing in. + + The Vessel where the kerbal resides. + The astronaut to check. + + + + Determines whether or not the kerbal's skills should be removed. + + true, if remove skills should be removed, false otherwise. + the ProtoCrewMember to investigate. + + + + Removes the skills if needed. The supplied kerbal must have at least one condition + registered in a SKILL_LOSS_CONDITION config node in order to remove the skills. + + The kerbal to check. + + + + Restores the skills if needed. The kerbal in question must not have any conditions that would result in a loss of skill. + + The kerbal to query. + + + + Removes skills from the desired kerbal. Does not check to see if they should be removed based on condition summary. + + The ProtoCrewMember to remove skills from. + + + + Restores skills to the desired kerbal. Does not check to see if they can be restored based on condition summary. + + + + + + Adds the name of the kerbal to the exemptions list. + + The name of the kerbal to add to the list. + + + + Registers crew into the astronaut database. + + The vessel to search for crew. + + + + Unregisters the crew from the astronaut database. + + The vessel to search for crew to unregister. + + + + Unregisters the crew from the astronaut database. + + The vessel to search for crew to unregister. + + + + Registers the astronaut into the astronaut database. + + The astronaut to register. + + + + Unregisters the astronaut from the astronaut database. + + The astronaut to unregister. + + + + Unregisters the astronaut data from the astronaut database. + + The astronaut data to unregister. + + + + Returns the number of crew that aren't exempt. + + The vessel to query for crew. + The number of victims. Er, number of non-exempt crew. + + + + Returns the non-exempt crew in the vessel. + + The Vessel to query. + An array of ProtoCrewMember objects if there are non-exempt crew, or null if not. + + + + Returns the astronaut data associated with the astronaut. + + The ProtoCrewMember to check for astronaut data. + The AstronautData associated with the kerbal. + + + + Saves the astronaut data into the database. + + The AstronautData to save. + + + + Adds the stress to crew if Stress is enabled. This is primarily + used by 3rd party mods like BARIS. + + The Vessel to query for crew. + The amount of Stress to add. + + + + Formats the supplied seconds into a string. + + The number of seconds to format. + A flag to indicate whether or not to show the compact form. + + + + + Gets the number of seconds per day on the homeworld. + + The lenght of the solar day in seconds of the homeworld. + + + + Gets the solar flux based on vessel location. + + The vessel to query. + The level of solar flux at the vessel's location. + + + + Creates a new precondition based on the config node data passed in. + + The ConfigNode containing data to parse. + A BasePrecondition containing the precondition object, or null if the config node couldn't be parsed. + + + + Creates a new outcome based on the config node data passed in. + + The outcome corresponding to the desired config. + The ConfigNode containing data to parse. + + + + The SnacksProcessor grinds out Snacks from Ore. It is derived from the SnacksConverter. The output of the + processor is affected by the game settings. + + + + + A status field showing the daily output of Snacks. + + + + + Helper field describing the original output ratio of Snacks. + + + + + Helper field to describe the original input ratio of Ore + + + + + Gets the daily snacks output. + + The amount of Snacks produced daily, subjected to game settings. + + + + This enum specifies the diffent types of emails to send during background processing. + + + + + The processor is missing an input resource. + + + + + The processor is missing a required resource. + + + + + The vessel is out of room. + + + + + The yield experienced a critical failure. + + + + + The yield has had a critical success. + + + + + The yield amount was lower than normal. + + + + + The yield amount was normal. + + + + + This class runs active converters in the background, consuming inputs, producing outputs, and yielding resources. + + + + + Name of the converter + + + + + Name of the converter part module. + + + + + Flag indicating that the converter is active. + + + + + Flag indicating that the converter is missing resources. + + + + + Flag indicating that the container is full. + + + + + The input efficiency. + + + + + The output efficiency. + + + + + Flag to indicate that the player has been emailed. Used so we don't spam the player's inbox. + + + + + Parses a vessel to find active converters to run in the background. + + A map keyed by Vessel that has a list of running converters to run in the background. + + + + Initializes a new instance of the class. + + The ProtPartSnapshot that hosts the converter. + The ProtoPartModuleSnapshot representing the converter. + The module index. + + + + Initializes a new instance of the class. + + + + + Checks to be sure the vessel has the required resources. + + The Vessel to check. + The seconds that have elapsed. + + + + Consumes the input resources. + + The Vessel to consume resources from. + Converter elapsed time. + + + + Produces the output resources. + + The Vessel to add resources to. + Converter elapsed time. + + + + Produces the yield resources + + The Vessel to add resources to. + + + + Prepares the converter to process. + + The Vessel to check for preparations. + + + + Handles post process tasks for the converter. + + The Vessel to update. + + + + The SnacksRosterRatio is a helper struct that is similar to a ResourceRatio, + but it's designed for use with roster resources (characteristics of a kerbal). + + + + + The name of the resource. + + + + + The amount per day. This value overwrites AmountPerSecond and is based + on the homeworld's second per day. + + + + + The amount per second. + + + + + An enhanced version of ModuleResourceConverter, the SnacksConverter offers a number of enhancements including + producing resources after a set number of hours have elapsed (defined by YIELD_RESOURCES nodes), the ability to + produce the yield resources based on the result of a random number generation, an optional flag that results in the part + exploding as a result of a critical failure roll, an optional flag that can prevent the converter from being + shut off, the ability to play effects, and the ability to be run in the background (when the vessel isn't loaded + into the scene). + + + + + Name of the effect to play when the converter starts. + + + + + Name of the effect to play when the converter stops. + + + + + Name of the effect to play while the converter is running. + + + + + This field describes how much ElectricCharge is consumed per second. A negative number indicates consumption. + + + + + This is a threshold value to ensure that the converter will shut off if the vessel's + ElectricCharge falls below the specified percentage. It is ignored if the converter doesn't + use ElectricCharge. + + + + + This flag tells the converter to check for a connection to the homeworld if set to true. + If no connection is present, then the converter operations are suspended. It requires + CommNet to be enabled. + + + + + This field specifies the minimum number of crew required to operate the converter. If the part + lacks the minimum required crew, then operations are suspended. + + + + + This field specifies the condition summary to set when a kerbal enters the part and the converter is + running. For example, the kerbal could be Relaxing. The condition summary appears in the kerbal's + condition summary display. Certain conditions will result a loss of skills for the duration that the + converter is running. For that to happen, be sure to define a SKILL_LOSS_CONDITION config node with + the name of the condition. + + + + + This field indicates whether or not the converter can be shut down. If set to false, then the converter + will remove the shutdown and toggle actions and disable the shutdown button. + + + + + Unique ID of the converter. Used to identify it during background processing. + + + + + Minimum die roll + + + + + Maximum die roll + + + + + On a roll of dieRollMin - dieRollMax, the minimum roll required to declare a successful resource yield. Set to 0 if you don't want to roll for success. + + + + + On a roll of dieRollMin - dieRollMax, minimum roll for a resource yield to be declared a critical success. + + + + + On a roll of dieRollMin - dieRollMax, the maximum roll for a resource yield to be declared a critical failure. + + + + + How many hours to wait before producing resources defined by YIELD_RESOURCE nodes. + + + + + The time at which we started a new resource production cycle. + + + + + Current progress of the production cycle + + + + + Display field to show time remaining on the production cycle. + + + + + Results of the last production cycle attempt. + + + + + If the yield check is a critical success, multiply the units produced by this number. Default is 1.0. + + + + + If the yield check is a failure, multiply the units produced by this number. Default is 1.0. + + + + + Flag to indicate whether or not the part explodes if the yield roll critically fails. + + + + + The amount of time that has passed since the converter was last checked if it should produce yield resources. + + + + + The number of seconds per yield cycle. + + + + + The list of resources to produce after the elapsedTime matches the secondsPerCycle. + + + + + Similar to an input list, this list contains the roster resources to consume during the + converter's processing. + + + + + Similar to an output list, this list contains the roster resources to produce during the converter's processing. + + + + + The converter is missing resources. If set to true then the converter's operations are suspended. + + + + + The efficieny bonus of the crew. + + + + + Performs the analysis roll to determine how many yield resources to produce. + The roll must meet or exceed the minimumSuccess required in order to produce a nominal + yield (the amount specified in a YIELD_RESOURCE's Ratio entry). If the roll fails, + then a lower than normal yield is produced. If the roll exceeds the criticalSuccess number, + then a higher than normal yield is produced. If the roll falls below the criticalFailure number, + then no yield is produced, and the part will explode if the explodeUponCriticalFailure flag is set. + + + + + Calculates and updates the progress of the yield production cycle. + + + + + Removes the summaryCondition from all kerbals in the part if they have it set. + + + + + The SnacksResourceProcessor is a specialized version of the BaseResourceProcessor. It has the distict advantage of making use of the game settings for Snacks, whereas BaseResourceProcessor + is entirely configured via config files. + + + + + When a part with crew capacity is loaded in the editor and it lacks this resource, or when a vessel is loaded into the scene and its parts with crew capacity lack this resource, + add it to the part. Doesn’t apply to kerbals going on EVA. Use SNACKS_EVA_RESOURCE for that. Use the SNACKS_PART_RESOURCE to define resources to add. + + + + + Name of the resource + + + + + Amount to add + + + + + Max amount possible + + + + + How many units per day that will be consumed. Overrides amount and maxAmount. + For Snacks, this is dynamically calculated based on game settings for Snacks per meal and meals per day. + + + + + Specifies how many days of life support to provide. + + + + + Parts with at least one of the modules on this list affect the part's capacity to store the resource (their equipment takes up additional space, for instance). + + + + + If a part has at least one part module on the capacityAffectingModules list then multiply resource amount and max amount by this multiplier. Default is 1.0 + + + + + If true (which is the default), then amount and maxAmount added are multiplied by the part's crew capacity. + + + + + Loads the SNACKS_PART_RESOURCE config nodes, if any, and returns SnacksPartResource objects. + + A list of SnacksPartResource objects. + + + + If the part with crew capacity doesn't have the resource, then add it. + + + + + + If the loaded vessel's parts with crew capacity don't have the resource, then load it. + + + + + + When a kerbal goes on EVA, take this resource along and remove a corresponding amount from the vessel. Use the SNACKS_EVA_RESOURCE to define the resource to add. + + + + + Name of the resource + + + + + Amount to add + + + + + Max amount possible + + + + + When the resource amount drops to or below this value, display the warning message. + + + + + Message to display when the kerbal's resource has dropped to or below the warningAmount. + + + + + The EVA resource that defines how many Snacks the kerbal gets. We track this so that we can update its amount and max amount based on game settings. + + + + + Loads the SNACKS_EVA_RESOURCE config nodes, if any, and returns SnacksEVAResource objects. + + A list of SnacksEVAResource objects. + + + + Handles the crew boarded event. The resource is removed from the kerbal and added to the vessel. + + The kerbal that is returning from EVA + The part that the kerbal boarded + + + + Handles the crew eva event. The kerbal gains the EVA resource and the vessel loses a corresponding amount. + + The kerbal that went on EVA + The part that the kerbal exited + + + + Represents a snapshot of the current and max units of a particular resource that is displayed in the Snapshots window. + + + + + Name of the resource + + + + + Current amount in the vessel + + + + + Max amount in the vessel + + + + + Flag to indicate whether to include the time remaining estimate in the display. + + + + + Flag to indicate whether or not simulator is running. + + + + + Estimated time remaining in seconds. + + + + + Flag to indicate whether or not the simulator was interrupted. + + + + + This class represents a single simulator job. It will check its job list for jobs to process and synchronize with other simulator jobs. + + + + + Starts the thread. + + + + + Stops all current and pending jobs and kills the thread. + + + + + Adds a simulator job to the job list. + + The simulator to add to the jobs list. + + + + Determines whether or not the simulator thread has jobs. + + true if the simulator has job, false if not. + + + + Clears all pending and running jobs. + + + + + This struct tracks vessel resources in the simulator. For the sake of simplicity, simulated resources aren't locked and are considered flow mode ALL_VESSEL. + + + + + This class is a simulated ModuleResourceConverter. It processes inputs, produces outputs, and when the time's up, generates yield resources. For the sake of simplicity, all vessel resources are available. + + + + + Processes resources, consuming inputs, producing outputs, and when time expires, producing yield resources. + For the purposes of simulation, we assume dumpExcess = true, yield resources always suceed, no heat generation, and no crew bonuses. + + The map of vessel resources to process. + The number of seconds per simulator cycle. + + + + Signifies that the converters have completed their run. + + The simulator that invoked the delegate method. + + + + Signifies that the consumers have completed their run. + + The simulator that invoked the delegate method. + + + + Signifies that the simulation cycle has completed. + + The simulator that invoked the delegate method. + + + + Signifies that the simulation has completed. + + The simulator that invoked the delegate method. + + + + Signifies that the simulation experienced an error. + + The simulator generating the error. + The Exception that was generated. + + + + Type of vessel being simulated + + + + + Context for how the simulator is being created. Typically used when Snacks fires an event to give mods a chance to add additional custom converters not covered by Snacks. + + + + + Type of vessel being simulated. + + + + + Vessel object for loaded/unloaded vessels being simulated. + + + + + Ship constructor for editor vessel being simulated. + + + + + This class determines how long consumed resources like Snacks will last by simulating resource consumption and simulating running converters like soil recyclers and snacks processors. + It is designed to allow for an arbitrary number of resource production chains and an arbitrary number of consumed resources. + + Conditions: + The only inputs allowed into the system are those consumed by kerbals. Ex: kerbals eat Snacks and produce Soil. + Resources aboard the vessel that aren't directly involved in resource consumption are fixed. Ex: Resource harvesters that produce Ore aren't accounted for. + Running simulations is computationally expensive. This class should be run in a thread. + + + + + Creates a simulator from the supplied ship construct + + A ShipConstruct to simulate + A SimSnacks simulator + + + + Creates a simulator from the proto vessel + + The unloaded vessel to query for resources and converters. + A SimSnacks simulator. + + + + Creates a simulator from a loaded vessel + + The Vessel object to query for resources and converters. + A SimSnacks simulator. + + + + This class handles simulator thread creation, data synching, and the job list.s + + + + + Max number of threads allowed + + + + + List of simulator jobs waiting to be run + + + + + Handles the completion of a thread's simulation. + + The simulator that just finished. + + + + Handles completion of a thread's simulation cycle. + + The simulator that just completed its cycle. + + + + Handles the exception generated by a simulator. + + The simulator that generated the exception. + The Exception generated. + + + + Locks the vessel resource durations so that we can query them. + Be sure to call UnlockResourceDurations when done. + + + + + Unlocks resource durations so that threads can operate on them. + + + + + Returns the vessel resource definitions for the requested vessel. + Be sure to call LockResourceDurations before calling this method. + Be sure to call UnlockResourceDurations after you're done. + + The vessel to query + The resource durations for the specified vessel, or null if they don't exist. + + + + Determines whether or not the simulator had to assume that converters were on. + + The vessel to query + true if the simulator couldn't determine activation state and had to assume converters were on; false if not. + + + + Removes the vessel resource durations for the specified vessel if they exist. + Be sure to call LockResourceDurations before calling this method. + Be sure to call UnlockResourceDurations after you're done. + + The vessel that will no longer have resource durations. + + + + Adds a simulator to the job list. + + The SimSnacks simulator to add to the list. + + + + Stops all current and pending jobs. + + + + + The SoilRecycler is designed to recycle Soil into Snacks. It is derived from SnacksProcessor (), + which is derived from SnacksConverter. SoilRecycler config nodes should be calibrated + to turn 1 Soil into 1 Snacks; game settings will adjust the recycler based on desired difficulty. + + + + + The number of kerbals that the recycler supports. + + + + + ID of the celestial body where the vessel is located. + + + + + Name of the vessel + + + + + Current number of crew in the vessel + + + + + Max number of crew in the vessel + + + + + Reference to the vessel itself + + + + + List of resource snapshots + + + + + Flag to indicate that the simulator couldn't determine if the converters were active, so it assumed that they were. + + + + + Returns the status of the vessel and its resources. + + A flag to indicate whether to show crew status instead of vessel resource status. + A string containing the vessel's status. + + + + The BaseOutcome class is the basis for all outcome processing. An outcome is used with the resource processors as well as + by the event system. It represents the consequences (or benefits) of a process result as well as the actions + to take when an event's preconditions are met. + + + + + Flag to indicate whether or not the outcome can be randomly selected. + Requires random outcomes to be turned on. If it isn't then the + outcome is always applied. + + + + + Flag to indicate whether or not to select a random crew member for the outcome + instead of applying the outcome to the entire crew. + + + + + Optional message to display to the player. + + + + + Optional list of child outcomes to apply when the parent outcome is applied. + Child outcomes use same vessel/kerbal as the parent. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. + + + + Initializes a new instance of the class. + + If set to true, the outcome can be randomly selected. + + + + Initializes a new instance of the class. + + If set to true, the outcome can be randomly selected. + A string containing a message to the player that is shown when the outcome + is applied.. + + + + Loads the configuration + + A ConfigNode containing data to load. + + + + Indicates whether or not the outcome is enabled. + + true if inabled, false if not. + + + + Applies the outcome to the vessel's crew + + The Vessel being processed. + The Result of the processing attempt. + + + + Removes the outcome from the vessel's crew. + + The Vessel to process. + A Bool indicating whether or not to inform the player. + + + diff --git a/Snacks/bin/Release/xmldoc2md.ps1 b/Snacks/bin/Release/xmldoc2md.ps1 new file mode 100644 index 0000000..f1cebc0 --- /dev/null +++ b/Snacks/bin/Release/xmldoc2md.ps1 @@ -0,0 +1,18 @@ +# xmldoc2md.ps1 +# By Jaime Olivares +# URL: http://github.com/jaime-olivares/xmldoc2md + +param ( + [string]$xml = $(throw "-xml is required."), + [string]$xsl = $(throw "-xsl is required."), + [string]$output = $(throw "-output is required.") +) + +# var = new XslCompiledTransform(true); +$xslt = New-Object -TypeName "System.Xml.Xsl.XslCompiledTransform" + +# xslt.Load(stylesheet); +$xslt.Load($xsl) + +# xslt.Transform(sourceFile, null, sw); +$xslt.Transform($xml, $output) diff --git a/Snacks/bin/Release/xmldoc2md.xml b/Snacks/bin/Release/xmldoc2md.xml new file mode 100644 index 0000000..c2b480b --- /dev/null +++ b/Snacks/bin/Release/xmldoc2md.xml @@ -0,0 +1,2992 @@ + + + + SnacksUtils + + + + + This precondition checks to see if a kerbal or vessel is in an environemnt with breathable air, and matches it with the expected parameter. + The vessel's celestial body must have an atmosphere with oxygen, and the vessel altitude must be between sea level and half the atmosphere height. + Example definition: + PRECONDITION + { + name = CheckBreathableAir + mustExist = false + } + + + + + Flag to indicate pressence (true) or absence (false) of the value to check. + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. parameters from the + class also apply. + + + + This precondition checks to see if a kerbal's experience level matches the desired value and type of check to make. For instance you could check to see if a kerbal is above 3 stars. + Example definition: + PRECONDITION + { + name = CheckSkillLevel + valueToCheck = 3 + checkType = checkGreaterOrEqual //Default value + } + + + + + The value to check for + + + + + Type of check to make + Default: checkGreaterOrEqual + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. parameters from the + class also apply. + + + + This precondition checks to see if a kerbal's skill matches the desired parameter. For instance, you could check to see if a kerbal has the ScienceSkill. + Example definition: + PRECONDITION + { + name = CheckSkill + skillToCheck = ScienceSkill + mustExist = true + } + + + + + Name of the skill to check + + + + + Flag to indicate pressence (true) or absence (false) of the value to check. + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. parameters from the + class also apply. + + + + This precondition checks to see if a kerbal's trait matches the desired parameter. For instance, you could check to see if a kerbal is an Engineer. + Example definition: + PRECONDITION + { + name = CheckTrait + traitToCheck = Engineer + mustExist = true + } + + + + + Name of the trait to check + + + + + Flag to indicate pressence (true) or absence (false) of the value to check. + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. parameters from the + class also apply. + + + + This precondition checks to see if a kerbal's courage matches the desired value and type of check to make. + Example definition: + PRECONDITION + { + name = CheckCourage + valueToCheck = 0.5 + checkType = checkEquals //Default value + } + + + + + The value to check for + + + + + Type of check to make + Default: checkEquals + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. parameters from the + class also apply. + + + + This precondition checks to see if a kerbal's stupidity matches the desired value and type of check to make. + Example definition: + PRECONDITION + { + name = CheckStupidity + valueToCheck = 0.5 + checkType = checkEquals //Default value + } + + + + + The value to check for + + + + + Type of check to make + Default: checkEquals + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. parameters from the + class also apply. + + + + + Flag to indicate pressence (true) or absence (false) of the value to check. + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. parameters from the + class also apply. + + + + This precondition checks to see if a vessel's crew count matches the desired parameter. + Example definition: + PRECONDITION + { + name = CheckCrewCount + valueToCheck = 1 + checkType = checkEquals //Default value + } + + + + + The value to check for + + + + + Type of check to make + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. parameters from the + class also apply. + + + + This precondition checks to see if a kerbal's badass status against the badassExists flag. Both must match in order for the precondition to be validated. + Example definition: + PRECONDITION + { + name = CheckBadass + mustExist = true + } + + + + + Flag to indicate pressence (true) or absence (false) of the value to check. + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. parameters from the + class also apply. + + + + This precondition checks the vessel status against the supplied parameters. + Example definition: + PRECONDITION + { + name = CheckVesselStatus + situation = LANDED + situation = SPLASHED + } + + + + + List of situations to check the vessel against. In the config file, separate each situation to check on + a separate line. + Ex: + situation = LANDED + situation = SPLASHED + Valid situations: LANDED, SPLASHED, ESCAPING, FLYING, ORBITING, SUB_ORBITAL, PRELAUNCH + + + + + Optional name of the planetary body where the vessel must be located. + + + + + Optional altitude in meters that the vessel must be at. + + + + + The type of check to make against metersAltitude. + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. parameters from the + class also apply. + + + + This precondition checks to see if a vessel or roster resource meets the supplied parameters. Gravity checks can be negated by setting CheckGravityLevel.checkType, where checkType is one + of the conditional qualifiers. For instance, CheckGravityLevel.checkLesserOrEqual will disqualify any microgravity event checks and is useful for centrifuges. + Example definition: + PRECONDITION + { + name = CheckGravityLevel + valueToCheck = 0.1 + checkType = checkLesserOrEqual //Default value + } + + + + + The value to check for + + + + + The conditional type to use during the validation. + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. parameters from the + class also apply. + + + + This enum represents the key-value conditionals to check. + + + + + Key-value must be equal to the supplied value. + + + + + Key-value must not be equal to the supplied value. + + + + + Key-value must be greater than the supplied value. + + + + + Key-value must be less than the supplied value. + + + + + Key-value must be greater than or equal to the supplied value. + + + + + Key-value must be less than or equal to the supplied value. + + + + + This precondition Checks a kerbal's key-value and validates it against the supplied parameters. + Example definition: + PRECONDITION + { + name = CheckKeyValue + keyValueName = State + checkType = checkEquals + stringValue = Bored + } + + + + + Name of the key-value + + + + + String value of the key. Takes precedence over the int values. + + + + + Integer value of the key + + + + + Type of check to make + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. parameters from the + class also apply. + + + + This precondition Checks a kerbal's condition summary to see if it exists or not. The precondition is valid if the kerbal's condition summary matches the parameters of the precondition. + Example definition: + PRECONDITION + { + name = CheckCondition + conditionSummary = Sleepy + mustExist = true + } + + + + + Name of the condition to check + + + + + Flag to indicate pressence (true) or absence (false) of the value to check. + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. parameters from the + class also apply. + + + + This precondition rolls a random die between a minimum and maximum value and compares it to a target number. If the roll meets or exceeds the target number then the precondition passes. + Example definition: + PRECONDITION + { + name = CheckRandomChance + dieRollMin = 1 + dieRollMax = 1000 + targetNumber = 999 + } + + + + + Minimum value on the die roll + + + + + Maximum value on the die roll + + + + + Target number required to declare the precondition valid. + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. parameters from the + class also apply. + + + + Enumerator with the type of results to check. + + + + + Check for a successful consumption + + + + + Check for a consumption failure + + + + + Check for a production success + + + + + Check for a production failure + + + + + This precondition checks the specified processor for desired results. + Example definition: + PRECONDITION + { + name = CheckProcessorResult + type = resultConsumptionFailure + processorName = Snacks! + resourceName = Snacks + cyclesRequired = 1 + } + + + + + The type of result to check + + + + + The name of the processor to check + + + + + The name of the resource to check + + + + + The number of process cycles to check + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. parameters from the + class also apply. + + + + This outcome removes the desired key-value from the affected kerbals + Example definition: + OUTCOME + { + name = ClearKeyValues + conditionSummary = Sick + } + + + + + Name of the key-value + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. Parameters in the + class also apply. + + + + This outcome removes the desired condition on the affected kerbals + Example definition: + OUTCOME + { + name = ClearCondition + conditionSummary = Sick + } + + + + + Name of the condition to set + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. Parameters in the + class also apply. + + + + This outcome consumes the specified resource in the desired amount. It can be a vessel resource or a roster resource. + Example definition: + OUTCOME + { + name = ConsumeResource + resourceName = Stress + amount = 1 + } + + + + + Name of the resource to produce + + + + + Optional minimum value of random amount to produce. + + + + + Optional maximum value of random amount to produce. + + + + + Amount of resource to consume. Takes presedence over randomMin and randomMax + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. Parameters in the + class also apply. + + + + A precondition is a check of some type that prevents outcomes from being applied unless the precondition's check suceeds. + + + + + Name of the precondition. + + + + + Initializes a new instance of the class. + + A ConfigNode specifying the initialization parameters. + + + + Determines if the precondition is valid. + + The ProtoCrewModule to check. + The Vessel to check + + + + + Determines if the precondition is valid. + + The ProtoCrewModule to check. + + + + + This outcome sets a condition on the affected kerbals. If that condition is defined in a + SKILL_LOSS_CONDITION config node, then the kerbals' skills will be removed until the + condition is cleared. + Example definition: + OUTCOME + { + name = ClearCondition + conditionSummary = Stressed Out + } + + + + + The name of the condition to set. If defined in a SKILL_LOSS_CONDITION node then the affected kerbals + will lose their skills until the condition is cleared. + + + + + Initializes a new instance of the class. + + The name of the condition to set. It must be added to a SKILL_LOSS_CONDITION + config node in order for the kerbal to lose its skills. + If set to true it can be randomly selected from the outcomes list. + A string containing the bad news. + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. Parameters in the + class also apply. + + + + This outcome produces the specified resource in the desired amount. It can be a vessel resource or a roster resource. + Example definition: + OUTCOME + { + name = ProduceResource + resourceName = Stress + amount = 1 + } + + + + + Name of the resource to produce + + + + + Optional minimum value of random amount to produce. + + + + + Optional maximum value of random amount to produce. + + + + + Amount of resource to produce. Takes presedence over randomMin and randomMax + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. Parameters in the + class also apply. + + + + Initializes a new instance of the class. + + The name of the resource to produce. It can be a roster resource. + The amount of resource to produce + If set to true it can be randomly selected from the outcomes list. + A message for the player. + + + + This precondition checks to see if a vessel or roster resource meets the supplied parameters. + Example definition: + PRECONDITION + { + name = CheckResource + resourceName = Stress + checkType = checkEquals + valueToCheck = 3.0 + } + + + + + Name of the resource to check + + + + + The conditional type to use during the validation. + + + + + The value to check for + + + + + Flag to indicate whether or not to check the resource's max amount instead of the curren amount; + + + + + Flag to indicate whether or not to check the resource levels as a percentage. + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. parameters from the + class also apply. + + + + This class represents resources consumed or produced by a SnacksResourceProcessor. Consumption and production is applied vessel-wide, or to individual kerbal roster entries depending on the configuration. + If applied vessel-wide, the resource can be produced or consumed per kerbal. Finally, the resource can be displayed in the Snapshots view. + + + + + Name of the consumed/produced resource + + + + + Name of the dependency resource if the resource to process depends upon the results of another resource's process result. E.G. 1 unit of Soil is produced for 1 unt of Snacks consumed. + + + + + Flag to indicate whether or not the resource is applied to roster entries instead of parts and vessels. if set to true, then appliedPerCrew is ignored. + Default: false + + + + + Flag to indicate whether or not to show the resource in the Snapshots window. Ignored if isRosterResource is set to true. + Default: true + + + + + Flag to indicate whether or not a failure result applies the processor's outcomes. + Default: true + + + + + The amount of resource to consume or produce. If appliedPerCrew is true, then the amount consumed/produced is multiplied by the number of crew aboard the vessel. + If isRosterResource is true, then each individual crew member's roster entry will be affected instead. + Default: 0 + + + + + Flag to indicate that astronaut data should be cleared when a vessel is recovered. + Default: true + + + + + Loads the fields from the config node. + + A ConfigNode containing fields to load. + + + + Saves current values to a ConfigNode. + + A ConfigNode containing the field data. + + + + Consumes the resource. + + The vessel to work on + Elapsed seconds + Current crew count + Current crew capacity + A SnacksConsumerResult containing the resuls of the consumption. + + + + Produces the resource + + The vessel to work on + Elapsed seconds + Current crew count + Current crew capacity + Results of resource consumption. + A SnacksConsumerResult containing the resuls of the production. + + + + This is a result that has data regarding what happened during resource consumption or production. + + + + + Name of the resource that was processed. + + + + + Type of result + + + + + Flag to indicate whether or not the process completed successfully. + + + + + Flag indicating if the process was applied per crew member. + + + + + Number of kerbals affected by the process. + + + + + Current amount of the resource in the vessel/kerbal. + + + + + Max amount of the resource in the vessel/kerbal. + + + + + Current number of crew aboard the vessel + + + + + Total crew capacity. + + + + + List of individual astronauts affected by the result. + + + + + This is the base class for a resource processor. Similar to ModuleResourceConverter, the consumer will consume resources and produce resources, but it happens at the vessel level, not the part level. + It's also designed to work with both loaded and unloaded vessels. Another important difference is that consumed/produced resources can occur on a per crewmember basis; a vessel with 5 crew will + consume and/or produce 5 times the resources as a vessel with 1 crewmember. The configuration of a BaseResourceProcessor is done through config files. + + + + + Name of the resource processor + + + + + Number of seconds that must pass before running the consumer. + + + + + Handles the situation where the kerbal went on EVA. + + The kerbal that went on EVA. + The part that the kerbal left. + + + + Handles the situation where a kerbal boards a vessel. + + The kerbal boarding a vessel. + The part boarded. + + + + Handles adding of a new kerbal, giving the consumer a chance to add custom roster data. + + The kerbal being added. + + + + Handles removal of a kerbal, giving the consumer a chance to update custom data if needed. + + The kerbal being removed. + + + + Handles a kerbal's name change. + + The kerbal whose name has changed. Note that roster data is already being carried over, this event is used to give consumers a chance to update custom data kept outside of the roster. + The kerbal's previous name. + The kerbal's new name. + + + + Handles vessel loaded event, for instance, adding resources that should be on the vessel. + + The vessel that was loaded. + + + + Handles vessel dock/undock event. + + The vessel that was loaded. + + + + Handles the vessel recovery event + + The ProtoVessel being recovered + + + + Handles the situation where the vessel goes off rails. + + The Vessel going off rails + + + + Handles changes to game settings. + + + + + Retrieves the editor estimates for roster resources, if any. + + An int containing the current crew count. + An int containing the vessel's crew capacity. + A StringBuilder that will hold the results. + A ShipConstruct that is the current ship design in the editor. + + + + Loads the SNACKS_RESOURCE_PROCESSOR config nodes and returns a list of processors. + + A list of resource processors. + + + + Initializes the consumer + + + + + Cleanup as processor is about to be destroyed + + + + + De-serializes persistence data + + The ConfigNode with the persistence data + + + + Saves persistence data to a ConfigNode and returns it. + + A ConfigNode containing persistence data, if any. + + + + Used primarily for simulations, returns the consumed and produced resources for the given unit of time. + + The vessel to query for data. + The number of seconds to calculate total inputs and outputs. + The list of consumed resources to add the inputs to. + The list of produced resources to add the outputs to. + + + + Used primarily for simulations, returns the consumed and produced resources for the given unit of time. + + The number of crew to simulate. + The number of seconds to calculate total inputs and outputs. + The list of consumed resources to add the inputs to. + The list of produced resources to add the outputs to. + + + + Returns the amount and max amount of the desired resource in the unloaded vessel. + + The vessel to query for the resource totals. + The name of the resource to query. + The amount of the resource that the entire vessel has. + The max amount of the resource that the entire vessel has. + + + + Runs the processor, consuming input resources, producing output resources, and collating results. + + The vessel to run the consumer on. + Number of seconds that have passed. + Number of crew aboard the vessel. + The vessel's total crew capacity. + + + + This class contains data related to a kerbal. Information includes + roster resources (characteristics of the kerbal akin to Courage and Stupidity), + a condition summary specifying what states the kerbal is in, + a list of disqualified conditions that will auto-fail precondition checks, + a list of processor successes and failures, + a key-value map suitable for tracking states in the event system, + an exempt flag that exempts the kerbal from all outcomes. + + + + + Name of the kerbal. + + + + + The kerba's current experience trait. + + + + + Timestamp of when the astronaut data was last update. + + + + + Flag to indicate that the kerbal is exempt from outcomes. + + + + + Summary of all the conditions that the kerbal currently has. If a + condition in the summary is defined in a SKILL_LOSS_CONDITION config node, + then the kerbal will lose its skills until the condition is cleared. + + + + + A map of key-value pairs. + + + + + Map of successful process cycles. The key is the name of the processor, + the value is the number of successes. + + + + + Map of unsuccessfull process cycles. The key is the name of the processor, + the value is the number of failures. + + + + + A map of roster resources (characteristics of the kerbal), similar to + vessel resources. + + + + + Conditions that will automatically disqualify a precondition check. + + + + + List of resources that the kerbal uses. + + + + + Initializes a new instance of the class. + + + + + Loads the astronaut data from the config node supplied. + + A map keyed kerbal name that contains astronaut data. + The ConfigNode to read data from. + + + + Saves persistent astronaut data to the supplied config node. + + A map of astronaut data, keyed by kerbal name. + The ConfigNode to save the data to. + + + + Sets a disqualifier that will automatically fail a precondition check. + + The name of the disqualifier to set. + + + + Clears a disqualifier that will no longer fail a precondition check. + + The name of the disqualifier to clear. + + + + Sets a condition that could result in loss of skills if defined in a SKILL_LOSS_CONDITION config node. + The condition will appear in the kerbal's condition summary in the status window. + + The name of the condition to set. + + + + Clears a condition, removing it from the condition summary display. If the condition is defined in + a SKILL_LOSS_CONDITION config node, and the kerbal has no other conditions that result from skill loss, + then the kerbal will regain its skills. + + The name of the condition to clear. + + + + Sets the key/value pair. + + The key to use. + The value of the key. + + + + Returns the value for the desired key. + + A string containing the desired key. + A string with the value, or null if it doesn't exist. + + + + Returns the value for the desired key. + + A string containing the desired key. + A double with the value, or NaN if it doesn't exist. + + + + Removes the key/value pair. + + A string containing the key/value key to remove. + + + + Sets the resource to the desired amount and max amount. + + A string containing the name of the resource. + A double containing the resource amount. + A double containing the resource max amount. + + + + Retrieves the resource's amount and max amount if they exist. + + A string containing the name of the resource. + A double containing the amount of resource. + A double containing the max amount of the resource. + true if the resource was successfully retrieved, false if not. + + + + Removes the desired resource from the map. + + A string containing the name of the resource to remove. + + + + Determines whether or not the resource exists. + + A string containing the name of the resource. + true if the resource exists, false if not. + + + + This outcome causes affected kerbals to die. + Example definition: + OUTCOME + { + name = DeathPenalty + resourceName = Snacks + cyclesBeforeDeath = 10 + } + + + + + The name of the resource to check for failed processor cycles. + + + + + The number of cycles that must fail before the kerbal dies. + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. Parameters in the + class also apply. + + + + Initializes a new instance of the class. + + The name of the resource to check. If no processor has a failed cycle with the resource + then the outcome is invalidated. + The number of failed processor cycles required before applying the outcome. + A string containing the bad news for the player. + + + + This outcome causes affected kerbals to faint. + Example definition: + OUTCOME + { + name = FaintPenalty + resourceName = Snacks + cyclesBeforeFainting = 3 + faintDurationSeconds = 180 + } + + + + + The name of the resource to check for failed processor cycles. + + + + + The number of cycles that must fail before the kerbal faints. + + + + + The number of seconds that the kerbal will faint for. + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. Parameters in the + class also apply. + + + + Initializes a new instance of the class. + + The name of the resource to check. If none of the resource processors have failed cycles + containing the resource then the outcome is invalidated. + The number of failed cycles required before applying the outcome.. + Faint duration seconds. + A string containing the bad news for the player. + + + + This outcome fines the space agency by a certain amount per affected kerbal. + Example definition: + OUTCOME + { + name = FundingPenalty + finePerKerbal = 1000 + } + + + + + The amount of Funds to lose per kerbal. + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. Parameters in the + class also apply. + + + + Initializes a new instance of the class. + + If set to true the outcome can be randomly selected from the outcome list. + A string containing the bad news. + The amount of Funds lost per affected kerval. + + + + This class represents a resource that's tied to individual kerbals instead of a part. One example is Stress, an abstracted habitation mechanic. + + + + + The name of the roster resource. + + + + + Public display name of the resource. + + + + + Flag to indicate whether or not to show the resource in the Snapshots window. + Default: true + + + + + The amount of resource available. + + + + + The maximum amount of resource allowed. + + + + + + The amount of resource to add when the kerbal levels up. + + + + + The maximum amount of resource to add when the kerbal levels up. + + + + + Handles the kerbal level up event + + The ProtoCrewMember that has leveled up. + + + + Handles the crew boarded event. The resource is removed from the kerbal and added to the vessel. + + The kerbal that is returning from EVA + The part that the kerbal boarded + + + + Handles the crew eva event. The kerbal gains the EVA resource and the vessel loses a corresponding amount. + + The kerbal that went on EVA + The part that the kerbal exited + + + + Adds the roster resource to the kerbal if needed + + The ProtoCrewMember to check. + + + + Adds the roster resource to the vessel's kerbal if needed + + The Vessel whose crew to check + + + + This is a helper class to handle the unique conditions of a kerbal leveling up with the Stress resource. + + + + + The Stress processor is designed to work with the Stress roster resource. + Essentially, Stress is an abstracted habitation mechanic that takes + into account a variety of different events. The main thing that causes + Stress is being aboard a vessel; you don't want to send kerbals to Jool + in a Mk1 command pod! NASA allocates 25 m^3 of space per astronaut per + year aboard the ISS, and Stress is based off that number. The larger the + habitable volume, the greater a kerbal's maximum Stress becomes, and it's + dynamically updated whenever a kerbal changes craft. Assuming no other + events, a kerbal will accumulate 1 point of Stress per day, and when the + kerbal reaches it's maximum Stress, bad things happen. + + + + + The first N seats use the multiplier instead of the N^3 formula. + + + + + How much Space a single seat provides, assuming that the vessel's + number of seats is less than or equal to MaxSeatsForMultiplier. + + + + + Calculates how much Space a vessel has. It is a function of + crew capacity and is influenced by the number of crew currently + aboard. + + The amount of Space aboard the vessel. + The Vessel to query. + + + + Calculates how much Space a vessel has. It is a function of + crew capacity and is influenced by the number of crew currently + aboard. + + Current crew count aboard the vessel + Current crew capacity of the vessel + The amount of Space aboard the vessel. + + + + Enumerator specifying the different types of events + + + + + Event is processed after the resource process cycle completes. + + + + + The event is chosen at random once per process cycle. + + + + + The event is processed when a kerbal levels up. + + + + + Enumerator specifying which kerbals are affected by the preconditions. + + + + + A single available kerbal is chosen at random. + + + + + A single assigned kerbal is chosen at random. + + + + + All available kerbals are affected. + + + + + All assigned kerbals are affected. + + + + + A single random kerbal is chosesn amongst each crewed vessel. + + + + + This class represents an "event" in Snacks. Events consist of one or more preconditions and one or more outcomes. Preconditions are things like random numbers, the pressence of specific conditions, and the like. + All preconditions must be met before the event outcomes can be applied. The outcomes include all the Snacks penalties as well as other things such as setting conditions. + + + + + The event's category + + + + + The type of kerbals affected by the event. + + + + + Number of seconds that must pass before the event can be checked. + + + + + The number of day that must pass before the event can be checked. Overrides secondsBetweenChecks. + + + + + Player-friendly message to display when outcomes are going to be applied. + + + + + Name of the event + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + A ConfigNode specifying the initialization parameters. + + + + Applies outcomes to the supplied astronaut + + The ProtoCrewMember to apply outcomes to. + The Vessel to check + + + + Applies outcomes to the supplied astronaut + + The ProtoCrewMember to apply outcomes to. + + + + Checks all preconditions against the supplied astronaut + + The ProtoCrewMember to check + The Vessel to check + + + + + Checks all preconditions against the supplied astronaut + + The ProtoCrewMember to check + + + + + Determines if the event can be evaluated based on the supplied elapsed time. + + The number of seconds that have passed since the last inquiry. + true if it's time to evaluate the event, false if not. + + + + Processes the event based on elapsed time, event type, and kerbals affected. + + The elapsed time since the last process cycle, ignored for event cards. + + + + Loads the persistent data. + + A ConfigNode with persistent data. + + + + Saves the persistent data. + + A ConfigNode with persistent data. + + + + This outcome sets the desired condition on the affected kerbals + Example definition: + OUTCOME + { + name = SetCondition + conditionSummary = Sick + } + + + + + Name of the condition to set + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. Parameters in the + class also apply. + + + + This outcome sets the desired key-vale on the affected kerbals + Example definition: + OUTCOME + { + name = SetKeyValue + keyValueName = DaysBored + intValue = 1 + } + + + + + Name of the key-value + + + + + String value of the key. Takes precedence over the int values. + + + + + Integer value of the key + + + + + Integer value to add to the existing key value. If key doesn't exist then it will be set to this value instead. Taks precedence over intValue. + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. Parameters in the + class also apply. + + + + This part module is designed to negate one or more preconditions so long as the kerbal resides in the part. + An example would be a centrifuge + + + + + Contains the disqualified preconditions such as CheckGravityLevel.checkLesserOrEqual for low gravity checks. Separate disqualified preconditions by semicolon. + Most of the preconditions can be disqualified simply by stating their name. If a precondition requires something different, be sure to check its documentation. + + + + + Number of science penalties to apply when the vessel becomes active. + + + + + This outcome reduces the space agency's reputation based on the supplied parameters. + Example definition: + OUTCOME + { + name = RepPenalty + repLossPerKerbal = 5 + } + + + + + The rep loss per kerbal. + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. Parameters in the + class also apply. + + + + Initializes a new instance of the class. + + If set to true it can be randomly selected from the outcomes list. + Rep loss per kerbal. + A string containing the bad news. + + + + This outcome disrupts science experiments aboard a vessel. + Example definition: + OUTCOME + { + name = SciencePenalty + } + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. Parameters in the + class also apply. + + + + Initializes a new instance of the class. + + If set to true it can be randomly selected from the outcomes list. + + + + Interface for creating and running penalties when a processor resource runs out or has too much aboard the vessel or kerbal. + + + + + Indicates whether or not the penalty is enabled. + + true if inabled, false if not. + + + + Indicates whether or not the penalty is always applied instead of randomly chosen. + + true if the penalty should always be applied, false if not. + + + + Applies the penalty to the affected kerbals + + An int containing the number of kerbals affected by the penalty. + The vessel to apply the penalty to. + + + + Removes penalty effects. + + The vessel to remove the penalt effects from. + + + + Handles changes in game settings, if any. + + + + + The SnacksScenario class is the heart of Snacks. It runs all the processes. + + + + + Tells listeners that snapshots were created. + + + + + Tells listeners that a simulator was created. Gives mods a chance to add custom converters not covered by Snacks. + + + + + Tells listeners that background converters were created. Gives mods a chance to add custom converters not covered by Snacks. + + + + + Signifies that snacking has occurred. + + + + + Signifies that the roster resource has been updated + + + + + Instance of the scenario. + + + + + Flag indicating whether or not logging is enabled. + + + + + Map of sciecnce penalties sorted by vessel. + + + + + Map of astronaut data, keyed by astronaut name. + + + + + List of kerbals that are exempt from outcome effects. + + + + + Last time the processing cycle started. + + + + + Map of the background conveters list, keyed by vessel. + + + + + List of resource processors that handle life support consumption and waste production. + + + + + List of resources that will be added to parts as they are created or loaded. + + + + + List of resources that are added to kerbals when they go on EVA. + + + + + Map of snapshots, keyed by vessel, that give a status of each vessel's visible life support resources and crew status. + + + + + Helper that gives a count, by celestial body id, of how many vessels are on or around the celestial body. + + + + + Map of all roster resources to add to kerbals as they are created. + + + + + List of conditions that will cause a skill loss. These conditions are defined via SKILL_LOSS_CONDITION nodes. + + + + + List of converters to watch for when creating snapshot simulations. + + + + + How many simulated seconds pass per simulator cycle. + + + + + Maximum number of simulator cycles to run. + + + + + Max number of simulator threads to create. + + + + + Updates the resource snapshots for each vessel in the game that isn't Debris, a Flag, a SpaceObject, or Unknown. + + + + + Returns the crew capacity of the vessel + + The crew capacity. + The Vessel to query. + + + + FixedUpdate handles all the processing tasks related to life support resources and event processing. + + + + + Runs the snack cyle immediately. + + Seconds elapsed. + + + + Finds the vessel that the kerbal is residing in. + + The Vessel where the kerbal resides. + The astronaut to check. + + + + Determines whether or not the kerbal's skills should be removed. + + true, if remove skills should be removed, false otherwise. + the ProtoCrewMember to investigate. + + + + Removes the skills if needed. The supplied kerbal must have at least one condition + registered in a SKILL_LOSS_CONDITION config node in order to remove the skills. + + The kerbal to check. + + + + Restores the skills if needed. The kerbal in question must not have any conditions that would result in a loss of skill. + + The kerbal to query. + + + + Removes skills from the desired kerbal. Does not check to see if they should be removed based on condition summary. + + The ProtoCrewMember to remove skills from. + + + + Restores skills to the desired kerbal. Does not check to see if they can be restored based on condition summary. + + + + + + Adds the name of the kerbal to the exemptions list. + + The name of the kerbal to add to the list. + + + + Registers crew into the astronaut database. + + The vessel to search for crew. + + + + Unregisters the crew from the astronaut database. + + The vessel to search for crew to unregister. + + + + Unregisters the crew from the astronaut database. + + The vessel to search for crew to unregister. + + + + Registers the astronaut into the astronaut database. + + The astronaut to register. + + + + Unregisters the astronaut from the astronaut database. + + The astronaut to unregister. + + + + Unregisters the astronaut data from the astronaut database. + + The astronaut data to unregister. + + + + Returns the number of crew that aren't exempt. + + The vessel to query for crew. + The number of victims. Er, number of non-exempt crew. + + + + Returns the non-exempt crew in the vessel. + + The Vessel to query. + An array of ProtoCrewMember objects if there are non-exempt crew, or null if not. + + + + Returns the astronaut data associated with the astronaut. + + The ProtoCrewMember to check for astronaut data. + The AstronautData associated with the kerbal. + + + + Saves the astronaut data into the database. + + The AstronautData to save. + + + + Adds the stress to crew if Stress is enabled. This is primarily + used by 3rd party mods like BARIS. + + The Vessel to query for crew. + The amount of Stress to add. + + + + Formats the supplied seconds into a string. + + The number of seconds to format. + A flag to indicate whether or not to show the compact form. + + + + + Gets the number of seconds per day on the homeworld. + + The lenght of the solar day in seconds of the homeworld. + + + + Gets the solar flux based on vessel location. + + The vessel to query. + The level of solar flux at the vessel's location. + + + + Creates a new precondition based on the config node data passed in. + + The ConfigNode containing data to parse. + A BasePrecondition containing the precondition object, or null if the config node couldn't be parsed. + + + + Creates a new outcome based on the config node data passed in. + + The outcome corresponding to the desired config. + The ConfigNode containing data to parse. + + + + The SnacksProcessor grinds out Snacks from Ore. It is derived from the SnacksConverter. The output of the + processor is affected by the game settings. + + + + + A status field showing the daily output of Snacks. + + + + + Helper field describing the original output ratio of Snacks. + + + + + Helper field to describe the original input ratio of Ore + + + + + Gets the daily snacks output. + + The amount of Snacks produced daily, subjected to game settings. + + + + This enum specifies the diffent types of emails to send during background processing. + + + + + The processor is missing an input resource. + + + + + The processor is missing a required resource. + + + + + The vessel is out of room. + + + + + The yield experienced a critical failure. + + + + + The yield has had a critical success. + + + + + The yield amount was lower than normal. + + + + + The yield amount was normal. + + + + + This class runs active converters in the background, consuming inputs, producing outputs, and yielding resources. + + + + + Name of the converter + + + + + Name of the converter part module. + + + + + Flag indicating that the converter is active. + + + + + Flag indicating that the converter is missing resources. + + + + + Flag indicating that the container is full. + + + + + The input efficiency. + + + + + The output efficiency. + + + + + Flag to indicate that the player has been emailed. Used so we don't spam the player's inbox. + + + + + Parses a vessel to find active converters to run in the background. + + A map keyed by Vessel that has a list of running converters to run in the background. + + + + Initializes a new instance of the class. + + The ProtPartSnapshot that hosts the converter. + The ProtoPartModuleSnapshot representing the converter. + The module index. + + + + Initializes a new instance of the class. + + + + + Checks to be sure the vessel has the required resources. + + The Vessel to check. + The seconds that have elapsed. + + + + Consumes the input resources. + + The Vessel to consume resources from. + Converter elapsed time. + + + + Produces the output resources. + + The Vessel to add resources to. + Converter elapsed time. + + + + Produces the yield resources + + The Vessel to add resources to. + + + + Prepares the converter to process. + + The Vessel to check for preparations. + + + + Handles post process tasks for the converter. + + The Vessel to update. + + + + The SnacksRosterRatio is a helper struct that is similar to a ResourceRatio, + but it's designed for use with roster resources (characteristics of a kerbal). + + + + + The name of the resource. + + + + + The amount per day. This value overwrites AmountPerSecond and is based + on the homeworld's second per day. + + + + + The amount per second. + + + + + An enhanced version of ModuleResourceConverter, the SnacksConverter offers a number of enhancements including + producing resources after a set number of hours have elapsed (defined by YIELD_RESOURCES nodes), the ability to + produce the yield resources based on the result of a random number generation, an optional flag that results in the part + exploding as a result of a critical failure roll, an optional flag that can prevent the converter from being + shut off, the ability to play effects, and the ability to be run in the background (when the vessel isn't loaded + into the scene). + + + + + Name of the effect to play when the converter starts. + + + + + Name of the effect to play when the converter stops. + + + + + Name of the effect to play while the converter is running. + + + + + This field describes how much ElectricCharge is consumed per second. A negative number indicates consumption. + + + + + This is a threshold value to ensure that the converter will shut off if the vessel's + ElectricCharge falls below the specified percentage. It is ignored if the converter doesn't + use ElectricCharge. + + + + + This flag tells the converter to check for a connection to the homeworld if set to true. + If no connection is present, then the converter operations are suspended. It requires + CommNet to be enabled. + + + + + This field specifies the minimum number of crew required to operate the converter. If the part + lacks the minimum required crew, then operations are suspended. + + + + + This field specifies the condition summary to set when a kerbal enters the part and the converter is + running. For example, the kerbal could be Relaxing. The condition summary appears in the kerbal's + condition summary display. Certain conditions will result a loss of skills for the duration that the + converter is running. For that to happen, be sure to define a SKILL_LOSS_CONDITION config node with + the name of the condition. + + + + + This field indicates whether or not the converter can be shut down. If set to false, then the converter + will remove the shutdown and toggle actions and disable the shutdown button. + + + + + Flag to indicate that the converter's part must be splashed in order to function. + + + + + Flag indicating that the converter requires an oxygenated atmosphere in order to run. + + + + + Unique ID of the converter. Used to identify it during background processing. + + + + + Minimum die roll + + + + + Maximum die roll + + + + + On a roll of dieRollMin - dieRollMax, the minimum roll required to declare a successful resource yield. Set to 0 if you don't want to roll for success. + + + + + On a roll of dieRollMin - dieRollMax, minimum roll for a resource yield to be declared a critical success. + + + + + On a roll of dieRollMin - dieRollMax, the maximum roll for a resource yield to be declared a critical failure. + + + + + How many hours to wait before producing resources defined by YIELD_RESOURCE nodes. + + + + + The time at which we started a new resource production cycle. + + + + + Current progress of the production cycle + + + + + Display field to show time remaining on the production cycle. + + + + + Results of the last production cycle attempt. + + + + + If the yield check is a critical success, multiply the units produced by this number. Default is 1.0. + + + + + If the yield check is a failure, multiply the units produced by this number. Default is 1.0. + + + + + Flag to indicate whether or not the part explodes if the yield roll critically fails. + + + + + The amount of time that has passed since the converter was last checked if it should produce yield resources. + + + + + The number of seconds per yield cycle. + + + + + The list of resources to produce after the elapsedTime matches the secondsPerCycle. + + + + + Similar to an input list, this list contains the roster resources to consume during the + converter's processing. + + + + + Similar to an output list, this list contains the roster resources to produce during the converter's processing. + + + + + The converter is missing resources. If set to true then the converter's operations are suspended. + + + + + The efficieny bonus of the crew. + + + + + Performs the analysis roll to determine how many yield resources to produce. + The roll must meet or exceed the minimumSuccess required in order to produce a nominal + yield (the amount specified in a YIELD_RESOURCE's Ratio entry). If the roll fails, + then a lower than normal yield is produced. If the roll exceeds the criticalSuccess number, + then a higher than normal yield is produced. If the roll falls below the criticalFailure number, + then no yield is produced, and the part will explode if the explodeUponCriticalFailure flag is set. + + + + + Calculates and updates the progress of the yield production cycle. + + + + + Removes the summaryCondition from all kerbals in the part if they have it set. + + + + + The SnacksResourceProcessor is a specialized version of the BaseResourceProcessor. It has the distict advantage of making use of the game settings for Snacks, whereas BaseResourceProcessor + is entirely configured via config files. + + + + + When a part with crew capacity is loaded in the editor and it lacks this resource, or when a vessel is loaded into the scene and its parts with crew capacity lack this resource, + add it to the part. Doesn’t apply to kerbals going on EVA. Use SNACKS_EVA_RESOURCE for that. Use the SNACKS_PART_RESOURCE to define resources to add. + + + + + Name of the resource + + + + + Amount to add + + + + + Max amount possible + + + + + How many units per day that will be consumed. Overrides amount and maxAmount. + For Snacks, this is dynamically calculated based on game settings for Snacks per meal and meals per day. + + + + + Specifies how many days of life support to provide. + + + + + Parts with at least one of the modules on this list affect the part's capacity to store the resource (their equipment takes up additional space, for instance). + + + + + If a part has at least one part module on the capacityAffectingModules list then multiply resource amount and max amount by this multiplier. Default is 1.0 + + + + + If true (which is the default), then amount and maxAmount added are multiplied by the part's crew capacity. + + + + + Loads the SNACKS_PART_RESOURCE config nodes, if any, and returns SnacksPartResource objects. + + A list of SnacksPartResource objects. + + + + If the part with crew capacity doesn't have the resource, then add it. + + + + + + If the loaded vessel's parts with crew capacity don't have the resource, then load it. + + + + + + When a kerbal goes on EVA, take this resource along and remove a corresponding amount from the vessel. Use the SNACKS_EVA_RESOURCE to define the resource to add. + + + + + Name of the resource + + + + + Amount to add + + + + + Max amount possible + + + + + When the resource amount drops to or below this value, display the warning message. + + + + + Message to display when the kerbal's resource has dropped to or below the warningAmount. + + + + + The EVA resource that defines how many Snacks the kerbal gets. We track this so that we can update its amount and max amount based on game settings. + + + + + Loads the SNACKS_EVA_RESOURCE config nodes, if any, and returns SnacksEVAResource objects. + + A list of SnacksEVAResource objects. + + + + Handles the crew boarded event. The resource is removed from the kerbal and added to the vessel. + + The kerbal that is returning from EVA + The part that the kerbal boarded + + + + Handles the crew eva event. The kerbal gains the EVA resource and the vessel loses a corresponding amount. + + The kerbal that went on EVA + The part that the kerbal exited + + + + Represents a snapshot of the current and max units of a particular resource that is displayed in the Snapshots window. + + + + + Name of the resource + + + + + Current amount in the vessel + + + + + Max amount in the vessel + + + + + Flag to indicate whether to include the time remaining estimate in the display. + + + + + Flag to indicate whether or not simulator is running. + + + + + Estimated time remaining in seconds. + + + + + Flag to indicate whether or not the simulator was interrupted. + + + + + This class represents a single simulator job. It will check its job list for jobs to process and synchronize with other simulator jobs. + + + + + Starts the thread. + + + + + Stops all current and pending jobs and kills the thread. + + + + + Adds a simulator job to the job list. + + The simulator to add to the jobs list. + + + + Determines whether or not the simulator thread has jobs. + + true if the simulator has job, false if not. + + + + Clears all pending and running jobs. + + + + + This struct tracks vessel resources in the simulator. For the sake of simplicity, simulated resources aren't locked and are considered flow mode ALL_VESSEL. + + + + + This class is a simulated ModuleResourceConverter. It processes inputs, produces outputs, and when the time's up, generates yield resources. For the sake of simplicity, all vessel resources are available. + + + + + Processes resources, consuming inputs, producing outputs, and when time expires, producing yield resources. + For the purposes of simulation, we assume dumpExcess = true, yield resources always suceed, no heat generation, and no crew bonuses. + + The map of vessel resources to process. + The number of seconds per simulator cycle. + + + + Signifies that the converters have completed their run. + + The simulator that invoked the delegate method. + + + + Signifies that the consumers have completed their run. + + The simulator that invoked the delegate method. + + + + Signifies that the simulation cycle has completed. + + The simulator that invoked the delegate method. + + + + Signifies that the simulation has completed. + + The simulator that invoked the delegate method. + + + + Signifies that the simulation experienced an error. + + The simulator generating the error. + The Exception that was generated. + + + + Type of vessel being simulated + + + + + Context for how the simulator is being created. Typically used when Snacks fires an event to give mods a chance to add additional custom converters not covered by Snacks. + + + + + Type of vessel being simulated. + + + + + Vessel object for loaded/unloaded vessels being simulated. + + + + + Ship constructor for editor vessel being simulated. + + + + + This class determines how long consumed resources like Snacks will last by simulating resource consumption and simulating running converters like soil recyclers and snacks processors. + It is designed to allow for an arbitrary number of resource production chains and an arbitrary number of consumed resources. + + Conditions: + The only inputs allowed into the system are those consumed by kerbals. Ex: kerbals eat Snacks and produce Soil. + Resources aboard the vessel that aren't directly involved in resource consumption are fixed. Ex: Resource harvesters that produce Ore aren't accounted for. + Running simulations is computationally expensive. This class should be run in a thread. + + + + + Creates a simulator from the supplied ship construct + + A ShipConstruct to simulate + A SimSnacks simulator + + + + Creates a simulator from the proto vessel + + The unloaded vessel to query for resources and converters. + A SimSnacks simulator. + + + + Creates a simulator from a loaded vessel + + The Vessel object to query for resources and converters. + A SimSnacks simulator. + + + + This class handles simulator thread creation, data synching, and the job list.s + + + + + Max number of threads allowed + + + + + List of simulator jobs waiting to be run + + + + + Handles the completion of a thread's simulation. + + The simulator that just finished. + + + + Handles completion of a thread's simulation cycle. + + The simulator that just completed its cycle. + + + + Handles the exception generated by a simulator. + + The simulator that generated the exception. + The Exception generated. + + + + Locks the vessel resource durations so that we can query them. + Be sure to call UnlockResourceDurations when done. + + + + + Unlocks resource durations so that threads can operate on them. + + + + + Returns the vessel resource definitions for the requested vessel. + Be sure to call LockResourceDurations before calling this method. + Be sure to call UnlockResourceDurations after you're done. + + The vessel to query + The resource durations for the specified vessel, or null if they don't exist. + + + + Determines whether or not the simulator had to assume that converters were on. + + The vessel to query + true if the simulator couldn't determine activation state and had to assume converters were on; false if not. + + + + Removes the vessel resource durations for the specified vessel if they exist. + Be sure to call LockResourceDurations before calling this method. + Be sure to call UnlockResourceDurations after you're done. + + The vessel that will no longer have resource durations. + + + + Adds a simulator to the job list. + + The SimSnacks simulator to add to the list. + + + + Stops all current and pending jobs. + + + + + The SoilRecycler is designed to recycle Soil into Snacks. It is derived from SnacksProcessor (), + which is derived from SnacksConverter. SoilRecycler config nodes should be calibrated + to turn 1 Soil into 1 Snacks; game settings will adjust the recycler based on desired difficulty. + + + + + The number of kerbals that the recycler supports. + + + + + ID of the celestial body where the vessel is located. + + + + + Name of the vessel + + + + + Current number of crew in the vessel + + + + + Max number of crew in the vessel + + + + + Reference to the vessel itself + + + + + List of resource snapshots + + + + + Flag to indicate that the simulator couldn't determine if the converters were active, so it assumed that they were. + + + + + Returns the status of the vessel and its resources. + + A flag to indicate whether to show crew status instead of vessel resource status. + A string containing the vessel's status. + + + + The BaseOutcome class is the basis for all outcome processing. An outcome is used with the resource processors as well as + by the event system. It represents the consequences (or benefits) of a process result as well as the actions + to take when an event's preconditions are met. + + + + + Flag to indicate whether or not the outcome can be randomly selected. + Requires random outcomes to be turned on. If it isn't then the + outcome is always applied. + + + + + Flag to indicate whether or not to select a random crew member for the outcome + instead of applying the outcome to the entire crew. + + + + + Optional message to display to the player. + + + + + Optional list of child outcomes to apply when the parent outcome is applied. + Child outcomes use same vessel/kerbal as the parent. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + A ConfigNode containing initialization parameters. + + + + Initializes a new instance of the class. + + If set to true, the outcome can be randomly selected. + + + + Initializes a new instance of the class. + + If set to true, the outcome can be randomly selected. + A string containing a message to the player that is shown when the outcome + is applied.. + + + + Loads the configuration + + A ConfigNode containing data to load. + + + + Indicates whether or not the outcome is enabled. + + true if inabled, false if not. + + + + Applies the outcome to the vessel's crew + + The Vessel being processed. + The Result of the processing attempt. + + + + Removes the outcome from the vessel's crew. + + The Vessel to process. + A Bool indicating whether or not to inform the player. + + + diff --git a/Snacks/bin/Release/xmldoc2md.xsl b/Snacks/bin/Release/xmldoc2md.xsl new file mode 100644 index 0000000..8940b4d --- /dev/null +++ b/Snacks/bin/Release/xmldoc2md.xsl @@ -0,0 +1,182 @@ + + + + + + + + + + + + # + + + + + + + + + + + + + + + + + + + + + # + + + + + + + ## Fields + + + + ### + + + + + + + + + ## Properties + + + + ### + + + + + + + + + ## Methods + + + + + + + + ### Constructor + + + + + ### + + + + + + + + + + + + + + > #### Parameters + + + + + > #### Return value + + + + + > #### Exceptions + + + + + > #### Example + > + + + + + + + + + + + + + + + + + + ` + + ` + + + + ``` + + ``` + + + + > **:** + + + + [External file]({@file}) + + + + + + + + > **:** + + + + * + + * + + + + **Permission:** ** + + + + > + + + + + > *See: * + + + + > *See also: + + + + diff --git a/Snacks/obj/Debug/.NETFramework,Version=v4.8.AssemblyAttributes.cs b/Snacks/obj/Debug/.NETFramework,Version=v4.8.AssemblyAttributes.cs new file mode 100644 index 0000000..15efebf --- /dev/null +++ b/Snacks/obj/Debug/.NETFramework,Version=v4.8.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] diff --git a/Snacks/obj/Debug/DesignTimeResolveAssemblyReferences.cache b/Snacks/obj/Debug/DesignTimeResolveAssemblyReferences.cache index 1f9682f..d8b8c63 100644 Binary files a/Snacks/obj/Debug/DesignTimeResolveAssemblyReferences.cache and b/Snacks/obj/Debug/DesignTimeResolveAssemblyReferences.cache differ diff --git a/Snacks/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/Snacks/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache index de23961..aa28978 100644 Binary files a/Snacks/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache and b/Snacks/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/Snacks/obj/Debug/Snacks.csproj.AssemblyReference.cache b/Snacks/obj/Debug/Snacks.csproj.AssemblyReference.cache index f5e894a..926e8f4 100644 Binary files a/Snacks/obj/Debug/Snacks.csproj.AssemblyReference.cache and b/Snacks/obj/Debug/Snacks.csproj.AssemblyReference.cache differ diff --git a/Snacks/obj/Debug/Snacks.csproj.CoreCompileInputs.cache b/Snacks/obj/Debug/Snacks.csproj.CoreCompileInputs.cache index 1c25b09..4178db0 100644 --- a/Snacks/obj/Debug/Snacks.csproj.CoreCompileInputs.cache +++ b/Snacks/obj/Debug/Snacks.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -b565bad45cdae4ca238c585fcf934c2fff352858 +59dac5170edeac447b0dceabae714f5a61131e2d diff --git a/Snacks/obj/Debug/Snacks.csproj.FileListAbsolute.txt b/Snacks/obj/Debug/Snacks.csproj.FileListAbsolute.txt index bc685d6..991fc07 100644 --- a/Snacks/obj/Debug/Snacks.csproj.FileListAbsolute.txt +++ b/Snacks/obj/Debug/Snacks.csproj.FileListAbsolute.txt @@ -110,3 +110,68 @@ C:\Projects\KSP\WildBlueIndustries\Snacks\Snacks\obj\Debug\Snacks.csproj.CopyCom C:\Projects\KSP\WildBlueIndustries\Snacks\Snacks\obj\Debug\SnacksUtils.dll C:\Projects\KSP\WildBlueIndustries\Snacks\Snacks\obj\Debug\SnacksUtils.pdb C:\Projects\KSP\WildBlueIndustries\Snacks\Snacks\obj\Debug\Snacks.csproj.AssemblyReference.cache +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\MarkdownSeparator.exe +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\xmldoc2md.xsl +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\RunMDSeparator.bat +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\RunPowershell.bat +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\xmldoc2md.ps1 +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\xmldoc2md.xml +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\SnacksUtils.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\SnacksUtils.pdb +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\UnityEngine.AudioModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\UnityEngine.ParticleSystemModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\KSPTrackIR.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\UnityEngine.UnityWebRequestModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\UnityEngine.AssetBundleModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\Mono.Cecil.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\UnityEngine.VehiclesModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\Ionic.Zip.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\UnityEngine.ScreenCaptureModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\Unity.Analytics.StandardEvents.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\UnityEngine.UnityAnalyticsModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\Unity.Analytics.DataPrivacy.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\UnityEngine.VRModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\UnityEngine.UnityWebRequestTextureModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\UnityEngine.UnityWebRequestAudioModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\UnityEngine.UnityWebRequestAssetBundleModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\UnityEngine.UnityWebRequestWWWModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\TDx.TDxInput.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\UnityEngine.Physics2DModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\UnityEngine.SharedInternalsModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\UnityEngine.TextCoreModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\UnityEngine.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\UnityEngine.JSONSerializeModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\UnityEngine.XRModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\UnityEngine.DSPGraphModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\UnityEngine.AndroidJNIModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\UnityEngine.AccessibilityModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\UnityEngine.UnityConnectModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\UnityEngine.AIModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\UnityEngine.PerformanceReportingModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\UnityEngine.ClothModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\UnityEngine.ClusterInputModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\UnityEngine.ClusterRendererModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\UnityEngine.CrashReportingModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\UnityEngine.TilemapModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\UnityEngine.TerrainModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\UnityEngine.VFXModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\UnityEngine.VideoModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\UnityEngine.GridModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\UnityEngine.SubsystemsModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\UnityEngine.LocalizationModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\UnityEngine.UNETModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\UnityEngine.DirectorModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\UnityEngine.GameCenterModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\UnityEngine.SpriteMaskModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\UnityEngine.StreamingModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\UnityEngine.TerrainPhysicsModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\UnityEngine.SpriteShapeModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\UnityEngine.WindModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\UnityEngine.ARModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\UnityEngine.InputModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Debug\KSPAssets.XmlSerializers.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\obj\Debug\Snacks.csproj.AssemblyReference.cache +D:\_work\_project\KSPMOD_Snacks\Snacks\obj\Debug\Snacks.csproj.CoreCompileInputs.cache +D:\_work\_project\KSPMOD_Snacks\Snacks\obj\Debug\Snacks.csproj.CopyComplete +D:\_work\_project\KSPMOD_Snacks\Snacks\obj\Debug\SnacksUtils.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\obj\Debug\SnacksUtils.pdb diff --git a/Snacks/obj/Debug/SnacksUtils.dll b/Snacks/obj/Debug/SnacksUtils.dll index 7d8d71c..0b6d668 100644 Binary files a/Snacks/obj/Debug/SnacksUtils.dll and b/Snacks/obj/Debug/SnacksUtils.dll differ diff --git a/Snacks/obj/Debug/SnacksUtils.pdb b/Snacks/obj/Debug/SnacksUtils.pdb index 8f10d37..5afd4a9 100644 Binary files a/Snacks/obj/Debug/SnacksUtils.pdb and b/Snacks/obj/Debug/SnacksUtils.pdb differ diff --git a/Snacks/obj/Debug/build.force b/Snacks/obj/Debug/build.force new file mode 100644 index 0000000..e69de29 diff --git a/Snacks/obj/Release/.NETFramework,Version=v4.5.AssemblyAttributes.cs b/Snacks/obj/Release/.NETFramework,Version=v4.5.AssemblyAttributes.cs new file mode 100644 index 0000000..e5dc9b8 --- /dev/null +++ b/Snacks/obj/Release/.NETFramework,Version=v4.5.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.5", FrameworkDisplayName = ".NET Framework 4.5")] diff --git a/Snacks/obj/Release/DesignTimeResolveAssemblyReferences.cache b/Snacks/obj/Release/DesignTimeResolveAssemblyReferences.cache new file mode 100644 index 0000000..0ddbbac Binary files /dev/null and b/Snacks/obj/Release/DesignTimeResolveAssemblyReferences.cache differ diff --git a/Snacks/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache b/Snacks/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..3a94dd9 Binary files /dev/null and b/Snacks/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/Snacks/obj/Release/Snacks.csproj.AssemblyReference.cache b/Snacks/obj/Release/Snacks.csproj.AssemblyReference.cache new file mode 100644 index 0000000..6041d06 Binary files /dev/null and b/Snacks/obj/Release/Snacks.csproj.AssemblyReference.cache differ diff --git a/Snacks/obj/Release/Snacks.csproj.CopyComplete b/Snacks/obj/Release/Snacks.csproj.CopyComplete new file mode 100644 index 0000000..e69de29 diff --git a/Snacks/obj/Release/Snacks.csproj.CoreCompileInputs.cache b/Snacks/obj/Release/Snacks.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..58cfc05 --- /dev/null +++ b/Snacks/obj/Release/Snacks.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +74ff250ffe55ab6a7134fe25f68122ceb4e90a6b diff --git a/Snacks/obj/Release/Snacks.csproj.FileListAbsolute.txt b/Snacks/obj/Release/Snacks.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..52cee2b --- /dev/null +++ b/Snacks/obj/Release/Snacks.csproj.FileListAbsolute.txt @@ -0,0 +1,65 @@ +D:\_work\_project\KSPMOD_Snacks\Snacks\obj\Release\Snacks.csproj.AssemblyReference.cache +D:\_work\_project\KSPMOD_Snacks\Snacks\obj\Release\Snacks.csproj.CoreCompileInputs.cache +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\MarkdownSeparator.exe +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\xmldoc2md.xsl +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\RunMDSeparator.bat +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\RunPowershell.bat +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\xmldoc2md.ps1 +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\SnacksUtils.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\SnacksUtils.pdb +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\UnityEngine.AudioModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\UnityEngine.ParticleSystemModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\KSPTrackIR.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\UnityEngine.UnityWebRequestModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\UnityEngine.AssetBundleModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\Mono.Cecil.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\UnityEngine.VehiclesModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\Ionic.Zip.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\UnityEngine.ScreenCaptureModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\Unity.Analytics.StandardEvents.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\UnityEngine.UnityAnalyticsModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\Unity.Analytics.DataPrivacy.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\UnityEngine.VRModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\UnityEngine.UnityWebRequestTextureModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\UnityEngine.UnityWebRequestAudioModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\UnityEngine.UnityWebRequestAssetBundleModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\UnityEngine.UnityWebRequestWWWModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\TDx.TDxInput.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\UnityEngine.Physics2DModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\UnityEngine.SharedInternalsModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\UnityEngine.TextCoreModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\UnityEngine.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\UnityEngine.JSONSerializeModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\UnityEngine.XRModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\UnityEngine.DSPGraphModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\UnityEngine.AndroidJNIModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\UnityEngine.AccessibilityModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\UnityEngine.UnityConnectModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\UnityEngine.AIModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\UnityEngine.PerformanceReportingModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\UnityEngine.ClothModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\UnityEngine.ClusterInputModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\UnityEngine.ClusterRendererModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\UnityEngine.CrashReportingModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\UnityEngine.TilemapModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\UnityEngine.TerrainModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\UnityEngine.VFXModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\UnityEngine.VideoModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\UnityEngine.GridModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\UnityEngine.SubsystemsModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\UnityEngine.LocalizationModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\UnityEngine.UNETModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\UnityEngine.DirectorModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\UnityEngine.GameCenterModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\UnityEngine.SpriteMaskModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\UnityEngine.StreamingModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\UnityEngine.TerrainPhysicsModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\UnityEngine.SpriteShapeModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\UnityEngine.WindModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\UnityEngine.ARModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\UnityEngine.InputModule.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\KSPAssets.XmlSerializers.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\obj\Release\Snacks.csproj.CopyComplete +D:\_work\_project\KSPMOD_Snacks\Snacks\obj\Release\SnacksUtils.dll +D:\_work\_project\KSPMOD_Snacks\Snacks\obj\Release\SnacksUtils.pdb +D:\_work\_project\KSPMOD_Snacks\Snacks\bin\Release\SnacksUtils.xml diff --git a/Snacks/obj/Release/SnacksUtils.dll b/Snacks/obj/Release/SnacksUtils.dll new file mode 100644 index 0000000..6a5aa22 Binary files /dev/null and b/Snacks/obj/Release/SnacksUtils.dll differ diff --git a/Snacks/obj/Release/SnacksUtils.pdb b/Snacks/obj/Release/SnacksUtils.pdb new file mode 100644 index 0000000..80e0fe8 Binary files /dev/null and b/Snacks/obj/Release/SnacksUtils.pdb differ diff --git a/Snacks/obj/Release/build.force b/Snacks/obj/Release/build.force new file mode 100644 index 0000000..e69de29 diff --git a/Snacks/obj/rele/.NETFramework,Version=v4.5.AssemblyAttributes.cs b/Snacks/obj/rele/.NETFramework,Version=v4.5.AssemblyAttributes.cs new file mode 100644 index 0000000..e5dc9b8 --- /dev/null +++ b/Snacks/obj/rele/.NETFramework,Version=v4.5.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.5", FrameworkDisplayName = ".NET Framework 4.5")] diff --git a/Snacks/obj/rele/DesignTimeResolveAssemblyReferencesInput.cache b/Snacks/obj/rele/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..6ca73f1 Binary files /dev/null and b/Snacks/obj/rele/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/Snacks/obj/rele/Snacks.csproj.AssemblyReference.cache b/Snacks/obj/rele/Snacks.csproj.AssemblyReference.cache new file mode 100644 index 0000000..895538d Binary files /dev/null and b/Snacks/obj/rele/Snacks.csproj.AssemblyReference.cache differ diff --git a/Snacks/obj/rele/build.force b/Snacks/obj/rele/build.force new file mode 100644 index 0000000..e69de29