diff --git a/FOR_RELEASE/GameData/000_USITools/AddConsumers.cfg b/FOR_RELEASE/GameData/000_USITools/AddConsumers.cfg index ae4509c..5b78d83 100644 --- a/FOR_RELEASE/GameData/000_USITools/AddConsumers.cfg +++ b/FOR_RELEASE/GameData/000_USITools/AddConsumers.cfg @@ -1,16 +1,7 @@ -@PART[*]:HAS[!MODULE[ModuleLogisticsConsumer],@MODULE[ModuleCommand]] +@PART[*]:HAS[!MODULE[ModuleLogisticsConsumer],@MODULE[ModuleCommand|KerbalSeat]] { MODULE { name = ModuleLogisticsConsumer } } - -@PART[*]:HAS[!MODULE[ModuleLogisticsConsumer],@MODULE[KerbalSeat]] -{ - MODULE - { - name = ModuleLogisticsConsumer - } -} - diff --git a/FOR_RELEASE/GameData/000_USITools/Agency/USIAgency.cfg b/FOR_RELEASE/GameData/000_USITools/Agency/USIAgency.cfg index ec6401a..63010d2 100644 --- a/FOR_RELEASE/GameData/000_USITools/Agency/USIAgency.cfg +++ b/FOR_RELEASE/GameData/000_USITools/Agency/USIAgency.cfg @@ -1,6 +1,7 @@ AGENT { name = Umbra Space Industries + title = Umbra Space Industries description = A world leader in corrugated paper products, Umbra Space Industries is now applying their formidable boxing and packaging skills into a a series of products for colonization, exploration, and resource exploitation! diff --git a/FOR_RELEASE/GameData/000_USITools/CHANGELOG.txt b/FOR_RELEASE/GameData/000_USITools/CHANGELOG.txt index 40faf6f..4eb4163 100644 --- a/FOR_RELEASE/GameData/000_USITools/CHANGELOG.txt +++ b/FOR_RELEASE/GameData/000_USITools/CHANGELOG.txt @@ -1,3 +1,15 @@ +1.1.0 - 2019.02.05 +------------------ +KSP 1.6.x Compatibility + +1.0.0 - 2018.11.20 +------------------ +KSP 1.5.0 Compatibility + +0.13.0 - 2018.06.22 +------------------ +KSP 1.4.4 Compatibility + 0.12.0 - 2018.03.13 ------------------ KSP 1.4.1 Compatibility diff --git a/FOR_RELEASE/GameData/000_USITools/Logistics.cfg b/FOR_RELEASE/GameData/000_USITools/Logistics.cfg index f50f99e..9dd880b 100644 --- a/FOR_RELEASE/GameData/000_USITools/Logistics.cfg +++ b/FOR_RELEASE/GameData/000_USITools/Logistics.cfg @@ -16,4 +16,12 @@ RESOURCE_DEFINITION //Hidden resource used to manage mass isTweakable = false isVisible = false volume = 1 -} \ No newline at end of file +} + +@PART[*]:HAS[!MODULE[USI_ModuleFieldRepair],RESOURCE[Machinery|EnrichedUranium|DepletedFuel|Recyclables]]:FOR[USITools] +{ + MODULE + { + name = USI_ModuleFieldRepair + } +} diff --git a/FOR_RELEASE/GameData/000_USITools/USITools.dll b/FOR_RELEASE/GameData/000_USITools/USITools.dll index 12b4439..a3a4d6d 100644 Binary files a/FOR_RELEASE/GameData/000_USITools/USITools.dll and b/FOR_RELEASE/GameData/000_USITools/USITools.dll differ diff --git a/FOR_RELEASE/GameData/000_USITools/USITools.dll.mdb b/FOR_RELEASE/GameData/000_USITools/USITools.dll.mdb index 9aa9e79..71cc976 100644 Binary files a/FOR_RELEASE/GameData/000_USITools/USITools.dll.mdb and b/FOR_RELEASE/GameData/000_USITools/USITools.dll.mdb differ diff --git a/FOR_RELEASE/GameData/000_USITools/USITools.pdb b/FOR_RELEASE/GameData/000_USITools/USITools.pdb index 3bf118b..14ad592 100644 Binary files a/FOR_RELEASE/GameData/000_USITools/USITools.pdb and b/FOR_RELEASE/GameData/000_USITools/USITools.pdb differ diff --git a/FOR_RELEASE/GameData/000_USITools/USITools.version b/FOR_RELEASE/GameData/000_USITools/USITools.version index 1ec62e5..6e22adb 100644 --- a/FOR_RELEASE/GameData/000_USITools/USITools.version +++ b/FOR_RELEASE/GameData/000_USITools/USITools.version @@ -8,24 +8,24 @@ "ALLOW_PRE_RELEASE":false }, "VERSION":{ - "MAJOR":0, - "MINOR":12, + "MAJOR":1, + "MINOR":1, "PATCH":0, "BUILD":0 }, "KSP_VERSION":{ "MAJOR":1, - "MINOR":4, - "PATCH":1 + "MINOR":6, + "PATCH":0 }, "KSP_VERSION_MIN":{ "MAJOR":1, - "MINOR":4, + "MINOR":6, "PATCH":0 }, "KSP_VERSION_MAX":{ "MAJOR":1, - "MINOR":4, + "MINOR":6, "PATCH":9 } } \ No newline at end of file diff --git a/FOR_RELEASE/GameData/CommunityCategoryKit/CCK.dll b/FOR_RELEASE/GameData/CommunityCategoryKit/CCK.dll index 01b0380..e6fce04 100644 Binary files a/FOR_RELEASE/GameData/CommunityCategoryKit/CCK.dll and b/FOR_RELEASE/GameData/CommunityCategoryKit/CCK.dll differ diff --git a/FOR_RELEASE/GameData/CommunityCategoryKit/CCK.version b/FOR_RELEASE/GameData/CommunityCategoryKit/CCK.version index 0e8dbb3..ffe3dc9 100644 --- a/FOR_RELEASE/GameData/CommunityCategoryKit/CCK.version +++ b/FOR_RELEASE/GameData/CommunityCategoryKit/CCK.version @@ -7,25 +7,25 @@ }, "KSP_VERSION":{ "MAJOR":1, - "MINOR":4, - "PATCH":1 + "MINOR":6, + "PATCH":0 }, "KSP_VERSION_MIN":{ "MAJOR":1, - "MINOR":4, + "MINOR":6, "PATCH":0 }, "KSP_VERSION_MAX":{ "MAJOR":1, - "MINOR":4, + "MINOR":6, "PATCH":9 }, "NAME": "Community Category Kit", "URL": "https://raw.githubusercontent.com/BobPalmer/CommunityCategoryKit/master/FOR_RELEASE/GameData/CommunityCategoryKit/CCK.version", "VERSION": { - "BUILD": 0, - "MAJOR": 3, - "MINOR": 0, - "PATCH": 0 - } + "MAJOR": 4, + "MINOR": 1, + "PATCH": 0, + "BUILD": 0 + } } \ No newline at end of file diff --git a/FOR_RELEASE/GameData/CommunityCategoryKit/CHANGELOG.txt b/FOR_RELEASE/GameData/CommunityCategoryKit/CHANGELOG.txt index 86b0fd2..64c7e85 100644 --- a/FOR_RELEASE/GameData/CommunityCategoryKit/CHANGELOG.txt +++ b/FOR_RELEASE/GameData/CommunityCategoryKit/CHANGELOG.txt @@ -1,3 +1,15 @@ +4.1.0 - 2019.02.05 +------------------ +KSP 1.6.x Compatibility + +4.0.0 - 2018.11.20 +------------------ +KSP 1.5.0 Compatibility + +3.2.0 - 2018.06.22 +------------------ +KSP 1.4.4 Compatibility + 3.1.0 - 2018.03.13 ----------------- KSP 1.4.1 Compatibility diff --git a/FOR_RELEASE/GameData/CommunityResourcePack/CHANGELOG.txt b/FOR_RELEASE/GameData/CommunityResourcePack/CHANGELOG.txt index c880945..b9ed47f 100644 --- a/FOR_RELEASE/GameData/CommunityResourcePack/CHANGELOG.txt +++ b/FOR_RELEASE/GameData/CommunityResourcePack/CHANGELOG.txt @@ -1,3 +1,20 @@ +1.1.0 - 2019.02.05 +------------------ +KSP 1.6.x Compatibility + +1.0.1 - 2018.11.20 +------------------ +Fixed antimatter config name + +1.0.0 - 2018.10.20 +------------------ +KSP 1.5.0 Compatibility +Normalized atmospheric resource harvesting values. + +0.11.0 - 2018.06.22 +------------------ +KSP 1.4.4 Compatibility + 0.10.0 - 2018.03.13 ----------------- KSP 1.4.1 Compatibility diff --git a/FOR_RELEASE/GameData/CommunityResourcePack/CRP.version b/FOR_RELEASE/GameData/CommunityResourcePack/CRP.version index a585c77..1f9a67a 100644 --- a/FOR_RELEASE/GameData/CommunityResourcePack/CRP.version +++ b/FOR_RELEASE/GameData/CommunityResourcePack/CRP.version @@ -8,24 +8,24 @@ "ALLOW_PRE_RELEASE":false }, "VERSION":{ - "MAJOR":0, - "MINOR":10, + "MAJOR":1, + "MINOR":1, "PATCH":0, "BUILD":0 }, "KSP_VERSION":{ "MAJOR":1, - "MINOR":4, - "PATCH":1 + "MINOR":6, + "PATCH":0 }, "KSP_VERSION_MIN":{ "MAJOR":1, - "MINOR":4, + "MINOR":6, "PATCH":0 }, "KSP_VERSION_MAX":{ "MAJOR":1, - "MINOR":4, + "MINOR":6, "PATCH":9 } } diff --git a/FOR_RELEASE/GameData/CommunityResourcePack/CommonResources.cfg b/FOR_RELEASE/GameData/CommunityResourcePack/CommonResources.cfg index 12e8875..5e6ecee 100644 --- a/FOR_RELEASE/GameData/CommunityResourcePack/CommonResources.cfg +++ b/FOR_RELEASE/GameData/CommunityResourcePack/CommonResources.cfg @@ -855,9 +855,9 @@ RESOURCE_DEFINITION { name = CompressedAir abbreviation = #LOC_CRP_CompressedAir_Abbreviation - displayName = #LOC_CompressedAir_DisplayName + displayName = #LOC_CRP_CompressedAir_DisplayName density = 0.000001283 - unitCost = 0.00015 + unitCost = 0.00004 hsp = 2175 flowMode = STAGE_PRIORITY_FLOW transfer = PUMP diff --git a/FOR_RELEASE/GameData/CommunityResourcePack/Localization/fr-fr.cfg b/FOR_RELEASE/GameData/CommunityResourcePack/Localization/fr-fr.cfg new file mode 100644 index 0000000..2ae3bc6 --- /dev/null +++ b/FOR_RELEASE/GameData/CommunityResourcePack/Localization/fr-fr.cfg @@ -0,0 +1,501 @@ +Localization + +{ + + fr-fr + + { + + //USI + + #LOC_CRP_Hydrates_DisplayName = Hydrates + + #LOC_CRP_Gypsum_DisplayName = Gypse + + #LOC_CRP_IntakeLqd_DisplayName = Aduction Liquide + + #LOC_CRP_ColonySupplies_DisplayName = Provisions Coloniales + + #LOC_CRP_Lead_DisplayName = Plomb + + #LOC_CRP_CarbonDioxide_DisplayName = Dioxyde de Carbone + + #LOC_CRP_Chemicals_DisplayName = Produits Chimiques + + #LOC_CRP_Dirt_DisplayName = Boue + + #LOC_CRP_ExoticMinerals_DisplayName = Minerais Exotiques + + #LOC_CRP_Food_DisplayName = Nourriture + + #LOC_CRP_Supplies_DisplayName = Provisions + + #LOC_CRP_Fertilizer_DisplayName = Fertilisant + + #LOC_CRP_Mulch_DisplayName = Compost + + #LOC_CRP_Machinery_DisplayName = Machinerie + + #LOC_CRP_SpecializedParts_DisplayName = Pièces spécialisées + + #LOC_CRP_Recyclables_DisplayName = Recyclables + + #LOC_CRP_Hydrogen_DisplayName = Hydrogène + + #LOC_CRP_Karbonite_DisplayName = Karbonite + + #LOC_CRP_Karborundum_DisplayName = Karborundum + + #LOC_CRP_LqdCO2_DisplayName = CO2 liquide + + #LOC_CRP_LqdCO_DisplayName = CO Liquide + + #LOC_CRP_MaterialKits_DisplayName = Kits de Matériel + + #LOC_CRP_Metals_DisplayName = Métaux + + #LOC_CRP_Minerals_DisplayName = Minéraux + + #LOC_CRP_MetallicOre_DisplayName = Minerai métallique + + #LOC_CRP_Organics_DisplayName = Matières organiques + + #LOC_CRP_Oxygen_DisplayName = Oxygène + + #LOC_CRP_Polymers_DisplayName = Polymères + + #LOC_CRP_RareMetals_DisplayName = Métaux rares + + #LOC_CRP_RefinedExotics_DisplayName = Produits Exotiques Rafinés + + #LOC_CRP_Rock_DisplayName = Roche + + #LOC_CRP_RocketParts_DisplayName = Pièces de Fusées + + #LOC_CRP_SpareParts_DisplayName = Pièces détachées + + #LOC_CRP_Substrate_DisplayName = Substrat + + #LOC_CRP_Uraninite_DisplayName = Uraninite + + #LOC_CRP_Waste_DisplayName = Déchets + + #LOC_CRP_WasteWater_DisplayName = Eaux Usées + + #LOC_CRP_Water_DisplayName = Eau + + //NFT + + #LOC_CRP_ArgonGas_DisplayName = Argon Gazeux + + #LOC_CRP_ArgonGas_Abbreviation = Ar + + #LOC_CRP_Boron_DisplayName = Bore + + #LOC_CRP_Boron_Abbreviation = Bo + + #LOC_CRP_ResourceLode_DisplayName = Gisement exploitable + + #LOC_CRP_EnrichedUranium_DisplayName = Uranium Enrichi + + #LOC_CRP_EnrichedUranium_Abbreviation = UEnr + + #LOC_CRP_DepletedUranium_DisplayName = Uranium Appauvri + + #LOC_CRP_DepletedUranium_Abbreviation = UApp + + #LOC_CRP_LqdHydrogen_DisplayName = Hydrogène Liquide + + #LOC_CRP_LqdHydrogen_Abbreviation = H2Liq + + #LOC_CRP_StoredCharge_DisplayName = Charge Stockée + + #LOC_CRP_StoredCharge_Abbreviation = CS + + //KSPI-E + + #LOC_CRP_Actinides_DisplayName = Actinides + + #LOC_CRP_Actinides_Abbreviation = Act + + #LOC_CRP_Aluminium_DisplayName = Aluminium + + #LOC_CRP_Aluminium_Abbreviation = Al + + #LOC_CRP_Alumina_DisplayName = Alumine + + #LOC_CRP_Alumina_Abbreviation = Alm + + #LOC_CRP_Ammonia_DisplayName = Ammoniaque + + #LOC_CRP_Ammonia_Abbreviation = NH3 + + #LOC_CRP_Antimatter_DisplayName = Antimatière + + #LOC_CRP_Antimatter_Abbreviation = AM + + #LOC_CRP_AntiHydrogen_DisplayName = Antihydrogène + + #LOC_CRP_AntiHydrogen_Abbreviation = AH + + #LOC_CRP_LqdArgon_DisplayName = Argon Liquide + + #LOC_CRP_LqdArgon_Abbreviation = ArLiq + + #LOC_CRP_Borate_DisplayName = Borate + + #LOC_CRP_Borate_Abbreviation = Br + + #LOC_CRP_Caesium_DisplayName = Césium + + #LOC_CRP_Caesium_Abbreviation = Cs + + #LOC_CRP_Calcium_Abbreviation = Ca + + #LOC_CRP_Calcium_DisplayName = Calcium + + #LOC_CRP_CarbonMonoxide_DisplayName = Monoxyde de Carbone + + #LOC_CRP_CarbonMonoxide_Abbreviation = CO + + #LOC_CRP_Carbon_DisplayName = Carbone + + #LOC_CRP_Carbon_Abbreviation = C + + #LOC_CRP_ChargedParticles_DisplayName = Particules Chargées + + #LOC_CRP_ChargedParticles_Abbreviation = PC + + #LOC_CRP_Chlorine_DisplayName = Chlore + + #LOC_CRP_Chlorine_Abbreviation = Cl + + #LOC_CRP_CompressedAir_DisplayName = Air Comprimé + + #LOC_CRP_CompressedAir_Abbreviation = Air + + #LOC_CRP_Decaborane_DisplayName = Décaborane + + #LOC_CRP_Decaborane_Abbreviation = DeBo + + #LOC_CRP_Deuterium_DisplayName = Deutérium + + #LOC_CRP_Deuterium_Abbreviation = D + + #LOC_CRP_LqdDeuterium_DisplayName = Deutérium Liquide + + #LOC_CRP_LqdDeuterium_Abbreviation = D + + #LOC_CRP_DepletedFuel_DisplayName = Combustible Appauvri + + #LOC_CRP_DepletedFuel_Abbreviation = ComApp + + #LOC_CRP_ExoticMatter_DisplayName = Matière Exotique + + #LOC_CRP_ExoticMatter_Abbreviation = MatExo + + #LOC_CRP_FusionPellets_DisplayName = Pastilles de fusion + + #LOC_CRP_FusionPellets_Abbreviation = PF + + #LOC_CRP_Fluorine_DisplayName = Fluor + + #LOC_CRP_Fluorine_Abbreviation = F + + #LOC_CRP_Fluorite_DisplayName = Fluorite + + #LOC_CRP_Fluorite_Abbreviation = CaF2 + + #LOC_CRP_HeavyWater_DisplayName = Eau Lourde + + #LOC_CRP_HeavyWater_Abbreviation = D2O + + #LOC_CRP_IntakeAtm_DisplayName = Entrée d'Air + + #LOC_CRP_IntakeAtm_Abbreviation = EntA + + #LOC_CRP_KryptonGas_DisplayName = Krypton + + #LOC_CRP_KryptonGas_Abbreviation = Kr + + #LOC_CRP_LqdKrypton_DisplayName = Krypton Liquide + + #LOC_CRP_LqdKrypton_Abbreviation = Kr + + #LOC_CRP_NeonGas_DisplayName = Néon + + #LOC_CRP_NeonGas_Abbreviation = Ne + + #LOC_CRP_LqdNeon_DisplayName = Néon Liquide + + #LOC_CRP_LqdNeon_Abbreviation = Ne + + #LOC_CRP_Lithium_DisplayName = Lithium + + #LOC_CRP_Lithium_Abbreviation = Li7 + + #LOC_CRP_Lithium6_DisplayName = Lithium6 + + #LOC_CRP_Lithium6_Abbreviation = Li6 + + #LOC_CRP_LithiumHydride_DisplayName = Hydrure de Lithium + + #LOC_CRP_LithiumHydride_Abbreviation = Li7H + + #LOC_CRP_LithiumDeuteride_DisplayName = Deutérure de Lithium + + #LOC_CRP_LithiumDeuteride_Abbreviation = Li6D + + #LOC_CRP_LqdAmmonia_DisplayName = Ammoniaque Liquide + + #LOC_CRP_LqdAmmonia_Abbreviation = NH3 + + #LOC_CRP_Helium3_DisplayName = Hélium3 + + #LOC_CRP_Helium3_Abbreviation = He3 + + #LOC_CRP_LqdHe3_DisplayName = Hélium3 Liquide + + #LOC_CRP_LqdHe3_Abbreviation = He3 + + #LOC_CRP_Helium4_DisplayName = Hélium4 + + #LOC_CRP_Helium4_Abbreviation = He4 + + #LOC_CRP_LqdHelium_DisplayName = Hélium Liquide + + #LOC_CRP_LqdHelium_Abbreviation = He4 + + #LOC_CRP_Nitratine_DisplayName = Nitratine + + #LOC_CRP_Nitratine_Abbreviation = Nit + + #LOC_CRP_Hexaborane_DisplayName = Héxaborane + + #LOC_CRP_Hexaborane_Abbreviation = HxBo + + #LOC_CRP_LqdNitrogen_DisplayName = Nitrogène Liquide + + #LOC_CRP_LqdNitrogen_Abbreviation = N14 + + #LOC_CRP_LqdNitrogen15_DisplayName = Nitrogène15 Liquide + + #LOC_CRP_LqdNitrogen15_Abbreviation = N15 + + #LOC_CRP_Megajoules_DisplayName = Mégajoules + + #LOC_CRP_Megajoules_Abbreviation = Meg3 + + #LOC_CRP_Monazite_DisplayName = Monazite + + #LOC_CRP_Monazite_Abbreviation = Monz + + #LOC_CRP_LqdOxygen18_DisplayName = Oxygène18 Liquide + + #LOC_CRP_LqdOxygen18_Abbreviation = O18 + + #LOC_CRP_Salt_DisplayName = Sel + + #LOC_CRP_Salt_Abbreviation = Sel + + #LOC_CRP_Sodium_DisplayName = Sodium + + #LOC_CRP_Sodium_Abbreviation = Na + + #LOC_CRP_Sulphur_DisplayName = Souffre + + #LOC_CRP_Sulphur_Abbreviation = S + + #LOC_CRP_SolidHydrogen_DisplayName = Hydrogène Solide + + #LOC_CRP_SolidHydrogen_Abbreviation = HS + + #LOC_CRP_PolyvinylChloride_DisplayName = Polychlorure de Vinyle + + #LOC_CRP_PolyvinylChloride_Abbreviation = PVC + + #LOC_CRP_Plutonium-238_DisplayName = Plutonium-238 + + #LOC_CRP_Plutonium-238_Abbreviation = Pu238 + + #LOC_CRP_Regolith_DisplayName = Régolithe + + #LOC_CRP_Regolith_Abbreviation = R + + #LOC_CRP_UF4_DisplayName = Fluorure d'Uranium4 + + #LOC_CRP_UF4_Abbreviation = UF4 + + #LOC_CRP_Silicates_DisplayName = Silicates + + #LOC_CRP_Silicates_Abbreviation = Silica + + #LOC_CRP_Silicon_DisplayName = Silicone + + #LOC_CRP_Silicon_Abbreviation = Si + + #LOC_CRP_Spodumene_DisplayName = Spodumène + + #LOC_CRP_Spodumene_Abbreviation = LiAl + + #LOC_CRP_SolarWind_DisplayName = Vents Solaire + + #LOC_CRP_SolarWind_Abbreviation = VS + + #LOC_CRP_ThermalPower_DisplayName = Energie Thermique + + #LOC_CRP_ThermalPower_Abbreviation = ET + + #LOC_CRP_Thorium_DisplayName = Thorium + + #LOC_CRP_Thorium_Abbreviation = Th + + #LOC_CRP_ThF4_DisplayName = Fluorure de thorium + + #LOC_CRP_ThF4_Abbreviation = ThF4 + + #LOC_CRP_Tritium_DisplayName = Tritium + + #LOC_CRP_Tritium_Abbreviation = T + + #LOC_CRP_LqdTritium_DisplayName = Tritium Liquide + + #LOC_CRP_LqdTritium_Abbreviation = T + + #LOC_CRP_UraniumNitride_DisplayName = Nitrure d'Uranium + + #LOC_CRP_UraniumNitride_Abbreviation = NU + + #LOC_CRP_VacuumPlasma_DisplayName = Projection Plasmique + + #LOC_CRP_VacuumPlasma_Abbreviation = PP + + #LOC_CRP_WasteHeat_DisplayName = Chaleur résiduelle + + #LOC_CRP_WasteHeat_Abbreviation = DT + + #LOC_CRP_LqdXenon_DisplayName = Xénon Liquide + + #LOC_CRP_LqdXenon_Abbreviation = Xe + + //RealFuels + + #LOC_CRP_Aerozine50_DisplayName = Aérozine50 + + #LOC_CRP_AK20_DisplayName = AK20 + + #LOC_CRP_AK27_DisplayName = AK27 + + #LOC_CRP_Aniline_DisplayName = Aniline + + #LOC_CRP_AvGas_DisplayName = AvGas + + #LOC_CRP_CaveaB_DisplayName = CaveaB + + #LOC_CRP_ClF3_DisplayName = ClF3 + + #LOC_CRP_ClF5_DisplayName = ClF5 + + #LOC_CRP_Diborane_DisplayName = Diborane + + #LOC_CRP_Ethane_DisplayName = Ethane + + #LOC_CRP_Ethanol_DisplayName = Ethanol + + #LOC_CRP_Ethanol75_DisplayName = Ethanol75 + + #LOC_CRP_Ethanol90_DisplayName = Ethanol90 + + #LOC_CRP_Ethylene_DisplayName = Ethylène + + #LOC_CRP_FLOX30_DisplayName = FLOX30 + + #LOC_CRP_FLOX70_DisplayName = FLOX70 + + #LOC_CRP_FLOX88_DisplayName = FLOX88 + + #LOC_CRP_Furfuryl_DisplayName = Alcool furfurylique + + #LOC_CRP_Helium_DisplayName = Hélium + + #LOC_CRP_HNIW_DisplayName = HNIW + + #LOC_CRP_HTP_DisplayName = HTP + + #LOC_CRP_HTPB_DisplayName = HTPB + + #LOC_CRP_Hydrazine_DisplayName = Hydrazine + + #LOC_CRP_Hydyne_DisplayName = Hydyne + + #LOC_CRP_IRFNA-III_DisplayName = IRFNA-III + + #LOC_CRP_IRFNA-IV_DisplayName = IRFNA-IV + + #LOC_CRP_IWFNA_DisplayName = IWFNA + + #LOC_CRP_Kerosene_DisplayName = Kérosene + + #LOC_CRP_LeadBallast_DisplayName = Lest + + #LOC_CRP_LqdFluorine_DisplayName = Fluor liquide + + #LOC_CRP_LqdMethane_DisplayName = Méthane Liquide + + #LOC_CRP_LqdOxygen_DisplayName = Oxygène Liquide + + #LOC_CRP_Methane_DisplayName = Méthane + + #LOC_CRP_Methanol_DisplayName = Méthanol + + #LOC_CRP_MMH_DisplayName = MMH + + #LOC_CRP_MON1_DisplayName = MON1 + + #LOC_CRP_MON3_DisplayName = MON3 + + #LOC_CRP_MON10_DisplayName = MON10 + + #LOC_CRP_MON15_DisplayName = MON15 + + #LOC_CRP_MON20_DisplayName = MON20 + + #LOC_CRP_MON25_DisplayName = MON25 + + #LOC_CRP_NGNC_DisplayName = NGNC + + #LOC_CRP_N2F4_DisplayName = N2F4 + + #LOC_CRP_Nitrogen_DisplayName = Nitrogène + + #LOC_CRP_NitrousOxide_DisplayName = Protoxyde d'Azote + + #LOC_CRP_NTO_DisplayName = NOS + + #LOC_CRP_OF2_DisplayName = OF2 + + #LOC_CRP_PBAN_DisplayName = PBAN + + #LOC_CRP_Pentaborane_DisplayName = Pentaborane + + #LOC_CRP_PSPC_DisplayName = PSPC + + #LOC_CRP_Syntin_DisplayName = Syntin + + #LOC_CRP_TEATEB_DisplayName = TEATEB + + #LOC_CRP_Tonka250_DisplayName = Tonka250 + + #LOC_CRP_Tonka500_DisplayName = Tonka500 + + #LOC_CRP_UDMH_DisplayName = UDMH + + #LOC_CRP_UH25_DisplayName = UH25 + + //DeepFreeze + + #LOC_CRP_Glykerol_DisplayName = Glycérol + + } + +} diff --git a/FOR_RELEASE/GameData/CommunityResourcePack/ResourceConfigs/Alumina.cfg b/FOR_RELEASE/GameData/CommunityResourcePack/ResourceConfigs/Alumina.cfg index 9103323..1594ad6 100644 --- a/FOR_RELEASE/GameData/CommunityResourcePack/ResourceConfigs/Alumina.cfg +++ b/FOR_RELEASE/GameData/CommunityResourcePack/ResourceConfigs/Alumina.cfg @@ -10,13 +10,40 @@ // //Express all numbers as percentages 0.0-100.0, not 0.0-1.0! // - +// ####################### Bodys with NO Alumina (Sun, Jool, Vall, Pol) +PLANETARY_RESOURCE +{ + ResourceName = Alumina + ResourceType = 0 + PlanetName = Sun + Distribution + { + PresenceChance = 0 + MinAbundance = 0 + MaxAbundance = 0 + Variance = 0 + Dispersal = 0 + } +} +PLANETARY_RESOURCE // See Biome definitions +{ + ResourceName = Alumina + ResourceType = 0 + PlanetName = Minmus + Distribution + { + PresenceChance = 0 + MinAbundance = 0 + MaxAbundance = 0 + Variance = 0 + Dispersal = 0 + } +} PLANETARY_RESOURCE { ResourceName = Alumina ResourceType = 0 PlanetName = Jool - Distribution { PresenceChance = 0 @@ -26,97 +53,299 @@ PLANETARY_RESOURCE Dispersal = 0 } } - +PLANETARY_RESOURCE +{ + ResourceName = Alumina + ResourceType = 0 + PlanetName = Vall + Distribution + { + PresenceChance = 0 + MinAbundance = 0 + MaxAbundance = 0 + Variance = 0 + Dispersal = 0 + } +} +PLANETARY_RESOURCE +{ + ResourceName = Alumina + ResourceType = 0 + PlanetName = Pol + Distribution + { + PresenceChance = 0 + MinAbundance = 0 + MaxAbundance = 0 + Variance = 0 + Dispersal = 0 + } +} +// ####################### Global definition of Alumina GLOBAL_RESOURCE { ResourceName = Alumina ResourceType = 0 - Distribution { - PresenceChance = 70 + PresenceChance = 80 MinAbundance = .001 MaxAbundance = 10 Variance = 50 Dispersal = 3 } } +// ####################### Planetary definition of Alumina +PLANETARY_RESOURCE +{ + ResourceName = Alumina + ResourceType = 0 + PlanetName = Moho + Distribution + { + PresenceChance = 100 + MinAbundance = 0.1 + MaxAbundance = 5 + Variance = 50 + Dispersal = 3 + } +} +PLANETARY_RESOURCE +{ + ResourceName = Alumina + ResourceType = 0 + PlanetName = Eve + Distribution + { + PresenceChance = 100 + MinAbundance = 0.5 + MaxAbundance = 8 + Variance = 50 + Dispersal = 3 + } +} +PLANETARY_RESOURCE +{ + ResourceName = Alumina + ResourceType = 0 + PlanetName = Gilly + Distribution + { + PresenceChance = 100 + MinAbundance = 0.1 + MaxAbundance = 5 + Variance = 50 + Dispersal = 3 + } +} PLANETARY_RESOURCE { ResourceName = Alumina ResourceType = 0 PlanetName = Kerbin - Distribution { PresenceChance = 100 - MinAbundance = .001 + MinAbundance = 0.1 MaxAbundance = 10 Variance = 50 Dispersal = 3 } } - PLANETARY_RESOURCE { ResourceName = Alumina ResourceType = 0 PlanetName = Mun + Distribution + { + PresenceChance = 100 + MinAbundance = 5 + MaxAbundance = 15 + Variance = 50 + Dispersal = 3 + } +} +// No Planetary definition for Minmus; See Biome definition. +PLANETARY_RESOURCE +{ + ResourceName = Alumina + ResourceType = 0 + PlanetName = Duna + Distribution + { + PresenceChance = 100 + MinAbundance = 0.1 + MaxAbundance = 3 + Variance = 50 + Dispersal = 3 + } +} +PLANETARY_RESOURCE +{ + ResourceName = Alumina + ResourceType = 0 + PlanetName = Ike + Distribution + { + PresenceChance = 100 + MinAbundance = 5 + MaxAbundance = 15 + Variance = 50 + Dispersal = 3 + } +} +PLANETARY_RESOURCE +{ + ResourceName = Alumina + ResourceType = 0 + PlanetName = Dres + Distribution + { + PresenceChance = 100 + MinAbundance = 0.5 + MaxAbundance = 6 + Variance = 50 + Dispersal = 3 + } +} +// No Planetary definition for Jool here (GasGiant); Alumina prevented, see top. +PLANETARY_RESOURCE +{ + ResourceName = Alumina + ResourceType = 0 + PlanetName = Laythe Distribution { PresenceChance = 100 - MinAbundance = .01 - MaxAbundance = 50 + MinAbundance = 0.01 + MaxAbundance = 1 Variance = 50 Dispersal = 3 } } - PLANETARY_RESOURCE { ResourceName = Alumina ResourceType = 0 - PlanetName = Moho + PlanetName = Tylo Distribution { PresenceChance = 100 - MinAbundance = .01 - MaxAbundance = 50 + MinAbundance = 5 + MaxAbundance = 15 Variance = 50 Dispersal = 3 } } - +// No Planetary definition for Vall; Alumina prevented, see top. PLANETARY_RESOURCE { ResourceName = Alumina ResourceType = 0 - PlanetName = Duna + PlanetName = Bop Distribution { PresenceChance = 100 - MinAbundance = .001 - MaxAbundance = 1 + MinAbundance = 1 + MaxAbundance = 5 Variance = 50 Dispersal = 3 } } - +// No Planetary definition for Pol; Alumina prevented, see top. PLANETARY_RESOURCE { ResourceName = Alumina ResourceType = 0 - PlanetName = Dres + PlanetName = Eeloo Distribution { PresenceChance = 100 - MinAbundance = .01 - MaxAbundance = 50 + MinAbundance = 0.1 + MaxAbundance = 3 Variance = 50 Dispersal = 3 } } +// ####################### Biome definition of Alumina +// ##### Minmus. All white areas. +BIOME_RESOURCE +{ + ResourceName = Alumina + ResourceType = 0 + PlanetName = Minmus + BiomeName = Poles + Distribution + { + PresenceChance = 100 + MinAbundance = 1 + MaxAbundance = 7 + Variance = 50 + Dispersal = 3 + } +} +BIOME_RESOURCE +{ + ResourceName = Alumina + ResourceType = 0 + PlanetName = Minmus + BiomeName = Highlands + Distribution + { + PresenceChance = 100 + MinAbundance = 1 + MaxAbundance = 7 + Variance = 50 + Dispersal = 3 + } +} +BIOME_RESOURCE +{ + ResourceName = Alumina + ResourceType = 0 + PlanetName = Minmus + BiomeName = Midlands + Distribution + { + PresenceChance = 100 + MinAbundance = 1 + MaxAbundance = 7 + Variance = 50 + Dispersal = 3 + } +} +BIOME_RESOURCE +{ + ResourceName = Alumina + ResourceType = 0 + PlanetName = Minmus + BiomeName = Lowlands + Distribution + { + PresenceChance = 100 + MinAbundance = 1 + MaxAbundance = 7 + Variance = 50 + Dispersal = 3 + } +} +BIOME_RESOURCE +{ + ResourceName = Alumina + ResourceType = 0 + PlanetName = Minmus + BiomeName = Slopes + Distribution + { + PresenceChance = 100 + MinAbundance = 0.01 + MaxAbundance = 3 + Variance = 50 + Dispersal = 3 + } +} \ No newline at end of file diff --git a/FOR_RELEASE/GameData/CommunityResourcePack/ResourceConfigs/Antimatter.cfg b/FOR_RELEASE/GameData/CommunityResourcePack/ResourceConfigs/Antimatter.cfg new file mode 100644 index 0000000..c269fc9 --- /dev/null +++ b/FOR_RELEASE/GameData/CommunityResourcePack/ResourceConfigs/Antimatter.cfg @@ -0,0 +1,50 @@ +// +// Community Resource Pack +// Resource: Antimatter +// +//Resource types: +// 0 = Crustal (Stuff you dig up) +// 1 = Oceanic (Stuff in the oceans) +// 2 = Atmospheric (Stuff in the air, varies with pressure) +// 3 = Interplanetary (Stuff you find between planets) +// +//Express all numbers as percentages 0.0-100.0, not 0.0-1.0! +// + +// Kerbin Exo +PLANETARY_RESOURCE +{ + ResourceName = Antimatter + ResourceType = 3 + PlanetName = Kerbin + Distribution + { + PresenceChance = 100 + MinAbundance = 0.001 // - Relative atmospheric scaling applied + MaxAbundance = 0.002 // - Relative atmospheric scaling applied + MinAltitude = 1 + MaxAltitude = 2 + MinRange = 0.25 + MaxRange = 0.3 + Variance = 0 + } +} + +// Jool exo +PLANETARY_RESOURCE +{ + ResourceName = Antimatter + ResourceType = 3 + PlanetName = Jool + Distribution + { + PresenceChance = 100 + MinAbundance = 50 // - Relative atmospheric scaling applied + MaxAbundance = 100 // - Relative atmospheric scaling applied + MinAltitude = 1 + MaxAltitude = 3 + MinRange = 1 + MaxRange = 1 + Variance = 0 + } +} diff --git a/FOR_RELEASE/GameData/CommunityResourcePack/ResourceConfigs/ArgonGas.cfg b/FOR_RELEASE/GameData/CommunityResourcePack/ResourceConfigs/ArgonGas.cfg index 1d74bde..c30ef92 100644 --- a/FOR_RELEASE/GameData/CommunityResourcePack/ResourceConfigs/ArgonGas.cfg +++ b/FOR_RELEASE/GameData/CommunityResourcePack/ResourceConfigs/ArgonGas.cfg @@ -2,7 +2,7 @@ // Community Resource Pack // Resource: // -//Resource types: +//Resource types: // 0 = Crustal (Stuff you dig up) // 1 = Oceanic (Stuff in the oceans) // 2 = Atmospheric (Stuff in the air, varies with pressure) @@ -14,12 +14,12 @@ GLOBAL_RESOURCE { ResourceName = ArgonGas ResourceType = 2 - + Distribution { - PresenceChance = 85 - MinAbundance = .001 - MaxAbundance = 0.5 + PresenceChance = 50 + MinAbundance = 1 // 0.001 - Relative atmospheric scaling applied + MaxAbundance = 100 // 0.5 - Relative atmospheric scaling applied Variance = 5 } } @@ -28,12 +28,12 @@ PLANETARY_RESOURCE ResourceName = ArgonGas ResourceType = 2 PlanetName = Kerbin - + Distribution { PresenceChance = 100 - MinAbundance = 0.01 - MaxAbundance = 0.1 + MinAbundance = 1 // 0.01 - Relative atmospheric scaling applied + MaxAbundance = 10 // 0.1 - Relative atmospheric scaling applied Variance = 5 } } @@ -42,12 +42,12 @@ PLANETARY_RESOURCE ResourceName = ArgonGas ResourceType = 2 PlanetName = Duna - + Distribution { PresenceChance = 100 - MinAbundance = 0.001 - MaxAbundance = 0.01 + MinAbundance = 0.1 // 0.001 - Relative atmospheric scaling applied + MaxAbundance = 1 // 0.01 - Relative atmospheric scaling applied Variance = 5 } } @@ -56,12 +56,12 @@ PLANETARY_RESOURCE ResourceName = ArgonGas ResourceType = 2 PlanetName = Jool - + Distribution { PresenceChance = 100 - MinAbundance = 0.07 - MaxAbundance = 1 + MinAbundance = 7 // 0.07 - Relative atmospheric scaling applied + MaxAbundance = 100 // 1 - Relative atmospheric scaling applied Variance = 5 } } diff --git a/FOR_RELEASE/GameData/CommunityResourcePack/ResourceConfigs/CarbonDioxide.cfg b/FOR_RELEASE/GameData/CommunityResourcePack/ResourceConfigs/CarbonDioxide.cfg index efdceee..83d22d8 100644 --- a/FOR_RELEASE/GameData/CommunityResourcePack/ResourceConfigs/CarbonDioxide.cfg +++ b/FOR_RELEASE/GameData/CommunityResourcePack/ResourceConfigs/CarbonDioxide.cfg @@ -2,7 +2,7 @@ // Community Resource Pack // Resource: // -//Resource types: +//Resource types: // 0 = Crustal (Stuff you dig up) // 1 = Oceanic (Stuff in the oceans) // 2 = Atmospheric (Stuff in the air, varies with pressure) @@ -15,12 +15,12 @@ PLANETARY_RESOURCE ResourceName = CarbonDioxide ResourceType = 2 PlanetName = Eve - + Distribution { PresenceChance = 100 - MinAbundance = 95 - MaxAbundance = 97 + MinAbundance = 97 // 95 - Relative atmospheric scaling applied + MaxAbundance = 100 // 97 - Relative atmospheric scaling applied Variance = 0 } } @@ -29,12 +29,12 @@ PLANETARY_RESOURCE ResourceName = CarbonDioxide ResourceType = 2 PlanetName = Kerbin - + Distribution { PresenceChance = 100 - MinAbundance = 1 - MaxAbundance = 2 + MinAbundance = 1 // 1 - Relative atmospheric scaling applied + MaxAbundance = 2 // 2 - Relative atmospheric scaling applied Variance = 0 } } @@ -43,12 +43,12 @@ PLANETARY_RESOURCE ResourceName = CarbonDioxide ResourceType = 2 PlanetName = Duna - + Distribution { PresenceChance = 100 - MinAbundance = 95 - MaxAbundance = 97 + MinAbundance = 97 // 95 - Relative atmospheric scaling applied + MaxAbundance = 100 // 97 - Relative atmospheric scaling applied Variance = 0 } } @@ -57,12 +57,12 @@ PLANETARY_RESOURCE ResourceName = CarbonDioxide ResourceType = 2 PlanetName = Laythe - + Distribution { PresenceChance = 100 - MinAbundance = 5 - MaxAbundance = 10 + MinAbundance = 5 // 5 - Relative atmospheric scaling applied + MaxAbundance = 11 // 10 - Relative atmospheric scaling applied Variance = 0 } } diff --git a/FOR_RELEASE/GameData/CommunityResourcePack/ResourceConfigs/Karbonite.cfg b/FOR_RELEASE/GameData/CommunityResourcePack/ResourceConfigs/Karbonite.cfg index f8a9576..c12057b 100644 --- a/FOR_RELEASE/GameData/CommunityResourcePack/ResourceConfigs/Karbonite.cfg +++ b/FOR_RELEASE/GameData/CommunityResourcePack/ResourceConfigs/Karbonite.cfg @@ -2,7 +2,7 @@ // Community Resource Pack // Resource: // -//Resource types: +//Resource types: // 0 = Crustal (Stuff you dig up) // 1 = Oceanic (Stuff in the oceans) // 2 = Atmospheric (Stuff in the air, varies with pressure) @@ -15,7 +15,7 @@ GLOBAL_RESOURCE { ResourceName = Karbonite ResourceType = 0 - + Distribution { PresenceChance = 70 @@ -30,12 +30,12 @@ GLOBAL_RESOURCE { ResourceName = Karbonite ResourceType = 1 - + Distribution { PresenceChance = 80 - MinAbundance = 1 - MaxAbundance = 10 + MinAbundance = 5 // 1 - Relative atmospheric scaling applied + MaxAbundance = 50 // 10 - Relative atmospheric scaling applied Variance = 20 Dispersal = 3 } @@ -45,30 +45,30 @@ GLOBAL_RESOURCE { ResourceName = Karbonite ResourceType = 2 - + Distribution { PresenceChance = 80 MinAbundance = .001 - MaxAbundance = 1 + MaxAbundance = 5 // 1 - Relative atmospheric scaling applied Variance = 50 //Karbonite plumes venting - Dispersal = 3 + Dispersal = 3 } } GLOBAL_RESOURCE { ResourceName = Karbonite ResourceType = 3 - + Distribution { PresenceChance = 20 MinAbundance = .001 - MaxAbundance = .5 + MaxAbundance = 50 // 0.5 - Relative atmospheric scaling applied MinAltitude = .2 MaxAltitude = 2 MinRange = .01 - MaxRange = .5 + MaxRange = .5 } } @@ -77,12 +77,12 @@ PLANETARY_RESOURCE ResourceName = Karbonite ResourceType = 2 PlanetName = Jool - + Distribution { PresenceChance = 100 - MinAbundance = 80 - MaxAbundance = 80 + MinAbundance = 100 // 80 - Relative atmospheric scaling applied + MaxAbundance = 100 // 80 - Relative atmospheric scaling applied Variance = 50 } } @@ -91,12 +91,12 @@ PLANETARY_RESOURCE ResourceName = Karbonite ResourceType = 1 PlanetName = Eve - + Distribution { PresenceChance = 100 - MinAbundance = 60 - MaxAbundance = 60 + MinAbundance = 75 // 60 - Relative atmospheric scaling applied + MaxAbundance = 75 //60 - Relative atmospheric scaling applied Variance = 10 } } @@ -105,7 +105,7 @@ PLANETARY_RESOURCE ResourceName = Karbonite ResourceType = 0 PlanetName = Kerbin - + Distribution { PresenceChance = 100 @@ -119,7 +119,7 @@ PLANETARY_RESOURCE ResourceName = Karbonite ResourceType = 1 PlanetName = Kerbin - + Distribution { PresenceChance = 100 @@ -134,7 +134,7 @@ PLANETARY_RESOURCE ResourceName = Karbonite ResourceType = 2 PlanetName = Kerbin - + Distribution { PresenceChance = 100 @@ -149,16 +149,16 @@ PLANETARY_RESOURCE ResourceName = Karbonite ResourceType = 3 PlanetName = Kerbin - + Distribution { PresenceChance = 100 - MinAbundance = .001 - MaxAbundance = .001 + MinAbundance = .001 // 0.001 - Relative atmospheric scaling applied + MaxAbundance = .001 // 0.001 - Relative atmospheric scaling applied MinAltitude = .245 MaxAltitude = .245 MinRange = .01 - MaxRange = .01 + MaxRange = .01 } } @@ -167,7 +167,7 @@ PLANETARY_RESOURCE ResourceName = Karbonite ResourceType = 0 PlanetName = Jool - + Distribution { PresenceChance = 0 @@ -183,15 +183,15 @@ PLANETARY_RESOURCE ResourceName = Karbonite ResourceType = 3 PlanetName = Jool - + Distribution { PresenceChance = 100 - MinAbundance = 1 - MaxAbundance = 1 + MinAbundance = 100 // 1 - Relative atmospheric scaling applied + MaxAbundance = 100 // 1 - Relative atmospheric scaling applied MinAltitude = .1 MaxAltitude = .1 MinRange = .1 - MaxRange = .1 + MaxRange = .1 } } diff --git a/FOR_RELEASE/GameData/CommunityResourcePack/ResourceConfigs/LqdDeuterium.cfg b/FOR_RELEASE/GameData/CommunityResourcePack/ResourceConfigs/LqdDeuterium.cfg new file mode 100644 index 0000000..628101e --- /dev/null +++ b/FOR_RELEASE/GameData/CommunityResourcePack/ResourceConfigs/LqdDeuterium.cfg @@ -0,0 +1,28 @@ +// +// Community Resource Pack +// Resource: +// +//Resource types: +// 0 = Crustal (Stuff you dig up) +// 1 = Oceanic (Stuff in the oceans) +// 2 = Atmospheric (Stuff in the air, varies with pressure) +// 3 = Interplanetary (Stuff you find between planets) +// +//Express all numbers as percentages 0.0-100.0, not 0.0-1.0! +// + +// Jool atmo +PLANETARY_RESOURCE +{ + ResourceName = LqdDeuterium + ResourceType = 2 + PlanetName = Jool + + Distribution + { + PresenceChance = 100 + MinAbundance = 20 // - Relative atmospheric scaling applied + MaxAbundance = 100 // - Relative atmospheric scaling applied + Variance = 20 + } +} diff --git a/FOR_RELEASE/GameData/CommunityResourcePack/ResourceConfigs/LqdHe3.cfg b/FOR_RELEASE/GameData/CommunityResourcePack/ResourceConfigs/LqdHe3.cfg index d35bec2..d79f13d 100644 --- a/FOR_RELEASE/GameData/CommunityResourcePack/ResourceConfigs/LqdHe3.cfg +++ b/FOR_RELEASE/GameData/CommunityResourcePack/ResourceConfigs/LqdHe3.cfg @@ -1,8 +1,8 @@ // -// +// // Resource: LqdHe3 // -//Resource types: +//Resource types: // 0 = Crustal (Stuff you dig up) // 1 = Oceanic (Stuff in the oceans) // 2 = Atmospheric (Stuff in the air, varies with pressure) @@ -16,7 +16,7 @@ GLOBAL_RESOURCE { ResourceName = LqdHe3 ResourceType = 0 - + Distribution { PresenceChance = 100 @@ -27,13 +27,13 @@ GLOBAL_RESOURCE } } -// Kerbin Crustal Helium3 abundance is 10 times Earth abundance +// Kerbin Crustal Helium3 abundance is 10 times Earth abundance PLANETARY_RESOURCE { ResourceName = LqdHe3 ResourceType = 0 PlanetName = Kerbin - + Distribution { PresenceChance = 100 @@ -50,7 +50,7 @@ PLANETARY_RESOURCE ResourceName = LqdHe3 ResourceType = 0 PlanetName = Earth - + Distribution { PresenceChance = 100 @@ -66,7 +66,7 @@ PLANETARY_RESOURCE ResourceName = LqdHe3 ResourceType = 0 PlanetName = Mun - + Distribution { PresenceChance = 100 @@ -83,7 +83,7 @@ PLANETARY_RESOURCE ResourceName = LqdHe3 ResourceType = 0 PlanetName = Moon - + Distribution { PresenceChance = 100 @@ -101,7 +101,7 @@ BIOME_RESOURCE ResourceType = 0 PlanetName = Kerbin BiomeName = Water - + Distribution { PresenceChance = 100 @@ -119,7 +119,7 @@ BIOME_RESOURCE ResourceType = 0 PlanetName = Earth BiomeName = Water - + Distribution { PresenceChance = 100 @@ -138,12 +138,12 @@ GLOBAL_RESOURCE { ResourceName = LqdHe3 ResourceType = 2 - + Distribution { - PresenceChance = 100 - MinAbundance = 0.0000000072 - MaxAbundance = 0.00014 + PresenceChance = 5 + MinAbundance = 0.001 // 0.0000000072 + MaxAbundance = 100 // 0.00014 Variance = 0 Dispersal = 1 } @@ -151,18 +151,18 @@ GLOBAL_RESOURCE -// Kerbin Atmospheric Helium3 abundance is 10 times Earth abundance +// Kerbin Atmospheric Helium3 abundance is 10 times Earth abundance PLANETARY_RESOURCE { ResourceName = LqdHe3 ResourceType = 2 PlanetName = Kerbin - + Distribution { PresenceChance = 100 - MinAbundance = 0.00000000072 - MaxAbundance = 0.00000000072 + MinAbundance = 0.001 // 0.00000000072 + MaxAbundance = 0.001 // 0.00000000072 Variance = 0 Dispersal = 1 } @@ -175,29 +175,29 @@ PLANETARY_RESOURCE ResourceName = LqdHe3 ResourceType = 2 PlanetName = Earth - + Distribution { PresenceChance = 100 - MinAbundance = 0.000000000072 - MaxAbundance = 0.000000000072 + MinAbundance = 0.001 // 0.000000000072 + MaxAbundance = 0.001 // 0.000000000072 Variance = 0 Dispersal = 1 } } -// Jool Helium3 abundance is 10 times Jupiter abundance +// Jool Helium3 abundance is 10 times Jupiter abundance PLANETARY_RESOURCE { ResourceName = LqdHe3 ResourceType = 2 PlanetName = Jool - + Distribution { PresenceChance = 100 - MinAbundance = 0.00014 - MaxAbundance = 0.00014 + MinAbundance = 10 // 0.00014 + MaxAbundance = 10 // 0.00014 Variance = 0 Dispersal = 1 } @@ -208,12 +208,12 @@ PLANETARY_RESOURCE ResourceName = LqdHe3 ResourceType = 2 PlanetName = Jupiter - + Distribution { PresenceChance = 100 - MinAbundance = 0.000014 - MaxAbundance = 0.000014 + MinAbundance = 1 // 0.000014 + MaxAbundance = 1 // 0.000014 Variance = 0 Dispersal = 1 } diff --git a/FOR_RELEASE/GameData/CommunityResourcePack/ResourceConfigs/LqdHydrogen.cfg b/FOR_RELEASE/GameData/CommunityResourcePack/ResourceConfigs/LqdHydrogen.cfg index 55138da..e7a1981 100644 --- a/FOR_RELEASE/GameData/CommunityResourcePack/ResourceConfigs/LqdHydrogen.cfg +++ b/FOR_RELEASE/GameData/CommunityResourcePack/ResourceConfigs/LqdHydrogen.cfg @@ -2,7 +2,7 @@ // Community Resource Pack // Resource: // -//Resource types: +//Resource types: // 0 = Crustal (Stuff you dig up) // 1 = Oceanic (Stuff in the oceans) // 2 = Atmospheric (Stuff in the air, varies with pressure) @@ -11,35 +11,95 @@ //Express all numbers as percentages 0.0-100.0, not 0.0-1.0! // + +// GLOBAL EXO GLOBAL_RESOURCE { ResourceName = LqdHydrogen ResourceType = 3 - + Distribution { - PresenceChance = 85 - MinAbundance = .00000001 - MaxAbundance = .00000005 + PresenceChance = 50 + MinAbundance = 1 // .00000001 - Relative atmospheric scaling applied + MaxAbundance = 100 // .00000005 - Relative atmospheric scaling applied MinAltitude = 500 MaxAltitude = 200000000000 MinRange = .01 - MaxRange = .5 + MaxRange = .5 Variance = 20 } } +// SUN EXO +PLANETARY_RESOURCE +{ + ResourceName = LqdHydrogen + ResourceType = 3 + PlanetName = Sun + + Distribution + { + PresenceChance = 100 + MinAbundance = 10 // .00000001 - Relative atmospheric scaling applied + MaxAbundance = 20 // .00000005 - Relative atmospheric scaling applied + MinAltitude = 0.1 + MaxAltitude = 500 + MinRange = 500 + MaxRange = 500 + Variance = 0 + } +} +// JOOL EXO +PLANETARY_RESOURCE +{ + ResourceName = LqdHydrogen + ResourceType = 3 + PlanetName = Jool + Distribution + { + PresenceChance = 100 + MinAbundance = 20 + MaxAbundance = 60 + MinAltitude = 0.1 + MaxAltitude = 0.1 + MinRange = 75 + MaxRange = 100 + Variance = 0 + } +} +// KERBIN EXO +PLANETARY_RESOURCE +{ + ResourceName = LqdHydrogen + ResourceType = 3 + PlanetName = Kerbin + Distribution + { + PresenceChance = 100 + MinAbundance = 40 + MaxAbundance = 80 + MinAltitude = 0.1 + MaxAltitude = 25 + MinRange = 25 + MaxRange = 25 + Variance = 0 + } +} + + +// JOOL ATMO PLANETARY_RESOURCE { ResourceName = LqdHydrogen ResourceType = 2 PlanetName = Jool - + Distribution { PresenceChance = 100 - MinAbundance = 0.05 - MaxAbundance = 0.08 + MinAbundance = 62 // 50 - Relative atmospheric scaling applied + MaxAbundance = 100 // 80 - Relative atmospheric scaling applied Variance = 20 } -} \ No newline at end of file +} diff --git a/FOR_RELEASE/GameData/CommunityResourcePack/ResourceConfigs/Oxygen.cfg b/FOR_RELEASE/GameData/CommunityResourcePack/ResourceConfigs/Oxygen.cfg index 1b27cab..99eaa31 100644 --- a/FOR_RELEASE/GameData/CommunityResourcePack/ResourceConfigs/Oxygen.cfg +++ b/FOR_RELEASE/GameData/CommunityResourcePack/ResourceConfigs/Oxygen.cfg @@ -2,7 +2,7 @@ // Community Resource Pack // Resource: // -//Resource types: +//Resource types: // 0 = Crustal (Stuff you dig up) // 1 = Oceanic (Stuff in the oceans) // 2 = Atmospheric (Stuff in the air, varies with pressure) @@ -15,12 +15,12 @@ PLANETARY_RESOURCE ResourceName = Oxygen ResourceType = 2 PlanetName = Kerbin - + Distribution { PresenceChance = 100 - MinAbundance = 20 - MaxAbundance = 30 + MinAbundance = 65 // 20 - Relative atmospheric scaling applied + MaxAbundance = 100 // 30 - Relative atmospheric scaling applied Variance = 0 } } @@ -29,13 +29,12 @@ PLANETARY_RESOURCE ResourceName = Oxygen ResourceType = 2 PlanetName = Laythe - + Distribution { PresenceChance = 100 - MinAbundance = 20 - MaxAbundance = 30 + MinAbundance = 65 // 20 - Relative atmospheric scaling applied + MaxAbundance = 100 // 30 - Relative atmospheric scaling applied Variance = 0 } } - diff --git a/FOR_RELEASE/GameData/CommunityResourcePack/ResourceConfigs/Regolith.cfg b/FOR_RELEASE/GameData/CommunityResourcePack/ResourceConfigs/Regolith.cfg new file mode 100644 index 0000000..8a0a78b --- /dev/null +++ b/FOR_RELEASE/GameData/CommunityResourcePack/ResourceConfigs/Regolith.cfg @@ -0,0 +1,371 @@ +// +// +// Resource: Regolith (Solar Wind Enriched Regolith) +// +//Resource types: +// 0 = Crustal (Stuff you dig up) +// 1 = Oceanic (Stuff in the oceans) +// 2 = Atmospheric (Stuff in the air, varies with pressure) +// 3 = Interplanetary (Stuff you find between planets) +// +//Express all numbers as percentages 0.0-100.0, not 0.0-1.0! +// +// ####################### Bodys with NO Regolith (Sun, Jool, Laythe) +PLANETARY_RESOURCE +{ + ResourceName = Regolith + ResourceType = 0 + PlanetName = Sun + Distribution + { + PresenceChance = 0 + MinAbundance = 0 + MaxAbundance = 0 + Variance = 0 + Dispersal = 0 + } +} +PLANETARY_RESOURCE +{ + ResourceName = Regolith + ResourceType = 0 + PlanetName = Jool + Distribution + { + PresenceChance = 0 + MinAbundance = 0 + MaxAbundance = 0 + Variance = 0 + Dispersal = 0 + } +} +PLANETARY_RESOURCE +{ + ResourceName = Regolith + ResourceType = 0 + PlanetName = Laythe + Distribution + { + PresenceChance = 0 + MinAbundance = 0 + MaxAbundance = 0 + Variance = 0 + Dispersal = 0 + } +} +// ####################### Global definition of Regolith +GLOBAL_RESOURCE +{ + ResourceName = Regolith + ResourceType = 0 + Distribution + { + PresenceChance = 90 + MinAbundance = 1 + MaxAbundance = 20 + Variance = 50 + Dispersal = 3 + } +} +// ####################### Planetary definition of Regolith +PLANETARY_RESOURCE +{ + ResourceName = Regolith + ResourceType = 0 + PlanetName = Moho + Distribution + { + PresenceChance = 100 + MinAbundance = 1 + MaxAbundance = 10 + Variance = 50 + Dispersal = 3 + } +} +PLANETARY_RESOURCE +{ + ResourceName = Regolith + ResourceType = 0 + PlanetName = Eve + Distribution + { + PresenceChance = 100 + MinAbundance = 2 + MaxAbundance = 15 + Variance = 50 + Dispersal = 3 + } +} +PLANETARY_RESOURCE +{ + ResourceName = Regolith + ResourceType = 0 + PlanetName = Gilly + Distribution + { + PresenceChance = 100 + MinAbundance = 1 + MaxAbundance = 8 + Variance = 50 + Dispersal = 3 + } +} +PLANETARY_RESOURCE +{ + ResourceName = Regolith + ResourceType = 0 + PlanetName = Kerbin + Distribution + { + PresenceChance = 100 + MinAbundance = 0.1 + MaxAbundance = 1 + Variance = 50 + Dispersal = 3 + } +} +PLANETARY_RESOURCE +{ + ResourceName = Regolith + ResourceType = 0 + PlanetName = Mun + Distribution + { + PresenceChance = 100 + MinAbundance = 10 + MaxAbundance = 50 + Variance = 50 + Dispersal = 3 + } +} +// No Planetary definition for Minmus; See Biome definition. +PLANETARY_RESOURCE +{ + ResourceName = Regolith + ResourceType = 0 + PlanetName = Duna + Distribution + { + PresenceChance = 100 + MinAbundance = 2 + MaxAbundance = 15 + Variance = 50 + Dispersal = 3 + } +} +PLANETARY_RESOURCE +{ + ResourceName = Regolith + ResourceType = 0 + PlanetName = Ike + Distribution + { + PresenceChance = 100 + MinAbundance = 10 + MaxAbundance = 50 + Variance = 50 + Dispersal = 3 + } +} +PLANETARY_RESOURCE +{ + ResourceName = Regolith + ResourceType = 0 + PlanetName = Dres + Distribution + { + PresenceChance = 100 + MinAbundance = 5 + MaxAbundance = 8 + Variance = 50 + Dispersal = 3 + } +} +// No Planetary definition for Jool here (GasGiant); Regolith prevented, see top. +// No Planetary definition for Laythe here; Regolith prevented, see top. +PLANETARY_RESOURCE +{ + ResourceName = Regolith + ResourceType = 0 + PlanetName = Tylo + Distribution + { + PresenceChance = 100 + MinAbundance = 5 + MaxAbundance = 25 + Variance = 50 + Dispersal = 3 + } +} +// No Planetary definition for Vall; See Biome definition. +PLANETARY_RESOURCE +{ + ResourceName = Regolith + ResourceType = 0 + PlanetName = Bop + Distribution + { + PresenceChance = 100 + MinAbundance = 1 + MaxAbundance = 10 + Variance = 50 + Dispersal = 3 + } +} +PLANETARY_RESOURCE +{ + ResourceName = Regolith + ResourceType = 0 + PlanetName = Pol + Distribution + { + PresenceChance = 100 + MinAbundance = 1 + MaxAbundance = 10 + Variance = 50 + Dispersal = 3 + } +} +// No Planetary definition for Eeloo; See Biome definition. +// ####################### Biome definition of Regolith +// ##### Moho +BIOME_RESOURCE +{ + ResourceName = Regolith + ResourceType = 0 + PlanetName = Moho + BiomeName = Northern Sinkhole Ridge + Distribution + { + PresenceChance = 100 + MinAbundance = 10 + MaxAbundance = 25 + Variance = 50 + Dispersal = 3 + } +} + +BIOME_RESOURCE +{ + ResourceName = Regolith + ResourceType = 0 + PlanetName = Moho + BiomeName = Northern Sinkhole + + Distribution + { + PresenceChance = 100 + MinAbundance = 25 + MaxAbundance = 45 + Variance = 50 + Dispersal = 3 + } +} +// ##### Minmus +BIOME_RESOURCE +{ + ResourceName = Regolith + ResourceType = 0 + PlanetName = Minmus + BiomeName = Poles + Distribution + { + PresenceChance = 100 + MinAbundance = 1 + MaxAbundance = 10 + Variance = 50 + Dispersal = 3 + } +} +BIOME_RESOURCE +{ + ResourceName = Regolith + ResourceType = 0 + PlanetName = Minmus + BiomeName = Highlands + Distribution + { + PresenceChance = 100 + MinAbundance = 1 + MaxAbundance = 10 + Variance = 50 + Dispersal = 3 + } +} +BIOME_RESOURCE +{ + ResourceName = Regolith + ResourceType = 0 + PlanetName = Minmus + BiomeName = Midlands + Distribution + { + PresenceChance = 100 + MinAbundance = 1 + MaxAbundance = 10 + Variance = 50 + Dispersal = 3 + } +} +BIOME_RESOURCE +{ + ResourceName = Regolith + ResourceType = 0 + PlanetName = Minmus + BiomeName = Lowlands + Distribution + { + PresenceChance = 100 + MinAbundance = 1 + MaxAbundance = 10 + Variance = 50 + Dispersal = 3 + } +} +BIOME_RESOURCE +{ + ResourceName = Regolith + ResourceType = 0 + PlanetName = Minmus + BiomeName = Slopes + Distribution + { + PresenceChance = 100 + MinAbundance = 0.01 + MaxAbundance = 5 + Variance = 50 + Dispersal = 3 + } +} +// ##### Vall +BIOME_RESOURCE +{ + ResourceName = Regolith + ResourceType = 0 + PlanetName = Vall + BiomeName = Mountains + Distribution + { + PresenceChance = 100 + MinAbundance = 0.5 + MaxAbundance = 4 + Variance = 50 + Dispersal = 3 + } +} +// ##### Eeloo +BIOME_RESOURCE +{ + ResourceName = Regolith + ResourceType = 0 + PlanetName = Eeloo + BiomeName = Ice Canyons + Distribution + { + PresenceChance = 100 + MinAbundance = 0.1 + MaxAbundance = 9 + Variance = 50 + Dispersal = 3 + } +} \ No newline at end of file diff --git a/FOR_RELEASE/GameData/CommunityResourcePack/ResourceConfigs/Silicates.cfg b/FOR_RELEASE/GameData/CommunityResourcePack/ResourceConfigs/Silicates.cfg index c8f869f..b337d3a 100644 --- a/FOR_RELEASE/GameData/CommunityResourcePack/ResourceConfigs/Silicates.cfg +++ b/FOR_RELEASE/GameData/CommunityResourcePack/ResourceConfigs/Silicates.cfg @@ -10,38 +10,327 @@ // //Express all numbers as percentages 0.0-100.0, not 0.0-1.0! // - +// ####################### Bodys with NO Silicates (Sun, Jool, Vall) +PLANETARY_RESOURCE +{ + ResourceName = Silicates + ResourceType = 0 + PlanetName = Sun + Distribution + { + PresenceChance = 0 + MinAbundance = 0 + MaxAbundance = 0 + Variance = 0 + Dispersal = 0 + } +} +PLANETARY_RESOURCE // See Biome definitions +{ + ResourceName = Silicates + ResourceType = 0 + PlanetName = Minmus + Distribution + { + PresenceChance = 0 + MinAbundance = 0 + MaxAbundance = 0 + Variance = 0 + Dispersal = 0 + } +} +PLANETARY_RESOURCE +{ + ResourceName = Silicates + ResourceType = 0 + PlanetName = Jool + Distribution + { + PresenceChance = 0 + MinAbundance = 0 + MaxAbundance = 0 + Variance = 0 + Dispersal = 0 + } +} +PLANETARY_RESOURCE +{ + ResourceName = Silicates + ResourceType = 0 + PlanetName = Vall + Distribution + { + PresenceChance = 0 + MinAbundance = 0 + MaxAbundance = 0 + Variance = 0 + Dispersal = 0 + } +} +// ####################### Global definition of Silicates GLOBAL_RESOURCE { ResourceName = Silicates ResourceType = 0 - Distribution { - PresenceChance = 60 + PresenceChance = 80 MinAbundance = .001 MaxAbundance = 10 - Variance = 10 + Variance = 50 Dispersal = 3 } } - -BIOME_RESOURCE +// ####################### Planetary definition of Silicates +PLANETARY_RESOURCE +{ + ResourceName = Silicates + ResourceType = 0 + PlanetName = Moho + Distribution + { + PresenceChance = 100 + MinAbundance = 1 + MaxAbundance = 15 + Variance = 50 + Dispersal = 3 + } +} +PLANETARY_RESOURCE +{ + ResourceName = Silicates + ResourceType = 0 + PlanetName = Eve + Distribution + { + PresenceChance = 100 + MinAbundance = 5 + MaxAbundance = 20 + Variance = 50 + Dispersal = 3 + } +} +PLANETARY_RESOURCE +{ + ResourceName = Silicates + ResourceType = 0 + PlanetName = Gilly + Distribution + { + PresenceChance = 100 + MinAbundance = 1 + MaxAbundance = 8 + Variance = 50 + Dispersal = 3 + } +} +PLANETARY_RESOURCE +{ + ResourceName = Silicates + ResourceType = 0 + PlanetName = Kerbin + Distribution + { + PresenceChance = 100 + MinAbundance = 0.1 + MaxAbundance = 10 + Variance = 50 + Dispersal = 3 + } +} +PLANETARY_RESOURCE { ResourceName = Silicates ResourceType = 0 PlanetName = Mun - BiomeName = Northern Basin + Distribution + { + PresenceChance = 100 + MinAbundance = 5 + MaxAbundance = 25 + Variance = 50 + Dispersal = 3 + } +} +// No Planetary definition for Minmus; See Biome definition. +PLANETARY_RESOURCE +{ + ResourceName = Silicates + ResourceType = 0 + PlanetName = Duna + Distribution + { + PresenceChance = 100 + MinAbundance = 2 + MaxAbundance = 12 + Variance = 50 + Dispersal = 3 + } +} +PLANETARY_RESOURCE +{ + ResourceName = Silicates + ResourceType = 0 + PlanetName = Ike + Distribution + { + PresenceChance = 100 + MinAbundance = 5 + MaxAbundance = 25 + Variance = 50 + Dispersal = 3 + } +} +PLANETARY_RESOURCE +{ + ResourceName = Silicates + ResourceType = 0 + PlanetName = Dres + Distribution + { + PresenceChance = 100 + MinAbundance = 1 + MaxAbundance = 8 + Variance = 50 + Dispersal = 3 + } +} +// No Planetary definition for Jool here (GasGiant); Silicates prevented, see top. +PLANETARY_RESOURCE +{ + ResourceName = Silicates + ResourceType = 0 + PlanetName = Laythe + + Distribution + { + PresenceChance = 100 + MinAbundance = 10 + MaxAbundance = 30 + Variance = 50 + Dispersal = 3 + } +} +PLANETARY_RESOURCE +{ + ResourceName = Silicates + ResourceType = 0 + PlanetName = Tylo + + Distribution + { + PresenceChance = 100 + MinAbundance = 6 + MaxAbundance = 18 + Variance = 50 + Dispersal = 3 + } +} +// No Planetary definition for Vall; Silicates prevented, see top. +PLANETARY_RESOURCE +{ + ResourceName = Silicates + ResourceType = 0 + PlanetName = Bop Distribution { PresenceChance = 100 MinAbundance = 1 - MaxAbundance = 20 - Variance = 10 + MaxAbundance = 5 + Variance = 50 + Dispersal = 3 + } +} +PLANETARY_RESOURCE +{ + ResourceName = Silicates + ResourceType = 0 + PlanetName = Pol + + Distribution + { + PresenceChance = 100 + MinAbundance = 20 + MaxAbundance = 40 + Variance = 50 Dispersal = 3 } } - - - +PLANETARY_RESOURCE +{ + ResourceName = Silicates + ResourceType = 0 + PlanetName = Eeloo + + Distribution + { + PresenceChance = 100 + MinAbundance = 0.2 + MaxAbundance = 8 + Variance = 50 + Dispersal = 3 + } +} +// ####################### Biome definition of Silicates +// ##### Minmus. All blue areas. +BIOME_RESOURCE +{ + ResourceName = Silicates + ResourceType = 0 + PlanetName = Minmus + BiomeName = Flats + Distribution + { + PresenceChance = 100 + MinAbundance = 1 + MaxAbundance = 7 + Variance = 50 + Dispersal = 3 + } +} +BIOME_RESOURCE +{ + ResourceName = Silicates + ResourceType = 0 + PlanetName = Minmus + BiomeName = Lesser Flats + Distribution + { + PresenceChance = 100 + MinAbundance = 2 + MaxAbundance = 10 + Variance = 50 + Dispersal = 3 + } +} +BIOME_RESOURCE +{ + ResourceName = Silicates + ResourceType = 0 + PlanetName = Minmus + BiomeName = Great Flats + Distribution + { + PresenceChance = 100 + MinAbundance = 2 + MaxAbundance = 10 + Variance = 50 + Dispersal = 3 + } +} +BIOME_RESOURCE +{ + ResourceName = Silicates + ResourceType = 0 + PlanetName = Minmus + BiomeName = Greater Flats + Distribution + { + PresenceChance = 100 + MinAbundance = 2 + MaxAbundance = 10 + Variance = 50 + Dispersal = 3 + } +} \ No newline at end of file diff --git a/FOR_RELEASE/GameData/CommunityResourcePack/ResourceConfigs/Spodumene.cfg b/FOR_RELEASE/GameData/CommunityResourcePack/ResourceConfigs/Spodumene.cfg new file mode 100644 index 0000000..6b35e5a --- /dev/null +++ b/FOR_RELEASE/GameData/CommunityResourcePack/ResourceConfigs/Spodumene.cfg @@ -0,0 +1,310 @@ +// +// Community Resource Pack +// Resource: Spodumene +// +//Resource types: +// 0 = Crustal (Stuff you dig up) +// 1 = Oceanic (Stuff in the oceans) +// 2 = Atmospheric (Stuff in the air, varies with pressure) +// 3 = Interplanetary (Stuff you find between planets) +// +//Express all numbers as percentages 0.0-100.0, not 0.0-1.0! +// +// ####################### Bodys with NO Spodumene (Sun, Jool) +PLANETARY_RESOURCE +{ + ResourceName = Spodumene + ResourceType = 0 + PlanetName = Sun + Distribution + { + PresenceChance = 0 + MinAbundance = 0 + MaxAbundance = 0 + Variance = 0 + Dispersal = 0 + } +} +PLANETARY_RESOURCE // See Biome definitions +{ + ResourceName = Spodumene + ResourceType = 0 + PlanetName = Minmus + Distribution + { + PresenceChance = 0 + MinAbundance = 0 + MaxAbundance = 0 + Variance = 0 + Dispersal = 0 + } +} +PLANETARY_RESOURCE +{ + ResourceName = Spodumene + ResourceType = 0 + PlanetName = Jool + Distribution + { + PresenceChance = 0 + MinAbundance = 0 + MaxAbundance = 0 + Variance = 0 + Dispersal = 0 + } +} +// ####################### Global definition of Spodumene +GLOBAL_RESOURCE +{ + ResourceName = Spodumene + ResourceType = 0 + Distribution + { + PresenceChance = 80 + MinAbundance = .001 + MaxAbundance = 10 + Variance = 50 + Dispersal = 3 + } +} +// ####################### Planetary definition of Spodumene +PLANETARY_RESOURCE +{ + ResourceName = Spodumene + ResourceType = 0 + PlanetName = Moho + Distribution + { + PresenceChance = 100 + MinAbundance = 1 + MaxAbundance = 10 + Variance = 50 + Dispersal = 3 + } +} +PLANETARY_RESOURCE +{ + ResourceName = Spodumene + ResourceType = 0 + PlanetName = Eve + Distribution + { + PresenceChance = 100 + MinAbundance = 3 + MaxAbundance = 15 + Variance = 50 + Dispersal = 3 + } +} +PLANETARY_RESOURCE +{ + ResourceName = Spodumene + ResourceType = 0 + PlanetName = Gilly + Distribution + { + PresenceChance = 100 + MinAbundance = 0.5 + MaxAbundance = 6 + Variance = 50 + Dispersal = 3 + } +} +PLANETARY_RESOURCE +{ + ResourceName = Spodumene + ResourceType = 0 + PlanetName = Kerbin + Distribution + { + PresenceChance = 100 + MinAbundance = 0.1 + MaxAbundance = 20 + Variance = 50 + Dispersal = 3 + } +} +PLANETARY_RESOURCE +{ + ResourceName = Spodumene + ResourceType = 0 + PlanetName = Mun + Distribution + { + PresenceChance = 100 + MinAbundance = 5 + MaxAbundance = 20 + Variance = 50 + Dispersal = 3 + } +} +// No Planetary definition for Minmus; See Biome definition. +PLANETARY_RESOURCE +{ + ResourceName = Spodumene + ResourceType = 0 + PlanetName = Duna + Distribution + { + PresenceChance = 100 + MinAbundance = 1 + MaxAbundance = 10 + Variance = 50 + Dispersal = 3 + } +} +PLANETARY_RESOURCE +{ + ResourceName = Spodumene + ResourceType = 0 + PlanetName = Ike + Distribution + { + PresenceChance = 100 + MinAbundance = 7 + MaxAbundance = 25 + Variance = 50 + Dispersal = 3 + } +} +PLANETARY_RESOURCE +{ + ResourceName = Spodumene + ResourceType = 0 + PlanetName = Dres + Distribution + { + PresenceChance = 100 + MinAbundance = 0.5 + MaxAbundance = 7 + Variance = 50 + Dispersal = 3 + } +} +// No Planetary definition for Jool here (GasGiant); Spodumene prevented, see top. +PLANETARY_RESOURCE +{ + ResourceName = Spodumene + ResourceType = 0 + PlanetName = Laythe + + Distribution + { + PresenceChance = 100 + MinAbundance = 0.1 + MaxAbundance = 2 + Variance = 50 + Dispersal = 3 + } +} +PLANETARY_RESOURCE +{ + ResourceName = Spodumene + ResourceType = 0 + PlanetName = Tylo + + Distribution + { + PresenceChance = 100 + MinAbundance = 3 + MaxAbundance = 15 + Variance = 50 + Dispersal = 3 + } +} +// No Planetary definition for Vall; See Biome definition. +PLANETARY_RESOURCE +{ + ResourceName = Spodumene + ResourceType = 0 + PlanetName = Bop + + Distribution + { + PresenceChance = 100 + MinAbundance = 1 + MaxAbundance = 5 + Variance = 50 + Dispersal = 3 + } +} +PLANETARY_RESOURCE +{ + ResourceName = Spodumene + ResourceType = 0 + PlanetName = Pol + + Distribution + { + PresenceChance = 100 + MinAbundance = 1 + MaxAbundance = 5 + Variance = 50 + Dispersal = 3 + } +} +// No Planetary definition for Eeloo; See Biome definition. +// ####################### Biome definition of Spodumene +// ##### Minmus +BIOME_RESOURCE +{ + ResourceName = Spodumene + ResourceType = 0 + PlanetName = Minmus + BiomeName = Slopes + Distribution + { + PresenceChance = 100 + MinAbundance = 1 + MaxAbundance = 8 + Variance = 50 + Dispersal = 3 + } +} +BIOME_RESOURCE +{ + ResourceName = Spodumene + ResourceType = 0 + PlanetName = Minmus + BiomeName = Poles + Distribution + { + PresenceChance = 100 + MinAbundance = 1 + MaxAbundance = 4 + Variance = 50 + Dispersal = 3 + } +} +// ##### Vall +BIOME_RESOURCE +{ + ResourceName = Spodumene + ResourceType = 0 + PlanetName = Vall + BiomeName = Mountains + Distribution + { + PresenceChance = 100 + MinAbundance = 0.1 + MaxAbundance = 2 + Variance = 50 + Dispersal = 3 + } +} +// ##### Eeloo +BIOME_RESOURCE +{ + ResourceName = Spodumene + ResourceType = 0 + PlanetName = Eeloo + BiomeName = Ice Canyons + Distribution + { + PresenceChance = 100 + MinAbundance = 5 + MaxAbundance = 15 + Variance = 50 + Dispersal = 3 + } +} \ No newline at end of file diff --git a/FOR_RELEASE/GameData/CommunityResourcePack/ResourceConfigs/XenonGas.cfg b/FOR_RELEASE/GameData/CommunityResourcePack/ResourceConfigs/XenonGas.cfg index 1aa0b11..a90111e 100644 --- a/FOR_RELEASE/GameData/CommunityResourcePack/ResourceConfigs/XenonGas.cfg +++ b/FOR_RELEASE/GameData/CommunityResourcePack/ResourceConfigs/XenonGas.cfg @@ -1,52 +1,94 @@ // // Community Resource Pack -// Resource: +// Resource: XenonGas // -//Resource types: +//Resource types: // 0 = Crustal (Stuff you dig up) // 1 = Oceanic (Stuff in the oceans) // 2 = Atmospheric (Stuff in the air, varies with pressure) // 3 = Interplanetary (Stuff you find between planets) // -//Express all numbers as percentages 0.0-100.0, not 0.0-1.0! +//Express all numbers as percentages 0.001-100.0, not < 0.001 or > 100 +// +// scaled_value =IF(original_value >=1, original_value, ROUND(original_value^0.25, 3)) // GLOBAL_RESOURCE { ResourceName = XenonGas ResourceType = 2 - + Distribution { PresenceChance = 50 - MinAbundance = 0.00000005 - MaxAbundance = 0.0000005 + MinAbundance = 0.001 // 0.00000005 - Relative atmospheric scaling applied + MaxAbundance = 0.01 // 0.0000005 - Relative atmospheric scaling applied Variance = 5 } } -GLOBAL_RESOURCE + +// Xenon can be present in Basalt on sea floor +BIOME_RESOURCE { ResourceName = XenonGas - ResourceType = 1 - + ResourceType = 0 + PlanetName = Kerbin + BiomeName = Water + Distribution { - PresenceChance = 50 - MinAbundance = .0001 + PresenceChance = 100 + MinAbundance = 0.001 + MaxAbundance = 0.01 + Variance = 10 + Dispersal = 3 + } +} + +BIOME_RESOURCE +{ + ResourceName = XenonGas + ResourceType = 0 + PlanetName = Kerbin + BiomeName = Water + + Distribution + { + PresenceChance = 100 + MinAbundance = 0.001 MaxAbundance = 0.01 - Variance = 50 + Variance = 10 + Dispersal = 3 } } + +BIOME_RESOURCE +{ + ResourceName = XenonGas + ResourceType = 0 + PlanetName = Laythe + BiomeName = Crater Bay + + Distribution + { + PresenceChance = 100 + MinAbundance = 0.01 + MaxAbundance = 0.02 + Variance = 10 + Dispersal = 3 + } +} + PLANETARY_RESOURCE { ResourceName = XenonGas ResourceType = 2 PlanetName = Kerbin - + Distribution { PresenceChance = 100 - MinAbundance = 0.00000009 - MaxAbundance = 0.0000002 + MinAbundance = 0.001 // 0.00000009 - Relative atmospheric scaling applied + MaxAbundance = 0.002 // 0.0000002 - Relative atmospheric scaling applied Variance = 5 } -} \ No newline at end of file +} diff --git a/FOR_RELEASE/GameData/CommunityResourcePack/SurfaceScanner.cfg b/FOR_RELEASE/GameData/CommunityResourcePack/SurfaceScanner.cfg index a796661..c3a7de0 100644 --- a/FOR_RELEASE/GameData/CommunityResourcePack/SurfaceScanner.cfg +++ b/FOR_RELEASE/GameData/CommunityResourcePack/SurfaceScanner.cfg @@ -1,5 +1,13 @@ @PART[SurfaceScanner] { + MODULE + { + name = ModuleResourceScanner + ScannerType = 0 + ResourceName = Alumina + MaxAbundanceAltitude = 1000 + RequiresUnlock = false + } MODULE { name = ModuleResourceScanner @@ -65,6 +73,14 @@ RequiresUnlock = false } MODULE + { + name = ModuleResourceScanner + ScannerType = 0 + ResourceName = Regolith + MaxAbundanceAltitude = 1000 + RequiresUnlock = false + } + MODULE { name = ModuleResourceScanner ScannerType = 0 @@ -73,6 +89,14 @@ RequiresUnlock = false } MODULE + { + name = ModuleResourceScanner + ScannerType = 0 + ResourceName = Spodumene + MaxAbundanceAltitude = 1000 + RequiresUnlock = false + } + MODULE { name = ModuleResourceScanner ScannerType = 0 diff --git a/FOR_RELEASE/GameData/ModuleManager.3.0.4.dll b/FOR_RELEASE/GameData/ModuleManager.3.0.4.dll deleted file mode 100644 index 5ecfde0..0000000 Binary files a/FOR_RELEASE/GameData/ModuleManager.3.0.4.dll and /dev/null differ diff --git a/FOR_RELEASE/GameData/ModuleManager.4.0.2.dll b/FOR_RELEASE/GameData/ModuleManager.4.0.2.dll new file mode 100644 index 0000000..3ef00da Binary files /dev/null and b/FOR_RELEASE/GameData/ModuleManager.4.0.2.dll differ diff --git a/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/ChangeLog.txt b/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/ChangeLog.txt index 0294bf5..6715775 100644 --- a/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/ChangeLog.txt +++ b/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/ChangeLog.txt @@ -1,3 +1,17 @@ +1.1.0 - 2019.02.05 +------------------ +KSP 1.6.x Compatibility + +1.0.0 - 2018.11.20 +------------------ +KSP 1.5.0 Compatibility +Refactoring + +0.10.0 - 2018.06.22 +------------------ +KSP 1.4.4 Compatibility +Fixed an issue with localization that would cause save corruption (Thanks DasSkelett!) + 0.9.0 - 2018.03.13 ----------------- KSP 1.4.1 Compatibility diff --git a/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/LSModule.cfg b/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/LSModule.cfg index 2ac8732..73174f2 100644 --- a/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/LSModule.cfg +++ b/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/LSModule.cfg @@ -2,28 +2,35 @@ { MODULE { - name = ModuleLifeSupport + name = USI_SwapController + } + MODULE + { + name = USI_SwappableBay + bayName = Bay 1 + moduleIndex = 0 + } + MODULE + { + name = USI_Converter + UseSpecialistBonus = false } - MODULE { - name = ModuleHabitation - BaseKerbalMonths = 21 - CrewCapacity = 4 - BaseHabMultiplier = 0 + name = USILS_HabitationSwapOption ConverterName = Habitat StartActionName = Start Habitat StopActionName = Stop Habitat + + BaseKerbalMonths = 21 + CrewCapacity = 4 + BaseHabMultiplier = 0 + INPUT_RESOURCE { ResourceName = ElectricCharge Ratio = 0.525 } - } - - MODULE - { - name = USI_ModuleFieldRepair } } @@ -31,93 +38,78 @@ { MODULE { - name = ModuleLifeSupport + name = USI_SwapController + } + MODULE + { + name = USI_SwappableBay + bayName = Bay 1 + moduleIndex = 0 + } + MODULE + { + name = USI_Converter + UseSpecialistBonus = false } - MODULE { - name = ModuleHabitation - BaseKerbalMonths = 0 - CrewCapacity = 2 - BaseHabMultiplier = 1.65 + name = USILS_HabitationSwapOption ConverterName = Habitat StartActionName = Start Habitat StopActionName = Stop Habitat + + BaseKerbalMonths = 0 + CrewCapacity = 2 + BaseHabMultiplier = 1.65 + INPUT_RESOURCE { ResourceName = ElectricCharge Ratio = 0.0825 } } - - - MODULE - { - name = USI_ModuleFieldRepair - } } @PART[Large_Crewed_Lab] { MODULE { - name = ModuleLifeSupport + name = USI_SwapController } - MODULE { - name = ModuleLifeSupportRecycler - CrewCapacity = 4 - RecyclePercent = .5 + name = USI_SwappableBay + bayName = Bay 1 + moduleIndex = 0 + } + MODULE + { + name = USI_Converter + UseSpecialistBonus = false + } + MODULE + { + name = USILS_LifeSupportRecyclerSwapOption ConverterName = Life Support - tag = Life Support StartActionName = Start Life Support StopActionName = Stop Life Support + CrewCapacity = 4 + RecyclePercent = 0.5 + INPUT_RESOURCE { ResourceName = ElectricCharge Ratio = 1 } } - - MODULE - { - name = USI_ModuleFieldRepair - } -} - -@PART[*]:HAS[!MODULE[ModuleLifeSupport],#CrewCapacity[*],~CrewCapacity[0]]:FOR[USILifeSupport] -{ - MODULE - { - name = ModuleLifeSupport - } - - MODULE - { - name = USI_ModuleFieldRepair - } -} - -@PART[*]:HAS[!MODULE[ModuleLifeSupport],MODULE[KerbalSeat]]:FOR[USILifeSupport] -{ - MODULE - { - name = ModuleLifeSupport - } - - MODULE - { - name = USI_ModuleFieldRepair - } } @PART[MiniISRU] { MODULE { - name = ModuleResourceConverter_USI + name = ModuleResourceConverter ConverterName = Fertilizer StartActionName = Start ISRU [Ore -> Fertilizer] StopActionName = Stop ISRU [Ore -> Fertilizer] diff --git a/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/Fert_125.cfg b/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/Fert_125.cfg index 916d2f1..e4e9e79 100644 --- a/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/Fert_125.cfg +++ b/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/Fert_125.cfg @@ -1,49 +1,48 @@ PART { -name = Fert_Tank_125 -module = Part -author = RoverDude + name = Fert_Tank_125 + module = Part + author = RoverDude -MODEL -{ - model = UmbraSpaceIndustries/LifeSupport/Assets/FertTank125 -} - -rescaleFactor = 1 + MODEL + { + model = UmbraSpaceIndustries/LifeSupport/Assets/FertTank125 + } -node_attach = 0,0,0.6,0,0,-1,1 -node_stack_top = 0.0, .25, 0.0, 0.0, 1.0, 0.0, 1 -node_stack_bottom = 0.0, -.25, 0.0, 0.0, -1.0, 0.0, 1 + rescaleFactor = 1 + node_attach = 0,0,0.6,0,0,-1,1 + node_stack_top = 0.0, .25, 0.0, 0.0, 1.0, 0.0, 1 + node_stack_bottom = 0.0, -.25, 0.0, 0.0, -1.0, 0.0, 1 -TechRequired = survivability -entryCost = 3000 -cost = 500 -category = none -subcategory = 0 -title = Fertilizer Tank (1.25) -manufacturer = USI - Life Support Division -description = A tank filled to the brim with Super-Gro Fertilizer. It's what plants crave! -attachRules = 1,1,1,1,0 -tags = cck-lifesupport -// --- standard part parameters --- -mass = 0.1 -dragModelType = default -maximum_drag = 0.2 -minimum_drag = 0.2 -angularDrag = 2 -crashTolerance = 7 -maxTemp = 2000 // = 3000 -bulkheadProfiles = size1,srf + TechRequired = survivability + entryCost = 3000 + cost = 500 + category = none + subcategory = 0 + title = Fertilizer Tank (1.25) + manufacturer = USI - Life Support Division + description = A tank filled to the brim with Super-Gro Fertilizer. It's what plants crave! + attachRules = 1,1,1,1,0 + tags = cck-lifesupport + // --- standard part parameters --- + mass = 0.1 + dragModelType = default + maximum_drag = 0.2 + minimum_drag = 0.2 + angularDrag = 2 + crashTolerance = 7 + maxTemp = 2000 // = 3000 + bulkheadProfiles = size1,srf -RESOURCE -{ - name = Fertilizer - amount = 500 - maxAmount = 500 -} MODULE { name = USI_ModuleResourceWarehouse } + RESOURCE + { + name = Fertilizer + amount = 500 + maxAmount = 500 + } } diff --git a/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/Fert_250.cfg b/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/Fert_250.cfg index eac63a2..ed2bde0 100644 --- a/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/Fert_250.cfg +++ b/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/Fert_250.cfg @@ -1,49 +1,48 @@ PART { -name = Fert_Tank_250 -module = Part -author = RoverDude + name = Fert_Tank_250 + module = Part + author = RoverDude -MODEL -{ - model = UmbraSpaceIndustries/LifeSupport/Assets/FertTank250 -} - -rescaleFactor = 1 + MODEL + { + model = UmbraSpaceIndustries/LifeSupport/Assets/FertTank250 + } -node_attach = 0,0,1.2,0,0,-1,2 -node_stack_top = 0.0, .5, 0.0, 0.0, 1.0, 0.0, 2 -node_stack_bottom = 0.0, -.5, 0.0, 0.0, -1.0, 0.0, 2 + rescaleFactor = 1 + node_attach = 0,0,1.2,0,0,-1,2 + node_stack_top = 0.0, .5, 0.0, 0.0, 1.0, 0.0, 2 + node_stack_bottom = 0.0, -.5, 0.0, 0.0, -1.0, 0.0, 2 -TechRequired = survivability -entryCost = 3000 -cost = 1000 -category = none -subcategory = 0 -title = Fertilizer Tank (2.5) -manufacturer = USI - Life Support Division -description = A tank filled to the brim with Super-Gro Fertilizer. It's what plants crave! -attachRules = 1,1,1,1,0 - tags = cck-lifesupport -// --- standard part parameters --- -mass = 0.9 -dragModelType = default -maximum_drag = 0.2 -minimum_drag = 0.2 -angularDrag = 2 -crashTolerance = 7 -maxTemp = 2000 // = 3000 -bulkheadProfiles = size2,srf + TechRequired = survivability + entryCost = 3000 + cost = 1000 + category = none + subcategory = 0 + title = Fertilizer Tank (2.5) + manufacturer = USI - Life Support Division + description = A tank filled to the brim with Super-Gro Fertilizer. It's what plants crave! + attachRules = 1,1,1,1,0 + tags = cck-lifesupport + // --- standard part parameters --- + mass = 0.9 + dragModelType = default + maximum_drag = 0.2 + minimum_drag = 0.2 + angularDrag = 2 + crashTolerance = 7 + maxTemp = 2000 // = 3000 + bulkheadProfiles = size2,srf -RESOURCE -{ - name = Fertilizer - amount = 4500 - maxAmount = 4500 -} MODULE { name = USI_ModuleResourceWarehouse } + RESOURCE + { + name = Fertilizer + amount = 4500 + maxAmount = 4500 + } } diff --git a/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/Fert_375.cfg b/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/Fert_375.cfg index c11770b..c54fc38 100644 --- a/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/Fert_375.cfg +++ b/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/Fert_375.cfg @@ -1,48 +1,47 @@ PART { -name = Fert_Tank_375 -module = Part -author = RoverDude + name = Fert_Tank_375 + module = Part + author = RoverDude -MODEL -{ - model = UmbraSpaceIndustries/LifeSupport/Assets/FertTank375 -} -rescaleFactor = 1 - -node_attach = 0,0,1.8,0,0,-1,3 -node_stack_top = 0.0, .75, 0.0, 0.0, 1.0, 0.0, 3 -node_stack_bottom = 0.0, -.75, 0.0, 0.0, -1.0, 0.0, 3 + MODEL + { + model = UmbraSpaceIndustries/LifeSupport/Assets/FertTank375 + } + rescaleFactor = 1 + node_attach = 0,0,1.8,0,0,-1,3 + node_stack_top = 0.0, .75, 0.0, 0.0, 1.0, 0.0, 3 + node_stack_bottom = 0.0, -.75, 0.0, 0.0, -1.0, 0.0, 3 -TechRequired = survivability -entryCost = 3000 -cost = 1500 -category = none -subcategory = 0 -title = Fertilizer Tank (3.75) -manufacturer = USI - Life Support Division -description = A tank filled to the brim with Super-Gro Fertilizer. It's what plants crave! -attachRules = 1,1,1,1,0 - tags = cck-lifesupport -// --- standard part parameters --- -mass = 3.0 -dragModelType = default -maximum_drag = 0.2 -minimum_drag = 0.2 -angularDrag = 2 -crashTolerance = 7 -maxTemp = 2000 // = 3000 -bulkheadProfiles = size3,srf + TechRequired = survivability + entryCost = 3000 + cost = 1500 + category = none + subcategory = 0 + title = Fertilizer Tank (3.75) + manufacturer = USI - Life Support Division + description = A tank filled to the brim with Super-Gro Fertilizer. It's what plants crave! + attachRules = 1,1,1,1,0 + tags = cck-lifesupport + // --- standard part parameters --- + mass = 3.0 + dragModelType = default + maximum_drag = 0.2 + minimum_drag = 0.2 + angularDrag = 2 + crashTolerance = 7 + maxTemp = 2000 // = 3000 + bulkheadProfiles = size3,srf -RESOURCE -{ - name = Fertilizer - amount = 15000 - maxAmount = 15000 -} MODULE { name = USI_ModuleResourceWarehouse } + RESOURCE + { + name = Fertilizer + amount = 15000 + maxAmount = 15000 + } } diff --git a/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/Greenhouse_Cupola.cfg b/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/Greenhouse_Cupola.cfg index cde16c2..c5047d8 100644 --- a/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/Greenhouse_Cupola.cfg +++ b/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/Greenhouse_Cupola.cfg @@ -31,41 +31,28 @@ PART model = UmbraSpaceIndustries/LifeSupport/Assets/JumboGreenhouse } - RESOURCE + MODULE { - name = Mulch - amount = 0 - maxAmount = 100 + name = USI_SwapController } - RESOURCE + MODULE { - name = Supplies - amount = 0 - maxAmount = 100 + name = USI_SwappableBay + bayName = Bay 1 + moduleIndex = 0 } - RESOURCE - { - name = Fertilizer - amount = 0 - maxAmount = 100 - } - RESOURCE + MODULE { - name = ElectricCharge - amount = 200 - maxAmount = 200 + name = USI_Converter + UseSpecialistBonus = false } - - - - MODULE { - name = ModuleResourceConverter_USI + name = USI_ConverterSwapOption ConverterName = Agroponics - tag = Agroponics StartActionName = Start Agroponics StopActionName = Stop Agroponics + INPUT_RESOURCE { ResourceName = Mulch @@ -87,5 +74,29 @@ PART ResourceName = ElectricCharge Ratio = 1.32 } - } + } + RESOURCE + { + name = Supplies + amount = 0 + maxAmount = 100 + } + RESOURCE + { + name = Fertilizer + amount = 0 + maxAmount = 100 + } + RESOURCE + { + name = Mulch + amount = 0 + maxAmount = 100 + } + RESOURCE + { + name = ElectricCharge + amount = 200 + maxAmount = 200 + } } diff --git a/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/Greenhouse_Inline.cfg b/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/Greenhouse_Inline.cfg index 4c1446f..44418a8 100644 --- a/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/Greenhouse_Inline.cfg +++ b/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/Greenhouse_Inline.cfg @@ -26,48 +26,38 @@ PART maxTemp = 1700 tags = cck-lifesupport CrewCapacity = 2 - INTERNAL - { - name = crewCabinInternals - } MODEL { model = UmbraSpaceIndustries/LifeSupport/Assets/InlineGreenhouse } - - RESOURCE + INTERNAL { - name = Mulch - amount = 0 - maxAmount = 300 + name = crewCabinInternals } - RESOURCE + + MODULE { - name = Supplies - amount = 0 - maxAmount = 300 + name = USI_SwapController } - RESOURCE + MODULE { - name = Fertilizer - amount = 0 - maxAmount = 300 + name = USI_SwappableBay + bayName = Bay 1 + moduleIndex = 0 } - RESOURCE + MODULE { - name = ElectricCharge - amount = 600 - maxAmount = 600 + name = USI_Converter + UseSpecialistBonus = false } - MODULE { - name = ModuleResourceConverter_USI + name = USI_ConverterSwapOption ConverterName = Agroponics - tag = Agroponics StartActionName = Start Agroponics StopActionName = Stop Agroponics + INPUT_RESOURCE { ResourceName = Mulch @@ -90,4 +80,28 @@ PART Ratio = 2.64 } } + RESOURCE + { + name = Supplies + amount = 0 + maxAmount = 300 + } + RESOURCE + { + name = Fertilizer + amount = 0 + maxAmount = 300 + } + RESOURCE + { + name = Mulch + amount = 0 + maxAmount = 300 + } + RESOURCE + { + name = ElectricCharge + amount = 600 + maxAmount = 600 + } } diff --git a/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/Greenhouse_MiniCupola.cfg b/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/Greenhouse_MiniCupola.cfg index 3ed9b98..f328016 100644 --- a/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/Greenhouse_MiniCupola.cfg +++ b/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/Greenhouse_MiniCupola.cfg @@ -26,45 +26,34 @@ PART maxTemp = 1700 bulkheadProfiles = size1,srf tags = cck-lifesupport + MODEL { model = UmbraSpaceIndustries/LifeSupport/Assets/Greenhouse } - RESOURCE - { - name = Mulch - amount = 0 - maxAmount = 50 - } - RESOURCE + MODULE { - name = Supplies - amount = 0 - maxAmount = 50 + name = USI_SwapController } - RESOURCE + MODULE { - name = Fertilizer - amount = 0 - maxAmount = 50 + name = USI_SwappableBay + bayName = Bay 1 + moduleIndex = 0 } - RESOURCE + MODULE { - name = ElectricCharge - amount = 100 - maxAmount = 100 + name = USI_Converter + UseSpecialistBonus = false } - - - MODULE { - name = ModuleResourceConverter_USI + name = USI_ConverterSwapOption ConverterName = Agroponics - tag = Agroponics StartActionName = Start Agroponics StopActionName = Stop Agroponics + INPUT_RESOURCE { ResourceName = Mulch @@ -87,4 +76,28 @@ PART Ratio = 0.26 } } + RESOURCE + { + name = Supplies + amount = 0 + maxAmount = 50 + } + RESOURCE + { + name = Fertilizer + amount = 0 + maxAmount = 50 + } + RESOURCE + { + name = Mulch + amount = 0 + maxAmount = 50 + } + RESOURCE + { + name = ElectricCharge + amount = 100 + maxAmount = 100 + } } diff --git a/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/LgRecycler.cfg b/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/LgRecycler.cfg index 77d6bba..154f50e 100644 --- a/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/LgRecycler.cfg +++ b/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/LgRecycler.cfg @@ -25,21 +25,36 @@ PART breakingTorque = 280 maxTemp = 1700 tags = cck-lifesupport + MODEL { model = UmbraSpaceIndustries/LifeSupport/Assets/LgRecycler } - MODULE { - name = ModuleLifeSupportRecycler - CrewCapacity = 3 - RecyclePercent = 0.79 + name = USI_SwapController + } + MODULE + { + name = USI_SwappableBay + bayName = Bay 1 + moduleIndex = 0 + } + MODULE + { + name = USI_Converter + UseSpecialistBonus = false + } + MODULE + { + name = USILS_LifeSupportRecyclerSwapOption ConverterName = Life Support - tag = Life Support StartActionName = Start Life Support StopActionName = Stop Life Support + CrewCapacity = 3 + RecyclePercent = 0.79 + INPUT_RESOURCE { ResourceName = ElectricCharge diff --git a/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/MiniPak_01.cfg b/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/MiniPak_01.cfg index f911e46..1ee1e63 100644 --- a/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/MiniPak_01.cfg +++ b/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/MiniPak_01.cfg @@ -30,14 +30,14 @@ PART texture = miniPak, UmbraSpaceIndustries/LifeSupport/Assets/miniPak_01 } + MODULE + { + name = USI_ModuleResourceWarehouse + } RESOURCE { name = Supplies amount = 100 maxAmount = 100 } - MODULE - { - name = USI_ModuleResourceWarehouse - } } diff --git a/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/MiniPak_02.cfg b/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/MiniPak_02.cfg index e1893c0..7fc6b4f 100644 --- a/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/MiniPak_02.cfg +++ b/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/MiniPak_02.cfg @@ -30,14 +30,14 @@ PART texture = miniPak, UmbraSpaceIndustries/LifeSupport/Assets/miniPak_03 } + MODULE + { + name = USI_ModuleResourceWarehouse + } RESOURCE { name = Fertilizer amount = 100 maxAmount = 100 } - MODULE - { - name = USI_ModuleResourceWarehouse - } } diff --git a/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/MiniPak_03.cfg b/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/MiniPak_03.cfg index e2fac94..43af2fe 100644 --- a/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/MiniPak_03.cfg +++ b/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/MiniPak_03.cfg @@ -30,14 +30,14 @@ PART texture = miniPak, UmbraSpaceIndustries/LifeSupport/Assets/miniPak_02 } + MODULE + { + name = USI_ModuleResourceWarehouse + } RESOURCE { name = Mulch amount = 0 maxAmount = 100 } - MODULE - { - name = USI_ModuleResourceWarehouse - } } diff --git a/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/Recycler.cfg b/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/Recycler.cfg index 2d96574..5ce4bb3 100644 --- a/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/Recycler.cfg +++ b/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/Recycler.cfg @@ -24,6 +24,7 @@ PART breakingTorque = 280 maxTemp = 1700 tags = cck-lifesupport + MODEL { model = UmbraSpaceIndustries/LifeSupport/Assets/Recycler @@ -31,19 +32,33 @@ PART MODULE { - name = ModuleLifeSupportRecycler - CrewCapacity = 1 - RecyclePercent = .6 + name = USI_SwapController + } + MODULE + { + name = USI_SwappableBay + bayName = Bay 1 + moduleIndex = 0 + } + MODULE + { + name = USI_Converter + UseSpecialistBonus = false + } + MODULE + { + name = USILS_LifeSupportRecyclerSwapOption ConverterName = Life Support - tag = Life Support StartActionName = Start Life Support StopActionName = Stop Life Support + CrewCapacity = 1 + RecyclePercent = .6 + INPUT_RESOURCE { ResourceName = ElectricCharge Ratio = .5 } } - } diff --git a/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/SmCupola.cfg b/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/SmCupola.cfg index 93941f3..18f12af 100644 --- a/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/SmCupola.cfg +++ b/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/SmCupola.cfg @@ -26,19 +26,38 @@ PART maxTemp = 1700 bulkheadProfiles = size1,srf tags = cck-lifesupport + MODEL { model = UmbraSpaceIndustries/LifeSupport/Assets/SmCupola } + + MODULE + { + name = USI_SwapController + } + MODULE + { + name = USI_SwappableBay + bayName = Bay 1 + moduleIndex = 0 + } + MODULE + { + name = USI_Converter + UseSpecialistBonus = false + } MODULE { - name = ModuleHabitation - BaseKerbalMonths = 0 - CrewCapacity = 1 - BaseHabMultiplier = 0.7 + name = USILS_HabitationSwapOption ConverterName = Habitat StartActionName = Start Habitat StopActionName = Stop Habitat + + BaseKerbalMonths = 0 + CrewCapacity = 1 + BaseHabMultiplier = 0.7 + INPUT_RESOURCE { ResourceName = ElectricCharge diff --git a/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/Tank_125.cfg b/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/Tank_125.cfg index 647407b..86f73b3 100644 --- a/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/Tank_125.cfg +++ b/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/Tank_125.cfg @@ -1,56 +1,55 @@ PART { -name = LS_Tank_125 -module = Part -author = RoverDude + name = LS_Tank_125 + module = Part + author = RoverDude -MODEL -{ - model = UmbraSpaceIndustries/LifeSupport/Assets/Tank_125 -} + MODEL + { + model = UmbraSpaceIndustries/LifeSupport/Assets/Tank_125 + } -rescaleFactor = 1 + rescaleFactor = 1 -node_attach = 0,0,0.6,0,0,-1,1 -node_stack_top = 0.0, .25, 0.0, 0.0, 1.0, 0.0, 1 -node_stack_bottom = 0.0, -.25, 0.0, 0.0, -1.0, 0.0, 1 + node_attach = 0,0,0.6,0,0,-1,1 + node_stack_top = 0.0, .25, 0.0, 0.0, 1.0, 0.0, 1 + node_stack_bottom = 0.0, -.25, 0.0, 0.0, -1.0, 0.0, 1 tags = cck-lifesupport -TechRequired = survivability -entryCost = 3000 -cost = 500 -category = none -subcategory = 0 -title = Life Support Tank (1.25) -manufacturer = USI - Life Support Division -description = A tank filled to the brim with Nutritional Organic Meal Substitutes (N.O.M.S.). -attachRules = 1,1,1,1,0 + TechRequired = survivability + entryCost = 3000 + cost = 500 + category = none + subcategory = 0 + title = Life Support Tank (1.25) + manufacturer = USI - Life Support Division + description = A tank filled to the brim with Nutritional Organic Meal Substitutes (N.O.M.S.). + attachRules = 1,1,1,1,0 -// --- standard part parameters --- -mass = 0.1 -dragModelType = default -maximum_drag = 0.2 -minimum_drag = 0.2 -angularDrag = 2 -crashTolerance = 7 -maxTemp = 2000 // = 3000 -bulkheadProfiles = size1,srf - -RESOURCE -{ - name = Supplies - amount = 500 - maxAmount = 500 -} + // --- standard part parameters --- + mass = 0.1 + dragModelType = default + maximum_drag = 0.2 + minimum_drag = 0.2 + angularDrag = 2 + crashTolerance = 7 + maxTemp = 2000 // = 3000 + bulkheadProfiles = size1,srf -RESOURCE -{ - name = Mulch - amount = 0 - maxAmount = 10 -} MODULE { name = USI_ModuleResourceWarehouse } + RESOURCE + { + name = Supplies + amount = 500 + maxAmount = 500 + } + RESOURCE + { + name = Mulch + amount = 0 + maxAmount = 10 + } } diff --git a/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/Tank_250.cfg b/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/Tank_250.cfg index 5a09925..c9d916f 100644 --- a/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/Tank_250.cfg +++ b/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/Tank_250.cfg @@ -1,56 +1,55 @@ PART { -name = LS_Tank_250 -module = Part -author = RoverDude + name = LS_Tank_250 + module = Part + author = RoverDude -MODEL -{ - model = UmbraSpaceIndustries/LifeSupport/Assets/Tank_250 -} + MODEL + { + model = UmbraSpaceIndustries/LifeSupport/Assets/Tank_250 + } -rescaleFactor = 1 + rescaleFactor = 1 -node_attach = 0,0,1.2,0,0,-1,2 -node_stack_top = 0.0, .5, 0.0, 0.0, 1.0, 0.0, 2 -node_stack_bottom = 0.0, -.5, 0.0, 0.0, -1.0, 0.0, 2 + node_attach = 0,0,1.2,0,0,-1,2 + node_stack_top = 0.0, .5, 0.0, 0.0, 1.0, 0.0, 2 + node_stack_bottom = 0.0, -.5, 0.0, 0.0, -1.0, 0.0, 2 tags = cck-lifesupport -TechRequired = survivability -entryCost = 3000 -cost = 1000 -category = none -subcategory = 0 -title = Life Support Tank (2.5) -manufacturer = USI - Life Support Division -description = A tank filled to the brim with Nutritional Organic Meal Substitutes (N.O.M.S.). -attachRules = 1,1,1,1,0 + TechRequired = survivability + entryCost = 3000 + cost = 1000 + category = none + subcategory = 0 + title = Life Support Tank (2.5) + manufacturer = USI - Life Support Division + description = A tank filled to the brim with Nutritional Organic Meal Substitutes (N.O.M.S.). + attachRules = 1,1,1,1,0 -// --- standard part parameters --- -mass = 0.9 -dragModelType = default -maximum_drag = 0.2 -minimum_drag = 0.2 -angularDrag = 2 -crashTolerance = 7 -maxTemp = 2000 // = 3000 -bulkheadProfiles = size2,srf - -RESOURCE -{ - name = Supplies - amount = 4500 - maxAmount = 4500 -} + // --- standard part parameters --- + mass = 0.9 + dragModelType = default + maximum_drag = 0.2 + minimum_drag = 0.2 + angularDrag = 2 + crashTolerance = 7 + maxTemp = 2000 // = 3000 + bulkheadProfiles = size2,srf -RESOURCE -{ - name = Mulch - amount = 0 - maxAmount = 150 -} MODULE { name = USI_ModuleResourceWarehouse } + RESOURCE + { + name = Supplies + amount = 4500 + maxAmount = 4500 + } + RESOURCE + { + name = Mulch + amount = 0 + maxAmount = 150 + } } diff --git a/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/Tank_375.cfg b/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/Tank_375.cfg index a1bdf18..ec229f5 100644 --- a/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/Tank_375.cfg +++ b/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/Tank_375.cfg @@ -1,53 +1,51 @@ PART { -name = LS_Tank_375 -module = Part -author = RoverDude + name = LS_Tank_375 + module = Part + author = RoverDude -MODEL -{ - model = UmbraSpaceIndustries/LifeSupport/Assets/Tank_375 -} -rescaleFactor = 1 - -node_attach = 0,0,1.8,0,0,-1,3 -node_stack_top = 0.0, .75, 0.0, 0.0, 1.0, 0.0, 3 -node_stack_bottom = 0.0, -.75, 0.0, 0.0, -1.0, 0.0, 3 + MODEL + { + model = UmbraSpaceIndustries/LifeSupport/Assets/Tank_375 + } + rescaleFactor = 1 + node_attach = 0,0,1.8,0,0,-1,3 + node_stack_top = 0.0, .75, 0.0, 0.0, 1.0, 0.0, 3 + node_stack_bottom = 0.0, -.75, 0.0, 0.0, -1.0, 0.0, 3 -TechRequired = survivability -entryCost = 3000 -cost = 1500 -category = none -subcategory = 0 -title = Life Support Tank (3.75) -manufacturer = USI - Life Support Division -description = A tank filled to the brim with Nutritional Organic Meal Substitutes (N.O.M.S.). -attachRules = 1,1,1,1,0 + TechRequired = survivability + entryCost = 3000 + cost = 1500 + category = none + subcategory = 0 + title = Life Support Tank (3.75) + manufacturer = USI - Life Support Division + description = A tank filled to the brim with Nutritional Organic Meal Substitutes (N.O.M.S.). + attachRules = 1,1,1,1,0 tags = cck-lifesupport -// --- standard part parameters --- -mass = 3.0 -dragModelType = default -maximum_drag = 0.2 -minimum_drag = 0.2 -angularDrag = 2 -crashTolerance = 7 -maxTemp = 2000 // = 3000 -bulkheadProfiles = size3,srf - -RESOURCE -{ - name = Supplies - amount = 15000 - maxAmount = 15000 -} + // --- standard part parameters --- + mass = 3.0 + dragModelType = default + maximum_drag = 0.2 + minimum_drag = 0.2 + angularDrag = 2 + crashTolerance = 7 + maxTemp = 2000 // = 3000 + bulkheadProfiles = size3,srf -RESOURCE -{ - name = Mulch - amount = 0 - maxAmount = 300 -} + RESOURCE + { + name = Supplies + amount = 15000 + maxAmount = 15000 + } + RESOURCE + { + name = Mulch + amount = 0 + maxAmount = 300 + } MODULE { name = USI_ModuleResourceWarehouse diff --git a/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/ViewingCupola.cfg b/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/ViewingCupola.cfg index e4d4e00..0c7a93b 100644 --- a/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/ViewingCupola.cfg +++ b/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Parts/ViewingCupola.cfg @@ -26,15 +26,17 @@ PART maxTemp = 1700 bulkheadProfiles = size1,srf tags = cck-lifesupport + CrewCapacity = 1 + MODEL { model = UmbraSpaceIndustries/LifeSupport/Assets/ViewingCupola } - CrewCapacity = 1 INTERNAL { name = ViewingCupolaInternal } + MODULE { name = FlagDecal @@ -42,13 +44,30 @@ PART } MODULE { - name = ModuleHabitation - BaseKerbalMonths = 0 - CrewCapacity = 1 - BaseHabMultiplier = 0.5 + name = USI_SwapController + } + MODULE + { + name = USI_SwappableBay + bayName = Bay 1 + moduleIndex = 0 + } + MODULE + { + name = USI_Converter + UseSpecialistBonus = false + } + MODULE + { + name = USILS_HabitationSwapOption ConverterName = Habitat StartActionName = Start Habitat StopActionName = Stop Habitat + + BaseKerbalMonths = 0 + CrewCapacity = 1 + BaseHabMultiplier = 0.5 + INPUT_RESOURCE { ResourceName = ElectricCharge diff --git a/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Spaces/ViewingCupola_Internall.cfg b/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Spaces/ViewingCupola_Internal.cfg similarity index 99% rename from FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Spaces/ViewingCupola_Internall.cfg rename to FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Spaces/ViewingCupola_Internal.cfg index daf8e7e..9758685 100644 --- a/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Spaces/ViewingCupola_Internall.cfg +++ b/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/Spaces/ViewingCupola_Internal.cfg @@ -11,5 +11,4 @@ INTERNAL seatTransformName = Kerbal_01 allowCrewHelmet = false } - } diff --git a/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/USI-LS.version b/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/USI-LS.version index 9f94437..9f13f84 100644 --- a/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/USI-LS.version +++ b/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/USI-LS.version @@ -8,24 +8,24 @@ "ALLOW_PRE_RELEASE":false }, "VERSION":{ - "MAJOR":0, - "MINOR":9, + "MAJOR":1, + "MINOR":1, "PATCH":0, "BUILD":0 }, "KSP_VERSION":{ "MAJOR":1, - "MINOR":4, - "PATCH":1 + "MINOR":6, + "PATCH":0 }, "KSP_VERSION_MIN":{ "MAJOR":1, - "MINOR":4, + "MINOR":6, "PATCH":0 }, "KSP_VERSION_MAX":{ "MAJOR":1, - "MINOR":4, + "MINOR":6, "PATCH":9 } } diff --git a/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/USILifeSupport.dll b/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/USILifeSupport.dll index 0804417..6b2dae6 100644 Binary files a/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/USILifeSupport.dll and b/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/USILifeSupport.dll differ diff --git a/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/USILifeSupport.dll.mdb b/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/USILifeSupport.dll.mdb index 287b836..69e628f 100644 Binary files a/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/USILifeSupport.dll.mdb and b/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/USILifeSupport.dll.mdb differ diff --git a/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/USILifeSupport.pdb b/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/USILifeSupport.pdb index 970cc7e..95ce18c 100644 Binary files a/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/USILifeSupport.pdb and b/FOR_RELEASE/GameData/UmbraSpaceIndustries/LifeSupport/USILifeSupport.pdb differ diff --git a/Source/USILifeSupport/Converters/DeprecatedClasses.cs b/Source/USILifeSupport/Converters/DeprecatedClasses.cs new file mode 100644 index 0000000..4b4eae0 --- /dev/null +++ b/Source/USILifeSupport/Converters/DeprecatedClasses.cs @@ -0,0 +1,16 @@ +using System; + +namespace LifeSupport +{ + [Obsolete("Use USILS_HabitationSwapOption and related classes instead.")] + public class ModuleHabitation { } + + [Obsolete("Use USILS_LifeSupportExtenderSwapOption and related classes instead.")] + public class ModuleLifeSupportExtender { } + + [Obsolete("Use USILS_LifeSupportRecyclerSwapOption and related classes instead.")] + public class ModuleLifeSupportRecycler { } + + [Obsolete("Use ModuleLifeSupportSystem instead.")] + public class ModuleLifeSupport { } +} diff --git a/Source/USILifeSupport/Converters/USILS_HabitationConverterAddon.cs b/Source/USILifeSupport/Converters/USILS_HabitationConverterAddon.cs new file mode 100644 index 0000000..7e62a1b --- /dev/null +++ b/Source/USILifeSupport/Converters/USILS_HabitationConverterAddon.cs @@ -0,0 +1,57 @@ +using USITools; + +namespace LifeSupport +{ + public class USILS_HabitationConverterAddon : AbstractConverterAddon + { + public double BaseKerbalMonths = 1; + public double CrewCapacity = 10; + public double BaseHabMultiplier = 0; + public bool HabIsActive = false; + + private double _habAdjustment = 1d; + public double HabAdjustment + { + get + { + return HighLogic.LoadedSceneIsEditor ? 1d : _habAdjustment; + } + set { _habAdjustment = value; } + } + + public double HabMultiplier + { + get + { + if ((HabIsActive && IsActive) || HighLogic.LoadedSceneIsEditor) + return BaseHabMultiplier * HabAdjustment; + + return 0f; + } + } + + public double KerbalMonths + { + get + { + if (HighLogic.LoadedSceneIsEditor) + return BaseKerbalMonths; + + if (!HabIsActive || !IsActive) + HabAdjustment = 0d; + + return BaseKerbalMonths * HabAdjustment; + } + } + + public USILS_HabitationConverterAddon(USI_Converter converter) : base(converter) { } + + public override void PostProcess(ConverterResults result, double deltaTime) + { + base.PostProcess(result, deltaTime); + + HabIsActive = result.TimeFactor > ResourceUtilities.FLOAT_TOLERANCE; + HabAdjustment = result.TimeFactor / deltaTime; + } + } +} diff --git a/Source/USILifeSupport/Converters/USILS_HabitationSwapOption.cs b/Source/USILifeSupport/Converters/USILS_HabitationSwapOption.cs new file mode 100644 index 0000000..9f5e21e --- /dev/null +++ b/Source/USILifeSupport/Converters/USILS_HabitationSwapOption.cs @@ -0,0 +1,43 @@ +using System.Text; +using USITools; + +namespace LifeSupport +{ + public class USILS_HabitationSwapOption : USI_ConverterSwapOption + { + [KSPField] + public double BaseKerbalMonths = 1; + + [KSPField] + public double CrewCapacity = 10; + + [KSPField] + public double BaseHabMultiplier = 0; + + public override void ApplyConverterChanges(USI_Converter converter) + { + UseEfficiencyBonus = false; + + converter.Addons.Add(new USILS_HabitationConverterAddon(converter) + { + BaseHabMultiplier = BaseHabMultiplier, + BaseKerbalMonths = BaseKerbalMonths, + CrewCapacity = CrewCapacity + }); + + base.ApplyConverterChanges(converter); + } + + public override string GetInfo() + { + var output = new StringBuilder(); + output.AppendLine(); + output.AppendLine(base.GetInfo()); + output.AppendLine(string.Format("Kerbal-Months: {0}", BaseKerbalMonths + part.CrewCapacity)); + output.AppendLine(string.Format("Crew Affected: {0}", CrewCapacity)); + output.AppendLine(string.Format("Hab Multipler: {0}", BaseHabMultiplier)); + + return output.ToString(); + } + } +} diff --git a/Source/USILifeSupport/Converters/USILS_LifeSupportExtenderConverterAddon.cs b/Source/USILifeSupport/Converters/USILS_LifeSupportExtenderConverterAddon.cs new file mode 100644 index 0000000..3757982 --- /dev/null +++ b/Source/USILifeSupport/Converters/USILS_LifeSupportExtenderConverterAddon.cs @@ -0,0 +1,73 @@ +using System.Collections.Generic; +using USITools; + +namespace LifeSupport +{ + public class USILS_LifeSupportExtenderConverterAddon : AbstractConverterAddon + { + public float TimeMultiplier = 1f; + public bool AffectsPartOnly = false; + public string RestrictedToClass = ""; + public bool AffectsHomeTimer = true; + public bool AffectsHabTimer = true; + + public USILS_LifeSupportExtenderConverterAddon(USI_Converter converter) : base(converter) { } + + public override void PreProcessing() + { + if (!HighLogic.LoadedSceneIsFlight) + return; + + base.PreProcessing(); + + var v = LifeSupportManager.Instance.FetchVessel(Converter.vessel.id.ToString()); + + var e = 1d; + if (v != null) + { + e += v.VesselHabMultiplier; + } + + Converter.EfficiencyBonus = (float)e; + } + + public override void PostProcess(ConverterResults result, double deltaTime) + { + if (!HighLogic.LoadedSceneIsFlight) + return; + + base.PostProcess(result, deltaTime); + var baseTime = TimeMultiplier * result.TimeFactor; + var kerbals = new List(); + var crew = Converter.vessel.GetVesselCrew(); + if (AffectsPartOnly) + crew = Converter.part.protoModuleCrew; + + var count = crew.Count; + for (int i = 0; i < count; ++i) + { + var c = crew[i]; + if (string.IsNullOrEmpty(RestrictedToClass) || c.experienceTrait.Title == RestrictedToClass) + kerbals.Add(c); + } + + if (kerbals.Count == 0) + return; + + var timePerKerbal = baseTime / kerbals.Count; + + count = kerbals.Count; + for (int i = 0; i < count; ++i) + { + var k = kerbals[i]; + var lsKerbal = LifeSupportManager.Instance.FetchKerbal(k); + if (AffectsHomeTimer) + lsKerbal.MaxOffKerbinTime += timePerKerbal; + if (AffectsHabTimer) + lsKerbal.TimeEnteredVessel += timePerKerbal; + + LifeSupportManager.Instance.TrackKerbal(lsKerbal); + } + } + } +} diff --git a/Source/USILifeSupport/Converters/USILS_LifeSupportExtenderSwapOption.cs b/Source/USILifeSupport/Converters/USILS_LifeSupportExtenderSwapOption.cs new file mode 100644 index 0000000..bc8ea86 --- /dev/null +++ b/Source/USILifeSupport/Converters/USILS_LifeSupportExtenderSwapOption.cs @@ -0,0 +1,57 @@ +using System.Text; +using USITools; + +namespace LifeSupport +{ + public class USILS_LifeSupportExtenderSwapOption : USI_ConverterSwapOption + { + [KSPField] + public float TimeMultiplier = 1f; + + [KSPField] + public bool AffectsPartOnly = false; + + [KSPField] + public string RestrictedToClass = ""; + + [KSPField] + public bool AffectsHomeTimer = true; + + [KSPField] + public bool AffectsHabTimer = true; + + public override void ApplyConverterChanges(USI_Converter converter) + { + UseEfficiencyBonus = false; + + converter.Addons.Add(new USILS_LifeSupportExtenderConverterAddon(converter) + { + TimeMultiplier = TimeMultiplier, + AffectsPartOnly = AffectsPartOnly, + RestrictedToClass = RestrictedToClass, + AffectsHomeTimer = AffectsHomeTimer, + AffectsHabTimer = AffectsHabTimer + }); + + base.ApplyConverterChanges(converter); + } + + public override string GetInfo() + { + var output = new StringBuilder(); + output.AppendLine(base.GetInfo()); + output.AppendLine("Pushes back onboard kerbals hab/home timers"); + output.AppendLine(string.Format("Rated for: {0} kerbals", TimeMultiplier)); + if (AffectsPartOnly) + { + output.AppendLine("Effects only kerbals in this part"); + } + if (!string.IsNullOrEmpty(RestrictedToClass)) + { + output.AppendLine(string.Format("Effects only {0}s", RestrictedToClass)); + } + + return output.ToString(); + } + } +} diff --git a/Source/USILifeSupport/Converters/USILS_LifeSupportRecyclerConverterAddon.cs b/Source/USILifeSupport/Converters/USILS_LifeSupportRecyclerConverterAddon.cs new file mode 100644 index 0000000..ee99930 --- /dev/null +++ b/Source/USILifeSupport/Converters/USILS_LifeSupportRecyclerConverterAddon.cs @@ -0,0 +1,19 @@ +using USITools; + +namespace LifeSupport +{ + public class USILS_LifeSupportRecyclerConverterAddon : AbstractConverterAddon + { + public float CrewCapacity = 1f; + public float RecyclePercent = 0f; + public bool IsOperational = false; + + public USILS_LifeSupportRecyclerConverterAddon(USI_Converter converter) : base(converter) { } + + public override void PostProcess(ConverterResults result, double deltaTime) + { + base.PostProcess(result, deltaTime); + IsOperational = result.TimeFactor > ResourceUtilities.FLOAT_TOLERANCE; + } + } +} diff --git a/Source/USILifeSupport/Converters/USILS_LifeSupportRecyclerSwapOption.cs b/Source/USILifeSupport/Converters/USILS_LifeSupportRecyclerSwapOption.cs new file mode 100644 index 0000000..e1f3a2b --- /dev/null +++ b/Source/USILifeSupport/Converters/USILS_LifeSupportRecyclerSwapOption.cs @@ -0,0 +1,37 @@ +using System.Text; +using USITools; + +namespace LifeSupport +{ + public class USILS_LifeSupportRecyclerSwapOption : USI_ConverterSwapOption + { + [KSPField] + public float CrewCapacity = 1f; + + [KSPField] + public float RecyclePercent = 0f; + + public override void ApplyConverterChanges(USI_Converter converter) + { + UseEfficiencyBonus = false; + + converter.Addons.Add(new USILS_LifeSupportRecyclerConverterAddon(converter) + { + CrewCapacity = CrewCapacity, + RecyclePercent = RecyclePercent + }); + base.ApplyConverterChanges(converter); + } + + public override string GetInfo() + { + var output = new StringBuilder(); + output.AppendLine(base.GetInfo()); + output.AppendLine("Reduces supplies consumption across Kolony"); + output.AppendLine(string.Format("Recycler Percent: {0}%", RecyclePercent * 100)); + output.AppendLine(string.Format("Crew Affected: {0}", CrewCapacity)); + + return output.ToString(); + } + } +} diff --git a/Source/USILifeSupport/LifeSupportManager.cs b/Source/USILifeSupport/LifeSupportManager.cs index 1710c66..0fbb0fa 100644 --- a/Source/USILifeSupport/LifeSupportManager.cs +++ b/Source/USILifeSupport/LifeSupportManager.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Linq; using UnityEngine; using USITools; @@ -314,57 +315,52 @@ internal static double GetRecyclerMultiplier(Vessel vessel) var recyclerTot = 0f; var crewCount = GetColonyCrewCount(vessel); - var recList = vessel.FindPartModulesImplementing(); - var rmCount = recList.Count; - for (int i = 0; i < rmCount; ++i) + var recyclers = vessel.FindConverterAddonsImplementing(); + for (int i = 0; i < recyclers.Count; ++i) { - var r = recList[i]; - if (r.RecyclerIsActive && r.IsActivated) + var recycler = recyclers[i]; + if (recycler.IsActive && recycler.IsOperational) { - if (r.RecyclePercent > recyclerCap) - recyclerCap = r.RecyclePercent; - var recPercent = r.RecyclePercent; - if (r.CrewCapacity < crewCount) - recPercent *= r.CrewCapacity/(float) crewCount; + if (recycler.RecyclePercent > recyclerCap) + recyclerCap = recycler.RecyclePercent; + var recPercent = recycler.RecyclePercent; + if (recycler.CrewCapacity < crewCount) + recPercent *= recycler.CrewCapacity/(float) crewCount; recyclerTot += recPercent; } } - var vList = LogisticsTools.GetNearbyVessels((float)LifeSupportScenario.Instance.settings.GetSettings().HabRange, false, vessel, false); - var vCount = vList.Count; - for(int i = 0; i < vCount; ++i) + var vessels = LogisticsTools.GetNearbyVessels((float)LifeSupportScenario.Instance.settings.GetSettings().HabRange, false, vessel, false); + for(int i = 0; i < vessels.Count; ++i) { - var v = vList[i]; - var subRecList = v.FindPartModulesImplementing(); - var subRmCount = subRecList.Count; - - for (int x = 0; x < subRmCount; ++x) + var v = vessels[i]; + var nearbyRecyclers = v.FindConverterAddonsImplementing(); + for (int x = 0; x < nearbyRecyclers.Count; ++x) { - var r = subRecList[x]; - if (r.IsActivated && r.RecyclerIsActive) + var recycler = nearbyRecyclers[x]; + if (recycler.IsActive && recycler.IsOperational) { - if (r.RecyclePercent > recyclerCap) - recyclerCap = r.RecyclePercent; - var recPercent = r.RecyclePercent; - if (r.CrewCapacity < crewCount) - recPercent *= r.CrewCapacity / (float)crewCount; + if (recycler.RecyclePercent > recyclerCap) + recyclerCap = recycler.RecyclePercent; + var recPercent = recycler.RecyclePercent; + if (recycler.CrewCapacity < crewCount) + recPercent *= recycler.CrewCapacity / (float)crewCount; recyclerTot += recPercent; } } - } + } + //Inverse because this is a multiplier - low is good! - double retVal = 1d - (Math.Min(recyclerTot, recyclerCap)); - return retVal; + double multiplier = 1d - (Math.Min(recyclerTot, recyclerCap)); + return multiplier; } - - internal static double GetTotalHabTime(VesselSupplyStatus sourceVessel, Vessel vsl) - { - int numSharedVessels = 0; - return GetTotalHabTime(sourceVessel, vsl, out numSharedVessels); - } + internal static double GetTotalHabTime(VesselSupplyStatus sourceVessel, Vessel vsl) + { + return GetTotalHabTime(sourceVessel, vsl, out int numSharedVessels); + } internal static double GetHabChecksum(VesselSupplyStatus sourceVessel, Vessel vsl) { @@ -408,10 +404,10 @@ internal static double GetHabChecksum(VesselSupplyStatus sourceVessel, Vessel vs return totHabSpace*(totHabMult+1); } - internal static double GetTotalHabTime(VesselSupplyStatus sourceVessel, Vessel vsl, out int numSharedVessels) + internal static double GetTotalHabTime(VesselSupplyStatus sourceVessel, Vessel vessel, out int numSharedVessels) { //In the event that a vessel is not loaded, we just return the cached value. - if (!vsl.loaded) + if (!vessel.loaded) { numSharedVessels = 0; return sourceVessel.CachedHabTime; @@ -422,7 +418,7 @@ internal static double GetTotalHabTime(VesselSupplyStatus sourceVessel, Vessel v numSharedVessels = 0; - var vList = LogisticsTools.GetNearbyVessels((float)LifeSupportScenario.Instance.settings.GetSettings().HabRange, false, vsl, false); + var vList = LogisticsTools.GetNearbyVessels((float)LifeSupportScenario.Instance.settings.GetSettings().HabRange, false, vessel, false); var hList = new List(); var vCount = vList.Count; for(int i = 0; i < vCount; ++i) @@ -442,7 +438,7 @@ internal static double GetTotalHabTime(VesselSupplyStatus sourceVessel, Vessel v } } double totHabSpace = sourceVessel.ExtraHabSpace; - double totHabMult = CalculateVesselHabMultiplier(vsl,totCurCrew); + double totHabMult = CalculateVesselHabMultiplier(vessel,totCurCrew); totHabSpace += (LifeSupportScenario.Instance.settings.GetSettings().BaseHabTime * totMaxCrew); var hCount = hList.Count; @@ -454,7 +450,7 @@ internal static double GetTotalHabTime(VesselSupplyStatus sourceVessel, Vessel v totHabMult += CalculateVesselHabMultiplier(v, totCurCrew); } - totHabMult += USI_GlobalBonuses.Instance.GetHabBonus(vsl.mainBody.flightGlobalsIndex); + totHabMult += USI_GlobalBonuses.Instance.GetHabBonus(vessel.mainBody.flightGlobalsIndex); double habTotal = totHabSpace / (double)totCurCrew * (totHabMult + 1) * LifeSupportScenario.Instance.settings.GetSettings().HabMultiplier; //print(String.Format("THS: {0} TC:{1} THM: {2} HM: {3}", totHabSpace, totCurCrew, totHabMult, LifeSupportScenario.Instance.settings.GetSettings().HabMultiplier)); sourceVessel.CachedHabTime = Math.Max(0, habTotal * LifeSupportUtilities.SecondsPerMonth()); @@ -462,7 +458,7 @@ internal static double GetTotalHabTime(VesselSupplyStatus sourceVessel, Vessel v return sourceVessel.CachedHabTime; } - internal static double GetRecyclerMultiplierForParts(List pList, int crewCount) + internal static double GetRecyclerMultiplierForParts(List parts, int crewCount) { if (!LifeSupportScenario.Instance.settings.GetSettings().EnableRecyclers) return 1d; @@ -470,61 +466,65 @@ internal static double GetRecyclerMultiplierForParts(List pList, int crewC var recyclerCap = 0f; var recyclerTot = 0f; - var count = pList.Count; - for (int i = 0; i < count; ++i) + for (int i = 0; i < parts.Count; ++i) { - var p = pList[i]; - var mod = p.FindModuleImplementing(); - if (mod == null) + var part = parts[i]; + var recycler = part + .FindConverterAddonsImplementing() + .FirstOrDefault(); + if (recycler == null) continue; - if (!mod.RecyclerIsActive && !HighLogic.LoadedSceneIsEditor) + if (!recycler.IsOperational && !HighLogic.LoadedSceneIsEditor) continue; - if (mod.RecyclePercent > recyclerCap) - recyclerCap = mod.RecyclePercent; - var recPercent = mod.RecyclePercent; - if (mod.CrewCapacity < crewCount) - recPercent *= mod.CrewCapacity / (float)crewCount; + if (recycler.RecyclePercent > recyclerCap) + recyclerCap = recycler.RecyclePercent; + var recPercent = recycler.RecyclePercent; + if (recycler.CrewCapacity < crewCount) + recPercent *= recycler.CrewCapacity / (float)crewCount; recyclerTot += recPercent; } + //Inverse because this is a multiplier - low is good! - double retVal = 1d - (Math.Min(recyclerTot, recyclerCap)); - return retVal; + double multiplier = 1d - (Math.Min(recyclerTot, recyclerCap)); + return multiplier; } - public static bool IsOnKerbin(Vessel v) + public static bool IsOnKerbin(Vessel vessel) { - return (v.mainBody == FlightGlobals.GetHomeBody() && v.altitude < LifeSupportScenario.Instance.settings.GetSettings().HomeWorldAltitude); + return (vessel.mainBody == FlightGlobals.GetHomeBody() && vessel.altitude < LifeSupportScenario.Instance.settings.GetSettings().HomeWorldAltitude); } - public static double CalculateVesselHabExtraTime(Vessel v) + public static double CalculateVesselHabExtraTime(Vessel vessel) { var habTime = 0d; - var habMods = v.FindPartModulesImplementing(); - var count = habMods.Count; - for (int i = 0; i < count; ++i) + var habitats = vessel.FindConverterAddonsImplementing(); + for (int i = 0; i < habitats.Count; ++i) { - var hab = habMods[i]; + var habitat = habitats[i]; //Next. Certain modules, in addition to crew capacity, have living space. - habTime += hab.KerbalMonths; + habTime += habitat.KerbalMonths; } + return habTime; } - public static double CalculateVesselHabMultiplier(Vessel v, int numCrew) + public static double CalculateVesselHabMultiplier(Vessel vessel, int crewCount) { - if (numCrew == 0) + if (crewCount == 0) return 0d; - var habMulti = 0d; - var habMods = v.FindPartModulesImplementing(); - var count = habMods.Count; + + var habMultiplier = 0d; + var habitats = vessel.FindConverterAddonsImplementing(); + var count = habitats.Count; for (int i = 0; i < count; ++i) { - var hab = habMods[i]; - habMulti += (hab.HabMultiplier * Math.Min(1, hab.CrewCapacity / numCrew)); + var habitat = habitats[i]; + habMultiplier += (habitat.HabMultiplier * Math.Min(1, habitat.CrewCapacity / crewCount)); } - return habMulti; + + return habMultiplier; } } } diff --git a/Source/USILifeSupport/LifeSupportMonitor.cs b/Source/USILifeSupport/LifeSupportMonitor.cs index 93b65c5..5567682 100644 --- a/Source/USILifeSupport/LifeSupportMonitor.cs +++ b/Source/USILifeSupport/LifeSupportMonitor.cs @@ -1,15 +1,12 @@ -using System; -using System.CodeDom; +using KSP.UI.Screens; +using System; using System.Collections.Generic; -using System.Data.SqlTypes; using System.IO; using System.Linq; using System.Reflection; -using System.Text; -using KSP.UI.Screens; using UnityEngine; -namespace LifeSupport +namespace LifeSupport { [KSPAddon(KSPAddon.Startup.Flight, false)] public class LifeSupportMonitor_Flight : LifeSupportMonitor @@ -32,16 +29,16 @@ protected override bool IsActive() public class LifeSupportMonitor : MonoBehaviour { - private ApplicationLauncherButton orbLogButton; + private ApplicationLauncherButton _lifeSupportMonitorButton; private Rect _windowPosition = new Rect(300, 60, 970, 400); private GUIStyle _windowStyle; private GUIStyle _labelStyle; private GUIStyle _scrollStyle; - private Vector2 scrollPos = Vector2.zero; + private Vector2 _scrollPos = Vector2.zero; private bool _hasInitStyles = false; internal static string EcGraceTimeDisplay; internal static string SuppliesGraceTimeDisplay; - public static bool renderDisplay = false; + public static bool _renderDisplay = false; void Awake() { @@ -49,13 +46,13 @@ void Awake() var textureFile = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Supplies.png"); print("Loading " + textureFile); texture.LoadImage(File.ReadAllBytes(textureFile)); - this.orbLogButton = ApplicationLauncher.Instance.AddModApplication(GuiOn, GuiOff, null, null, null, null, + _lifeSupportMonitorButton = ApplicationLauncher.Instance.AddModApplication(GuiOn, GuiOff, null, null, null, null, ApplicationLauncher.AppScenes.ALWAYS, texture); } private void GuiOn() { - renderDisplay = true; + _renderDisplay = true; } public void Start() @@ -66,12 +63,12 @@ public void Start() private void GuiOff() { - renderDisplay = false; + _renderDisplay = false; } private void OnGUI() { - if (!renderDisplay) + if (!_renderDisplay) return; if (!IsActive()) return; @@ -238,7 +235,7 @@ private void GenerateWindow() } GUILayout.BeginVertical(); - scrollPos = GUILayout.BeginScrollView(scrollPos, _scrollStyle, GUILayout.Width(950), GUILayout.Height(350)); + _scrollPos = GUILayout.BeginScrollView(_scrollPos, _scrollStyle, GUILayout.Width(950), GUILayout.Height(350)); GUILayout.BeginVertical(); try { @@ -360,10 +357,10 @@ private string GetCrewNameLabel(ProtoCrewMember c, LifeSupportStatus cls) internal void OnDestroy() { - if (orbLogButton == null) + if (_lifeSupportMonitorButton == null) return; - ApplicationLauncher.Instance.RemoveModApplication(orbLogButton); - orbLogButton = null; + ApplicationLauncher.Instance.RemoveModApplication(_lifeSupportMonitorButton); + _lifeSupportMonitorButton = null; } private void InitStyles() diff --git a/Source/USILifeSupport/LifeSupportMonitor_Editor.cs b/Source/USILifeSupport/LifeSupportMonitor_Editor.cs index 0bb60f0..c0e1a40 100644 --- a/Source/USILifeSupport/LifeSupportMonitor_Editor.cs +++ b/Source/USILifeSupport/LifeSupportMonitor_Editor.cs @@ -5,20 +5,21 @@ using KSP.UI.Screens; using UnityEngine; using USITools; +using System.Linq; namespace LifeSupport { [KSPAddon(KSPAddon.Startup.EditorAny, false)] public class LifeSupportMonitor_Editor : MonoBehaviour { - private ApplicationLauncherButton orbLogButton; + private ApplicationLauncherButton _lifeSupportMonitorButton; private Rect _windowPosition = new Rect(300, 60, 665, 400); private GUIStyle _windowStyle; private GUIStyle _labelStyle; private GUIStyle _scrollStyle; - private Vector2 scrollPos = Vector2.zero; + private Vector2 _scrollPos = Vector2.zero; private bool _hasInitStyles = false; - public static bool renderDisplay = false; + public static bool _renderDisplay = false; void Awake() @@ -27,13 +28,13 @@ void Awake() var textureFile = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Supplies.png"); print("Loading " + textureFile); texture.LoadImage(File.ReadAllBytes(textureFile)); - this.orbLogButton = ApplicationLauncher.Instance.AddModApplication(GuiOn, GuiOff, null, null, null, null, + _lifeSupportMonitorButton = ApplicationLauncher.Instance.AddModApplication(GuiOn, GuiOff, null, null, null, null, ApplicationLauncher.AppScenes.ALWAYS, texture); } private void GuiOn() { - renderDisplay = true; + _renderDisplay = true; } private bool useHabPenalties; @@ -48,12 +49,12 @@ public void Start() private void GuiOff() { - renderDisplay = false; + _renderDisplay = false; } private void OnGUI() { - if (!renderDisplay) + if (!_renderDisplay) return; if (!configLoaded && LifeSupportScenario.Instance.settings.isLoaded()) @@ -93,7 +94,7 @@ private void ResetValues() fertilizer = 0d; habMult = 1d; batteryAmount = 0d; - habs = new List(); + habs = new List(); hab_curCrew = ""; hab_maxCrew = ""; supplyExt_curCrew = ""; @@ -106,7 +107,7 @@ private void ResetValues() totalHabMult = 0d; totalBatteryTime = 0d; totalSupplyTime = 0d; - recyclers = new List(); + recyclers = new List(); } private int curCrew = 0; @@ -117,7 +118,7 @@ private void ResetValues() private double extraHabTime = 0d; private double habMult = 1d; private double batteryAmount = 0d; - private List habs; + private List habs; private string hab_curCrew = ""; private string hab_maxCrew = ""; @@ -134,7 +135,7 @@ private void ResetValues() private double totalBatteryTime = 0d; private double totalSupplyTime = 0d; private double totalFertilizerTime = 0d; - private List recyclers; + private List recyclers; private void UpdateGUIInfo(ShipConstruct ship) { @@ -163,32 +164,21 @@ private void UpdateGUIInfo(ShipConstruct ship) for (int i = 0; i < count; ++i) { var part = parts[i]; - var hab = part.Modules.GetModule(); - if (hab != null) + var swapOptions = part.FindModulesImplementing(); + var bays = part.FindModulesImplementing(); + if (swapOptions != null && bays != null && swapOptions.Count > 0 && bays.Count > 0) { - var conList = part.Modules.GetModules(); - var bayList = part.Modules.GetModules(); - if (bayList == null || bayList.Count == 0) + for (int x = 0; x < bays.Count; x++) { - habs.Add(hab); - //Certain modules, in addition to crew capacity, have living space. - extraHabTime += hab.KerbalMonths; - //Some modules act more as 'multipliers', dramatically extending a hab's workable lifespan. - habMult += hab.HabMultiplier * Math.Min(1, hab.CrewCapacity / Math.Max(curCrew, 1)); - } - else - { - var bCount = bayList.Count; - for(int x = 0; x < bCount; ++x) + var bay = bays[x]; + var loadout = swapOptions[bay.currentLoadout] as USILS_HabitationSwapOption; + if (loadout != null) { - var bay = bayList[x]; - var con = conList[bay.currentLoadout] as ModuleHabitation; - if (con != null) - { - habs.Add(con); - extraHabTime += con.KerbalMonths; - habMult += con.HabMultiplier * Math.Min(1, con.CrewCapacity / Math.Max(curCrew, 1)); - } + habs.Add(loadout); + //Certain modules, in addition to crew capacity, have living space. + extraHabTime += loadout.BaseKerbalMonths; + //Some modules act more as 'multipliers', dramatically extending a hab's workable lifespan. + habMult += loadout.BaseHabMultiplier * Math.Min(1, loadout.CrewCapacity / Math.Max(curCrew, 1)); } } } @@ -210,7 +200,6 @@ private void UpdateGUIInfo(ShipConstruct ship) } } - totalHabSpace = (LifeSupportScenario.Instance.settings.GetSettings().BaseHabTime * maxCrew) + extraHabTime; //A Kerbal month is 30 six-hour Kerbin days. totalHabMult = habMult * LifeSupportScenario.Instance.settings.GetSettings().HabMultiplier * LifeSupportUtilities.SecondsPerMonth(); @@ -222,27 +211,18 @@ private void UpdateGUIInfo(ShipConstruct ship) { for (int i = 0; i < count; ++i) { - var p = parts[i]; - var rec = p.Modules.GetModule(); - if (rec != null) + var part = parts[i]; + var swapOptions = part.FindModulesImplementing(); + var bays = part.FindModulesImplementing(); + if (swapOptions != null && bays != null && swapOptions.Count > 0 && bays.Count > 0) { - var conList = p.Modules.GetModules(); - var bayList = p.Modules.GetModules(); - if (bayList == null || bayList.Count == 0) - { - recyclers.Add(rec); - } - else + for (int x = 0; x < bays.Count; x++) { - var bCount = bayList.Count; - for (int x = 0; x < bCount; ++x) + var bay = bays[x]; + var loadout = swapOptions[bay.currentLoadout] as USILS_LifeSupportRecyclerSwapOption; + if (loadout != null) { - var bay = bayList[x]; - var con = conList[bay.currentLoadout] as ModuleLifeSupportRecycler; - if (con != null) - { - recyclers.Add(con); - } + this.recyclers.Add(loadout); } } } @@ -282,11 +262,10 @@ private void UpdateGUIInfo(ShipConstruct ship) } } - private void GenerateWindow() { GUILayout.BeginVertical(); - scrollPos = GUILayout.BeginScrollView(scrollPos, _scrollStyle, GUILayout.Width(645), GUILayout.Height(350)); + _scrollPos = GUILayout.BeginScrollView(_scrollPos, _scrollStyle, GUILayout.Width(645), GUILayout.Height(350)); GUILayout.BeginVertical(); if (EditorLogic.fetch != null) @@ -468,8 +447,8 @@ private void GenerateWindow() var hab = habs[x]; GUILayout.BeginHorizontal(); GUILayout.Label(CTag(hab.part.partInfo.title, partColor), _labelStyle, GUILayout.Width(c1)); - GUILayout.Label(CTag(hab.KerbalMonths.ToString(), textColor), _labelStyle, GUILayout.Width(c2)); - GUILayout.Label(CTag(hab.HabMultiplier.ToString(), textColor), _labelStyle, GUILayout.Width(c3)); + GUILayout.Label(CTag(hab.BaseKerbalMonths.ToString(), textColor), _labelStyle, GUILayout.Width(c2)); + GUILayout.Label(CTag(hab.BaseHabMultiplier.ToString(), textColor), _labelStyle, GUILayout.Width(c3)); GUILayout.EndHorizontal(); } } @@ -484,10 +463,10 @@ private void GenerateWindow() internal void OnDestroy() { - if (orbLogButton == null) + if (_lifeSupportMonitorButton == null) return; - ApplicationLauncher.Instance.RemoveModApplication(orbLogButton); - orbLogButton = null; + ApplicationLauncher.Instance.RemoveModApplication(_lifeSupportMonitorButton); + _lifeSupportMonitorButton = null; GameEvents.onEditorShipModified.Remove(UpdateGUIInfo); } diff --git a/Source/USILifeSupport/ModuleHabitation.cs b/Source/USILifeSupport/ModuleHabitation.cs deleted file mode 100644 index 01bca27..0000000 --- a/Source/USILifeSupport/ModuleHabitation.cs +++ /dev/null @@ -1,83 +0,0 @@ -using System; -using System.Text; -using USITools; -using USITools.Logistics; - -namespace LifeSupport -{ - public class ModuleHabitation : ModuleResourceConverter_USI - { - [KSPField] - public double BaseKerbalMonths = 1; - [KSPField] - public double CrewCapacity = 10; - [KSPField] - public double BaseHabMultiplier = 0; - - [KSPField(isPersistant = true)] - public bool HabIsActive = false; - - public double HabAdjustment - { - get - { - return HighLogic.LoadedSceneIsEditor ? 1d : _habAdjustment; - } - set { _habAdjustment = value; } - } - - private double _habAdjustment = 1d; - - public double HabMultiplier - { - - get - { - if ((HabIsActive && IsActivated) || HighLogic.LoadedSceneIsEditor) - return BaseHabMultiplier * HabAdjustment; - return 0f; - } - } - - public double KerbalMonths - { - get - { - if (HighLogic.LoadedSceneIsEditor) - return BaseKerbalMonths; - if (!HabIsActive || !IsActivated) - HabAdjustment = 0d; - return BaseKerbalMonths* HabAdjustment; - } - } - - protected override void PreProcessing() - { - base.PreProcessing(); - EfficiencyBonus = 1f; - } - - - protected override void PostProcess(ConverterResults result, double deltaTime) - { - base.PostProcess(result,deltaTime); - HabIsActive = result.TimeFactor > ResourceUtilities.FLOAT_TOLERANCE; - HabAdjustment = result.TimeFactor/deltaTime; - } - - public override string GetInfo() - { - var output = new StringBuilder(); - output.Append(Environment.NewLine); - output.Append(base.GetInfo()); - output.Append(Environment.NewLine); - output.Append(String.Format("Kerbal-Months: {0}", BaseKerbalMonths + part.CrewCapacity)); - output.Append(Environment.NewLine); - output.Append(String.Format("Crew Affected: {0}", CrewCapacity)); - output.Append(Environment.NewLine); - output.Append(String.Format("Hab Multipler: {0}", BaseHabMultiplier)); - output.Append(Environment.NewLine); - return output.ToString(); - } - } -} \ No newline at end of file diff --git a/Source/USILifeSupport/ModuleLifeSupport.cs b/Source/USILifeSupport/ModuleLifeSupport.cs deleted file mode 100644 index 1c8506a..0000000 --- a/Source/USILifeSupport/ModuleLifeSupport.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace LifeSupport -{ - public class ModuleLifeSupport : PartModule - { - //This module has been deprecated in favor of ModuleLifeSupportSystem - } -} - diff --git a/Source/USILifeSupport/ModuleLifeSupportExtender.cs b/Source/USILifeSupport/ModuleLifeSupportExtender.cs deleted file mode 100644 index ca7c51d..0000000 --- a/Source/USILifeSupport/ModuleLifeSupportExtender.cs +++ /dev/null @@ -1,140 +0,0 @@ -using System; -using System.Text; -using System.Collections.Generic; -using USITools; - -namespace LifeSupport -{ - public class ModuleLifeSupportExtender : ModuleResourceConverter_USI - { - [KSPField] - public float TimeMultiplier= 1f; - - [KSPField] - public bool PartOnly = false; - - [KSPField] - public string restrictedClass = ""; - - [KSPField] - public bool homeTimer = true; - - [KSPField] - public bool habTimer = true; - - [KSPField(guiName = "Kolony Growth", guiActive = true, guiActiveEditor = true, isPersistant = true), UI_Toggle(disabledText = "disabled", enabledText = "enabled")] - public bool KolonyGrowthEnabled = false; - - [KSPField(isPersistant = true)] - public double GrowthTime = 0d; - - public const double GestationTime = 9720000d; - - protected override void PreProcessing() - { - if (!HighLogic.LoadedSceneIsFlight) - return; - - base.PreProcessing(); - var v = LifeSupportManager.Instance.FetchVessel(vessel.id.ToString()); - var e = 1d; - if (v != null) - { - e += v.VesselHabMultiplier; - } - EfficiencyBonus = (float)e; - } - - - protected override void PostProcess(ConverterResults result, double deltaTime) - { - if (!HighLogic.LoadedSceneIsFlight) - return; - - base.PostProcess(result, deltaTime); - var baseTime = TimeMultiplier*result.TimeFactor; - var kerbals = new List(); - var crew = vessel.GetVesselCrew(); - if (PartOnly) - crew = part.protoModuleCrew; - - var hasMale = false; - var hasFemale = false; - - var count = crew.Count; - for (int i = 0; i < count; ++i) - { - var c = crew[i]; - if (c.gender == ProtoCrewMember.Gender.Male) - hasMale = true; - if (c.gender == ProtoCrewMember.Gender.Female) - hasFemale = true; - - if (string.IsNullOrEmpty(restrictedClass) || c.experienceTrait.Title == restrictedClass) - kerbals.Add(c); - } - - if (kerbals.Count == 0) - return; - - var timePerKerbal = baseTime/kerbals.Count; - - count = kerbals.Count; - for(int i = 0; i < count; ++i) - { - var k = kerbals[i]; - var lsKerbal = LifeSupportManager.Instance.FetchKerbal(k); - if(homeTimer) - lsKerbal.MaxOffKerbinTime += timePerKerbal; - if(habTimer) - lsKerbal.TimeEnteredVessel += timePerKerbal; - - LifeSupportManager.Instance.TrackKerbal(lsKerbal); - } - - //Kolony Growth - if (KolonyGrowthEnabled && part.CrewCapacity > part.protoModuleCrew.Count && hasMale && hasFemale) - { - GrowthTime += (result.TimeFactor * part.protoModuleCrew.Count); - if (GrowthTime >= GestationTime) - { - GrowthTime -= GestationTime; - SpawnKerbal(); - } - } - } - - private void SpawnKerbal() - { - ProtoCrewMember newKerb = HighLogic.CurrentGame.CrewRoster.GetNewKerbal(); - newKerb.rosterStatus = ProtoCrewMember.RosterStatus.Assigned; - part.AddCrewmember(newKerb); - var msg = String.Format("{0}, a new {1}, has joined your crew!", newKerb.name, newKerb.experienceTrait.TypeName); - ScreenMessages.PostScreenMessage(msg, 5f, ScreenMessageStyle.UPPER_CENTER); - } - - public override string GetInfo() - { - var output = new StringBuilder(""); - output.Append(base.GetInfo()); - output.Append(Environment.NewLine); - output.Append("Pushes back onboard kerbals hab/home timers"); - output.Append(Environment.NewLine); - output.AppendFormat("Rated for: {0} kerbals", TimeMultiplier); - output.Append(Environment.NewLine); - if (PartOnly) - { - output.Append("Effects only kerbals in this part"); - output.Append(Environment.NewLine); - } - if (!String.IsNullOrEmpty(restrictedClass)) - { - output.AppendFormat("Effects only {0}s", restrictedClass); - output.Append(Environment.NewLine); - } - return output.ToString(); - } - - - } -} \ No newline at end of file diff --git a/Source/USILifeSupport/ModuleLifeSupportRecycler.cs b/Source/USILifeSupport/ModuleLifeSupportRecycler.cs deleted file mode 100644 index a83aec2..0000000 --- a/Source/USILifeSupport/ModuleLifeSupportRecycler.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System; -using System.Text; -using USITools; - -namespace LifeSupport -{ - public class ModuleLifeSupportRecycler : ModuleResourceConverter_USI - { - [KSPField] - public float CrewCapacity = 1f; - - [KSPField] - public float RecyclePercent = 0f; - - [KSPField(isPersistant = true)] - public bool RecyclerIsActive = false; - - protected override void PreProcessing() - { - base.PreProcessing(); - EfficiencyBonus = 1f; - } - - protected override void PostProcess(ConverterResults result, double deltaTime) - { - base.PostProcess(result, deltaTime); - RecyclerIsActive = result.TimeFactor > ResourceUtilities.FLOAT_TOLERANCE; - } - - public override string GetInfo() - { - var output = new StringBuilder(); - output.Append(base.GetInfo()); - output.Append(Environment.NewLine); - output.Append("Reduces supplies consumption across Kolony"); - output.Append(Environment.NewLine); - output.Append(String.Format("Recycler Percent: {0}%", RecyclePercent * 100)); - output.Append(Environment.NewLine); - output.Append(String.Format("Crew Affected: {0}", CrewCapacity)); - output.Append(Environment.NewLine); - return output.ToString(); - } - } -} \ No newline at end of file diff --git a/Source/USILifeSupport/ModuleLifeSupportSystem.cs b/Source/USILifeSupport/ModuleLifeSupportSystem.cs index 31a00bc..b2796f0 100644 --- a/Source/USILifeSupport/ModuleLifeSupportSystem.cs +++ b/Source/USILifeSupport/ModuleLifeSupportSystem.cs @@ -9,78 +9,127 @@ public class ModuleLifeSupportSystem : VesselModule [KSPField(isPersistant = true)] public double LastUpdateTime; - private bool isDirty = true; - private double oldHabChecksum; + private readonly double _checkInterval = 1d; + private double _lastProcessingTime; + private double _lastUpdate; + private bool _isDirty = true; + private double _oldHabChecksum; + private int _currentCrewCount; + private Part _crewPart; + private int _partCount; + bool _isStatusRefreshRequired = false; - public override void OnLoadVessel() + protected ResourceConverter _resourceConverter; + protected IResourceBroker _resourceBroker; + private VesselSupplyStatus _vesselStatus; + + public ResourceConverter Converter { - GameEvents.onVesselPartCountChanged.Add(SetVesselDirty); - GameEvents.onVesselCrewWasModified.Add(SetVesselDirty); - GameEvents.onVesselChange.Add(SetVesselDirty); + get { return _resourceConverter ?? (_resourceConverter = new ResourceConverter(ResourceBroker)); } } - private void SetVesselDirty(Vessel v) + public IResourceBroker ResourceBroker { - isDirty = true; + get { return _resourceBroker ?? (_resourceBroker = new ResourceBroker()); } } - private VesselSupplyStatus _vStat; - private double _checkInterval = 1d; - private double _lastProcessingTime; - private int _currentCrew; - private Part _crewPart; - protected IResourceBroker _resBroker; - protected ResourceConverter _resConverter; - private int _partCount; + public VesselSupplyStatus VesselStatus + { + get { return _vesselStatus ?? (_vesselStatus = SetupVesselStatus()); } + set { _vesselStatus = value; } + } - public ResourceConverter ResConverter + private ConversionRecipe SupplyRecipe { - get { return _resConverter ?? (_resConverter = new ResourceConverter(ResBroker)); } + get { return GenerateSupplyRecipe(); } } - public IResourceBroker ResBroker + private ConversionRecipe ECRecipe { - get { return _resBroker ?? (_resBroker = new ResourceBroker()); } + get { return GenerateECRecipe(); } } - public VesselSupplyStatus VesselStatus + private VesselSupplyStatus SetupVesselStatus() { - get { return _vStat ?? (_vStat = SetupVesselStatus()); } - set { _vStat = value; } + UpdateVesselInfo(); + + var id = base.vessel.id.ToString(); + var vessel = LifeSupportManager.Instance.FetchVessel(id); + LifeSupportManager.Instance.TrackVessel(vessel); + + return vessel; } - public void OnDestroy() + private ConversionRecipe GenerateSupplyRecipe() { - GameEvents.onVesselPartCountChanged.Remove(SetVesselDirty); - GameEvents.onVesselCrewWasModified.Remove(SetVesselDirty); - GameEvents.onVesselChange.Remove(SetVesselDirty); + var crewCount = _currentCrewCount; + var recyclerMultiplier = VesselStatus.RecyclerMultiplier; + var suppliesConsumption = LifeSupportScenario.Instance.settings.GetSettings().SupplyAmount; + var wasteOutput = LifeSupportScenario.Instance.settings.GetSettings().WasteAmount; + + var supRatio = suppliesConsumption * crewCount * recyclerMultiplier; + var mulchRatio = wasteOutput * crewCount * recyclerMultiplier; + + var recipe = new ConversionRecipe(); + recipe.Inputs.Add(new ResourceRatio + { + FlowMode = ResourceFlowMode.ALL_VESSEL, + Ratio = supRatio, + ResourceName = "Supplies", + DumpExcess = true + }); + recipe.Outputs.Add(new ResourceRatio + { + FlowMode = ResourceFlowMode.ALL_VESSEL, + Ratio = mulchRatio, + ResourceName = "Mulch", + DumpExcess = true + }); + + return recipe; } - bool refreshVesselTime = false; + private ConversionRecipe GenerateECRecipe() + { + var crewCount = _currentCrewCount; + var electricityConsumption = LifeSupportScenario.Instance.settings.GetSettings().ECAmount; - private bool CheckIfHomeWorld() + var recipe = new ConversionRecipe(); + recipe.Inputs.Add(new ResourceRatio + { + FlowMode = ResourceFlowMode.ALL_VESSEL, + Ratio = electricityConsumption * crewCount, + ResourceName = "ElectricCharge", + DumpExcess = true + }); + + return recipe; + } + + public override void OnLoadVessel() { - if (USI_GlobalBonuses.Instance.GetHabBonus(vessel.mainBody.flightGlobalsIndex) < 5) //TODO - make this a parm - return false; + GameEvents.onVesselPartCountChanged.Add(SetVesselDirty); + GameEvents.onVesselCrewWasModified.Add(SetVesselDirty); + GameEvents.onVesselChange.Add(SetVesselDirty); + } - //Check for hab time. - var habTime = LifeSupportManager.Instance.FetchVessel(vessel.id.ToString()).CachedHabTime; - //We want one year, either Kerbal or earth. - const double secsPerMinute = 60d; - const double secsPerHour = secsPerMinute * 60d; - double secsPerDay = GameSettings.KERBIN_TIME ? secsPerHour * 6d : secsPerHour * 24d; - double secsPerYear = GameSettings.KERBIN_TIME ? secsPerDay * 425d : secsPerDay * 365d; - double y = Math.Floor(habTime / secsPerYear); + private void SetVesselDirty(Vessel v) + { + _isDirty = true; + } - return y >= 1; + public void OnDestroy() + { + GameEvents.onVesselPartCountChanged.Remove(SetVesselDirty); + GameEvents.onVesselCrewWasModified.Remove(SetVesselDirty); + GameEvents.onVesselChange.Remove(SetVesselDirty); } public void FixedUpdate() { - if (!HighLogic.LoadedSceneIsFlight || vessel == null) - return; - if (!vessel.loaded) + if (!HighLogic.LoadedSceneIsFlight || vessel == null || !vessel.loaded) return; + if (vessel.isEVA) { CheckEVA(vessel); @@ -91,29 +140,31 @@ public void FixedUpdate() { if (_partCount > 0) { - refreshVesselTime = true; + _isStatusRefreshRequired = true; } _partCount = vessel.parts.Count; } - - if (isDirty) + if (_isDirty) { - isDirty = false; + _isDirty = false; UpdateVesselInfo(); UpdateStatus(); } - if (_currentCrew == 0) + var now = Planetarium.GetUniversalTime(); + if (_currentCrewCount == 0) { VesselStatus.VesselName = vessel.vesselName; VesselStatus.NumCrew = vessel.GetCrewCount(); VesselStatus.CrewCap = vessel.GetCrewCapacity(); - VesselStatus.LastECCheck = Planetarium.GetUniversalTime(); - VesselStatus.LastFeeding = Planetarium.GetUniversalTime(); - VesselStatus.LastUpdate = Planetarium.GetUniversalTime(); + VesselStatus.LastECCheck = now; + VesselStatus.LastFeeding = now; + VesselStatus.LastUpdate = now; + LifeSupportManager.Instance.TrackVessel(VesselStatus); - LastUpdateTime = Planetarium.GetUniversalTime(); + LastUpdateTime = now; + return; } @@ -123,524 +174,610 @@ public void FixedUpdate() var offKerbin = !LifeSupportManager.IsOnKerbin(vessel); CheckVesselId(); - //Check our time + // Check our time double deltaTime = GetDeltaTime(); bool isCatchup = deltaTime / 2 > TimeWarp.fixedDeltaTime; if (deltaTime < ResourceUtilities.FLOAT_TOLERANCE * 10) return; - if (Planetarium.GetUniversalTime() >= _lastProcessingTime + _checkInterval) + if (now >= _lastProcessingTime + _checkInterval) { isLongLoop = true; - _lastProcessingTime = Planetarium.GetUniversalTime(); + _lastProcessingTime = now; } - VesselStatus.LastUpdate = Planetarium.GetUniversalTime(); + VesselStatus.LastUpdate = now; VesselStatus.VesselName = vessel.vesselName; VesselStatus.NumCrew = vessel.GetCrewCount(); VesselStatus.CrewCap = vessel.GetCrewCapacity(); + if (isLongLoop) { CheckForDeadKerbals(); } - if (_currentCrew > 0) + if (_currentCrewCount > 0) { //Guard clause if (_crewPart == null) UpdateVesselInfo(); //we will add a bit of a fudge factor for supplies - var tolerance = deltaTime/2f; + var tolerance = deltaTime / 2f; + //nom nom nom! - ConverterResults resultSupply = ResConverter.ProcessRecipe(deltaTime, SupplyRecipe, _crewPart, null, - 1f); - ConverterResults resultEC = ResConverter.ProcessRecipe(deltaTime, ECRecipe, _crewPart, null, 1f); + ConverterResults resultSupply = Converter.ProcessRecipe(deltaTime, SupplyRecipe, _crewPart, null, 1f); + ConverterResults resultEC = Converter.ProcessRecipe(deltaTime, ECRecipe, _crewPart, null, 1f); #region Long Loop - Crew if (isLongLoop) { //Ensure status is current UpdateStatus(); - var vCrew = vessel.GetVesselCrew(); - var count = vCrew.Count; + var habTime = LifeSupportManager.GetTotalHabTime(VesselStatus, vessel); - if (oldHabChecksum < ResourceUtilities.FLOAT_TOLERANCE) - oldHabChecksum = LifeSupportManager.GetHabChecksum(VesselStatus,vessel); + if (_oldHabChecksum < ResourceUtilities.FLOAT_TOLERANCE) + _oldHabChecksum = LifeSupportManager.GetHabChecksum(VesselStatus, vessel); var newHabChecksum = LifeSupportManager.GetHabChecksum(VesselStatus, vessel); - if (Math.Abs(oldHabChecksum - newHabChecksum) > ResourceUtilities.FLOAT_TOLERANCE) + if (Math.Abs(_oldHabChecksum - newHabChecksum) > ResourceUtilities.FLOAT_TOLERANCE) { - Debug.Log("Vessel situation changed, refreshing life support"); - refreshVesselTime = true; - oldHabChecksum = newHabChecksum; + Debug.Log("[USI-LS] Vessel situation changed, refreshing life support"); + _isStatusRefreshRequired = true; + _oldHabChecksum = newHabChecksum; } + var crewRoster = vessel.GetVesselCrew(); + var count = crewRoster.Count; for (int i = 0; i < count; ++i) { - var c = vCrew[i]; + var crewMember = crewRoster[i]; bool isGrouchyHab = false; bool isGrouchySupplies = false; bool isGrouchyEC = false; - bool isScout = c.HasEffect("ExplorerSkill") && habTime >= LifeSupportScenario.Instance.settings.GetSettings().ScoutHabTime; + bool isScout = crewMember.HasEffect("ExplorerSkill") && habTime >= LifeSupportScenario.Instance.settings.GetSettings().ScoutHabTime; bool isPermaHab = habTime >= LifeSupportScenario.Instance.settings.GetSettings().PermaHabTime; - bool isHomeWorld = CheckIfHomeWorld() && habTime >= LifeSupportScenario.Instance.settings.GetSettings().ScoutHabTime && vessel.LandedOrSplashed; - //Fetch them from the queue - var k = LifeSupportManager.Instance.FetchKerbal(c); - //Update our stuff - if (refreshVesselTime) + bool isHomeWorld = CheckIfHomeWorld() && habTime >= LifeSupportScenario.Instance.settings.GetSettings().ScoutHabTime && vessel.LandedOrSplashed; + + // Get the crew member's life support stats + var trackedKerbal = LifeSupportManager.Instance.FetchKerbal(crewMember); + + // Update life support stats + if (_isStatusRefreshRequired) { - k.TimeEnteredVessel = Planetarium.GetUniversalTime(); - refreshVesselTime = false; - LifeSupportManager.Instance.TrackKerbal(k); + trackedKerbal.TimeEnteredVessel = now; + _isStatusRefreshRequired = false; + LifeSupportManager.Instance.TrackKerbal(trackedKerbal); } - //First - Hab effects. + + // Update Hab effects if (!offKerbin || isScout || isHomeWorld || isPermaHab) { - k.LastAtHome = Planetarium.GetUniversalTime(); - k.MaxOffKerbinTime = habTime + k.LastAtHome; - k.TimeEnteredVessel = Planetarium.GetUniversalTime(); + trackedKerbal.TimeEnteredVessel = now; + trackedKerbal.LastAtHome = now; + trackedKerbal.MaxOffKerbinTime = habTime + trackedKerbal.LastAtHome; } else { - if (vessel.id.ToString() != k.CurrentVesselId) + if (vessel.id.ToString() != trackedKerbal.CurrentVesselId) { - if (vessel.id.ToString() != k.PreviousVesselId) - k.TimeEnteredVessel = Planetarium.GetUniversalTime(); + if (vessel.id.ToString() != trackedKerbal.PreviousVesselId) + trackedKerbal.TimeEnteredVessel = now; - k.PreviousVesselId = k.CurrentVesselId; - k.CurrentVesselId = vessel.id.ToString(); - LifeSupportManager.Instance.TrackKerbal(k); + trackedKerbal.PreviousVesselId = trackedKerbal.CurrentVesselId; + trackedKerbal.CurrentVesselId = vessel.id.ToString(); + LifeSupportManager.Instance.TrackKerbal(trackedKerbal); } - isGrouchyHab = CheckHabSideEffects(k); - } + isGrouchyHab = CheckHabSideEffects(trackedKerbal); + } - //Second - Supply + // Update Supplies effects if (offKerbin && (deltaTime - resultSupply.TimeFactor > tolerance)) { - isGrouchySupplies = CheckSupplySideEffects(k); + isGrouchySupplies = CheckSupplySideEffects(trackedKerbal); } else if (deltaTime >= ResourceUtilities.FLOAT_TOLERANCE) { //All is well - k.LastMeal = LastUpdateTime; + trackedKerbal.LastMeal = LastUpdateTime; VesselStatus.LastFeeding = LastUpdateTime; } - //Third - EC + // Update ElectricCharge effects if (offKerbin && (deltaTime - resultEC.TimeFactor > tolerance)) { - isGrouchyEC = CheckECSideEffects(k); + isGrouchyEC = CheckECSideEffects(trackedKerbal); } else if (deltaTime >= ResourceUtilities.FLOAT_TOLERANCE) { //All is well - k.LastEC = LastUpdateTime; + trackedKerbal.LastEC = LastUpdateTime; VesselStatus.LastECCheck = LastUpdateTime; } + trackedKerbal.LastUpdate = now; - k.LastUpdate = Planetarium.GetUniversalTime(); var isAnyGrouch = isGrouchyEC || isGrouchyHab || isGrouchySupplies; - if (isGrouchyEC && !isCatchup) { - ApplyEffect(k, c, - LifeSupportManager.GetNoECEffect(k.KerbalName), + ApplyEffect( + trackedKerbal, + crewMember, + LifeSupportManager.GetNoECEffect(trackedKerbal.KerbalName), "power loss"); } else if (isGrouchySupplies && !isCatchup) { - ApplyEffect(k, c, - LifeSupportManager.GetNoSupplyEffect(k.KerbalName), + ApplyEffect( + trackedKerbal, + crewMember, + LifeSupportManager.GetNoSupplyEffect(trackedKerbal.KerbalName), "lack of supplies"); } else if (isGrouchyHab && !isCatchup) { - ApplyEffect(k, c, - LifeSupportManager.GetNoHomeEffect(k.KerbalName), + ApplyEffect( + trackedKerbal, + crewMember, + LifeSupportManager.GetNoHomeEffect(trackedKerbal.KerbalName), "homesickness"); } - else if (c.experienceTrait.Title != k.OldTrait && !isAnyGrouch) + else if (crewMember.experienceTrait.Title != trackedKerbal.OldTrait && !isAnyGrouch) { - RemoveGrouchiness(c, k); + RemoveGrouchiness(crewMember, trackedKerbal); } - LifeSupportManager.Instance.TrackKerbal(k); + + LifeSupportManager.Instance.TrackKerbal(trackedKerbal); } } #endregion - Crew - var supAmount = _resBroker.AmountAvailable(_crewPart, "Supplies", deltaTime, - ResourceFlowMode.ALL_VESSEL); - var ecAmount = _resBroker.AmountAvailable(_crewPart, "ElectricCharge", deltaTime, + var remainingSupplies = ResourceBroker.AmountAvailable( + _crewPart, + "Supplies", + deltaTime, ResourceFlowMode.ALL_VESSEL); - VesselStatus.SuppliesLeft = supAmount / - LifeSupportScenario.Instance.settings.GetSettings().SupplyAmount / - _currentCrew / - VesselStatus.RecyclerMultiplier; - VesselStatus.ECLeft = ecAmount / LifeSupportScenario.Instance.settings.GetSettings().ECAmount / - _currentCrew; + var remainingBattery = ResourceBroker.AmountAvailable( + _crewPart, + "ElectricCharge", + deltaTime, + ResourceFlowMode.ALL_VESSEL); + var suppliesConsumption = LifeSupportScenario.Instance.settings.GetSettings().SupplyAmount; + var electricityConsumption = LifeSupportScenario.Instance.settings.GetSettings().ECAmount; + + VesselStatus.SuppliesLeft = remainingSupplies / suppliesConsumption / _currentCrewCount / VesselStatus.RecyclerMultiplier; + VesselStatus.ECLeft = remainingBattery / electricityConsumption / _currentCrewCount; } else { - VesselStatus.LastECCheck = Planetarium.GetUniversalTime(); - VesselStatus.LastFeeding = Planetarium.GetUniversalTime(); - VesselStatus.LastUpdate = Planetarium.GetUniversalTime(); + VesselStatus.LastECCheck = now; + VesselStatus.LastFeeding = now; + VesselStatus.LastUpdate = now; } + LifeSupportManager.Instance.TrackVessel(VesselStatus); } catch (Exception ex) { - print(String.Format("ERROR {0} IN ModuleLifeSupport", ex.Message)); + print(string.Format("ERROR {0} IN ModuleLifeSupport", ex.Message)); } } - private void UpdateVesselInfo() + private void CheckEVA(Vessel evaKerbal) { - if (!HighLogic.LoadedSceneIsFlight || vessel == null) + if (IsAtHomeForEva(evaKerbal)) return; - CheckForDeadKerbals(); - _currentCrew = vessel.GetCrewCount(); - if (vessel.GetCrewCapacity() > 0) + var kerbal = evaKerbal.GetVesselCrew()[0]; + //Check their status. + var kerbalStatus = LifeSupportManager.Instance.FetchKerbal(kerbal); + if (evaKerbal.missionTime > LifeSupportScenario.Instance.settings.GetSettings().EVATime) { - var count = vessel.parts.Count; - for (int i = 0; i < count; ++i) - { - var p = vessel.parts[i]; - if (p.CrewCapacity > 0) - { - _crewPart = p; - return; - } - } + var effect = LifeSupportManager.GetEVAExcessEffect(kerbalStatus.KerbalName); + ApplyEVAEffect(kerbalStatus, kerbal, evaKerbal, effect); } } - private void UpdateStatus() + private bool IsAtHomeForEva(Vessel evaKerbal) { - UpdateStatus(VesselStatus); + return (evaKerbal.mainBody == FlightGlobals.GetHomeBody()) && + (evaKerbal.altitude < LifeSupportScenario.Instance.settings.GetSettings().HomeWorldAltitude); } - private double _lastUpdate; - - private void UpdateStatus(VesselSupplyStatus v) + private void ApplyEVAEffect(LifeSupportStatus trackedKerbal, ProtoCrewMember crewMember, Vessel vessel, int effectId) { - if (_lastUpdate < ResourceUtilities.FLOAT_TOLERANCE) - _lastUpdate = Planetarium.GetUniversalTime(); + if (crewMember.type == ProtoCrewMember.KerbalType.Tourist || crewMember.experienceTrait.Title == "Tourist") + return; - bool fullRefresh = false; + /* SIDE EFFECTS: + * 0 = No Effect (The feature is effectively turned off) + * 1 = Grouchy (they become a Tourist until rescued) + * 2 = Mutinous (A tourist, but also destroys a part of a nearby vessel...) + * 3 = Instantly 'wander' back to the KSC - don't ask us how! + * 4 = M.I.A. (will eventually respawn) + * 5 = K.I.A. + */ - if (Planetarium.GetUniversalTime() > _lastUpdate + 5d) //A reasonable time for easing in everything + var screenMessage = ""; + switch (effectId) { - fullRefresh = true; - _lastUpdate = Planetarium.GetUniversalTime(); + case 0: // No effect + return; // No need to print + case 1: //Grouchy + if (crewMember.type != ProtoCrewMember.KerbalType.Tourist) + { + screenMessage = string.Format("{0} refuses to work", crewMember.name); + trackedKerbal.OldTrait = crewMember.experienceTrait.TypeName; + crewMember.type = ProtoCrewMember.KerbalType.Tourist; + KerbalRoster.SetExperienceTrait(crewMember, "Tourist"); + trackedKerbal.IsGrouchy = true; + LifeSupportManager.Instance.TrackKerbal(trackedKerbal); + } + break; + case 2: //Mutinous + { + screenMessage = string.Format("{0} has become mutinous", crewMember.name); + trackedKerbal.OldTrait = crewMember.experienceTrait.TypeName; + crewMember.type = ProtoCrewMember.KerbalType.Tourist; + KerbalRoster.SetExperienceTrait(crewMember, "Tourist"); + trackedKerbal.IsGrouchy = true; + LifeSupportManager.Instance.TrackKerbal(trackedKerbal); + DestroyRandomPart(vessel); + } + break; + case 3: //Return to KSC + screenMessage = string.Format("{0} gets fed up and wanders back to the KSC", crewMember.name); + LifeSupportManager.Instance.UntrackKerbal(crewMember.name); + crewMember.rosterStatus = ProtoCrewMember.RosterStatus.Available; + DestroyVessel(vessel); + break; + case 4: //Despawn + screenMessage = string.Format("{0} has gone missing", crewMember.name); + LifeSupportManager.Instance.UntrackKerbal(crewMember.name); + crewMember.rosterStatus = ProtoCrewMember.RosterStatus.Missing; + DestroyVessel(vessel); + break; + case 5: //Kill + screenMessage = string.Format("{0} has died", crewMember.name); + LifeSupportManager.Instance.UntrackKerbal(crewMember.name); + crewMember.rosterStatus = ProtoCrewMember.RosterStatus.Dead; + DestroyVessel(vessel); + break; } - var newRecMult = (float)LifeSupportManager.GetRecyclerMultiplier(vessel); - var newSpace = (float)LifeSupportManager.CalculateVesselHabExtraTime(vessel); - var newHabMult = (float)LifeSupportManager.CalculateVesselHabMultiplier(vessel, _currentCrew); - //If we're the active vessel, and we're past easing, we always take calc values. - //Otherwise, let's use the cache. - var useCur = fullRefresh && vessel.id == FlightGlobals.ActiveVessel.id; - - //Start with intelligent defaults. - if (v.RecyclerMultiplier < ResourceUtilities.FLOAT_TOLERANCE) - v.RecyclerMultiplier = 1f; - if (newRecMult < ResourceUtilities.FLOAT_TOLERANCE) - newRecMult = 1f; - //And take the lowest (non-zero) - if (useCur || newRecMult < v.RecyclerMultiplier) - v.RecyclerMultiplier = newRecMult; - - //Hab we want the best ones. - if (useCur || newSpace > v.ExtraHabSpace) - v.ExtraHabSpace = newSpace; - - if (useCur || newHabMult > v.VesselHabMultiplier) - v.VesselHabMultiplier = newHabMult; - - LifeSupportManager.Instance.TrackVessel(v); + ScreenMessages.PostScreenMessage(screenMessage, 5f, ScreenMessageStyle.UPPER_CENTER); } - - private VesselSupplyStatus SetupVesselStatus() + private void DestroyRandomPart(Vessel vessel) { - var id = vessel.id.ToString(); - var v = LifeSupportManager.Instance.FetchVessel(id); - UpdateVesselInfo(); - LifeSupportManager.Instance.TrackVessel(v); - return v; + System.Random rng = new System.Random(); + var vessels = GetNearbyVessels(150, false, vessel, false); + var count = vessels.Count; + for (int i = 0; i < count; ++i) + { + var v = vessels[i]; + var idx = rng.Next(1, v.parts.Count - 1); + var part = v.parts[idx]; + if (part.parent != null) + part.decouple(); + } } - private void UnlockTins() + public static List GetNearbyVessels(int range, bool includeSelf, Vessel focusedVessel, bool landedOnly = true) { - if (HighLogic.LoadedSceneIsFlight) + try { - //Unlock the biscuit tins... - bool foundSupplies = false; - var count = vessel.parts.Count; - for (int i = 0; i < count; ++i) + var nearbyVessels = new List(); + var vesselCount = FlightGlobals.Vessels.Count; + for (int i = 0; i < vesselCount; ++i) { - var p = vessel.parts[i]; - if (p.Resources.Contains("Supplies")) + var vessel = FlightGlobals.Vessels[i]; + if (vessel.mainBody == focusedVessel.mainBody + && (!landedOnly || vessel.Landed || vessel == focusedVessel)) { - var r = p.Resources["Supplies"]; - if (r.flowState == false) + if (!includeSelf && vessel == focusedVessel) + continue; + + var focusedPosition = focusedVessel.GetWorldPos3D(); + var neighborPosition = vessel.GetWorldPos3D(); + var distance = Vector3d.Distance(focusedPosition, neighborPosition); + if (distance < range) { - r.flowState = true; - foundSupplies = true; + nearbyVessels.Add(vessel); } } } - if(foundSupplies) - ScreenMessages.PostScreenMessage("Supply containers unlocked...", 5f, ScreenMessageStyle.UPPER_CENTER); + + return nearbyVessels; + } + catch (Exception ex) + { + Debug.LogError(string.Format("[USI-LS] - ERROR in GetNearbyVessels - {0}", ex.Message)); + return new List(); } } - protected double GetDeltaTime() + private void DestroyVessel(Vessel vessel) { - if (Time.timeSinceLevelLoad < 1.0f || !FlightGlobals.ready) + var demoParts = new List(); + var count = vessel.parts.Count; + for (int i = 0; i < count; ++i) { - return -1; + demoParts.Add(vessel.parts[i]); } - if (Math.Abs(LastUpdateTime) < ResourceUtilities.FLOAT_TOLERANCE) + for (int i = 0; i < count; ++i) { - // Just started running - LastUpdateTime = Planetarium.GetUniversalTime(); - return -1; + var p = demoParts[i]; + p.decouple(); + p.explode(); } + } - double maxDeltaTime = ResourceUtilities.GetMaxDeltaTime(); - double deltaTime = Math.Min(Planetarium.GetUniversalTime() - LastUpdateTime, maxDeltaTime); + private void UpdateVesselInfo() + { + if (!HighLogic.LoadedSceneIsFlight || vessel == null) + return; - LastUpdateTime += deltaTime; - return deltaTime; + CheckForDeadKerbals(); + _currentCrewCount = vessel.GetCrewCount(); + if (vessel.GetCrewCapacity() > 0) + { + var partCount = vessel.parts.Count; + for (int i = 0; i < partCount; ++i) + { + var part = vessel.parts[i]; + if (part.CrewCapacity > 0) + { + _crewPart = part; + return; + } + } + } } private void CheckForDeadKerbals() { try { + var crewRoster = vessel.GetVesselCrew(); var crewNames = new List(); - var vCrew = vessel.GetVesselCrew(); - var cCount = vCrew.Count; - for (int x = 0; x < cCount; ++x) + var crewCount = crewRoster.Count; + for (int x = 0; x < crewCount; ++x) { - crewNames.Add(vCrew[x].name); + crewNames.Add(crewRoster[x].name); } var count = LifeSupportManager.Instance.LifeSupportInfo.Count; - for(int i = count; i --> 0;) + for (int i = count; i-- > 0;) { - var thisCrew = LifeSupportManager.Instance.LifeSupportInfo[i]; - if (thisCrew.CurrentVesselId != vessel.id.ToString()) + var trackedKerbal = LifeSupportManager.Instance.LifeSupportInfo[i]; + if (trackedKerbal.CurrentVesselId != vessel.id.ToString()) continue; - if(!crewNames.Contains(thisCrew.KerbalName) && KerbalIsMissing(thisCrew.KerbalName)) - LifeSupportManager.Instance.UntrackKerbal(thisCrew.KerbalName); + if (!crewNames.Contains(trackedKerbal.KerbalName) && IsKerbalMissing(trackedKerbal.KerbalName)) + LifeSupportManager.Instance.UntrackKerbal(trackedKerbal.KerbalName); } } catch (Exception ex) { - print(String.Format("ERROR {0} IN CheckForDeadKerbals", ex.Message)); + print(string.Format("ERROR {0} IN CheckForDeadKerbals", ex.Message)); } } - private bool KerbalIsMissing(string name) + private bool IsKerbalMissing(string name) { - var vCount = FlightGlobals.Vessels.Count; - var cCount = 0; - for (int i = 0; i < vCount; ++i) + var vesselCount = FlightGlobals.Vessels.Count; + var crewCount = 0; + for (int i = 0; i < vesselCount; ++i) { - var v = FlightGlobals.Vessels[i]; - var crew = v.GetVesselCrew(); - cCount = crew.Count; - for (int x = 0; x < cCount; ++x) + var vessel = FlightGlobals.Vessels[i]; + var crewRoster = vessel.GetVesselCrew(); + crewCount = crewRoster.Count; + for (int x = 0; x < crewCount; ++x) { - var c = crew[x]; - if (c.name == name) + var crewMember = crewRoster[x]; + if (crewMember.name == name) return false; } } return true; } - private void CheckVesselId() + private void UpdateStatus() { - if(String.IsNullOrEmpty(VesselStatus.VesselId)) - return; - - //Something changed... - if (VesselStatus.VesselId != vessel.id.ToString()) - { - var oldV = LifeSupportManager.Instance.FetchVessel(VesselStatus.VesselId); - var newV = LifeSupportManager.Instance.FetchVessel(vessel.id.ToString()); - newV.LastFeeding = oldV.LastFeeding; - newV.LastECCheck = oldV.LastECCheck; - newV.LastUpdate = oldV.LastUpdate; - newV.NumCrew = oldV.NumCrew; - newV.RecyclerMultiplier = oldV.RecyclerMultiplier; - newV.CrewCap = oldV.CrewCap; - newV.VesselHabMultiplier = oldV.VesselHabMultiplier; - newV.CachedHabTime = oldV.CachedHabTime; - newV.ExtraHabSpace = oldV.ExtraHabSpace; - newV.SuppliesLeft = oldV.SuppliesLeft; - newV.ECLeft = oldV.ECLeft; - newV.VesselId = vessel.id.ToString(); - newV.VesselName = vessel.vesselName; - LifeSupportManager.Instance.TrackVessel(newV); - VesselStatus = newV; - } + UpdateStatus(VesselStatus); } - public static double CalculateVesselHabExtraTime(Vessel v) + private void UpdateStatus(VesselSupplyStatus supplyStatus) { - var habTime = 0d; - var habList = v.FindPartModulesImplementing(); - var count = habList.Count; - for(int i = 0; i < count; ++i) - { - var hab = habList[i]; - habTime += hab.KerbalMonths; - } - return habTime; - } + var now = Planetarium.GetUniversalTime(); + if (_lastUpdate < ResourceUtilities.FLOAT_TOLERANCE) + _lastUpdate = now; - public static double CalculateVesselHabMultiplier(Vessel v, int numCrew) - { - var habMulti = 0d; - var habList = v.FindPartModulesImplementing(); - var count = habList.Count; - for (int i = 0; i < count; ++i) + // Give converters time to catch up before we start using calculated values + bool fullRefresh = false; + if (now > _lastUpdate + 5d) { - var hab = habList[i]; - habMulti += (hab.HabMultiplier * Math.Min(1, hab.CrewCapacity / numCrew)); + fullRefresh = true; + _lastUpdate = now; } - return habMulti; + + var calcRecyclerMultiplier = (float)LifeSupportManager.GetRecyclerMultiplier(vessel); + var calcHabTime = (float)LifeSupportManager.CalculateVesselHabExtraTime(vessel); + var calcHabMultiplier = (float)LifeSupportManager.CalculateVesselHabMultiplier(vessel, _currentCrewCount); + + // If we're the active vessel, and we're past easing, use calculated values. + // Otherwise, use the cache. + var useCalculated = fullRefresh && vessel.id == FlightGlobals.ActiveVessel.id; + + //Start with intelligent defaults. + if (supplyStatus.RecyclerMultiplier < ResourceUtilities.FLOAT_TOLERANCE) + supplyStatus.RecyclerMultiplier = 1f; + if (calcRecyclerMultiplier < ResourceUtilities.FLOAT_TOLERANCE) + calcRecyclerMultiplier = 1f; + + //And take the lowest (non-zero) + if (useCalculated || calcRecyclerMultiplier < supplyStatus.RecyclerMultiplier) + supplyStatus.RecyclerMultiplier = calcRecyclerMultiplier; + + //Hab we want the best ones. + if (useCalculated || calcHabTime > supplyStatus.ExtraHabSpace) + supplyStatus.ExtraHabSpace = calcHabTime; + + if (useCalculated || calcHabMultiplier > supplyStatus.VesselHabMultiplier) + supplyStatus.VesselHabMultiplier = calcHabMultiplier; + + LifeSupportManager.Instance.TrackVessel(supplyStatus); } - private ConversionRecipe SupplyRecipe + private void CheckVesselId() { - get + if (string.IsNullOrEmpty(VesselStatus.VesselId)) + return; + + // Update values if the vessel id has changed (usually due to docking/undocking) + if (VesselStatus.VesselId != vessel.id.ToString()) { - return GenerateSupplyRecipe(); + // We're basically just cloning the old values here + var oldTrackedVessel = LifeSupportManager.Instance.FetchVessel(VesselStatus.VesselId); + var newTrackedVessel = LifeSupportManager.Instance.FetchVessel(vessel.id.ToString()); + + newTrackedVessel.VesselId = vessel.id.ToString(); + newTrackedVessel.VesselName = vessel.vesselName; + newTrackedVessel.LastFeeding = oldTrackedVessel.LastFeeding; + newTrackedVessel.LastECCheck = oldTrackedVessel.LastECCheck; + newTrackedVessel.LastUpdate = oldTrackedVessel.LastUpdate; + newTrackedVessel.NumCrew = oldTrackedVessel.NumCrew; + newTrackedVessel.RecyclerMultiplier = oldTrackedVessel.RecyclerMultiplier; + newTrackedVessel.CrewCap = oldTrackedVessel.CrewCap; + newTrackedVessel.VesselHabMultiplier = oldTrackedVessel.VesselHabMultiplier; + newTrackedVessel.CachedHabTime = oldTrackedVessel.CachedHabTime; + newTrackedVessel.ExtraHabSpace = oldTrackedVessel.ExtraHabSpace; + newTrackedVessel.SuppliesLeft = oldTrackedVessel.SuppliesLeft; + newTrackedVessel.ECLeft = oldTrackedVessel.ECLeft; + + LifeSupportManager.Instance.TrackVessel(newTrackedVessel); + VesselStatus = newTrackedVessel; } } - private ConversionRecipe ECRecipe + protected double GetDeltaTime() { - get + if (Time.timeSinceLevelLoad < 1.0f || !FlightGlobals.ready) + return -1; + + var now = Planetarium.GetUniversalTime(); + if (Math.Abs(LastUpdateTime) < ResourceUtilities.FLOAT_TOLERANCE) { - return GenerateECRecipe(); + // Just started running + LastUpdateTime = now; + return -1; } + + double maxDeltaTime = ResourceUtilities.GetMaxDeltaTime(); + double deltaTime = Math.Min(now - LastUpdateTime, maxDeltaTime); + + LastUpdateTime += deltaTime; + + return deltaTime; } - private ConversionRecipe GenerateSupplyRecipe() + private bool CheckIfHomeWorld() { - //Two recipes are executed. One for EC, one for Supplies. - var recipe = new ConversionRecipe(); - var numCrew = _currentCrew; - var recMult = VesselStatus.RecyclerMultiplier; - var supAmount = LifeSupportScenario.Instance.settings.GetSettings().SupplyAmount; - var scrapAmount = LifeSupportScenario.Instance.settings.GetSettings().WasteAmount; - var supRatio = supAmount * numCrew * recMult; - var mulchRatio = scrapAmount * numCrew * recMult; - recipe.Inputs.Add(new ResourceRatio { FlowMode = ResourceFlowMode.ALL_VESSEL, Ratio = supRatio, ResourceName = "Supplies", DumpExcess = true }); - recipe.Outputs.Add(new ResourceRatio { FlowMode = ResourceFlowMode.ALL_VESSEL, Ratio = mulchRatio, ResourceName = "Mulch", DumpExcess = true }); - return recipe; + if (USI_GlobalBonuses.Instance.GetHabBonus(vessel.mainBody.flightGlobalsIndex) < 5) //TODO - make this a parm + return false; + + //Check for hab time. + var habTime = LifeSupportManager.Instance.FetchVessel(vessel.id.ToString()).CachedHabTime; + + //We want one year, either Kerbal or earth. Note: 60 seconds X 60 minutes = 3600 seconds in an hour + double secondsPerDay = GameSettings.KERBIN_TIME ? 3600d * 6d : 3600d * 24d; + double secsPerYear = GameSettings.KERBIN_TIME ? secondsPerDay * 425d : secondsPerDay * 365d; + + double habYears = Math.Floor(habTime / secsPerYear); + + return habYears >= 1d; } - private ConversionRecipe GenerateECRecipe() + private bool CheckHabSideEffects(LifeSupportStatus trackedKerbal) { - //Two recipes are executed. One for EC, one for Supplies. - var recipe = new ConversionRecipe(); - var numCrew = _currentCrew; - var ecAmount = LifeSupportScenario.Instance.settings.GetSettings().ECAmount; - recipe.Inputs.Add(new ResourceRatio { FlowMode = ResourceFlowMode.ALL_VESSEL, Ratio = ecAmount * numCrew, ResourceName = "ElectricCharge", DumpExcess = true }); - return recipe; + var now = Planetarium.GetUniversalTime(); + var habTime = LifeSupportManager.GetTotalHabTime(VesselStatus, vessel); + + if (trackedKerbal.LastAtHome < 1) + trackedKerbal.LastAtHome = now; + if (habTime + trackedKerbal.LastAtHome > trackedKerbal.MaxOffKerbinTime) + trackedKerbal.MaxOffKerbinTime = habTime + trackedKerbal.LastAtHome; + + LifeSupportManager.Instance.TrackKerbal(trackedKerbal); + + return (now > trackedKerbal.MaxOffKerbinTime || (now - trackedKerbal.TimeEnteredVessel) > habTime); } - private bool CheckSupplySideEffects(LifeSupportStatus kStat) + private bool CheckSupplySideEffects(LifeSupportStatus trackedKerbal) { - var curTime = Planetarium.GetUniversalTime(); - var SnackMax = LifeSupportScenario.Instance.settings.GetSettings().SupplyTime; + var now = Planetarium.GetUniversalTime(); + var snackMax = LifeSupportScenario.Instance.settings.GetSettings().SupplyTime; + var snackTime = Math.Max(now - trackedKerbal.LastMeal, ResourceUtilities.FLOAT_TOLERANCE); - var SnackTime = Math.Max(curTime - kStat.LastMeal, ResourceUtilities.FLOAT_TOLERANCE); - - if(SnackTime > ResourceUtilities.FLOAT_TOLERANCE) + if (snackTime > ResourceUtilities.FLOAT_TOLERANCE) UnlockTins(); - if (SnackTime > SnackMax) - { - return true; - } - return false; + return snackTime > snackMax; } - private bool CheckECSideEffects(LifeSupportStatus kStat) + private void UnlockTins() { - var curTime = Planetarium.GetUniversalTime(); - var ecMax = LifeSupportScenario.Instance.settings.GetSettings().ECTime; - var ecTime = Math.Max(curTime - kStat.LastEC, ResourceUtilities.FLOAT_TOLERANCE); - if (ecTime > ecMax) + if (HighLogic.LoadedSceneIsFlight) { - return true; - } - return false; - } - - private bool CheckHabSideEffects(LifeSupportStatus kStat) - { - var habTime = LifeSupportManager.GetTotalHabTime(VesselStatus, vessel); - if (kStat.LastAtHome < 1) - kStat.LastAtHome = Planetarium.GetUniversalTime(); - if (habTime + kStat.LastAtHome > kStat.MaxOffKerbinTime) - kStat.MaxOffKerbinTime = habTime + kStat.LastAtHome; - - LifeSupportManager.Instance.TrackKerbal(kStat); + //Unlock the biscuit tins... + bool foundSupplies = false; + var partCount = vessel.parts.Count; + for (int i = 0; i < partCount; ++i) + { + var part = vessel.parts[i]; + if (part.Resources.Contains("Supplies")) + { + var resource = part.Resources["Supplies"]; + if (resource.flowState == false) + { + resource.flowState = true; + foundSupplies = true; + } + } + } - if (Planetarium.GetUniversalTime() > kStat.MaxOffKerbinTime || (Planetarium.GetUniversalTime() - kStat.TimeEnteredVessel) > habTime) - { - return true; + if (foundSupplies) + ScreenMessages.PostScreenMessage("Supply containers unlocked...", 5f, ScreenMessageStyle.UPPER_CENTER); } - return false; } - - private void RemoveGrouchiness(ProtoCrewMember c, LifeSupportStatus k) + private bool CheckECSideEffects(LifeSupportStatus trackedKerbal) { - if (k.IsGrouchy) - { - string msg = string.Format("{0} has returned to duty", c.name); - ScreenMessages.PostScreenMessage(msg, 5f, ScreenMessageStyle.UPPER_CENTER); - c.type = ProtoCrewMember.KerbalType.Crew; - KerbalRoster.SetExperienceTrait(c, k.OldTrait); - k.IsGrouchy = false; - LifeSupportManager.Instance.TrackKerbal(k); - } + var now = Planetarium.GetUniversalTime(); + var ecMax = LifeSupportScenario.Instance.settings.GetSettings().ECTime; + var ecTime = Math.Max(now - trackedKerbal.LastEC, ResourceUtilities.FLOAT_TOLERANCE); + + return ecTime > ecMax; } - private void ApplyEffect(LifeSupportStatus kStat, ProtoCrewMember crew, int effectId, string reason) + private void ApplyEffect(LifeSupportStatus trackedKerbal, ProtoCrewMember crewMember, int effectId, string reason) { //Tourists are immune to effects - if (crew.type == ProtoCrewMember.KerbalType.Tourist || crew.experienceTrait.Title == "Tourist") + if (crewMember.type == ProtoCrewMember.KerbalType.Tourist || crewMember.experienceTrait.Title == "Tourist") return; - /* - * SIDE EFFECTS: - * - * 0 = No Effect (The feature is effectively turned off - * 1 = Grouchy (they become a Tourist until rescued) - * 2 = Mutinous (A tourist, but a random part of the ship is decoupled as they search for snacks - * 3 = Instantly 'wander' back to the KSC - don't ask us how! - * 4 = M.I.A. (will eventually respawn) - * 5 = K.I.A. - * - */ + /* SIDE EFFECTS: + * 0 = No Effect (The feature is effectively turned off) + * 1 = Grouchy (they become a Tourist until rescued) + * 2 = Mutinous (Also a tourist, but a random part of the ship is decoupled as they search for snacks) + * 3 = Instantly 'wander' back to the KSC - don't ask us how! + * 4 = M.I.A. (will eventually respawn) + * 5 = K.I.A. + */ var msg = ""; switch (effectId) @@ -648,45 +785,43 @@ private void ApplyEffect(LifeSupportStatus kStat, ProtoCrewMember crew, int effe case 0: // No effect return; // No need to print case 1: //Grouchy - msg = string.Format("{0} refuses to work {1}", crew.name, reason); - kStat.OldTrait = crew.experienceTrait.Title; - crew.type = ProtoCrewMember.KerbalType.Tourist; - KerbalRoster.SetExperienceTrait(crew, "Tourist"); - kStat.IsGrouchy = true; - LifeSupportManager.Instance.TrackKerbal(kStat); + msg = string.Format("{0} refuses to work {1}", crewMember.name, reason); + trackedKerbal.OldTrait = crewMember.experienceTrait.TypeName; + crewMember.type = ProtoCrewMember.KerbalType.Tourist; + KerbalRoster.SetExperienceTrait(crewMember, "Tourist"); + trackedKerbal.IsGrouchy = true; + LifeSupportManager.Instance.TrackKerbal(trackedKerbal); break; case 2: //Mutinous - { - msg = string.Format("{0} has become mutinous due to {1}", crew.name, reason); - kStat.OldTrait = crew.experienceTrait.Title; - crew.type = ProtoCrewMember.KerbalType.Tourist; - KerbalRoster.SetExperienceTrait(crew, "Tourist"); - kStat.IsGrouchy = true; - LifeSupportManager.Instance.TrackKerbal(kStat); - ClipRandomPart(); - SpawnExtraSupplies(100f); - } + msg = string.Format("{0} has become mutinous due to {1}", crewMember.name, reason); + trackedKerbal.OldTrait = crewMember.experienceTrait.TypeName; + crewMember.type = ProtoCrewMember.KerbalType.Tourist; + KerbalRoster.SetExperienceTrait(crewMember, "Tourist"); + trackedKerbal.IsGrouchy = true; + LifeSupportManager.Instance.TrackKerbal(trackedKerbal); + ClipRandomPart(); + SpawnExtraSupplies(100f); break; case 3: //Return to KSC - msg = string.Format("{0} gets fed up and wanders back to the KSC due to {1}", crew.name, reason); - LifeSupportManager.Instance.UntrackKerbal(crew.name); - crew.rosterStatus = ProtoCrewMember.RosterStatus.Available; + msg = string.Format("{0} gets fed up and wanders back to the KSC due to {1}", crewMember.name, reason); + LifeSupportManager.Instance.UntrackKerbal(crewMember.name); + crewMember.rosterStatus = ProtoCrewMember.RosterStatus.Available; vessel.CrewListSetDirty(); - RemoveCrewFromPart(crew); + RemoveCrewFromPart(crewMember); break; case 4: //Despawn - msg = string.Format("{0} has gone missing due to {1}", crew.name, reason); - LifeSupportManager.Instance.UntrackKerbal(crew.name); + msg = string.Format("{0} has gone missing due to {1}", crewMember.name, reason); + LifeSupportManager.Instance.UntrackKerbal(crewMember.name); vessel.CrewListSetDirty(); - RemoveCrewFromPart(crew); - crew.rosterStatus = ProtoCrewMember.RosterStatus.Missing; + RemoveCrewFromPart(crewMember); + crewMember.rosterStatus = ProtoCrewMember.RosterStatus.Missing; break; case 5: //Kill - msg = string.Format("{0} has died due to {1}", crew.name, reason); - LifeSupportManager.Instance.UntrackKerbal(crew.name); + msg = string.Format("{0} has died due to {1}", crewMember.name, reason); + LifeSupportManager.Instance.UntrackKerbal(crewMember.name); vessel.CrewListSetDirty(); - RemoveCrewFromPart(crew); - crew.rosterStatus = ProtoCrewMember.RosterStatus.Dead; + RemoveCrewFromPart(crewMember); + crewMember.rosterStatus = ProtoCrewMember.RosterStatus.Dead; break; } @@ -695,25 +830,25 @@ private void ApplyEffect(LifeSupportStatus kStat, ProtoCrewMember crew, int effe private void SpawnExtraSupplies(float sup) { - ResBroker.StoreResource(vessel.rootPart, "Supplies", sup, TimeWarp.deltaTime, ResourceFlowMode.ALL_VESSEL); + ResourceBroker.StoreResource(vessel.rootPart, "Supplies", sup, TimeWarp.deltaTime, ResourceFlowMode.ALL_VESSEL); } - private void RemoveCrewFromPart(ProtoCrewMember crew) + private void RemoveCrewFromPart(ProtoCrewMember crewMemberToRemove) { var parts = vessel.parts; for (int i = 0; i < parts.Count; ++i) { - var p = parts[i]; - if (p.CrewCapacity > 0) + var part = parts[i]; + if (part.CrewCapacity > 0) { - var crewList = p.protoModuleCrew; - var cCount = crewList.Count; - for (int x = 0; x < cCount; x++) + var crewRoster = part.protoModuleCrew; + var crewCount = crewRoster.Count; + for (int x = 0; x < crewCount; x++) { - var c = crewList[x]; - if (c.name == crew.name) + var crewMember = crewRoster[x]; + if (crewMember.name == crewMemberToRemove.name) { - p.RemoveCrewmember(c); + part.RemoveCrewmember(crewMember); return; } } @@ -723,165 +858,51 @@ private void RemoveCrewFromPart(ProtoCrewMember crew) private void ClipRandomPart() { - System.Random r = new System.Random(); - var idx = r.Next(1, vessel.parts.Count - 1); - var p = vessel.parts[idx]; - if (p.parent != null) - p.decouple(); + System.Random rng = new System.Random(); + var idx = rng.Next(1, vessel.parts.Count - 1); + var part = vessel.parts[idx]; + if (part.parent != null) + part.decouple(); } - private void CheckEVA(Vessel evaKerbal) + private void RemoveGrouchiness(ProtoCrewMember crewMember, LifeSupportStatus trackedKerbal) { - if (IsAtHomeForEva(evaKerbal)) - { - return; - } - - var kerbal = evaKerbal.GetVesselCrew()[0]; - //Check their status. - var kerbalStatus = LifeSupportManager.Instance.FetchKerbal(kerbal); - if (evaKerbal.missionTime > LifeSupportScenario.Instance.settings.GetSettings().EVATime) + if (trackedKerbal.IsGrouchy) { - var effect = LifeSupportManager.GetEVAExcessEffect(kerbalStatus.KerbalName); - ApplyEVAEffect(kerbalStatus, kerbal, evaKerbal, effect); - } - } - - private bool IsAtHomeForEva(Vessel evaKerbal) - { - return (evaKerbal.mainBody == FlightGlobals.GetHomeBody()) && - (evaKerbal.altitude < LifeSupportScenario.Instance.settings.GetSettings().HomeWorldAltitude); - } + crewMember.type = ProtoCrewMember.KerbalType.Crew; + KerbalRoster.SetExperienceTrait(crewMember, trackedKerbal.OldTrait); - private void ApplyEVAEffect(LifeSupportStatus kStat, ProtoCrewMember crew, Vessel v, int effectId) - { - if (crew.type == ProtoCrewMember.KerbalType.Tourist || crew.experienceTrait.Title == "Tourist") - return; - - /* - * SIDE EFFECTS: - * - * 0 = No Effect (The feature is effectively turned off - * 1 = Grouchy (they become a Tourist until rescued) - * 2 = Mutinous (A tourist, but destroys a part of a nearby vessel...) - * 3 = Instantly 'wander' back to the KSC - don't ask us how! - * 4 = M.I.A. (will eventually respawn) - * 5 = K.I.A. - * - */ + trackedKerbal.IsGrouchy = false; + LifeSupportManager.Instance.TrackKerbal(trackedKerbal); - var msg = ""; - switch (effectId) - { - case 0: // No effect - return; // No need to print - case 1: //Grouchy - if (crew.type != ProtoCrewMember.KerbalType.Tourist) - { - msg = string.Format("{0} refuses to work", crew.name); - kStat.OldTrait = crew.experienceTrait.Title; - crew.type = ProtoCrewMember.KerbalType.Tourist; - KerbalRoster.SetExperienceTrait(crew, "Tourist"); - kStat.IsGrouchy = true; - LifeSupportManager.Instance.TrackKerbal(kStat); - } - break; - case 2: //Mutinous - { - msg = string.Format("{0} has become mutinous", crew.name); - kStat.OldTrait = crew.experienceTrait.Title; - crew.type = ProtoCrewMember.KerbalType.Tourist; - KerbalRoster.SetExperienceTrait(crew, "Tourist"); - kStat.IsGrouchy = true; - LifeSupportManager.Instance.TrackKerbal(kStat); - DestroyRandomPart(v); - } - break; - case 3: //Return to KSC - msg = string.Format("{0} gets fed up and wanders back to the KSC", crew.name); - LifeSupportManager.Instance.UntrackKerbal(crew.name); - crew.rosterStatus = ProtoCrewMember.RosterStatus.Available; - DestroyVessel(v); - break; - case 4: //Despawn - msg = string.Format("{0} has gone missing", crew.name); - LifeSupportManager.Instance.UntrackKerbal(crew.name); - crew.rosterStatus = ProtoCrewMember.RosterStatus.Missing; - DestroyVessel(v); - break; - case 5: //Kill - msg = string.Format("{0} has died", crew.name); - LifeSupportManager.Instance.UntrackKerbal(crew.name); - crew.rosterStatus = ProtoCrewMember.RosterStatus.Dead; - DestroyVessel(v); - break; - } - - ScreenMessages.PostScreenMessage(msg, 5f, ScreenMessageStyle.UPPER_CENTER); - } - - private void DestroyRandomPart(Vessel thisVessel) - { - System.Random r = new System.Random(); - var vlist = GetNearbyVessels(150, false, thisVessel, false); - var count = vlist.Count; - for (int i = 0; i < count; ++i) - { - var v = vlist[i]; - var idx = r.Next(1, v.parts.Count - 1); - var p = v.parts[idx]; - if (p.parent != null) - p.decouple(); - } - } - - private void DestroyVessel(Vessel v) - { - var _demoParts = new List(); - var count = v.parts.Count; - for (int i = 0; i < count; ++i) - { - _demoParts.Add(v.parts[i]); - } - - for (int i = 0; i < count; ++i) - { - var p = _demoParts[i]; - p.decouple(); - p.explode(); - } - } - - public static List GetNearbyVessels(int range, bool includeSelf, Vessel thisVessel, bool landedOnly = true) - { - try - { - var vessels = new List(); - var count = FlightGlobals.Vessels.Count; - for(int i = 0; i < count; ++i) - { - var v = FlightGlobals.Vessels[i]; - if (v.mainBody == thisVessel.mainBody - && (v.Landed || !landedOnly || v == thisVessel)) - { - if (v == thisVessel && !includeSelf) continue; - var posCur = thisVessel.GetWorldPos3D(); - var posNext = v.GetWorldPos3D(); - var distance = Vector3d.Distance(posCur, posNext); - if (distance < range) - { - vessels.Add(v); - } - } - } - return vessels; - } - catch (Exception ex) - { - Debug.Log(String.Format("[LS] - ERROR in GetNearbyVessels - {0}", ex.Message)); - return new List(); + string msg = string.Format("{0} has returned to duty", crewMember.name); + ScreenMessages.PostScreenMessage(msg, 5f, ScreenMessageStyle.UPPER_CENTER); } } + //public static double CalculateVesselHabExtraTime(Vessel vessel) + //{ + // var habTime = 0d; + // var habitats = vessel.FindConverterAddonsImplementing(); + // for(int i = 0; i < habitats.Count; ++i) + // { + // var habitat = habitats[i]; + // habTime += habitat.KerbalMonths; + // } + // return habTime; + //} + + //public static double CalculateVesselHabMultiplier(Vessel v, int numCrew) + //{ + // var habMulti = 0d; + // var habList = v.FindPartModulesImplementing(); + // var count = habList.Count; + // for (int i = 0; i < count; ++i) + // { + // var hab = habList[i]; + // habMulti += (hab.HabMultiplier * Math.Min(1, hab.CrewCapacity / numCrew)); + // } + // return habMulti; + //} } } diff --git a/Source/USILifeSupport/USILS_KolonyGrowthModule.cs b/Source/USILifeSupport/USILS_KolonyGrowthModule.cs new file mode 100644 index 0000000..4577c06 --- /dev/null +++ b/Source/USILifeSupport/USILS_KolonyGrowthModule.cs @@ -0,0 +1,75 @@ +namespace LifeSupport +{ + public class USILS_KolonyGrowthModule : PartModule + { + [KSPField(guiName = "Kolony Growth", guiActive = true, guiActiveEditor = true, isPersistant = true), UI_Toggle(disabledText = "Off", enabledText = "On")] + public bool KolonyGrowthEnabled = false; + + [KSPField(isPersistant = false, guiName = "Next Birthday")] + public string KerbabyCountdown; + + [KSPField(isPersistant = true)] + public double GrowthTime = 0d; + + public const double GestationTime = 9720000d; + private double _lastCheck = 0; + + public override void OnStart(StartState state) + { + _lastCheck = Planetarium.GetUniversalTime(); + } + + public override void OnUpdate() + { + Fields["KerbabyCountdown"].guiActive = KolonyGrowthEnabled; + + // We don't need to update kolony growth hyperactively, once per second is more than sufficient + var now = Planetarium.GetUniversalTime(); + var elapsedTime = now - _lastCheck; + + if (elapsedTime >= 1d) + { + _lastCheck = now; + + if (KolonyGrowthEnabled && part.CrewCapacity > part.protoModuleCrew.Count) + { + var hasMale = false; + var hasFemale = false; + + var crew = vessel.GetVesselCrew(); + var count = crew.Count; + for (int i = 0; i < count; ++i) + { + var c = crew[i]; + if (c.gender == ProtoCrewMember.Gender.Male) + hasMale = true; + if (c.gender == ProtoCrewMember.Gender.Female) + hasFemale = true; + } + + if (hasMale && hasFemale) + { + // Grow our Kolony! + GrowthTime += (elapsedTime * part.protoModuleCrew.Count); + if (GrowthTime >= GestationTime) + { + GrowthTime -= GestationTime; + SpawnKerbal(); + } + KerbabyCountdown = LifeSupportUtilities.SmartDurationDisplay(GestationTime - GrowthTime); + } + } + } + } + + private void SpawnKerbal() + { + ProtoCrewMember newKerb = HighLogic.CurrentGame.CrewRoster.GetNewKerbal(); + newKerb.rosterStatus = ProtoCrewMember.RosterStatus.Assigned; + part.AddCrewmember(newKerb); + + var msg = string.Format("{0}, a new {1}, has joined your crew!", newKerb.name, newKerb.experienceTrait.TypeName); + ScreenMessages.PostScreenMessage(msg, 5f, ScreenMessageStyle.UPPER_CENTER); + } + } +} diff --git a/Source/USILifeSupport/USILifeSupport.csproj b/Source/USILifeSupport/USILifeSupport.csproj index 549ddf0..0743917 100644 --- a/Source/USILifeSupport/USILifeSupport.csproj +++ b/Source/USILifeSupport/USILifeSupport.csproj @@ -32,7 +32,7 @@ - ..\..\..\..\KSP_DEV\KSP_Data\Managed\Assembly-CSharp.dll + ..\..\..\..\KSP_DEV\KSP_x64_Data\Managed\Assembly-CSharp.dll False @@ -42,11 +42,11 @@ - ..\..\..\..\KSP_DEV\KSP_Data\Managed\UnityEngine.dll + ..\..\..\..\KSP_DEV\KSP_x64_Data\Managed\UnityEngine.dll False - ..\..\..\..\KSP_DEV\KSP_Data\Managed\UnityEngine.UI.dll + ..\..\..\..\KSP_DEV\KSP_x64_Data\Managed\UnityEngine.UI.dll False @@ -56,14 +56,17 @@ + + + + + + + - - - - @@ -71,6 +74,7 @@ +