├── misc ├── VisualStudio │ ├── steam_appid.txt │ ├── buildscripts │ │ ├── ZipPack │ │ │ ├── 7za.dll │ │ │ ├── 7za.exe │ │ │ ├── 7za-License.txt │ │ │ └── build-package.bat │ │ └── UnityDebug │ │ │ ├── pdb2mdb.exe │ │ │ ├── Mono.Cecil.dll │ │ │ ├── Mono.CompilerServices.SymbolWriter.dll │ │ │ └── prepare-debug.bat │ ├── Kerbalism.csproj.user │ └── Kerbalism.sln └── img │ ├── banner.png │ ├── gui │ ├── monitor.png │ ├── planner.png │ ├── body-info.png │ ├── telemetry.png │ ├── dev-manager.png │ ├── file-manager.png │ └── monitor-filter.gif │ ├── parts │ ├── containers.png │ ├── greenhouse.png │ ├── active-shield.png │ ├── gravity-ring.png │ ├── short-antenna.png │ ├── chemical-plant.png │ ├── geiger-counter.gif │ └── geiger-counter.png │ └── rdr │ ├── radiation-fields-0.png │ ├── radiation-fields-1.png │ ├── radiation-fields-2.png │ ├── radiation-fields-3.png │ └── radiation-fields-4.png ├── GameData └── Kerbalism │ ├── Kerbalism.dll │ ├── Shaders │ ├── _osx │ ├── _linux │ ├── _windows │ ├── mini_particle.shader │ ├── aa_line.shader │ ├── full_point_particle.shader │ ├── point_particle.shader │ └── point_sprite.shader │ ├── Parts │ ├── _ │ │ ├── food.mbm │ │ ├── 125food.mu │ │ ├── 25food.mu │ │ └── oxygen.mu │ ├── GravityRing │ │ ├── circ.mbm │ │ ├── model.mu │ │ ├── main_body.mbm │ │ ├── support.mbm │ │ ├── tunnel_main.mbm │ │ ├── main_support.mbm │ │ ├── main_support2.mbm │ │ ├── static_base2.mbm │ │ ├── tunnel_piston.mbm │ │ └── GravityRing.cfg │ ├── Greenhouse │ │ ├── model.mu │ │ ├── model000.dds │ │ ├── model001.dds │ │ └── Greenhouse.cfg │ ├── ShortAntenna │ │ ├── model.mu │ │ ├── model000.dds │ │ └── shortAntenna.cfg │ ├── ActiveShield │ │ ├── big_diff.png │ │ ├── big_glow.png │ │ ├── bigtank.mu │ │ ├── big_n_NRM.png │ │ └── ActiveShield.cfg │ ├── ChemicalPlant │ │ ├── ChemicalPlant.mu │ │ ├── ksp_s_processorSmall_diff.dds │ │ └── ChemicalPlant.cfg │ ├── GeigerCounter │ │ ├── kismcounter.mu │ │ └── kismcounter.png │ ├── InlineContainer0625 │ │ ├── kismfoodsm.mu │ │ ├── kismfoodsm.png │ │ ├── kismfoodsmNRM.png │ │ └── InlineContainer0625.cfg │ ├── RadialContainer │ │ ├── RadialContainer.cfg │ │ ├── BigRadialContainer.cfg │ │ └── SmallRadialContainer.cfg │ ├── InlineContainer125 │ │ └── InlineContainer125.cfg │ └── InlineContainer250 │ │ └── InlineContainer250.cfg │ ├── Textures │ ├── close.png │ ├── empty.png │ ├── box-red.png │ ├── lab-cyan.png │ ├── particle.png │ ├── box-white.png │ ├── box-yellow.png │ ├── brain-red.png │ ├── health-red.png │ ├── lab-black.png │ ├── left-arrow.png │ ├── send-black.png │ ├── send-cyan.png │ ├── signal-red.png │ ├── small-info.png │ ├── storm-red.png │ ├── sun-black.png │ ├── sun-white.png │ ├── toggle-red.png │ ├── wrench-red.png │ ├── applauncher.png │ ├── battery-red.png │ ├── battery-white.png │ ├── brain-white.png │ ├── brain-yellow.png │ ├── health-white.png │ ├── health-yellow.png │ ├── plant-white.png │ ├── plant-yellow.png │ ├── radiation-red.png │ ├── recycle-red.png │ ├── right-arrow.png │ ├── signal-white.png │ ├── signal-yellow.png │ ├── small-config.png │ ├── small-console.png │ ├── small-folder.png │ ├── small-notes.png │ ├── small-search.png │ ├── storm-yellow.png │ ├── toggle-green.png │ ├── wrench-white.png │ ├── wrench-yellow.png │ ├── battery-yellow.png │ ├── category-normal.png │ ├── recycle-yellow.png │ ├── black-background.png │ ├── category-selected.png │ ├── radiation-yellow.png │ └── icons-license.txt │ ├── Support │ ├── CTT.cfg │ ├── SMURFF.cfg │ ├── OrbitalTug.cfg │ ├── ALCOR.cfg │ ├── SRC.cfg │ ├── HabTech.cfg │ ├── RealFuels.cfg │ ├── EPL.cfg │ ├── ETT.cfg │ ├── CLS.cfg │ ├── SCANsat.cfg │ ├── HGR.cfg │ ├── Kopernicus.cfg │ ├── SoundingRockets.cfg │ ├── Tundra.cfg │ ├── SEP.cfg │ ├── DeepFreeze.cfg │ ├── Buffalo.cfg │ ├── AtomicAge.cfg │ ├── KerbalAtomics.cfg │ ├── CxAerospace.cfg │ ├── JX2Antenna.cfg │ ├── RLAStockalikeContinued.cfg │ ├── B9.cfg │ ├── NearFuture.cfg │ ├── Origami.cfg │ ├── RSS.cfg │ ├── ContractConfigurator.cfg │ ├── SSPX.cfg │ ├── MOLE.cfg │ └── SXT.cfg │ ├── Profiles │ └── None.cfg │ ├── System │ ├── Planner.cfg │ ├── Comfort.cfg │ └── Misc.cfg │ ├── Extra │ └── WetWorkshop.disabled │ └── Settings.cfg ├── src ├── Database │ ├── SupplyData.cs │ ├── UIData.cs │ ├── RuleData.cs │ ├── BodyData.cs │ ├── LandmarkData.cs │ └── KerbalData.cs ├── Science │ ├── Sample.cs │ ├── File.cs │ └── ExperimentInfo.cs ├── Automation │ ├── Device.cs │ ├── Script.cs │ └── Devices │ │ ├── Laboratory.cs │ │ ├── Light.cs │ │ ├── Emitter.cs │ │ ├── Ring.cs │ │ ├── Greenhouse.cs │ │ ├── Drill.cs │ │ ├── Generator.cs │ │ ├── Converter.cs │ │ ├── Process.cs │ │ ├── Scanner.cs │ │ ├── Experiment.cs │ │ ├── Antenna.cs │ │ ├── Harvester.cs │ │ └── Panel.cs ├── Utility │ ├── DumpSpec.cs │ ├── Space.cs │ ├── Specifics.cs │ ├── Archive.cs │ ├── Animator.cs │ ├── Highlighter.cs │ └── CrewSpecs.cs ├── External │ ├── RemoteTech.cs │ └── SCANsat.cs ├── Modules │ └── PlannerController.cs ├── Properties │ └── AssemblyInfo.cs ├── UI │ ├── TimedOut.cs │ ├── UI.cs │ ├── Tooltip.cs │ ├── VesselConfig.cs │ └── BodyInfo.cs ├── Signal │ └── ConnectionInfo.cs ├── Contracts │ ├── CrossBelt.cs │ ├── SpaceHarvest.cs │ ├── SpaceAnalysis.cs │ ├── CrossHeliopause.cs │ └── MannedOrbit.cs ├── Renderer │ ├── ParticleRenderer.cs │ └── ParticleMesh.cs ├── System │ ├── Loader.cs │ └── Features.cs └── Profile │ ├── Process.cs │ └── Modifiers.cs └── LICENSE /misc/VisualStudio/steam_appid.txt: -------------------------------------------------------------------------------- 1 | 220200 2 | -------------------------------------------------------------------------------- /misc/img/banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/misc/img/banner.png -------------------------------------------------------------------------------- /misc/img/gui/monitor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/misc/img/gui/monitor.png -------------------------------------------------------------------------------- /misc/img/gui/planner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/misc/img/gui/planner.png -------------------------------------------------------------------------------- /misc/img/gui/body-info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/misc/img/gui/body-info.png -------------------------------------------------------------------------------- /misc/img/gui/telemetry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/misc/img/gui/telemetry.png -------------------------------------------------------------------------------- /misc/img/gui/dev-manager.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/misc/img/gui/dev-manager.png -------------------------------------------------------------------------------- /misc/img/gui/file-manager.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/misc/img/gui/file-manager.png -------------------------------------------------------------------------------- /misc/img/parts/containers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/misc/img/parts/containers.png -------------------------------------------------------------------------------- /misc/img/parts/greenhouse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/misc/img/parts/greenhouse.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Kerbalism.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Kerbalism.dll -------------------------------------------------------------------------------- /GameData/Kerbalism/Shaders/_osx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Shaders/_osx -------------------------------------------------------------------------------- /misc/img/gui/monitor-filter.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/misc/img/gui/monitor-filter.gif -------------------------------------------------------------------------------- /misc/img/parts/active-shield.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/misc/img/parts/active-shield.png -------------------------------------------------------------------------------- /misc/img/parts/gravity-ring.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/misc/img/parts/gravity-ring.png -------------------------------------------------------------------------------- /misc/img/parts/short-antenna.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/misc/img/parts/short-antenna.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Parts/_/food.mbm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Parts/_/food.mbm -------------------------------------------------------------------------------- /GameData/Kerbalism/Shaders/_linux: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Shaders/_linux -------------------------------------------------------------------------------- /GameData/Kerbalism/Shaders/_windows: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Shaders/_windows -------------------------------------------------------------------------------- /misc/img/parts/chemical-plant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/misc/img/parts/chemical-plant.png -------------------------------------------------------------------------------- /misc/img/parts/geiger-counter.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/misc/img/parts/geiger-counter.gif -------------------------------------------------------------------------------- /misc/img/parts/geiger-counter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/misc/img/parts/geiger-counter.png -------------------------------------------------------------------------------- /misc/img/rdr/radiation-fields-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/misc/img/rdr/radiation-fields-0.png -------------------------------------------------------------------------------- /misc/img/rdr/radiation-fields-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/misc/img/rdr/radiation-fields-1.png -------------------------------------------------------------------------------- /misc/img/rdr/radiation-fields-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/misc/img/rdr/radiation-fields-2.png -------------------------------------------------------------------------------- /misc/img/rdr/radiation-fields-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/misc/img/rdr/radiation-fields-3.png -------------------------------------------------------------------------------- /misc/img/rdr/radiation-fields-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/misc/img/rdr/radiation-fields-4.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Parts/_/125food.mu: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Parts/_/125food.mu -------------------------------------------------------------------------------- /GameData/Kerbalism/Parts/_/25food.mu: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Parts/_/25food.mu -------------------------------------------------------------------------------- /GameData/Kerbalism/Parts/_/oxygen.mu: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Parts/_/oxygen.mu -------------------------------------------------------------------------------- /GameData/Kerbalism/Textures/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Textures/close.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Textures/empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Textures/empty.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Support/CTT.cfg: -------------------------------------------------------------------------------- 1 | @PART[Greenhouse]:NEEDS[CommunityTechTree]:FOR[Kerbalism] 2 | { 3 | @TechRequired = hydroponics 4 | } -------------------------------------------------------------------------------- /GameData/Kerbalism/Textures/box-red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Textures/box-red.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Textures/lab-cyan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Textures/lab-cyan.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Textures/particle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Textures/particle.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Textures/box-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Textures/box-white.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Textures/box-yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Textures/box-yellow.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Textures/brain-red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Textures/brain-red.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Textures/health-red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Textures/health-red.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Textures/lab-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Textures/lab-black.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Textures/left-arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Textures/left-arrow.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Textures/send-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Textures/send-black.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Textures/send-cyan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Textures/send-cyan.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Textures/signal-red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Textures/signal-red.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Textures/small-info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Textures/small-info.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Textures/storm-red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Textures/storm-red.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Textures/sun-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Textures/sun-black.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Textures/sun-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Textures/sun-white.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Textures/toggle-red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Textures/toggle-red.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Textures/wrench-red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Textures/wrench-red.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Parts/GravityRing/circ.mbm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Parts/GravityRing/circ.mbm -------------------------------------------------------------------------------- /GameData/Kerbalism/Parts/GravityRing/model.mu: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Parts/GravityRing/model.mu -------------------------------------------------------------------------------- /GameData/Kerbalism/Parts/Greenhouse/model.mu: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Parts/Greenhouse/model.mu -------------------------------------------------------------------------------- /GameData/Kerbalism/Textures/applauncher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Textures/applauncher.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Textures/battery-red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Textures/battery-red.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Textures/battery-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Textures/battery-white.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Textures/brain-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Textures/brain-white.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Textures/brain-yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Textures/brain-yellow.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Textures/health-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Textures/health-white.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Textures/health-yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Textures/health-yellow.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Textures/plant-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Textures/plant-white.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Textures/plant-yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Textures/plant-yellow.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Textures/radiation-red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Textures/radiation-red.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Textures/recycle-red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Textures/recycle-red.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Textures/right-arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Textures/right-arrow.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Textures/signal-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Textures/signal-white.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Textures/signal-yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Textures/signal-yellow.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Textures/small-config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Textures/small-config.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Textures/small-console.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Textures/small-console.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Textures/small-folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Textures/small-folder.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Textures/small-notes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Textures/small-notes.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Textures/small-search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Textures/small-search.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Textures/storm-yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Textures/storm-yellow.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Textures/toggle-green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Textures/toggle-green.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Textures/wrench-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Textures/wrench-white.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Textures/wrench-yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Textures/wrench-yellow.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Parts/ShortAntenna/model.mu: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Parts/ShortAntenna/model.mu -------------------------------------------------------------------------------- /GameData/Kerbalism/Textures/battery-yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Textures/battery-yellow.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Textures/category-normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Textures/category-normal.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Textures/recycle-yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Textures/recycle-yellow.png -------------------------------------------------------------------------------- /misc/VisualStudio/buildscripts/ZipPack/7za.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/misc/VisualStudio/buildscripts/ZipPack/7za.dll -------------------------------------------------------------------------------- /misc/VisualStudio/buildscripts/ZipPack/7za.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/misc/VisualStudio/buildscripts/ZipPack/7za.exe -------------------------------------------------------------------------------- /GameData/Kerbalism/Parts/ActiveShield/big_diff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Parts/ActiveShield/big_diff.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Parts/ActiveShield/big_glow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Parts/ActiveShield/big_glow.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Parts/ActiveShield/bigtank.mu: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Parts/ActiveShield/bigtank.mu -------------------------------------------------------------------------------- /GameData/Kerbalism/Parts/GravityRing/main_body.mbm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Parts/GravityRing/main_body.mbm -------------------------------------------------------------------------------- /GameData/Kerbalism/Parts/GravityRing/support.mbm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Parts/GravityRing/support.mbm -------------------------------------------------------------------------------- /GameData/Kerbalism/Parts/Greenhouse/model000.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Parts/Greenhouse/model000.dds -------------------------------------------------------------------------------- /GameData/Kerbalism/Parts/Greenhouse/model001.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Parts/Greenhouse/model001.dds -------------------------------------------------------------------------------- /GameData/Kerbalism/Parts/ShortAntenna/model000.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Parts/ShortAntenna/model000.dds -------------------------------------------------------------------------------- /GameData/Kerbalism/Textures/black-background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Textures/black-background.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Textures/category-selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Textures/category-selected.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Textures/radiation-yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Textures/radiation-yellow.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Parts/ActiveShield/big_n_NRM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Parts/ActiveShield/big_n_NRM.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Parts/GravityRing/tunnel_main.mbm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Parts/GravityRing/tunnel_main.mbm -------------------------------------------------------------------------------- /GameData/Kerbalism/Parts/ChemicalPlant/ChemicalPlant.mu: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Parts/ChemicalPlant/ChemicalPlant.mu -------------------------------------------------------------------------------- /GameData/Kerbalism/Parts/GeigerCounter/kismcounter.mu: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Parts/GeigerCounter/kismcounter.mu -------------------------------------------------------------------------------- /GameData/Kerbalism/Parts/GeigerCounter/kismcounter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Parts/GeigerCounter/kismcounter.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Parts/GravityRing/main_support.mbm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Parts/GravityRing/main_support.mbm -------------------------------------------------------------------------------- /GameData/Kerbalism/Parts/GravityRing/main_support2.mbm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Parts/GravityRing/main_support2.mbm -------------------------------------------------------------------------------- /GameData/Kerbalism/Parts/GravityRing/static_base2.mbm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Parts/GravityRing/static_base2.mbm -------------------------------------------------------------------------------- /GameData/Kerbalism/Parts/GravityRing/tunnel_piston.mbm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Parts/GravityRing/tunnel_piston.mbm -------------------------------------------------------------------------------- /misc/VisualStudio/buildscripts/UnityDebug/pdb2mdb.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/misc/VisualStudio/buildscripts/UnityDebug/pdb2mdb.exe -------------------------------------------------------------------------------- /misc/VisualStudio/buildscripts/UnityDebug/Mono.Cecil.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/misc/VisualStudio/buildscripts/UnityDebug/Mono.Cecil.dll -------------------------------------------------------------------------------- /GameData/Kerbalism/Parts/InlineContainer0625/kismfoodsm.mu: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Parts/InlineContainer0625/kismfoodsm.mu -------------------------------------------------------------------------------- /GameData/Kerbalism/Parts/InlineContainer0625/kismfoodsm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Parts/InlineContainer0625/kismfoodsm.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Parts/InlineContainer0625/kismfoodsmNRM.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Parts/InlineContainer0625/kismfoodsmNRM.png -------------------------------------------------------------------------------- /GameData/Kerbalism/Textures/icons-license.txt: -------------------------------------------------------------------------------- 1 | Hearthbeat icon by Freepik from www.flaticon.com 2 | 3 | All the other icons are released under the CC0 1.0 Universal by various authors. -------------------------------------------------------------------------------- /GameData/Kerbalism/Parts/ChemicalPlant/ksp_s_processorSmall_diff.dds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/GameData/Kerbalism/Parts/ChemicalPlant/ksp_s_processorSmall_diff.dds -------------------------------------------------------------------------------- /GameData/Kerbalism/Support/SMURFF.cfg: -------------------------------------------------------------------------------- 1 | // adding monoprop to kerbals makes smurff try to treat them like fuel tanks 2 | 3 | @PART[kerbalEVA*]:NEEDS[SMURFF]:FOR[Kerbalism] 4 | { 5 | %SMURFFExclude = true 6 | } 7 | -------------------------------------------------------------------------------- /misc/VisualStudio/buildscripts/UnityDebug/Mono.CompilerServices.SymbolWriter.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ShotgunNinja/Kerbalism/HEAD/misc/VisualStudio/buildscripts/UnityDebug/Mono.CompilerServices.SymbolWriter.dll -------------------------------------------------------------------------------- /GameData/Kerbalism/Support/OrbitalTug.cfg: -------------------------------------------------------------------------------- 1 | @PART[engineOnArm]:NEEDS[OrbitalTug,Kerbalism,FeatureRadiation] 2 | { 3 | MODULE 4 | { 5 | name = Emitter 6 | radiation = 0.0000011111 // 0.004 rad/h 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /GameData/Kerbalism/Support/ALCOR.cfg: -------------------------------------------------------------------------------- 1 | // Habitat surface/volume 2 | // by schrema 3 | 4 | @PART[ALCOR_LanderCapsule]:NEEDS[FeatureHabitat]:AFTER[Kerbalism] 5 | { 6 | @MODULE[Habitat] 7 | { 8 | volume = 3.76 9 | surface = 7.53 10 | } 11 | } -------------------------------------------------------------------------------- /GameData/Kerbalism/Support/SRC.cfg: -------------------------------------------------------------------------------- 1 | @PART[SampleReturnCapsule_Parachute]:NEEDS[FeatureSignal]:FOR[Kerbalism] 2 | { 3 | MODULE 4 | { 5 | name = Antenna 6 | type = low_gain 7 | cost = 0.02 8 | dist = 1e6 9 | rate = 0.004 10 | } 11 | } -------------------------------------------------------------------------------- /GameData/Kerbalism/Support/HabTech.cfg: -------------------------------------------------------------------------------- 1 | @PART[habtech_cupola]:NEEDS[FeatureComfort]:FOR[Kerbalism] 2 | { 3 | MODULE 4 | { 5 | name = Comfort 6 | desc = This is great to look at the panorama. 7 | bonus = panorama 8 | } 9 | 10 | @tags ^= :$: comfort: 11 | } -------------------------------------------------------------------------------- /GameData/Kerbalism/Support/RealFuels.cfg: -------------------------------------------------------------------------------- 1 | // use hydrazine as EVA propellant, instead of Monoprop 2 | @PART[kerbalEVA,kerbalEVAfemale]:NEEDS[RealFuels]:AFTER[Kerbalism] 3 | { 4 | @MODULE[KerbalEVA] 5 | { 6 | @propellantResourceName = Hydrazine 7 | } 8 | 9 | @RESOURCE[MonoPropellant] 10 | { 11 | @name = Hydrazine 12 | } 13 | } -------------------------------------------------------------------------------- /GameData/Kerbalism/Support/EPL.cfg: -------------------------------------------------------------------------------- 1 | // allow production of Shielding on Extra Planetary Launchpad - by Enceos 2 | 3 | EL_ResourceRecipe:NEEDS[FeatureShielding]:FOR[Kerbalism] 4 | { 5 | name = Shielding 6 | Resources { RocketParts = 400 } 7 | } 8 | 9 | @EL_ResourceRecipe[Shielding]:NEEDS[Kolonization,FeatureShielding]:FOR[Kerbalism] 10 | { 11 | -Resources {} 12 | Resources { MaterialKits = 800 } 13 | } -------------------------------------------------------------------------------- /GameData/Kerbalism/Support/ETT.cfg: -------------------------------------------------------------------------------- 1 | // ETT Compatability by autumnalequinox 2 | 3 | @ManufacturingQuality:NEEDS[ETT,FeatureReliability]:FOR[Kerbalism] 4 | { 5 | @tech0 = engineering101 6 | @tech1 = experimentalScience 7 | @tech2 = scienceTech 8 | @tech3 = advScienceTech 9 | } 10 | 11 | @SignalProcessing:NEEDS[ETT,FeatureReliability]:FOR[Kerbalism] 12 | { 13 | @tech0 = electronics 14 | @tech1 = mechatronics 15 | @tech2 = automation 16 | } -------------------------------------------------------------------------------- /GameData/Kerbalism/Support/CLS.cfg: -------------------------------------------------------------------------------- 1 | @PART[Greenhouse]:HAS[!MODULE[ModuleConnectedLivingSpace]]:NEEDS[ConnectedLivingSpace]:FOR[Kerbalism] 2 | { 3 | MODULE 4 | { 5 | name = ModuleConnectedLivingSpace 6 | passable = true 7 | } 8 | } 9 | 10 | 11 | @PART[GravityRing]:HAS[!MODULE[ModuleConnectedLivingSpace]]:NEEDS[ConnectedLivingSpace]:FOR[Kerbalism] 12 | { 13 | MODULE 14 | { 15 | name = ModuleConnectedLivingSpace 16 | passable = true 17 | } 18 | } -------------------------------------------------------------------------------- /GameData/Kerbalism/Support/SCANsat.cfg: -------------------------------------------------------------------------------- 1 | // ============================================================================ 2 | // Add PlannerController to SCANsat scanners 3 | // ============================================================================ 4 | 5 | @PART[*]:HAS[@MODULE[SCANsat]]:FOR[Kerbalism] 6 | { 7 | MODULE 8 | { 9 | name = PlannerController 10 | } 11 | } 12 | 13 | @PART[*]:HAS[@MODULE[ModuleSCANresourceScanner]]:FOR[Kerbalism] 14 | { 15 | MODULE 16 | { 17 | name = PlannerController 18 | } 19 | } -------------------------------------------------------------------------------- /GameData/Kerbalism/Support/HGR.cfg: -------------------------------------------------------------------------------- 1 | 2 | @PART[HGRSolarPanels1]:NEEDS[HGR,FeatureSignal]:FOR[Kerbalism] 3 | { 4 | MODULE 5 | { 6 | name = Antenna 7 | type = low_gain 8 | cost = 0.12 9 | dist = 2e8 10 | rate = 0.008 11 | } 12 | 13 | MODULE:NEEDS[FeatureReliability] 14 | { 15 | name = Reliability 16 | type = Antenna 17 | title = Antenna 18 | redundancy = Communication 19 | repair = Engineer 20 | mtbf = 72576000 // 8y 21 | extra_cost = 2.0 22 | extra_mass = 0.25 23 | } 24 | } -------------------------------------------------------------------------------- /GameData/Kerbalism/Support/Kopernicus.cfg: -------------------------------------------------------------------------------- 1 | // Why we are disabling the Kopernicus custom module implementing their multi-star fix: 2 | // - we can't leverage it for background simulation 3 | // - warp fixer de-facto replace their computations anyway 4 | // - a lot of our code assume a single star, multiple stars support is planned for a future release 5 | // - lack of time to further investigate the interactions 6 | 7 | @PART:HAS[@MODULE[ModuleDeployableSolarPanel]]:NEEDS[Kopernicus]:FOR[Kerbalism] 8 | { 9 | @MODULE[ModuleDeployableSolarPanel] 10 | { 11 | %useKopernicusSolarPanels = false 12 | } 13 | } -------------------------------------------------------------------------------- /src/Database/SupplyData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | 6 | namespace KERBALISM { 7 | 8 | 9 | public class SupplyData 10 | { 11 | public SupplyData() 12 | { 13 | message = 0; 14 | } 15 | 16 | public SupplyData(ConfigNode node) 17 | { 18 | message = Lib.ConfigValue(node, "message", 0u); 19 | } 20 | 21 | public void save(ConfigNode node) 22 | { 23 | node.AddValue("message", message); 24 | } 25 | 26 | public uint message; // used to avoid sending messages multiple times 27 | } 28 | 29 | 30 | } // KERBALISM -------------------------------------------------------------------------------- /GameData/Kerbalism/Profiles/None.cfg: -------------------------------------------------------------------------------- 1 | // ============================================================================ 2 | // An empty profile 3 | // This make Kerbalism degenerate into a background resource simulator with a 4 | // simple EC consumption planner/monitor. Optional low-ec warning included. 5 | // ============================================================================ 6 | 7 | Profile 8 | { 9 | name = none 10 | 11 | Supply 12 | { 13 | resource = ElectricCharge 14 | low_threshold = 0.15 15 | low_message = $VESSEL batteries are almost empty@We are squeezing the last bit of juice 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /GameData/Kerbalism/Support/SoundingRockets.cfg: -------------------------------------------------------------------------------- 1 | // Support for RoverDude's Sounding Rockets from http://forum.kerbalspaceprogram.com/index.php?/topic/92434-12-sounding-rockets-start-small-dream-big-050/ 2 | // A short-range antenna built into the nosecone intended for use for controlling sounding rockets only. Not intended for science transmission. 3 | // Config originally by ValynEritai, released under the Unlicense for use in Kerbalism. 4 | 5 | @PART[SR_Nosecone_*]:NEEDS[FeatureSignal]:FOR[Kerbalism]:AFTER[USISoundingRockets] 6 | { 7 | MODULE 8 | { 9 | name = Antenna 10 | type = low_gain 11 | cost = 0.1 12 | dist = 2e6 13 | rate = 0.008 14 | } 15 | } -------------------------------------------------------------------------------- /misc/VisualStudio/buildscripts/UnityDebug/prepare-debug.bat: -------------------------------------------------------------------------------- 1 | rem Generate the MDB file needed by UnityVS and Monodevelop for debugging 2 | rem For information on how to setup your debugging environment. 3 | rem see https://github.com/ShotgunNinja/Kerbalism/tree/master/misc/VisualStudio/Readme.md 4 | 5 | @echo off 6 | 7 | rem get parameters that are passed by visual studio post build event 8 | SET TargetName=%1 9 | 10 | rem make sure the initial working directory is the one containing the current script 11 | SET scriptPath=%~dp0 12 | 13 | echo Generating Unity Monodevelop Debug file... 14 | echo %TargetName%.dll -^> %TargetName%.dll.mdb 15 | "%scriptPath%\pdb2mdb.exe" %TargetName%.dll 16 | -------------------------------------------------------------------------------- /src/Science/Sample.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace KERBALISM { 5 | 6 | 7 | public sealed class Sample 8 | { 9 | public Sample(double amount=0.0) 10 | { 11 | size = amount; 12 | analyze = false; 13 | } 14 | 15 | public Sample(ConfigNode node) 16 | { 17 | size = Lib.ConfigValue(node, "size", 0.0); 18 | analyze = Lib.ConfigValue(node, "analyze", false); 19 | } 20 | 21 | public void save(ConfigNode node) 22 | { 23 | node.AddValue("size", size); 24 | node.AddValue("analyze", analyze); 25 | } 26 | 27 | public double size; // data size in Mb 28 | public bool analyze; // analyze-in-lab flag 29 | } 30 | 31 | 32 | } // KERBALISM 33 | 34 | -------------------------------------------------------------------------------- /GameData/Kerbalism/Support/Tundra.cfg: -------------------------------------------------------------------------------- 1 | // ============================================================================ 2 | // Support the tundra antenna 3 | // ============================================================================ 4 | 5 | @PART[NH_Antenna]:NEEDS[FeatureSignal]:FOR[Kerbalism] 6 | { 7 | MODULE 8 | { 9 | name = Antenna 10 | type = high_gain 11 | cost = 0.33 12 | dist = 5e10 13 | rate = 0.064 14 | } 15 | 16 | MODULE:NEEDS[FeatureReliability] 17 | { 18 | name = Reliability 19 | type = Antenna 20 | title = Antenna 21 | redundancy = Communication 22 | repair = Engineer 23 | mtbf = 72576000 // 8y 24 | extra_cost = 2.0 25 | extra_mass = 0.25 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /GameData/Kerbalism/Support/SEP.cfg: -------------------------------------------------------------------------------- 1 | // ============================================================================ 2 | // Surface Experiment Package rebalance for Kerbalism 3 | // ============================================================================ 4 | 5 | // Tweak science values for experiments, 100% return rates 6 | @EXPERIMENT_DEFINITION[*]:HAS[#id[SEP_*]]:NEEDS[FeatureScience]:FOR[Kerbalism] 7 | { 8 | %baseValue = #$scienceCap$ 9 | } 10 | 11 | // Replace Central Station antenna with a small low-gain 12 | @PART[SEP_CentralStation]:NEEDS[FeatureSignal]:FOR[Kerbalism] 13 | { 14 | MODULE 15 | { 16 | name = Antenna 17 | type = low_gain 18 | cost = 0.01 19 | dist = 1e5 20 | rate = 0.002 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /GameData/Kerbalism/Support/DeepFreeze.cfg: -------------------------------------------------------------------------------- 1 | // Habitat surface/volume 2 | // by schrema 3 | 4 | @PART[CRY-0300RFreezer]:NEEDS[DeepFreeze,FeatureHabitat]:AFTER[Kerbalism] 5 | { 6 | @MODULE[Habitat] 7 | { 8 | volume = 1.57 9 | surface = 6.28 10 | } 11 | } 12 | @PART[CRY-0300Freezer]:NEEDS[DeepFreeze,FeatureHabitat]:AFTER[Kerbalism] 13 | { 14 | @MODULE[Habitat] 15 | { 16 | volume = 2.45 17 | surface = 7.85 18 | } 19 | } 20 | @PART[CRY-1300Freezer]:NEEDS[DeepFreeze,FeatureHabitat]:AFTER[Kerbalism] 21 | { 22 | @MODULE[Habitat] 23 | { 24 | volume = 9.81 25 | surface = 15.7 26 | } 27 | } 28 | @PART[CRY-2300Freezer]:NEEDS[DeepFreeze,FeatureHabitat]:AFTER[Kerbalism] 29 | { 30 | @MODULE[Habitat] 31 | { 32 | volume = 18.4 33 | surface = 29.45 34 | } 35 | } -------------------------------------------------------------------------------- /src/Automation/Device.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace KERBALISM { 5 | 6 | 7 | public abstract class Device 8 | { 9 | // return device name 10 | public abstract string name(); 11 | 12 | // return part id 13 | public abstract uint part(); 14 | 15 | // return short device status string 16 | public abstract string info(); 17 | 18 | // control the device using a value 19 | public abstract void ctrl(bool value); 20 | 21 | // toggle the device state 22 | public abstract void toggle(); 23 | 24 | // generate unique id for the module 25 | // - multiple same-type components in the same part will have the same id 26 | public uint id() { return part() + (uint)name().GetHashCode(); } 27 | } 28 | 29 | 30 | } // KERBALISM -------------------------------------------------------------------------------- /GameData/Kerbalism/Support/Buffalo.cfg: -------------------------------------------------------------------------------- 1 | // Habitat surface/volume 2 | // by schreme 3 | 4 | @PART[WBI_BuffaloCab]:NEEDS[WildBlueIndustries,FeatureHabitat]:AFTER[Kerbalism] 5 | { 6 | @MODULE[Habitat] 7 | { 8 | volume = 2.41 9 | surface = 6.03 10 | } 11 | } 12 | @PART[WBI_CrewCab,WBI_ShortPassengerCab]:NEEDS[WildBlueIndustries,FeatureHabitat]:AFTER[Kerbalism] 13 | { 14 | @MODULE[Habitat] 15 | { 16 | volume = 3.51 17 | surface = 8.79 18 | } 19 | } 20 | @PART[WBI_BuffaloAirlock]:NEEDS[WildBlueIndustries,FeatureHabitat]:AFTER[Kerbalism] 21 | { 22 | @MODULE[Habitat] 23 | { 24 | volume = 1.5 25 | surface = 3.76 26 | } 27 | } 28 | @PART[WBI_ShortPassengerCab]:NEEDS[WildBlueIndustries,FeatureHabitat]:AFTER[Kerbalism] 29 | { 30 | @MODULE[Habitat] 31 | { 32 | volume = 1.7 33 | surface = 4.27 34 | } 35 | } -------------------------------------------------------------------------------- /GameData/Kerbalism/Support/AtomicAge.cfg: -------------------------------------------------------------------------------- 1 | // ============================================================================ 2 | // Radiation emitters for Atomic Age nuclear engines 3 | // by ThePsion5 4 | // ============================================================================ 5 | 6 | @PART[NuclearJetEngine]:NEEDS[FeatureRadiation]:FOR[Kerbalism] 7 | { 8 | MODULE 9 | { 10 | name = Emitter 11 | radiation = 0.0000041666 // 0.012 rad/h 12 | } 13 | } 14 | 15 | @PART[nuclearEngineKANDL]:NEEDS[FeatureRadiation]:FOR[Kerbalism] 16 | { 17 | MODULE 18 | { 19 | name = Emitter 20 | radiation = 0.0000022222 // 0.008 rad/h 21 | } 22 | } 23 | 24 | @PART[nuclearEngineLightbulb]:NEEDS[FeatureRadiation]:FOR[Kerbalism] 25 | { 26 | MODULE 27 | { 28 | name = Emitter 29 | radiation = 0.0000083331 // 0.02 rad/h 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/Science/File.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace KERBALISM { 5 | 6 | 7 | public sealed class File 8 | { 9 | public File(double amount=0.0) 10 | { 11 | size = amount; 12 | buff = 0.0; 13 | send = false; 14 | } 15 | 16 | public File(ConfigNode node) 17 | { 18 | size = Lib.ConfigValue(node, "size", 0.0); 19 | buff = Lib.ConfigValue(node, "buff", 0.0); 20 | send = Lib.ConfigValue(node, "send", false); 21 | } 22 | 23 | public void save(ConfigNode node) 24 | { 25 | node.AddValue("size", size); 26 | node.AddValue("buff", buff); 27 | node.AddValue("send", send); 28 | } 29 | 30 | public double size; // data size in Mb 31 | public double buff; // data transmitted but not credited 32 | public bool send; // send-home flag 33 | } 34 | 35 | 36 | } // KERBALISM -------------------------------------------------------------------------------- /misc/VisualStudio/Kerbalism.csproj.user: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Program 5 | D:\KSP_Dev\KSP_x64.exe 6 | D:\KSP_Dev\ 7 | 8 | 9 | Program 10 | D:\KSP_Dev\KSP_x64_Dbg.exe 11 | D:\KSP_Dev\ 12 | false 13 | false 14 | 15 | 16 | D:\KSP_Dev\KSP_x64_Data\Managed\ 17 | 18 | -------------------------------------------------------------------------------- /GameData/Kerbalism/Support/KerbalAtomics.cfg: -------------------------------------------------------------------------------- 1 | // ============================================================================ 2 | // Kerbal Atomics emitters 3 | // by TheSaint 4 | // ============================================================================ 5 | 6 | @PART[ntr-gc-25-1]:NEEDS[FeatureRadiation]:FOR[Kerbalism] 7 | { 8 | MODULE 9 | { 10 | name = Emitter 11 | radiation = 0.0000083333 // 0.02 rad/h 12 | } 13 | } 14 | 15 | @PART[ntr-sc-25-1]:NEEDS[FeatureRadiation]:FOR[Kerbalism] 16 | { 17 | MODULE 18 | { 19 | name = Emitter 20 | radiation = 0.0000055555 // 0.015 rad/h 21 | } 22 | } 23 | 24 | @PART[ntr-sc-125-1]:NEEDS[FeatureRadiation]:FOR[Kerbalism] 25 | { 26 | MODULE 27 | { 28 | name = Emitter 29 | radiation = 0.0000027777 // 0.01 rad/h 30 | } 31 | } 32 | 33 | @PART[ntr-sc-125-2]:NEEDS[FeatureRadiation]:FOR[Kerbalism] 34 | { 35 | MODULE 36 | { 37 | name = Emitter 38 | radiation = 0.0000027777 // 0.01 rad/h 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /GameData/Kerbalism/Parts/RadialContainer/RadialContainer.cfg: -------------------------------------------------------------------------------- 1 | PART 2 | { 3 | name = kerbalism-container-radial-medium 4 | module = Part 5 | author = Tygoo7 6 | 7 | title = Pressurized Tank 8 | manufacturer = Tygoo Transport Solutions 9 | description = A pressurized tank that can be attached radially. 10 | category = none 11 | subcategory = 0 12 | 13 | MODEL 14 | { 15 | model = Kerbalism/Parts/_/oxygen 16 | scale = 5, 5, 5 17 | rotation = 0, 180, 0 18 | } 19 | rescaleFactor = 1 20 | 21 | node_attach = 0.0, 0.0, 0, 0.0, 0.0, -1.0 22 | attachRules = 0,1,0,1,0 23 | 24 | bulkheadProfiles = srf 25 | dragModelType = default 26 | maximum_drag = 0.2 27 | minimum_drag = 0.2 28 | angularDrag = 2 29 | crashTolerance = 6 30 | breakingForce = 50 31 | breakingTorque = 50 32 | maxTemp = 1600 33 | 34 | TechRequired = spaceExploration 35 | entryCost = 2000 36 | cost = 500 37 | mass = 0.025 38 | ContainerVolume = 66.47 39 | } -------------------------------------------------------------------------------- /src/Database/UIData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace KERBALISM { 5 | 6 | 7 | public class UIData 8 | { 9 | public UIData() 10 | { 11 | win_left = 280u; 12 | win_top = 100u; 13 | map_viewed = false; 14 | } 15 | 16 | public UIData(ConfigNode node) 17 | { 18 | win_left = Lib.ConfigValue(node, "win_left", 280u); 19 | win_top = Lib.ConfigValue(node, "win_top", 100u); 20 | map_viewed = Lib.ConfigValue(node, "map_viewed", false); 21 | } 22 | 23 | public void save(ConfigNode node) 24 | { 25 | node.AddValue("win_left", win_left); 26 | node.AddValue("win_top", win_top); 27 | node.AddValue("map_viewed", map_viewed); 28 | } 29 | 30 | public uint win_left; // popout window position left 31 | public uint win_top; // popout window position top 32 | public bool map_viewed; // has the user entered map-view/tracking-station 33 | } 34 | 35 | 36 | } // KERBALISM -------------------------------------------------------------------------------- /GameData/Kerbalism/Parts/RadialContainer/BigRadialContainer.cfg: -------------------------------------------------------------------------------- 1 | PART 2 | { 3 | name = kerbalism-container-radial-big 4 | module = Part 5 | author = Tygoo7 6 | 7 | title = Big Pressurized Tank 8 | manufacturer = Tygoo Transport Solutions 9 | description = A big pressurized tank that can be attached radially. 10 | category = none 11 | subcategory = 0 12 | 13 | MODEL 14 | { 15 | model = Kerbalism/Parts/_/oxygen 16 | scale = 5, 5, 5 17 | rotation = 0, 180, 0 18 | } 19 | rescaleFactor = 2 20 | 21 | node_attach = 0.0, 0.0, 0, 0.0, 0.0, -1.0 22 | attachRules = 0,1,0,1,0 23 | 24 | bulkheadProfiles = srf 25 | dragModelType = default 26 | maximum_drag = 0.2 27 | minimum_drag = 0.2 28 | angularDrag = 2 29 | crashTolerance = 6 30 | breakingForce = 50 31 | breakingTorque = 50 32 | maxTemp = 1600 33 | 34 | TechRequired = advExploration 35 | entryCost = 4000 36 | cost = 1000 37 | mass = 0.125 38 | ContainerVolume = 531.77 39 | } 40 | -------------------------------------------------------------------------------- /GameData/Kerbalism/Parts/RadialContainer/SmallRadialContainer.cfg: -------------------------------------------------------------------------------- 1 | PART 2 | { 3 | name = kerbalism-container-radial-small 4 | module = Part 5 | author = Tygoo7 6 | 7 | title = Small Pressurized Tank 8 | manufacturer = Tygoo Transport Solutions 9 | description = A small pressurized tank that can be attached radially. 10 | category = none 11 | subcategory = 0 12 | 13 | MODEL 14 | { 15 | model = Kerbalism/Parts/_/oxygen 16 | scale = 5, 5, 5 17 | rotation = 0, 180, 0 18 | } 19 | rescaleFactor = 0.6 20 | 21 | node_attach = 0.0, 0.0, 0, 0.0, 0.0, -1.0 22 | attachRules = 0,1,0,1,0 23 | 24 | bulkheadProfiles = srf 25 | dragModelType = default 26 | maximum_drag = 0.2 27 | minimum_drag = 0.2 28 | angularDrag = 2 29 | crashTolerance = 6 30 | breakingForce = 50 31 | breakingTorque = 50 32 | maxTemp = 1600 33 | 34 | TechRequired = survivability 35 | entryCost = 1000 36 | cost = 250 37 | mass = 0.005 38 | ContainerVolume = 14.36 39 | } -------------------------------------------------------------------------------- /GameData/Kerbalism/Parts/ShortAntenna/shortAntenna.cfg: -------------------------------------------------------------------------------- 1 | PART 2 | { 3 | name = kerbalism-antenna 4 | module = Part 5 | author = NovaSilisko 6 | 7 | title = Communotron 8 8 | manufacturer = Ionic Symphonic Protonic Electronics 9 | description = Designed long ago by a young and inspired Wernher von Kerman, before his focus shifted to the development of weapons of mass destruction. 10 | category = none 11 | subcategory = 0 12 | 13 | mesh = model.mu 14 | scale = 1 15 | rescaleFactor = 0.666 16 | 17 | node_stack_bottom = 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 0 18 | node_attach = 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 0 19 | attachRules = 1,1,0,0,1 20 | 21 | bulkheadProfiles = size0, srf 22 | dragModelType = default 23 | maximum_drag = 0.2 24 | minimum_drag = 0.2 25 | angularDrag = 2 26 | crashTolerance = 7 27 | maxTemp = 2000 28 | PhysicsSignificance = 1 29 | 30 | TechRequired = start 31 | entryCost = 600 32 | cost = 150 33 | mass = 0.005 34 | } 35 | 36 | -------------------------------------------------------------------------------- /GameData/Kerbalism/Parts/InlineContainer0625/InlineContainer0625.cfg: -------------------------------------------------------------------------------- 1 | PART 2 | { 3 | name = kerbalism-container-inline-0625 4 | module = Part 5 | author = Nazari1382 6 | 7 | title = Small Supply Container 8 | manufacturer = Nazari Storage Services 9 | description = A valid alternative to starving. 10 | category = none 11 | subcategory = 0 12 | 13 | mesh = kismfoodsm.mu 14 | rescaleFactor = 1 15 | 16 | node_stack_top = 0.0, 0.105, 0.0, 0.0, 1.0, 0.0, 0 17 | node_stack_bottom = 0.0, -0.105, 0.0, 0.0, -1.0, 0.0, 0 18 | node_attach = 0.25, 0.0, 0.0, 1.0, 0.0, 0.0 19 | attachRules = 1,0,1,1,0 20 | 21 | bulkheadProfiles = size0, srf 22 | dragModelType = default 23 | maximum_drag = 0.2 24 | minimum_drag = 0.15 25 | angularDrag = 2 26 | crashTolerance = 6 27 | maxTemp = 1600 28 | breakingForce = 50 29 | breakingTorque = 50 30 | 31 | TechRequired = survivability 32 | entryCost = 500 33 | cost = 125 34 | mass = 0.02 35 | ContainerVolume = 51 36 | } 37 | -------------------------------------------------------------------------------- /src/Database/RuleData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | 6 | namespace KERBALISM { 7 | 8 | 9 | public class RuleData 10 | { 11 | public RuleData() 12 | { 13 | problem = 0.0; 14 | message = 0; 15 | time_since = 0.0; 16 | } 17 | 18 | public RuleData(ConfigNode node) 19 | { 20 | problem = Lib.ConfigValue(node, "problem", 0.0); 21 | message = Lib.ConfigValue(node, "message", 0u); 22 | time_since = Lib.ConfigValue(node, "time_since", 0.0); 23 | } 24 | 25 | public void save(ConfigNode node) 26 | { 27 | node.AddValue("problem", problem); 28 | node.AddValue("message", message); 29 | node.AddValue("time_since", time_since); 30 | } 31 | 32 | public double problem; // accumulator for the rule 33 | public uint message; // used to avoid sending messages multiple times 34 | public double time_since; // time since last execution, if interval > 0 35 | } 36 | 37 | 38 | } // KERBALISM 39 | 40 | -------------------------------------------------------------------------------- /GameData/Kerbalism/Parts/Greenhouse/Greenhouse.cfg: -------------------------------------------------------------------------------- 1 | // author: zzz 2 | // license: public domain 3 | 4 | PART 5 | { 6 | name = kerbalism-greenhouse 7 | module = Part 8 | author = Yemo, zzz 9 | 10 | title = Greenhouse 11 | manufacturer = TripleZeta Workshops 12 | description = Grow crops in the deeps of space or on the surface of some desolate rock. 13 | category = none 14 | subcategory = 0 15 | 16 | mesh = model.mu 17 | rescaleFactor = 1.25 18 | 19 | node_stack_top = 0.0, 1.61, 0.0, 0.0, 1.0, 0.0, 2 20 | node_stack_bottom = 0.0, -1.61, 0.0, 0.0, -1.0, 0.0, 2 21 | node_attach = 1.25, 0.0, 0.0, 1.0, 0.0, 0.0, 1 22 | attachRules = 1,0,1,1,0 23 | 24 | bulkheadProfiles = size2, srf 25 | dragModelType = default 26 | maximum_drag = 0.2 27 | minimum_drag = 0.2 28 | angularDrag = 2 29 | crashTolerance = 6 30 | breakingForce = 50 31 | breakingTorque = 50 32 | maxTemp = 1200 33 | 34 | TechRequired = advExploration 35 | entryCost = 24000 36 | cost = 6000 37 | mass = 2.5 38 | } -------------------------------------------------------------------------------- /src/Utility/DumpSpec.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | 5 | namespace KERBALISM { 6 | 7 | 8 | public sealed class DumpSpecs 9 | { 10 | public DumpSpecs(string value) 11 | { 12 | // if empty or false: don't dump anything 13 | if (value.Length == 0 || value.ToLower() == "false") 14 | { 15 | any = false; 16 | list = new List(); 17 | } 18 | // if true: dump everything 19 | else if (value.ToLower() == "true") 20 | { 21 | any = true; 22 | list = new List(); 23 | } 24 | // all other cases: dump only specified resources 25 | else 26 | { 27 | any = false; 28 | list = Lib.Tokenize(value, ','); 29 | } 30 | } 31 | 32 | // return true if the resource should dump 33 | public bool check(string res_name) 34 | { 35 | return any || list.Contains(res_name); 36 | } 37 | 38 | bool any; 39 | List list; 40 | } 41 | 42 | 43 | } // KERBALISM 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /GameData/Kerbalism/Parts/ChemicalPlant/ChemicalPlant.cfg: -------------------------------------------------------------------------------- 1 | PART 2 | { 3 | name = kerbalism-chemicalplant 4 | module = Part 5 | author = RoverDude 6 | 7 | title = Chemical Plant 8 | manufacturer = Rookies Inc. 9 | description = A versatile chemical plant that can fit in the small service bay. Any similarities with the Convert-O-Tron is purely coincidental. 10 | category = none 11 | subcategory = 0 12 | 13 | MODEL 14 | { 15 | model = Kerbalism/Parts/ChemicalPlant/ChemicalPlant 16 | scale = 1.25,1.25,1.25 17 | } 18 | rescaleFactor = 0.28 19 | 20 | node_stack_top = 0.0, .9, 0.0, 0.0, 1.0, 0.0, 1 21 | node_stack_bottom = 0.0, -.9, 0.0, 0.0, -1.0, 0.0, 1 22 | attachRules = 1,0,1,1,0 23 | 24 | bulkheadProfiles = size1 25 | dragModelType = default 26 | maximum_drag = 0.2 27 | minimum_drag = 0.2 28 | angularDrag = 2 29 | crashTolerance = 7 30 | breakingForce = 50 31 | breakingTorque = 50 32 | maxTemp = 2000 33 | 34 | TechRequired = spaceExploration 35 | entryCost = 8000 36 | cost = 2000 37 | mass = 0.2 38 | } 39 | -------------------------------------------------------------------------------- /GameData/Kerbalism/Parts/GravityRing/GravityRing.cfg: -------------------------------------------------------------------------------- 1 | PART 2 | { 3 | name = kerbalism-gravityring 4 | module = Part 5 | author = Mehka 6 | 7 | title = Gravity Ring 8 | manufacturer = Mehka Awesome Productions 9 | description = Artificial gravity can delay the inevitable consequences of zero-g on the body. If you don't mind the Coriolis. 10 | category = none 11 | subcategory = 0 12 | 13 | mesh = NewModel.mu 14 | rescaleFactor = 1.0 15 | 16 | attachRules = 1,0,1,0,0 17 | node_stack_bottom = 0.0, -0.2, 0.0, 0.0, -1.0, 0.0, 2 18 | node_stack_top = 0.0, 2.5, 0.0, 0.0, 1.0, 0.0, 1 19 | 20 | bulkheadProfiles = size2, size1 21 | dragModelType = default 22 | maximum_drag = 0.20 23 | minimum_drag = 0.20 24 | angularDrag = 4 25 | crashTolerance = 8 26 | maxTemp = 1000 27 | skinMaxTemp = 2000 28 | 29 | TechRequired = advExploration 30 | entryCost = 32000 31 | cost = 8000 32 | mass = 2.5 33 | 34 | MODULE 35 | { 36 | name = GravityRing 37 | ec_rate = 2.5 38 | deploy = open 39 | rotate = rotate 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /misc/VisualStudio/Kerbalism.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Kerbalism", "Kerbalism.csproj", "{7CF587A9-6E49-46E8-AB3F-87B80A6276DA}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {7CF587A9-6E49-46E8-AB3F-87B80A6276DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {7CF587A9-6E49-46E8-AB3F-87B80A6276DA}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {7CF587A9-6E49-46E8-AB3F-87B80A6276DA}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {7CF587A9-6E49-46E8-AB3F-87B80A6276DA}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /GameData/Kerbalism/Support/CxAerospace.cfg: -------------------------------------------------------------------------------- 1 | // Habitat volume/surface 2 | // by schrema 3 | 4 | @PART[CXA_ELM_MiniLab]:NEEDS[CxAerospace,FeatureHabitat]:AFTER[Kerbalism] 5 | { 6 | @MODULE[Habitat] 7 | { 8 | volume = 9.8 9 | surface = 23.5 10 | } 11 | } 12 | @PART[CXA_Quest_Airlock]:NEEDS[CxAerospace,FeatureHabitat]:AFTER[Kerbalism] 13 | { 14 | @MODULE[Habitat] 15 | { 16 | volume = 9.8 17 | surface = 28.8 18 | } 19 | } 20 | @PART[CXA_Node1]:NEEDS[CxAerospace,FeatureHabitat]:AFTER[Kerbalism] 21 | { 22 | @MODULE[Habitat] 23 | { 24 | volume = 12.2 25 | surface = 26.4 26 | } 27 | } 28 | @PART[CXA_Kibo_Lab]:NEEDS[CxAerospace,FeatureHabitat]:AFTER[Kerbalism] 29 | { 30 | @MODULE[Habitat] 31 | { 32 | volume = 26.9 33 | surface = 50 34 | } 35 | } 36 | @PART[CXA_SleepHabV6,CXA_SleepHabV6-2]:NEEDS[CxAerospace,FeatureHabitat]:AFTER[Kerbalism] 37 | { 38 | @MODULE[Habitat] 39 | { 40 | volume = 24.5 41 | surface = 46 42 | } 43 | } 44 | @PART[CXA_GymHab,CXA_SleepHabV4-1,CXA_SleepHabV4-2]:NEEDS[CxAerospace,FeatureHabitat]:AFTER[Kerbalism] 45 | { 46 | @MODULE[Habitat] 47 | { 48 | volume = 19.6 49 | surface = 38.2 50 | } 51 | } -------------------------------------------------------------------------------- /GameData/Kerbalism/Parts/InlineContainer125/InlineContainer125.cfg: -------------------------------------------------------------------------------- 1 | PART 2 | { 3 | name = kerbalism-container-inline-125 4 | module = Part 5 | author = Tygoo7 6 | 7 | title = Supply Container 8 | manufacturer = Tygoo Transport Solutions 9 | description = One of the guys at JPL had a simple and brilliant idea: bigger containers to store more supplies. After a couple thousands man-months and 300M in fundings, the prototype was ready for early testing. 10 | category = none 11 | subcategory = 0 12 | 13 | MODEL 14 | { 15 | model = Kerbalism/Parts/_/125food 16 | scale = 5, 5, 5 17 | } 18 | rescaleFactor = 1 19 | 20 | node_stack_top = 0.0, 0.2166, 0.0, 0.0, 1.0, 0.0, 1 21 | node_stack_bottom = 0.0, -0.2166, 0.0, 0.0, -1.0, 0.0, 1 22 | attachRules = 1,0,1,1,0 23 | 24 | bulkheadProfiles = size1, srf 25 | dragModelType = default 26 | maximum_drag = 0.2 27 | minimum_drag = 0.2 28 | angularDrag = 2 29 | crashTolerance = 6 30 | breakingForce = 50 31 | breakingTorque = 50 32 | maxTemp = 1600 33 | 34 | TechRequired = spaceExploration 35 | entryCost = 2000 36 | cost = 500 37 | mass = 0.1 38 | ContainerVolume = 620 39 | } 40 | -------------------------------------------------------------------------------- /GameData/Kerbalism/Shaders/mini_particle.shader: -------------------------------------------------------------------------------- 1 | // render a 1 pixel point sprite 2 | // - POINT_COLOR: point color 3 | 4 | 5 | Shader "Custom/MiniParticle" 6 | { 7 | Properties 8 | { 9 | POINT_COLOR ("Point color", Color) = (1.0,1.0,1.0,1.0) 10 | } 11 | SubShader 12 | { 13 | Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } 14 | Blend SrcAlpha One 15 | ColorMask RGB 16 | Cull Off Lighting Off ZWrite Off 17 | 18 | Pass 19 | { 20 | CGPROGRAM 21 | #pragma vertex vert 22 | #pragma fragment frag 23 | #pragma target 2.0 24 | 25 | fixed4 POINT_COLOR; 26 | 27 | struct v2f 28 | { 29 | float size : PSIZE; 30 | float4 pos : SV_POSITION; 31 | }; 32 | 33 | v2f vert(float4 in_pos : POSITION) 34 | { 35 | // output clip-space vertex position 36 | v2f o; 37 | o.pos = mul(UNITY_MATRIX_MVP, in_pos); 38 | 39 | // pass down point size 40 | o.size = 1.0; 41 | return o; 42 | } 43 | 44 | half4 frag(v2f i) : COLOR 45 | { 46 | return POINT_COLOR; 47 | } 48 | ENDCG 49 | } 50 | } 51 | } -------------------------------------------------------------------------------- /GameData/Kerbalism/Support/JX2Antenna.cfg: -------------------------------------------------------------------------------- 1 | // Support for JX2 Antenna from https://github.com/KSPSnark/JX2Antenna 2 | 3 | // A long-range, very reliable antenna that can provide DSN link even 4 | // when using Outer Planets Mod 5 | 6 | @PART[jx2LDA]:NEEDS[FeatureSignal]:FOR[Kerbalism]:AFTER[JX2Antenna] 7 | { 8 | MODULE 9 | { 10 | name = Antenna 11 | type = high_gain 12 | cost = 1.98 13 | dist = 1.0e12 14 | rate = 0.256 15 | } 16 | 17 | MODULE:NEEDS[FeatureReliability] 18 | { 19 | name = Reliability 20 | type = Antenna 21 | title = Antenna 22 | redundancy = Communication 23 | repair = Engineer 24 | mtbf = 108864000 // 12y 25 | extra_cost = 3.0 26 | extra_mass = 0.5 27 | } 28 | 29 | MODULE 30 | { 31 | name = ModuleAnimationGroup 32 | deployAnimationName = deployHexes 33 | moduleType = Antenna 34 | } 35 | 36 | !MODULE[ModuleAnimateGeneric]:HAS[#animationName[deployHexes]] {} 37 | 38 | @description = An enormous High-Gain antenna, powerful enough to maintain contact with DSN even from the farthest outskirts of the system. It has been built from the highest quality components available, thus ensuring a long and reliable service. 39 | } 40 | -------------------------------------------------------------------------------- /GameData/Kerbalism/Support/RLAStockalikeContinued.cfg: -------------------------------------------------------------------------------- 1 | // Patches for RLA Stockalike Continued 2 | 3 | @PART[RLA_mp_small_fuelcell]:NEEDS[RLA_Stockalike]:FOR[Kerbalism] 4 | { 5 | !MODULE[ModuleResourceConverter] {} 6 | !RESOURCE[ElectricCharge] {} 7 | 8 | MODULE 9 | { 10 | name = ProcessController 11 | resource = _MonopropFuelCell 12 | title = Monoprop Fuel Cell 13 | capacity = 2 14 | } 15 | 16 | MODULE:NEEDS[FeatureReliability] 17 | { 18 | name = Reliability 19 | type = ProcessController 20 | title = Monoprop Fuel Cell 21 | redundancy = Power Generation 22 | repair = Engineer 23 | mtbf = 72576000 // 8y 24 | extra_cost = 1.0 25 | extra_mass = 0.5 26 | } 27 | } 28 | 29 | @PART[RLA_mmrtg]:NEEDS[RLA_Stockalike]:FOR[Kerbalism] 30 | { 31 | MODULE:NEEDS[FeatureRadiation] 32 | { 33 | name = Emitter 34 | radiation = 0.00000009258 // 0.00003 rad/h, shows as nominal 35 | } 36 | 37 | MODULE:NEEDS[ProfileDefault|ProfileClassic] 38 | { 39 | name = ProcessController 40 | resource = _RTG 41 | title = RTG 42 | capacity = 0.122 43 | running = true 44 | toggle = false 45 | } 46 | 47 | !MODULE[ModuleGenerator]:NEEDS[ProfileDefault|ProfileClassic] {} 48 | } -------------------------------------------------------------------------------- /src/Database/BodyData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | 6 | namespace KERBALISM { 7 | 8 | 9 | public class BodyData 10 | { 11 | public BodyData() 12 | { 13 | storm_time = 0.0; 14 | storm_age = 0.0; 15 | storm_state = 0; 16 | msg_storm = 0; 17 | } 18 | 19 | public BodyData(ConfigNode node) 20 | { 21 | storm_time = Lib.ConfigValue(node, "storm_time", 0.0); 22 | storm_age = Lib.ConfigValue(node, "storm_age", 0.0); 23 | storm_state = Lib.ConfigValue(node, "storm_state", 0u); 24 | msg_storm = Lib.ConfigValue(node, "msg_storm", 0u); 25 | } 26 | 27 | public void save(ConfigNode node) 28 | { 29 | node.AddValue("storm_time", storm_time); 30 | node.AddValue("storm_age", storm_age); 31 | node.AddValue("storm_state", storm_state); 32 | node.AddValue("msg_storm", msg_storm); 33 | } 34 | 35 | public double storm_time; // time of next storm 36 | public double storm_age; // time since last storm 37 | public uint storm_state; // 0: none, 1: inbound, 2: inprogress 38 | public uint msg_storm; // message flag 39 | } 40 | 41 | 42 | } // KERBALISM 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /src/External/RemoteTech.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace KERBALISM { 5 | 6 | 7 | public static class RemoteTech 8 | { 9 | static RemoteTech() 10 | { 11 | foreach(var a in AssemblyLoader.loadedAssemblies) 12 | { 13 | if (a.name == "RemoteTech") 14 | { 15 | API = a.assembly.GetType("RemoteTech.API.API"); 16 | IsEnabled = API.GetMethod("IsRemoteTechEnabled"); 17 | IsConnected = API.GetMethod("HasAnyConnection"); 18 | break; 19 | } 20 | } 21 | } 22 | 23 | // return true if RemoteTech is enabled for the current game 24 | public static bool Enabled() 25 | { 26 | return API != null && (bool)IsEnabled.Invoke(null, new Object[]{}); 27 | } 28 | 29 | // return true if the vessel is connected according to RemoteTech 30 | public static bool Connected(Guid id) 31 | { 32 | return API != null && (bool)IsConnected.Invoke(null, new Object[]{id}); 33 | } 34 | 35 | // reflection type of SCANUtils static class in SCANsat assembly, if present 36 | static Type API; 37 | static System.Reflection.MethodInfo IsEnabled; 38 | static System.Reflection.MethodInfo IsConnected; 39 | } 40 | 41 | 42 | } // KERBALISM 43 | 44 | -------------------------------------------------------------------------------- /src/Modules/PlannerController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | 6 | namespace KERBALISM { 7 | 8 | 9 | public sealed class PlannerController : PartModule 10 | { 11 | // config 12 | [KSPField] public bool toggle = true; // true to show the toggle button in editor 13 | 14 | // persistence 15 | [KSPField(isPersistant = true)] public bool considered; // true to consider the part modules in planner 16 | 17 | 18 | public override void OnStart(StartState state) 19 | { 20 | // don't break tutorial scenarios 21 | if (Lib.DisableScenario(this)) return; 22 | 23 | if (Lib.IsEditor()) 24 | { 25 | Events["Toggle"].active = toggle; 26 | } 27 | } 28 | 29 | void Update() 30 | { 31 | Events["Toggle"].guiName = Lib.StatusToggle 32 | ( 33 | "Simulate in planner", 34 | considered ? "yes" : "no" 35 | ); 36 | } 37 | 38 | [KSPEvent(guiActive = false, guiActiveEditor = true, guiName = "_", active = true)] 39 | public void Toggle() 40 | { 41 | considered = !considered; 42 | } 43 | } 44 | 45 | 46 | } // KERBALISM 47 | 48 | -------------------------------------------------------------------------------- /misc/VisualStudio/buildscripts/ZipPack/7za-License.txt: -------------------------------------------------------------------------------- 1 | 7-Zip Extra 2 | ~~~~~~~~~~~ 3 | License for use and distribution 4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5 | 6 | Copyright (C) 1999-2016 Igor Pavlov. 7 | 8 | 7-Zip Extra files are under the GNU LGPL license. 9 | 10 | 11 | Notes: 12 | You can use 7-Zip Extra on any computer, including a computer in a commercial 13 | organization. You don't need to register or pay for 7-Zip. 14 | 15 | 16 | GNU LGPL information 17 | -------------------- 18 | 19 | This library is free software; you can redistribute it and/or 20 | modify it under the terms of the GNU Lesser General Public 21 | License as published by the Free Software Foundation; either 22 | version 2.1 of the License, or (at your option) any later version. 23 | 24 | This library is distributed in the hope that it will be useful, 25 | but WITHOUT ANY WARRANTY; without even the implied warranty of 26 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 27 | Lesser General Public License for more details. 28 | 29 | You can receive a copy of the GNU Lesser General Public License from 30 | http://www.gnu.org/ 31 | 32 | -------------------------------------------------------------------------------- /src/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | #region Using directives 2 | using System; 3 | using System.Reflection; 4 | using System.Runtime.InteropServices; 5 | 6 | #endregion 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle ("Kerbalism")] 11 | [assembly: AssemblyDescription ("Hundreds of Kerbals were killed in the making of this mod.")] 12 | [assembly: AssemblyConfiguration ("")] 13 | [assembly: AssemblyCompany ("")] 14 | [assembly: AssemblyProduct ("Kerbalism")] 15 | [assembly: AssemblyCopyright ("")] 16 | [assembly: AssemblyTrademark ("")] 17 | [assembly: AssemblyCulture ("")] 18 | // This sets the default COM visibility of types in the assembly to invisible. 19 | // If you need to expose a type to COM, use [ComVisible(true)] on that type. 20 | [assembly: ComVisible (false)] 21 | // The assembly version has following format : 22 | // 23 | // Major.Minor.Build.Revision 24 | // 25 | // You can specify all the values or you can use the default the Revision and 26 | // Build Numbers by using the '*' as shown below: 27 | [assembly: AssemblyVersion ("1.2.9.0")] 28 | [assembly: AssemblyFileVersion ("1.2.9.0")] 29 | -------------------------------------------------------------------------------- /src/UI/TimedOut.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | 6 | namespace KERBALISM { 7 | 8 | 9 | public static class TimedOut 10 | { 11 | public static bool timeout(this Panel p, vessel_info vi) 12 | { 13 | if (!vi.connection.linked && vi.crew_count == 0) 14 | { 15 | p.header(msg[((int)Time.realtimeSinceStartup) % msg.Length]); 16 | return true; 17 | } 18 | return false; 19 | } 20 | 21 | static string[] msg = 22 | { 23 | "Connection in progress", 24 | "Connection in progress.", 25 | "Connection in progress..", 26 | "Connection in progress...", 27 | "Connection in progress....", 28 | "Connection in progress.....", 29 | "Connection timed-out", 30 | "Connection timed-out", 31 | "Connection timed-out", 32 | "Connection timed-out", 33 | "Connection timed-out", 34 | "New tentative in 3s", 35 | "New tentative in 2s", 36 | "New tentative in 1s" 37 | }; 38 | } 39 | 40 | 41 | } // KERBALISM 42 | 43 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to -------------------------------------------------------------------------------- /GameData/Kerbalism/Support/B9.cfg: -------------------------------------------------------------------------------- 1 | // Habitat surface/volume 2 | // by schrema 3 | 4 | @PART[HL_Aero_Cockpit]:NEEDS[B9_Aerospace,FeatureHabitat]:AFTER[Kerbalism] 5 | { 6 | @MODULE[Habitat] 7 | { 8 | volume = 18.4 9 | surface = 31.45 10 | } 11 | } 12 | @PART[B9_Cockpit_S2]:NEEDS[B9_Aerospace,FeatureHabitat]:AFTER[Kerbalism] 13 | { 14 | @MODULE[Habitat] 15 | { 16 | volume = 5.72 17 | surface = 14.59 18 | } 19 | } 20 | @PART[B9_Body_Mk2_Cockpit_Intake,B9_Body_Mk2_Cockpit]:NEEDS[B9_Aerospace,FeatureHabitat]:AFTER[Kerbalism] 21 | { 22 | @MODULE[Habitat] 23 | { 24 | volume = 3.27 25 | surface = 9.26 26 | } 27 | } 28 | @PART[B9_Cockpit_M27]:NEEDS[B9_Aerospace,FeatureHabitat]:AFTER[Kerbalism] 29 | { 30 | @MODULE[Habitat] 31 | { 32 | volume = 1.17 33 | surface = 5.03 34 | } 35 | } 36 | @PART[B9_Cockpit_MK5]:NEEDS[B9_Aerospace,FeatureHabitat]:AFTER[Kerbalism] 37 | { 38 | @MODULE[Habitat] 39 | { 40 | volume = 4.09 41 | surface = 10.97 42 | } 43 | } 44 | @PART[B9_Cockpit_S2_Body_Crew]:NEEDS[B9_Aerospace,FeatureHabitat]:AFTER[Kerbalism] 45 | { 46 | @MODULE[Habitat] 47 | { 48 | volume = 9.81 49 | surface = 15.7 50 | } 51 | } 52 | @PART[B9_Cockpit_S2_Body_Crew_6m]:NEEDS[B9_Aerospace,FeatureHabitat]:AFTER[Kerbalism] 53 | { 54 | @MODULE[Habitat] 55 | { 56 | volume = 29.45 57 | surface = 47.12 58 | } 59 | } -------------------------------------------------------------------------------- /GameData/Kerbalism/Support/NearFuture.cfg: -------------------------------------------------------------------------------- 1 | // Habitat surface/volume 2 | // by schrema 3 | 4 | @PART[inlineCmdPod]:NEEDS[NearFutureSpacecraft,FeatureHabitat]:AFTER[Kerbalism] 5 | { 6 | @MODULE[Habitat] 7 | { 8 | volume = 14.11 9 | surface = 18.42 10 | } 11 | } 12 | @PART[mk4-1pod]:NEEDS[NearFutureSpacecraft,FeatureHabitat]:AFTER[Kerbalism] 13 | { 14 | @MODULE[Habitat] 15 | { 16 | volume = 17.89 17 | surface = 28.2 18 | } 19 | } 20 | @PART[mk3-9pod]:NEEDS[NearFutureSpacecraft,FeatureHabitat]:AFTER[Kerbalism] 21 | { 22 | @MODULE[Habitat] 23 | { 24 | volume = 4.8 25 | surface = 10.93 26 | } 27 | } 28 | @PART[utilityCabin]:NEEDS[NearFutureSpacecraft,FeatureHabitat]:AFTER[Kerbalism] 29 | { 30 | @MODULE[Habitat] 31 | { 32 | volume = 8.59 33 | surface = 13.74 34 | } 35 | } 36 | 37 | @PART[rtg-0625]:NEEDS[NearFutureElectrical]:FOR[Kerbalism] 38 | { 39 | MODULE:NEEDS[FeatureRadiation] 40 | { 41 | name = Emitter 42 | radiation = 0.000002222 // 0.008 rad/h 43 | } 44 | 45 | MODULE:NEEDS[ProfileDefault|ProfileClassic] 46 | { 47 | name = ProcessController 48 | resource = _RTG 49 | title = RTG 50 | capacity = 3.0 51 | running = true 52 | toggle = false 53 | } 54 | 55 | !MODULE[ModuleGenerator]:NEEDS[ProfileDefault|ProfileClassic] {} 56 | } 57 | 58 | -------------------------------------------------------------------------------- /GameData/Kerbalism/System/Planner.cfg: -------------------------------------------------------------------------------- 1 | // ============================================================================ 2 | // Add PlannerController to relevant stock modules 3 | // ============================================================================ 4 | 5 | @PART[*]:HAS[@MODULE[ModuleGenerator]]:FOR[Kerbalism] 6 | { 7 | MODULE 8 | { 9 | name = PlannerController 10 | considered = true 11 | } 12 | } 13 | 14 | 15 | @PART[*]:HAS[@MODULE[ModuleResourceConverter]]:FOR[Kerbalism] 16 | { 17 | MODULE 18 | { 19 | name = PlannerController 20 | } 21 | } 22 | 23 | 24 | @PART[*]:HAS[@MODULE[ModuleResourceHarvester]]:FOR[Kerbalism] 25 | { 26 | MODULE 27 | { 28 | name = PlannerController 29 | } 30 | } 31 | 32 | 33 | @PART[*]:HAS[@MODULE[ModuleScienceConverter]]:AFTER[Kerbalism] 34 | { 35 | MODULE 36 | { 37 | name = PlannerController 38 | } 39 | } 40 | 41 | 42 | @PART[*]:HAS[@MODULE[ModuleActiveRadiator]]:FOR[Kerbalism] 43 | { 44 | MODULE 45 | { 46 | name = PlannerController 47 | } 48 | } 49 | 50 | 51 | @PART[*]:HAS[@MODULE[ModuleWheelMotor]]:FOR[Kerbalism] 52 | { 53 | MODULE 54 | { 55 | name = PlannerController 56 | } 57 | } 58 | 59 | 60 | @PART[*]:HAS[@MODULE[Antenna]]:AFTER[Kerbalism] 61 | { 62 | MODULE 63 | { 64 | name = PlannerController 65 | } 66 | } 67 | 68 | -------------------------------------------------------------------------------- /GameData/Kerbalism/Parts/ActiveShield/ActiveShield.cfg: -------------------------------------------------------------------------------- 1 | PART 2 | { 3 | name = kerbalism-activeshield 4 | module = Part 5 | author = zzz 6 | 7 | title = Active Shield 8 | manufacturer = TripleZeta Workshops 9 | description = Generate a magnetic field around the vessel, reducing incoming radiation. The effect is significant only in relation to the radiation levels encountered in interplanetary flight, and will do little to nothing inside super-charged particle belts or during solar storms. 10 | category = none 11 | subcategory = 0 12 | 13 | mesh = bigtank.mu 14 | rescaleFactor = 1.0 15 | 16 | node_stack_top = 0.0, 0.7231, 0.0, 0.0, 1.0, 0.0, 2 17 | node_stack_bottom = 0.0, -0.315, 0.0, 0.0, -1.0, 0.0, 2 18 | node_attach = 1.25, 0.0, 0.0, 1.0, 0.0, 0.0, 1 19 | attachRules = 1,0,1,1,0 20 | 21 | bulkheadProfiles = size2, srf 22 | dragModelType = default 23 | maximum_drag = 0.2 24 | minimum_drag = 0.2 25 | angularDrag = 2 26 | crashTolerance = 6 27 | breakingForce = 50 28 | breakingTorque = 50 29 | maxTemp = 1600 30 | 31 | TechRequired = experimentalScience 32 | entryCost = 64000 33 | cost = 16000 34 | mass = 2.5 35 | 36 | MODULE 37 | { 38 | name = Emitter 39 | radiation = -0.0000008333 // -0.003 rad/h 40 | toggle = true 41 | ec_rate = 2.5 42 | active = e10 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /misc/VisualStudio/buildscripts/ZipPack/build-package.bat: -------------------------------------------------------------------------------- 1 | rem Generate the Kerbalism.zip Release package. 2 | rem For information on how to setup your environment. 3 | rem see https://github.com/ShotgunNinja/Kerbalism/tree/master/misc/VisualStudio/Readme.md 4 | 5 | @echo off 6 | 7 | rem get parameters that are passed by visual studio post build event 8 | SET TargetName=%1 9 | SET Dllversion=%2 10 | 11 | rem make sure the initial working directory is the one containing the current script 12 | SET scriptPath=%~dp0 13 | SET rootPath=%scriptPath%..\..\..\..\ 14 | SET initialWD=%CD% 15 | 16 | echo Generating %TargetName% Release Package... 17 | cd "%rootPath%" 18 | xcopy /y "%initialWD%\%TargetName%.dll" GameData\%TargetName%\%TargetName%.dll* 19 | 20 | IF EXIST package\ rd /s /q package 21 | mkdir package 22 | cd package 23 | mkdir GameData 24 | cd GameData 25 | mkdir "%TargetName%" 26 | cd "%TargetName%" 27 | 28 | xcopy /y /e "..\..\..\GameData\%TargetName%\*" . 29 | xcopy /y ..\..\..\CHANGELOG.md . 30 | xcopy /y ..\..\..\License . 31 | xcopy /y ..\..\..\README.md . 32 | 33 | echo. 34 | echo Compressing %TargetName% Release Package... 35 | IF EXIST "%rootPath%%TargetName%*.zip" del "%rootPath%%TargetName%*.zip" 36 | "%scriptPath%7za.exe" a "..\..\..\%TargetName%%Dllversion%.zip" ..\..\GameData 37 | 38 | cd "%rootPath%" 39 | rd /s /q package 40 | 41 | cd "%initialWD%" 42 | -------------------------------------------------------------------------------- /src/Utility/Space.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | 5 | namespace KERBALISM { 6 | 7 | 8 | // represent a 3d reference frame 9 | public struct Space 10 | { 11 | public Space(Vector3 x_axis, Vector3 y_axis, Vector3 z_axis, Vector3 origin, float scale) 12 | { 13 | this.x_axis = x_axis; 14 | this.y_axis = y_axis; 15 | this.z_axis = z_axis; 16 | this.origin = origin; 17 | this.scale = scale; 18 | } 19 | 20 | public Vector3 transform_in(Vector3 p) 21 | { 22 | p -= origin; 23 | p /= scale; 24 | return new Vector3 25 | ( 26 | Vector3.Dot(p, x_axis), 27 | Vector3.Dot(p, y_axis), 28 | Vector3.Dot(p, z_axis) 29 | ); 30 | } 31 | 32 | public Vector3 transform_out(Vector3 p) 33 | { 34 | return origin 35 | + x_axis * (p.x * scale) 36 | + y_axis * (p.y * scale) 37 | + z_axis * (p.z * scale); 38 | } 39 | 40 | public Matrix4x4 look_at() 41 | { 42 | return Matrix4x4.TRS 43 | ( 44 | origin, 45 | Quaternion.LookRotation(z_axis, y_axis), 46 | new Vector3(scale, scale, scale) 47 | ); 48 | } 49 | 50 | public Vector3 x_axis; 51 | public Vector3 y_axis; 52 | public Vector3 z_axis; 53 | public Vector3 origin; 54 | public float scale; 55 | } 56 | 57 | 58 | } // KERBALISM 59 | 60 | -------------------------------------------------------------------------------- /GameData/Kerbalism/Parts/InlineContainer250/InlineContainer250.cfg: -------------------------------------------------------------------------------- 1 | PART 2 | { 3 | name = kerbalism-container-inline-250 4 | module = Part 5 | author = Tygoo7 6 | 7 | title = Big Supply Container 8 | manufacturer = Tygoo Transport Solutions 9 | description = After the extravagant excesses of the previous generation of space-grade supply containers, the fiscal department wasn't very happy of funding development of an even bigger one. When one of the clerks complained about the rationale behind 'putting men in space for the sake of it', JPL switched to war-mode and blackmailed all bureaucrats involved into submission. And the project was approved in the earnest. 10 | category = none 11 | subcategory = 0 12 | 13 | MODEL 14 | { 15 | model = Kerbalism/Parts/_/25food 16 | scale = 5, 5, 5 17 | } 18 | rescaleFactor = 1 19 | 20 | node_stack_top = 0.0, 0.364, 0.0, 0.0, 1.0, 0.0, 1 21 | node_stack_bottom = 0.0, -0.364, 0.0, 0.0, -1.0, 0.0, 1 22 | attachRules = 1,0,1,1,0 23 | 24 | bulkheadProfiles = size2, srf 25 | dragModelType = default 26 | maximum_drag = 0.2 27 | minimum_drag = 0.2 28 | angularDrag = 2 29 | crashTolerance = 6 30 | breakingForce = 50 31 | breakingTorque = 50 32 | maxTemp = 1600 33 | 34 | TechRequired = advExploration 35 | entryCost = 8000 36 | cost = 2000 37 | mass = 0.5 38 | ContainerVolume = 4100 39 | } 40 | -------------------------------------------------------------------------------- /src/Utility/Specifics.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | using UnityEngine; 5 | 6 | 7 | namespace KERBALISM { 8 | 9 | 10 | public interface ISpecifics 11 | { 12 | Specifics Specs(); 13 | } 14 | 15 | public sealed class Specifics 16 | { 17 | public Specifics() 18 | { 19 | entries = new List(); 20 | } 21 | 22 | public void add(string label, string value = "") 23 | { 24 | Entry e = new Entry(); 25 | e.label = label; 26 | e.value = value; 27 | entries.Add(e); 28 | } 29 | 30 | public string info(string desc = "") 31 | { 32 | StringBuilder sb = new StringBuilder(); 33 | if (desc.Length > 0) 34 | { 35 | sb.Append(""); 36 | sb.Append(desc); 37 | sb.Append("\n\n"); 38 | } 39 | foreach(Entry e in entries) 40 | { 41 | sb.Append(e.label); 42 | if (e.value.Length > 0) 43 | { 44 | sb.Append(": "); 45 | sb.Append(e.value); 46 | sb.Append(""); 47 | } 48 | sb.Append("\n"); 49 | } 50 | return sb.ToString(); 51 | } 52 | 53 | public class Entry 54 | { 55 | public string label = string.Empty; 56 | public string value = string.Empty; 57 | } 58 | 59 | public List entries; 60 | } 61 | 62 | 63 | } // KERBALISM -------------------------------------------------------------------------------- /src/Utility/Archive.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text; 3 | 4 | 5 | namespace KERBALISM { 6 | 7 | 8 | public class ReadArchive 9 | { 10 | public ReadArchive(string data) 11 | { 12 | this.data = data; 13 | } 14 | 15 | public void load(out int integer) 16 | { 17 | integer = data[index] - 32; 18 | ++index; 19 | } 20 | 21 | public void load(out string text) 22 | { 23 | int len; 24 | load(out len); 25 | text = data.Substring(index, len); 26 | index += len; 27 | } 28 | 29 | public void load(out double value) 30 | { 31 | string s; 32 | load(out s); 33 | value = Lib.Parse.ToDouble(s); 34 | } 35 | 36 | string data; 37 | int index; 38 | } 39 | 40 | 41 | public class WriteArchive 42 | { 43 | public void save(int integer) 44 | { 45 | integer = Lib.Clamp(integer + 32, 32, 255); 46 | sb.Append((char)integer); 47 | } 48 | 49 | public void save(string text) 50 | { 51 | save(text.Length); 52 | sb.Append(text.Substring(0, Math.Min(255 - 32, text.Length))); 53 | } 54 | 55 | public void save(double value) 56 | { 57 | save(value.ToString()); 58 | } 59 | 60 | public string serialize() 61 | { 62 | return sb.ToString(); 63 | } 64 | 65 | StringBuilder sb = new StringBuilder(); 66 | } 67 | 68 | 69 | } // KERBALISM 70 | 71 | -------------------------------------------------------------------------------- /src/Signal/ConnectionInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | 6 | namespace KERBALISM { 7 | 8 | 9 | // link state 10 | public enum LinkStatus 11 | { 12 | direct_link, 13 | indirect_link, 14 | no_link, 15 | no_antenna, 16 | blackout 17 | }; 18 | 19 | 20 | public sealed class ConnectionInfo 21 | { 22 | public ConnectionInfo(LinkStatus status, double rate = 0.0, double cost = 0.0) 23 | { 24 | this.linked = status == LinkStatus.direct_link || status == LinkStatus.indirect_link; 25 | this.status = status; 26 | this.rate = rate; 27 | this.cost = cost; 28 | this.path = new List(); 29 | } 30 | 31 | public ConnectionInfo(ConnectionInfo other) 32 | { 33 | this.linked = other.linked; 34 | this.status = other.status; 35 | this.rate = other.rate; 36 | this.cost = other.cost; 37 | this.path = new List(); 38 | foreach(Vessel v in other.path) this.path.Add(v); 39 | } 40 | 41 | public bool linked; // true if there is a connection back to DSN 42 | public LinkStatus status; // the link status 43 | public double rate; // data rate in Mb/s 44 | public double cost; // EC/s consumed for transmission 45 | public List path; // set of vessels relaying the data 46 | } 47 | 48 | 49 | } // KERBALISM 50 | 51 | -------------------------------------------------------------------------------- /GameData/Kerbalism/Support/Origami.cfg: -------------------------------------------------------------------------------- 1 | @PART[NAU_ORI350Gm]:NEEDS[FeatureSignal]:FOR[Kerbalism] 2 | { 3 | MODULE 4 | { 5 | name = Antenna 6 | type = high_gain 7 | cost = 1.0 8 | dist = 3.5e11 9 | rate = 0.256 10 | } 11 | 12 | MODULE:NEEDS[FeatureReliability] 13 | { 14 | name = Reliability 15 | type = Antenna 16 | title = Antenna 17 | redundancy = Communication 18 | repair = Engineer 19 | mtbf = 72576000 // 8y 20 | extra_cost = 2.0 21 | extra_mass = 0.25 22 | } 23 | 24 | MODULE 25 | { 26 | name = ModuleAnimationGroup 27 | deployAnimationName = Deploy 28 | moduleType = Antenna 29 | } 30 | 31 | !MODULE[ModuleAnimateGeneric]:HAS[#animationName[Deploy]] {} 32 | } 33 | 34 | 35 | @PART[NAU_ORI69Gm]:NEEDS[FeatureSignal]:FOR[Kerbalism] 36 | { 37 | MODULE 38 | { 39 | name = Antenna 40 | type = high_gain 41 | cost = 0.5 42 | dist = 6.9e10 43 | rate = 0.128 44 | } 45 | 46 | MODULE:NEEDS[FeatureReliability] 47 | { 48 | name = Reliability 49 | type = Antenna 50 | title = Antenna 51 | redundancy = Communication 52 | repair = Engineer 53 | mtbf = 72576000 // 8y 54 | extra_cost = 2.0 55 | extra_mass = 0.25 56 | } 57 | 58 | MODULE 59 | { 60 | name = ModuleAnimationGroup 61 | deployAnimationName = Deploy 62 | moduleType = Antenna 63 | } 64 | 65 | !MODULE[ModuleAnimateGeneric]:HAS[#animationName[Deploy]] {} 66 | } -------------------------------------------------------------------------------- /GameData/Kerbalism/Shaders/aa_line.shader: -------------------------------------------------------------------------------- 1 | // render an antialiased line 2 | // - txcoord: [normalized distance from line center, ignored] 3 | 4 | 5 | Shader "Custom/AntiAliasedLine" 6 | { 7 | Properties 8 | { 9 | } 10 | SubShader 11 | { 12 | Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } 13 | Blend SrcAlpha One 14 | ColorMask RGB 15 | Cull Off Lighting Off ZWrite Off 16 | 17 | Pass 18 | { 19 | CGPROGRAM 20 | #pragma vertex vert 21 | #pragma fragment frag 22 | #pragma target 2.5 23 | 24 | struct v2f 25 | { 26 | half4 color : COLOR; 27 | float txcoord : TEXCOORD0; 28 | float pos_z : NORMAL; 29 | }; 30 | 31 | v2f vert(float4 in_pos : POSITION, half4 color : COLOR, float2 txcoord : TEXCOORD0, out float4 pos : SV_POSITION) 32 | { 33 | pos = mul(UNITY_MATRIX_MVP, in_pos); 34 | 35 | v2f o; 36 | o.color = color; 37 | o.pos_z = pos.z; 38 | o.txcoord = txcoord.x * o.pos_z; // undo perspective correction 39 | return o; 40 | } 41 | 42 | half4 frag(v2f i) : COLOR 43 | { 44 | // used to antialias the line border 45 | float k = 1.0 - abs(i.txcoord / i.pos_z); 46 | 47 | // calculate output color 48 | half4 output = i.color; 49 | output.w *= k; 50 | return output; 51 | } 52 | ENDCG 53 | } 54 | } 55 | } -------------------------------------------------------------------------------- /GameData/Kerbalism/System/Comfort.cfg: -------------------------------------------------------------------------------- 1 | // ============================================================================ 2 | // add Comfort module to stock parts 3 | // ============================================================================ 4 | 5 | 6 | @PART[cupola]:NEEDS[FeatureComfort]:FOR[Kerbalism] 7 | { 8 | MODULE 9 | { 10 | name = Comfort 11 | bonus = panorama 12 | desc = The cupola offer a relaxing panoramic view of the void of space. 13 | } 14 | 15 | @tags ^= :$: comfort: 16 | } 17 | 18 | 19 | @PART[crewCabin]:NEEDS[FeatureComfort]:FOR[Kerbalism] 20 | { 21 | MODULE 22 | { 23 | name = Comfort 24 | bonus = exercise 25 | desc = A treadmill designed to permit exercise in zero-g is included. The crew will love it. 26 | } 27 | 28 | MODULE:NEEDS[FeatureReliability] 29 | { 30 | name = Reliability 31 | type = Comfort 32 | title = Treadmill 33 | repair = Engineer 34 | mtbf = 36288000 // 4y 35 | extra_cost = 0.25 36 | extra_mass = 0.05 37 | } 38 | 39 | @tags ^= :$: comfort: 40 | } 41 | 42 | 43 | @PART[probeCoreOcto2]:NEEDS[FeatureComfort]:FOR[Kerbalism] 44 | { 45 | MODULE 46 | { 47 | name = Comfort 48 | bonus = not-alone 49 | desc = This probe comes with the G.E.R.T.Y. User Interface Software, designed to play chess and disgress about philosophical matters with the crew. The innovative EMOT-ICON interface trick the user into feeling empathy for the software. 50 | } 51 | 52 | @tags ^= :$: comfort: 53 | } 54 | 55 | 56 | -------------------------------------------------------------------------------- /src/Database/LandmarkData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | 6 | namespace KERBALISM { 7 | 8 | 9 | public class LandmarkData 10 | { 11 | public LandmarkData() 12 | { 13 | } 14 | 15 | public LandmarkData(ConfigNode node) 16 | { 17 | belt_crossing = Lib.ConfigValue(node, "belt_crossing", false); 18 | manned_orbit = Lib.ConfigValue(node, "manned_orbit", false); 19 | space_harvest = Lib.ConfigValue(node, "space_harvest", false); 20 | space_analysis = Lib.ConfigValue(node, "space_analysis", false); 21 | heliopause_crossing = Lib.ConfigValue(node, "heliopause_crossing", false); 22 | } 23 | 24 | public void save(ConfigNode node) 25 | { 26 | node.AddValue("belt_crossing", belt_crossing); 27 | node.AddValue("manned_orbit", manned_orbit); 28 | node.AddValue("space_harvest", space_harvest); 29 | node.AddValue("space_analysis", space_analysis); 30 | node.AddValue("heliopause_crossing", heliopause_crossing); 31 | } 32 | 33 | public bool belt_crossing; // record first belt crossing 34 | public bool manned_orbit; // record first 30 days manned orbit 35 | public bool space_harvest; // record first greenhouse harvest in space 36 | public bool space_analysis; // record first lab sample analysis in space 37 | public bool heliopause_crossing; // record first heliopause crossing 38 | } 39 | 40 | 41 | } // KERBALISM 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /src/Automation/Script.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | 6 | namespace KERBALISM { 7 | 8 | 9 | public sealed class Script 10 | { 11 | public Script() 12 | { 13 | states = new Dictionary(); 14 | prev = string.Empty; 15 | } 16 | 17 | public Script(ConfigNode node) 18 | { 19 | states = new Dictionary(); 20 | foreach(string s in node.GetValues("state")) 21 | { 22 | var tokens = Lib.Tokenize(s, '@'); 23 | if (tokens.Count < 2) continue; 24 | states.Add(Lib.Parse.ToUInt(tokens[0]), Lib.Parse.ToBool(tokens[1])); 25 | } 26 | prev = Lib.ConfigValue(node, "prev", string.Empty); 27 | } 28 | 29 | public void save(ConfigNode node) 30 | { 31 | foreach(var p in states) 32 | { 33 | node.AddValue("state", Lib.BuildString(p.Key.ToString(), "@", p.Value.ToString())); 34 | } 35 | node.AddValue("prev", prev); 36 | } 37 | 38 | public void set(Device dev, bool? state) 39 | { 40 | states.Remove(dev.id()); 41 | if (state != null) 42 | { 43 | states.Add(dev.id(), state == true); 44 | } 45 | } 46 | 47 | public void execute(Dictionary devices) 48 | { 49 | Device dev; 50 | foreach(var p in states) 51 | { 52 | if (devices.TryGetValue(p.Key, out dev)) 53 | { 54 | dev.ctrl(p.Value); 55 | } 56 | } 57 | } 58 | 59 | 60 | public Dictionary states; 61 | public string prev; 62 | } 63 | 64 | 65 | 66 | } // KERBALISM 67 | 68 | -------------------------------------------------------------------------------- /src/Science/ExperimentInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | 6 | namespace KERBALISM { 7 | 8 | 9 | public sealed class ExperimentInfo 10 | { 11 | public ExperimentInfo(string subject_id) 12 | { 13 | // get experiment id out of subject id 14 | int i = subject_id.IndexOf('@'); 15 | id = i > 0 ? subject_id.Substring(0, i) : subject_id; 16 | 17 | // get experiment definition 18 | // - available even in sandbox 19 | expdef = ResearchAndDevelopment.GetExperiment(id); 20 | 21 | // deduce short name for the subject 22 | name = expdef != null ? expdef.experimentTitle : Lib.UppercaseFirst(id); 23 | 24 | // deduce situation for the subject 25 | situation = subject_id.Length < i + 2 ? "Unknown" : Lib.SpacesOnCaps(subject_id.Substring(i + 1)); 26 | situation = situation.Replace("Srf ", string.Empty).Replace("In ", string.Empty); 27 | 28 | // provide a full name 29 | fullname = Lib.BuildString(name, " (", situation, ")"); 30 | 31 | // deduce max data amount 32 | max_amount = expdef != null ? expdef.scienceCap * expdef.dataScale : double.MaxValue; 33 | } 34 | 35 | 36 | public string id; // experiment identifier 37 | public ScienceExperiment expdef; // experiment definition 38 | public string name; // short description of the experiment 39 | public string fullname; // full description of the experiment 40 | public string situation; // description of the situation 41 | public double max_amount; // max data amount for the experiment 42 | } 43 | 44 | 45 | } // KERBALISM 46 | 47 | -------------------------------------------------------------------------------- /GameData/Kerbalism/Extra/WetWorkshop.disabled: -------------------------------------------------------------------------------- 1 | // rename from 'WetWorkshop.disabled' to 'WetWorkshop.cfg' to enable, viceversa to disable 2 | 3 | // ============================================================================ 4 | // Some of the big fuel tanks can be converted to wet workshops, in editor or in flight. 5 | // The tank will then act as an additional habitat. The conversion require an Engineer. 6 | // This patch will conflict with any third-party mods that change what is stored inside 7 | // the stock fuel tanks, and that is why it is disabled by default. 8 | // ============================================================================ 9 | 10 | @PART[fuelTank_long|fuelTank1-2|fuelTank3-2|Size3MediumTank|Size3LargeTank]:NEEDS[FeatureHabitat]:FOR[Kerbalism] 11 | { 12 | MODULE 13 | { 14 | name = Habitat 15 | } 16 | 17 | MODULE 18 | { 19 | name = Configure 20 | title = Tank 21 | slots = 1 22 | reconfigure = Engineer 23 | 24 | SETUP 25 | { 26 | name = Fuel Tank 27 | 28 | RESOURCE 29 | { 30 | name = LiquidFuel 31 | amount = #$../../../RESOURCE[LiquidFuel]/amount$ 32 | maxAmount = #$../../../RESOURCE[LiquidFuel]/maxAmount$ 33 | } 34 | RESOURCE 35 | { 36 | name = Oxidizer 37 | amount = #$../../../RESOURCE[Oxidizer]/amount$ 38 | maxAmount = #$../../../RESOURCE[Oxidizer]/maxAmount$ 39 | } 40 | } 41 | 42 | SETUP 43 | { 44 | name = Wet Workshop 45 | desc = We can re-use our spent stages as Habitats. 46 | 47 | MODULE 48 | { 49 | type = Habitat 50 | } 51 | } 52 | } 53 | 54 | !RESOURCE[LiquidFuel] {} 55 | !RESOURCE[Oxidizer] {} 56 | } -------------------------------------------------------------------------------- /src/Automation/Devices/Laboratory.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | 6 | namespace KERBALISM { 7 | 8 | 9 | public sealed class LaboratoryDevice : Device 10 | { 11 | public LaboratoryDevice(Laboratory lab) 12 | { 13 | this.lab = lab; 14 | } 15 | 16 | public override string name() 17 | { 18 | return "laboratory"; 19 | } 20 | 21 | public override uint part() 22 | { 23 | return lab.part.flightID; 24 | } 25 | 26 | public override string info() 27 | { 28 | return lab.running ? "active" : "disabled"; 29 | } 30 | 31 | public override void ctrl(bool value) 32 | { 33 | if (lab.running != value) lab.Toggle(); 34 | } 35 | 36 | public override void toggle() 37 | { 38 | ctrl(!lab.running); 39 | } 40 | 41 | Laboratory lab; 42 | } 43 | 44 | 45 | public sealed class ProtoLaboratoryDevice : Device 46 | { 47 | public ProtoLaboratoryDevice(ProtoPartModuleSnapshot lab, uint part_id) 48 | { 49 | this.lab = lab; 50 | this.part_id = part_id; 51 | } 52 | 53 | public override string name() 54 | { 55 | return "laboratory"; 56 | } 57 | 58 | public override uint part() 59 | { 60 | return part_id; 61 | } 62 | 63 | public override string info() 64 | { 65 | return Lib.Proto.GetBool(lab, "running") ? "active" : "disabled"; 66 | } 67 | 68 | public override void ctrl(bool value) 69 | { 70 | Lib.Proto.Set(lab, "running", value); 71 | } 72 | 73 | public override void toggle() 74 | { 75 | ctrl(!Lib.Proto.GetBool(lab, "running")); 76 | } 77 | 78 | ProtoPartModuleSnapshot lab; 79 | uint part_id; 80 | } 81 | 82 | 83 | } // KERBALISM 84 | 85 | -------------------------------------------------------------------------------- /src/Automation/Devices/Light.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | 6 | namespace KERBALISM { 7 | 8 | 9 | public sealed class LightDevice : Device 10 | { 11 | public LightDevice(ModuleLight light) 12 | { 13 | this.light = light; 14 | } 15 | 16 | public override string name() 17 | { 18 | return "light"; 19 | } 20 | 21 | public override uint part() 22 | { 23 | return light.part.flightID; 24 | } 25 | 26 | public override string info() 27 | { 28 | return light.isOn ? "on" : "off"; 29 | } 30 | 31 | public override void ctrl(bool value) 32 | { 33 | if (value) light.LightsOn(); 34 | else light.LightsOff(); 35 | } 36 | 37 | public override void toggle() 38 | { 39 | ctrl(!light.isOn); 40 | } 41 | 42 | ModuleLight light; 43 | } 44 | 45 | 46 | public sealed class ProtoLightDevice : Device 47 | { 48 | public ProtoLightDevice(ProtoPartModuleSnapshot light, uint part_id) 49 | { 50 | this.light = light; 51 | this.part_id = part_id; 52 | } 53 | 54 | public override string name() 55 | { 56 | return "light"; 57 | } 58 | 59 | public override uint part() 60 | { 61 | return part_id; 62 | } 63 | 64 | public override string info() 65 | { 66 | bool is_on = Lib.Proto.GetBool(light, "isOn"); 67 | return is_on ? "on" : "off"; 68 | } 69 | 70 | public override void ctrl(bool value) 71 | { 72 | Lib.Proto.Set(light, "isOn", value); 73 | } 74 | 75 | public override void toggle() 76 | { 77 | ctrl(!Lib.Proto.GetBool(light, "isOn")); 78 | } 79 | 80 | ProtoPartModuleSnapshot light; 81 | uint part_id; 82 | } 83 | 84 | 85 | } // KERBALISM -------------------------------------------------------------------------------- /src/Automation/Devices/Emitter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | 6 | namespace KERBALISM { 7 | 8 | 9 | public sealed class EmitterDevice : Device 10 | { 11 | public EmitterDevice(Emitter emitter) 12 | { 13 | this.emitter = emitter; 14 | } 15 | 16 | public override string name() 17 | { 18 | return "emitter"; 19 | } 20 | 21 | public override uint part() 22 | { 23 | return emitter.part.flightID; 24 | } 25 | 26 | public override string info() 27 | { 28 | return emitter.running ? "active" : "disabled"; 29 | } 30 | 31 | public override void ctrl(bool value) 32 | { 33 | if (emitter.running != value) emitter.Toggle(); 34 | } 35 | 36 | public override void toggle() 37 | { 38 | ctrl(!emitter.running); 39 | } 40 | 41 | Emitter emitter; 42 | } 43 | 44 | 45 | public sealed class ProtoEmitterDevice : Device 46 | { 47 | public ProtoEmitterDevice(ProtoPartModuleSnapshot emitter, uint part_id) 48 | { 49 | this.emitter = emitter; 50 | this.part_id = part_id; 51 | } 52 | 53 | public override string name() 54 | { 55 | return "emitter"; 56 | } 57 | 58 | public override uint part() 59 | { 60 | return part_id; 61 | } 62 | 63 | public override string info() 64 | { 65 | return Lib.Proto.GetBool(emitter, "running") ? "active" : "disabled"; 66 | } 67 | 68 | public override void ctrl(bool value) 69 | { 70 | Lib.Proto.Set(emitter, "running", value); 71 | } 72 | 73 | public override void toggle() 74 | { 75 | ctrl(!Lib.Proto.GetBool(emitter, "running")); 76 | } 77 | 78 | ProtoPartModuleSnapshot emitter; 79 | uint part_id; 80 | } 81 | 82 | 83 | } // KERBALISM -------------------------------------------------------------------------------- /src/Utility/Animator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | 6 | namespace KERBALISM { 7 | 8 | 9 | public sealed class Animator 10 | { 11 | Animation anim; 12 | string name; 13 | 14 | public Animator(Part p, string anim_name) 15 | { 16 | anim = null; 17 | name = string.Empty; 18 | 19 | if (anim_name.Length > 0) 20 | { 21 | Animation[] animations = p.FindModelAnimators(anim_name); 22 | if (animations.Length > 0) 23 | { 24 | anim = animations[0]; 25 | name = anim_name; 26 | } 27 | } 28 | } 29 | 30 | public void play(bool reverse, bool loop) 31 | { 32 | if (anim != null) 33 | { 34 | anim[name].normalizedTime = !reverse ? 0.0f : 1.0f; 35 | anim[name].speed = !reverse ? 1.0f : -1.0f; 36 | anim[name].wrapMode = !loop ? WrapMode.Once : WrapMode.Loop; 37 | anim.Play(name); 38 | } 39 | } 40 | 41 | 42 | public void stop() 43 | { 44 | if (anim != null) 45 | { 46 | anim.Stop(); 47 | } 48 | } 49 | 50 | 51 | public void pause() 52 | { 53 | if (anim != null) 54 | { 55 | anim[name].speed = 0.0f; 56 | } 57 | } 58 | 59 | 60 | public void resume(bool reverse) 61 | { 62 | if (anim != null) 63 | { 64 | anim[name].speed = !reverse ? 1.0f : -1.0f; 65 | } 66 | } 67 | 68 | 69 | public void still(double t) 70 | { 71 | if (anim != null) 72 | { 73 | anim[name].normalizedTime = (float)t; 74 | anim[name].speed = 0.0f; 75 | anim.Play(name); 76 | } 77 | } 78 | 79 | 80 | public bool playing() 81 | { 82 | if (anim != null) 83 | { 84 | return anim.IsPlaying(name); 85 | } 86 | return false; 87 | } 88 | } 89 | 90 | 91 | } // KERBALISM 92 | 93 | -------------------------------------------------------------------------------- /src/Automation/Devices/Ring.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | 6 | namespace KERBALISM { 7 | 8 | 9 | public sealed class RingDevice : Device 10 | { 11 | public RingDevice(GravityRing ring) 12 | { 13 | this.ring = ring; 14 | } 15 | 16 | public override string name() 17 | { 18 | return "gravity ring"; 19 | } 20 | 21 | public override uint part() 22 | { 23 | return ring.part.flightID; 24 | } 25 | 26 | public override string info() 27 | { 28 | return ring.deployed ? "deployed" : "retracted"; 29 | } 30 | 31 | public override void ctrl(bool value) 32 | { 33 | if (ring.deployed != value) 34 | { 35 | ring.Toggle(); 36 | } 37 | } 38 | 39 | public override void toggle() 40 | { 41 | ctrl(!ring.deployed); 42 | } 43 | 44 | GravityRing ring; 45 | } 46 | 47 | 48 | public sealed class ProtoRingDevice : Device 49 | { 50 | public ProtoRingDevice(ProtoPartModuleSnapshot ring, uint part_id) 51 | { 52 | this.ring = ring; 53 | this.part_id = part_id; 54 | } 55 | 56 | public override string name() 57 | { 58 | return "gravity ring"; 59 | } 60 | 61 | public override uint part() 62 | { 63 | return part_id; 64 | } 65 | 66 | public override string info() 67 | { 68 | bool deployed = Lib.Proto.GetBool(ring, "deployed"); 69 | return deployed ? "deployed" : "retracted"; 70 | } 71 | 72 | public override void ctrl(bool value) 73 | { 74 | Lib.Proto.Set(ring, "deployed", value); 75 | } 76 | 77 | public override void toggle() 78 | { 79 | ctrl(!Lib.Proto.GetBool(ring, "deployed")); 80 | } 81 | 82 | ProtoPartModuleSnapshot ring; 83 | uint part_id; 84 | } 85 | 86 | 87 | } // KERBALISM -------------------------------------------------------------------------------- /src/Database/KerbalData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | 6 | namespace KERBALISM { 7 | 8 | 9 | public class KerbalData 10 | { 11 | public KerbalData() 12 | { 13 | rescue = true; 14 | disabled = false; 15 | eva_dead = false; 16 | rules = new Dictionary(); 17 | } 18 | 19 | public KerbalData(ConfigNode node) 20 | { 21 | rescue = Lib.ConfigValue(node, "rescue", Lib.ConfigValue(node, "resque", true)); //< support pre 1.1.9 typo 22 | disabled = Lib.ConfigValue(node, "disabled", false); 23 | eva_dead = Lib.ConfigValue(node, "eva_dead", false); 24 | rules = new Dictionary(); 25 | 26 | foreach(var rule_node in node.GetNode("rules").GetNodes()) 27 | { 28 | rules.Add(DB.from_safe_key(rule_node.name), new RuleData(rule_node)); 29 | } 30 | } 31 | 32 | public void save(ConfigNode node) 33 | { 34 | node.AddValue("rescue", rescue); 35 | node.AddValue("disabled", disabled); 36 | node.AddValue("eva_dead", eva_dead); 37 | var rules_node = node.AddNode("rules"); 38 | 39 | foreach(var p in rules) 40 | { 41 | p.Value.save(rules_node.AddNode(DB.to_safe_key(p.Key))); 42 | } 43 | } 44 | 45 | public RuleData Rule(string name) 46 | { 47 | if (!rules.ContainsKey(name)) 48 | { 49 | rules.Add(name, new RuleData()); 50 | } 51 | return rules[name]; 52 | } 53 | 54 | public bool rescue; // used to deal with rescue mission kerbals 55 | public bool disabled; // a generic flag to disable resource consumption, for use by other mods 56 | public bool eva_dead; // the eva kerbal died, and is now a floating body 57 | public Dictionary rules; // rules data 58 | } 59 | 60 | 61 | } // KERBALISM 62 | 63 | -------------------------------------------------------------------------------- /src/Automation/Devices/Greenhouse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | 6 | namespace KERBALISM { 7 | 8 | 9 | public sealed class GreenhouseDevice : Device 10 | { 11 | public GreenhouseDevice(Greenhouse greenhouse) 12 | { 13 | this.greenhouse = greenhouse; 14 | } 15 | 16 | public override string name() 17 | { 18 | return "greenhouse"; 19 | } 20 | 21 | public override uint part() 22 | { 23 | return greenhouse.part.flightID; 24 | } 25 | 26 | public override string info() 27 | { 28 | return greenhouse.active ? "enabled" : "disabled"; 29 | } 30 | 31 | public override void ctrl(bool value) 32 | { 33 | if (greenhouse.active != value) greenhouse.Toggle(); 34 | } 35 | 36 | public override void toggle() 37 | { 38 | ctrl(!greenhouse.active); 39 | } 40 | 41 | Greenhouse greenhouse; 42 | } 43 | 44 | 45 | public sealed class ProtoGreenhouseDevice : Device 46 | { 47 | public ProtoGreenhouseDevice(ProtoPartModuleSnapshot greenhouse, uint part_id) 48 | { 49 | this.greenhouse = greenhouse; 50 | this.part_id = part_id; 51 | } 52 | 53 | public override string name() 54 | { 55 | return "greenhouse"; 56 | } 57 | 58 | public override uint part() 59 | { 60 | return part_id; 61 | } 62 | 63 | public override string info() 64 | { 65 | bool active = Lib.Proto.GetBool(greenhouse, "active"); 66 | return active ? "enabled" : "disabled"; 67 | } 68 | 69 | public override void ctrl(bool value) 70 | { 71 | Lib.Proto.Set(greenhouse, "active", value); 72 | } 73 | 74 | public override void toggle() 75 | { 76 | ctrl(!Lib.Proto.GetBool(greenhouse, "active")); 77 | } 78 | 79 | ProtoPartModuleSnapshot greenhouse; 80 | uint part_id; 81 | } 82 | 83 | 84 | } // KERBALISM -------------------------------------------------------------------------------- /src/External/SCANsat.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace KERBALISM { 5 | 6 | 7 | public static class SCANsat 8 | { 9 | static SCANsat() 10 | { 11 | foreach(var a in AssemblyLoader.loadedAssemblies) 12 | { 13 | if (a.name == "SCANsat") 14 | { 15 | SCANUtils = a.assembly.GetType("SCANsat.SCANUtil"); 16 | RegisterSensor = SCANUtils.GetMethod("registerSensorExternal"); 17 | UnregisterSensor = SCANUtils.GetMethod("unregisterSensorExternal"); 18 | break; 19 | } 20 | } 21 | } 22 | 23 | // interrupt scanning of a SCANsat module 24 | // - v: vessel that own the module 25 | // - m: protomodule of a SCANsat or a resource scanner 26 | // - p: prefab of the part owning the module 27 | public static bool stopScanner(Vessel v, ProtoPartModuleSnapshot m, Part part_prefab) 28 | { 29 | return SCANUtils != null && (bool)UnregisterSensor.Invoke(null, new Object[]{v, m, part_prefab}); 30 | } 31 | 32 | // resume scanning of a SCANsat module 33 | // - v: vessel that own the module 34 | // - m: protomodule of a SCANsat or a resource scanner 35 | // - p: prefab of the part owning the module 36 | public static bool resumeScanner(Vessel v, ProtoPartModuleSnapshot m, Part part_prefab) 37 | { 38 | return SCANUtils != null && (bool)RegisterSensor.Invoke(null, new Object[]{v, m, part_prefab}); 39 | } 40 | 41 | // return scanner EC consumption per-second 42 | public static double EcConsumption(PartModule scanner) 43 | { 44 | foreach(ModuleResource res in scanner.resHandler.inputResources) 45 | { 46 | if (res.name == "ElectricCharge") return res.rate; 47 | } 48 | return 0.0; 49 | } 50 | 51 | // reflection type of SCANUtils static class in SCANsat assembly, if present 52 | static Type SCANUtils; 53 | static System.Reflection.MethodInfo RegisterSensor; 54 | static System.Reflection.MethodInfo UnregisterSensor; 55 | } 56 | 57 | 58 | } // KERBALISM -------------------------------------------------------------------------------- /GameData/Kerbalism/Shaders/full_point_particle.shader: -------------------------------------------------------------------------------- 1 | // render a point sprite, with the point color and size specified per-particle 2 | 3 | 4 | Shader "Custom/FullPointParticle" 5 | { 6 | Properties 7 | { 8 | } 9 | SubShader 10 | { 11 | Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } 12 | Blend SrcAlpha One 13 | ColorMask RGB 14 | Cull Off Lighting Off ZWrite Off 15 | 16 | Pass 17 | { 18 | CGPROGRAM 19 | #pragma vertex vert 20 | #pragma fragment frag 21 | #pragma target 2.5 22 | 23 | struct v2f 24 | { 25 | float size : PSIZE; 26 | float inv_hsize : TEXCOORD0; 27 | float2 screen_coords : TEXCOORD1; 28 | float4 color : TEXCOORD2; 29 | }; 30 | 31 | v2f vert(float4 in_pos : POSITION, fixed4 in_color : COLOR, float2 in_psize : TEXCOORD, out float4 pos : SV_POSITION) 32 | { 33 | // output clip-space vertex position 34 | pos = mul(UNITY_MATRIX_MVP, in_pos); 35 | 36 | // pass down point size and inverse of point half-size 37 | v2f o; 38 | o.size = in_psize.x; 39 | o.inv_hsize = 2.0 / o.size; 40 | 41 | // pass down point color 42 | o.color = in_color; 43 | 44 | // calculate and pass down screen-space position of point center 45 | o.screen_coords = (pos.xy / pos.w) * 0.5 + 0.5; 46 | o.screen_coords *= _ScreenParams.xy; 47 | o.screen_coords.y = _ScreenParams.y - o.screen_coords.y; 48 | return o; 49 | } 50 | 51 | half4 frag(v2f i, UNITY_VPOS_TYPE screen_pos : VPOS) : COLOR 52 | { 53 | // calculate normalized distance between fragment screen-space 54 | // position, and point center in screen-space 55 | float k = 1.0 - distance(screen_pos.xy, i.screen_coords.xy) * i.inv_hsize; 56 | 57 | // calculate output color 58 | half4 output = i.color; 59 | output.w *= k; 60 | return output; 61 | } 62 | ENDCG 63 | } 64 | } 65 | } -------------------------------------------------------------------------------- /GameData/Kerbalism/Shaders/point_particle.shader: -------------------------------------------------------------------------------- 1 | // render a point sprite 2 | // - POINT_COLOR: point color 3 | // - POINT_SIZE: point size on screen, in pixels 4 | 5 | 6 | Shader "Custom/PointParticle" 7 | { 8 | Properties 9 | { 10 | POINT_COLOR ("Point color", Color) = (1.0,1.0,1.0,1.0) 11 | POINT_SIZE ("Point size in pixels", Float) = 16.0 12 | } 13 | SubShader 14 | { 15 | Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } 16 | Blend SrcAlpha One 17 | ColorMask RGB 18 | Cull Off Lighting Off ZWrite Off 19 | 20 | Pass 21 | { 22 | CGPROGRAM 23 | #pragma vertex vert 24 | #pragma fragment frag 25 | #pragma target 2.5 26 | 27 | fixed4 POINT_COLOR; 28 | float POINT_SIZE; 29 | 30 | struct v2f 31 | { 32 | float size : PSIZE; 33 | float inv_hsize : TEXCOORD0; 34 | float2 screen_coords : TEXCOORD1; 35 | }; 36 | 37 | v2f vert(float4 in_pos : POSITION, out float4 pos : SV_POSITION) 38 | { 39 | // output clip-space vertex position 40 | pos = mul(UNITY_MATRIX_MVP, in_pos); 41 | 42 | // pass down point size and inverse of point half-size 43 | v2f o; 44 | o.size = POINT_SIZE; 45 | o.inv_hsize = 2.0 / o.size; 46 | 47 | // calculate and pass down screen-space position of point center 48 | o.screen_coords = (pos.xy / pos.w) * 0.5 + 0.5; 49 | o.screen_coords *= _ScreenParams.xy; 50 | o.screen_coords.y = _ScreenParams.y - o.screen_coords.y; 51 | return o; 52 | } 53 | 54 | half4 frag(v2f i, UNITY_VPOS_TYPE screen_pos : VPOS) : COLOR 55 | { 56 | // calculate normalized distance between fragment screen-space 57 | // position, and point center in screen-space 58 | float k = 1.0 - distance(screen_pos.xy, i.screen_coords.xy) * i.inv_hsize; 59 | 60 | // calculate output color 61 | half4 output = POINT_COLOR; 62 | output.w *= k; 63 | return output; 64 | } 65 | ENDCG 66 | } 67 | } 68 | } -------------------------------------------------------------------------------- /src/UI/UI.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | 6 | namespace KERBALISM { 7 | 8 | 9 | public static class UI 10 | { 11 | public static void init() 12 | { 13 | // create subsystems 14 | message = new Message(); 15 | launcher = new Launcher(); 16 | window = new Window(260u, DB.ui.win_left, DB.ui.win_top); 17 | } 18 | 19 | public static void sync() 20 | { 21 | window.position(DB.ui.win_left, DB.ui.win_top); 22 | } 23 | 24 | public static void update(bool show_window) 25 | { 26 | // if gui should be shown 27 | if (show_window) 28 | { 29 | // as a special case, the first time the user enter 30 | // map-view/tracking-station we open the body info window 31 | if (MapView.MapIsEnabled && !DB.ui.map_viewed) 32 | { 33 | open(BodyInfo.body_info); 34 | DB.ui.map_viewed = true; 35 | } 36 | 37 | // update subsystems 38 | launcher.update(); 39 | window.update(); 40 | 41 | // remember main window position 42 | DB.ui.win_left = window.left(); 43 | DB.ui.win_top = window.top(); 44 | } 45 | 46 | // re-enable camera mouse scrolling, as some of the on_gui functions can 47 | // disable it on mouse-hover, but can't re-enable it again consistently 48 | // (eg: you mouse-hover and then close the window with the cursor still inside it) 49 | // - we are ignoring user preference on mouse wheel 50 | GameSettings.AXIS_MOUSEWHEEL.primary.scale = 1.0f; 51 | } 52 | 53 | public static void on_gui(bool show_window) 54 | { 55 | // render subsystems 56 | message.on_gui(); 57 | if (show_window) 58 | { 59 | launcher.on_gui(); 60 | window.on_gui(); 61 | } 62 | } 63 | 64 | public static void open(Action refresh) 65 | { 66 | window.open(refresh); 67 | } 68 | 69 | static Message message; 70 | static Launcher launcher; 71 | static Window window; 72 | } 73 | 74 | 75 | } // KERBALISM 76 | 77 | -------------------------------------------------------------------------------- /GameData/Kerbalism/Shaders/point_sprite.shader: -------------------------------------------------------------------------------- 1 | // render a textured point sprite 2 | // - POINT_TEXTURE: 2d texture to use 3 | // - POINT_COLOR: multiply texture sample with this 4 | // - POINT_SIZE: point size on screen, in pixels 5 | 6 | 7 | Shader "Custom/PointSprite" 8 | { 9 | Properties 10 | { 11 | POINT_TEXTURE ("Point texture", 2D) = "white" {} 12 | POINT_COLOR ("Point color", Color) = (1.0,1.0,1.0,1.0) 13 | POINT_SIZE ("Point size in pixels", Float) = 16.0 14 | } 15 | SubShader 16 | { 17 | Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } 18 | Blend SrcAlpha One 19 | ColorMask RGB 20 | Cull Off Lighting Off ZWrite Off 21 | 22 | Pass 23 | { 24 | CGPROGRAM 25 | #pragma vertex vert 26 | #pragma fragment frag 27 | #pragma target 2.5 28 | 29 | sampler2D POINT_TEXTURE; 30 | fixed4 POINT_COLOR; 31 | float POINT_SIZE; 32 | 33 | struct v2f 34 | { 35 | float size : PSIZE; 36 | float inv_size : TEXCOORD0; 37 | float2 screen_coords : TEXCOORD1; 38 | }; 39 | 40 | v2f vert(float4 in_pos : POSITION, out float4 pos : SV_POSITION) 41 | { 42 | // output clip-space vertex position 43 | pos = mul(UNITY_MATRIX_MVP, in_pos); 44 | 45 | // pass down point size and inverse of point size 46 | v2f o; 47 | o.size = POINT_SIZE; 48 | o.inv_size = 1.0 / o.size; 49 | 50 | // calculate and pass down screen-space position of point center 51 | o.screen_coords = (pos.xy / pos.w) * 0.5 + 0.5; 52 | o.screen_coords *= _ScreenParams.xy; 53 | o.screen_coords.y = _ScreenParams.y - o.screen_coords.y; 54 | return o; 55 | } 56 | 57 | half4 frag(v2f i, UNITY_VPOS_TYPE screen_pos : VPOS) : COLOR 58 | { 59 | // calculate txcoords 60 | float s = 0.5 + (screen_pos.x - i.screen_coords.x) * i.inv_size; 61 | float t = 0.5 - (screen_pos.y - i.screen_coords.y) * i.inv_size; 62 | 63 | // sample texture and multiply by specified color 64 | return tex2D(POINT_TEXTURE, float2(s, t)) * POINT_COLOR; 65 | } 66 | ENDCG 67 | } 68 | } 69 | } -------------------------------------------------------------------------------- /src/Automation/Devices/Drill.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | 6 | namespace KERBALISM { 7 | 8 | 9 | public sealed class DrillDevice : Device 10 | { 11 | public DrillDevice(ModuleResourceHarvester drill) 12 | { 13 | this.drill = drill; 14 | } 15 | 16 | public override string name() 17 | { 18 | return "drill"; 19 | } 20 | 21 | public override uint part() 22 | { 23 | return drill.part.flightID; 24 | } 25 | 26 | public override string info() 27 | { 28 | if (drill.AlwaysActive) return "always on"; 29 | return drill.IsActivated ? "on" : "off"; 30 | } 31 | 32 | public override void ctrl(bool value) 33 | { 34 | if (drill.AlwaysActive) return; 35 | if (value) drill.StartResourceConverter(); 36 | else drill.StopResourceConverter(); 37 | } 38 | 39 | public override void toggle() 40 | { 41 | ctrl(!drill.IsActivated); 42 | } 43 | 44 | ModuleResourceHarvester drill; 45 | } 46 | 47 | 48 | public sealed class ProtoDrillDevice : Device 49 | { 50 | public ProtoDrillDevice(ProtoPartModuleSnapshot drill, ModuleResourceHarvester prefab, uint part_id) 51 | { 52 | this.drill = drill; 53 | this.prefab = prefab; 54 | this.part_id = part_id; 55 | } 56 | 57 | public override string name() 58 | { 59 | return "drill"; 60 | } 61 | 62 | public override uint part() 63 | { 64 | return part_id; 65 | } 66 | 67 | public override string info() 68 | { 69 | if (prefab.AlwaysActive) return "always on"; 70 | bool is_on = Lib.Proto.GetBool(drill, "IsActivated"); 71 | return is_on ? "on" : "off"; 72 | } 73 | 74 | public override void ctrl(bool value) 75 | { 76 | if (prefab.AlwaysActive) return; 77 | Lib.Proto.Set(drill, "IsActivated", value); 78 | } 79 | 80 | public override void toggle() 81 | { 82 | ctrl(!Lib.Proto.GetBool(drill, "IsActivated")); 83 | } 84 | 85 | ProtoPartModuleSnapshot drill; 86 | ModuleResourceHarvester prefab; 87 | uint part_id; 88 | } 89 | 90 | 91 | } // KERBALISM -------------------------------------------------------------------------------- /src/Automation/Devices/Generator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | 6 | namespace KERBALISM { 7 | 8 | 9 | public sealed class GeneratorDevice : Device 10 | { 11 | public GeneratorDevice(ModuleGenerator generator) 12 | { 13 | this.generator = generator; 14 | } 15 | 16 | public override string name() 17 | { 18 | return "generator"; 19 | } 20 | 21 | public override uint part() 22 | { 23 | return generator.part.flightID; 24 | } 25 | 26 | public override string info() 27 | { 28 | return generator.isAlwaysActive ? "always on" : generator.generatorIsActive ? "on" : "off"; 29 | } 30 | 31 | public override void ctrl(bool value) 32 | { 33 | if (generator.isAlwaysActive) return; 34 | if (value) generator.Activate(); 35 | else generator.Shutdown(); 36 | } 37 | 38 | public override void toggle() 39 | { 40 | ctrl(!generator.generatorIsActive); 41 | } 42 | 43 | ModuleGenerator generator; 44 | } 45 | 46 | 47 | public sealed class ProtoGeneratorDevice : Device 48 | { 49 | public ProtoGeneratorDevice(ProtoPartModuleSnapshot generator, ModuleGenerator prefab, uint part_id) 50 | { 51 | this.generator = generator; 52 | this.prefab = prefab; 53 | this.part_id = part_id; 54 | } 55 | 56 | public override string name() 57 | { 58 | return "generator"; 59 | } 60 | 61 | public override uint part() 62 | { 63 | return part_id; 64 | } 65 | 66 | public override string info() 67 | { 68 | if (prefab.isAlwaysActive) return "always on"; 69 | bool is_on = Lib.Proto.GetBool(generator, "generatorIsActive"); 70 | return is_on ? "on" : "off"; 71 | } 72 | 73 | public override void ctrl(bool value) 74 | { 75 | if (prefab.isAlwaysActive) return; 76 | Lib.Proto.Set(generator, "generatorIsActive", value); 77 | } 78 | 79 | public override void toggle() 80 | { 81 | ctrl(!Lib.Proto.GetBool(generator, "generatorIsActive")); 82 | } 83 | 84 | ProtoPartModuleSnapshot generator; 85 | ModuleGenerator prefab; 86 | uint part_id; 87 | } 88 | 89 | 90 | } // KERBALISM -------------------------------------------------------------------------------- /src/Automation/Devices/Converter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | 6 | namespace KERBALISM { 7 | 8 | 9 | public sealed class ConverterDevice : Device 10 | { 11 | public ConverterDevice(ModuleResourceConverter converter) 12 | { 13 | this.converter = converter; 14 | } 15 | 16 | public override string name() 17 | { 18 | return "converter"; 19 | } 20 | 21 | public override uint part() 22 | { 23 | return converter.part.flightID; 24 | } 25 | 26 | public override string info() 27 | { 28 | return converter.AlwaysActive ? "always on" : converter.IsActivated ? "on" : "off"; 29 | } 30 | 31 | public override void ctrl(bool value) 32 | { 33 | if (converter.AlwaysActive) return; 34 | if (value) converter.StartResourceConverter(); 35 | else converter.StopResourceConverter(); 36 | } 37 | 38 | public override void toggle() 39 | { 40 | ctrl(!converter.IsActivated); 41 | } 42 | 43 | ModuleResourceConverter converter; 44 | } 45 | 46 | 47 | public sealed class ProtoConverterDevice : Device 48 | { 49 | public ProtoConverterDevice(ProtoPartModuleSnapshot converter, ModuleResourceConverter prefab, uint part_id) 50 | { 51 | this.converter = converter; 52 | this.prefab = prefab; 53 | this.part_id = part_id; 54 | } 55 | 56 | public override string name() 57 | { 58 | return "converter"; 59 | } 60 | 61 | public override uint part() 62 | { 63 | return part_id; 64 | } 65 | 66 | public override string info() 67 | { 68 | if (prefab.AlwaysActive) return "always on"; 69 | bool is_on = Lib.Proto.GetBool(converter, "IsActivated"); 70 | return is_on ? "on" : "off"; 71 | } 72 | 73 | public override void ctrl(bool value) 74 | { 75 | if (prefab.AlwaysActive) return; 76 | Lib.Proto.Set(converter, "IsActivated", value); 77 | } 78 | 79 | public override void toggle() 80 | { 81 | ctrl(!Lib.Proto.GetBool(converter, "IsActivated")); 82 | } 83 | 84 | ProtoPartModuleSnapshot converter; 85 | ModuleResourceConverter prefab; 86 | uint part_id; 87 | } 88 | 89 | 90 | } // KERBALISM -------------------------------------------------------------------------------- /src/Automation/Devices/Process.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | 6 | namespace KERBALISM { 7 | 8 | 9 | public sealed class ProcessDevice : Device 10 | { 11 | public ProcessDevice(ProcessController process_ctrl) 12 | { 13 | this.process_ctrl = process_ctrl; 14 | } 15 | 16 | public override string name() 17 | { 18 | return process_ctrl.title.ToLower(); 19 | } 20 | 21 | public override uint part() 22 | { 23 | return process_ctrl.part.flightID; 24 | } 25 | 26 | public override string info() 27 | { 28 | return process_ctrl.running 29 | ? "running" 30 | : "stopped"; 31 | } 32 | 33 | public override void ctrl(bool value) 34 | { 35 | if (!process_ctrl.toggle) return; 36 | process_ctrl.running = value; 37 | } 38 | 39 | public override void toggle() 40 | { 41 | ctrl(!process_ctrl.running); 42 | } 43 | 44 | ProcessController process_ctrl; 45 | } 46 | 47 | 48 | public sealed class ProtoProcessDevice : Device 49 | { 50 | public ProtoProcessDevice(ProtoPartModuleSnapshot process_ctrl, ProcessController prefab, uint part_id) 51 | { 52 | this.process_ctrl = process_ctrl; 53 | this.prefab = prefab; 54 | this.part_id = part_id; 55 | } 56 | 57 | public override string name() 58 | { 59 | return prefab.title.ToLower(); 60 | } 61 | 62 | public override uint part() 63 | { 64 | return part_id; 65 | } 66 | 67 | public override string info() 68 | { 69 | return Lib.Proto.GetBool(process_ctrl, "running") 70 | ? "running" 71 | : "stopped"; 72 | } 73 | 74 | public override void ctrl(bool value) 75 | { 76 | if (!prefab.toggle) return; 77 | Lib.Proto.Set(process_ctrl, "running", value); 78 | ProtoPartSnapshot part_prefab = FlightGlobals.FindProtoPartByID(part_id); 79 | part_prefab.resources.Find(k => k.resourceName == prefab.resource).flowState = value; 80 | } 81 | 82 | public override void toggle() 83 | { 84 | ctrl(!Lib.Proto.GetBool(process_ctrl, "running")); 85 | } 86 | 87 | ProtoPartModuleSnapshot process_ctrl; 88 | ProcessController prefab; 89 | uint part_id; 90 | } 91 | 92 | 93 | } // KERBALISM 94 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /src/Automation/Devices/Scanner.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | 6 | namespace KERBALISM { 7 | 8 | 9 | public sealed class ScannerDevice : Device 10 | { 11 | public ScannerDevice(PartModule scanner) 12 | { 13 | this.scanner = scanner; 14 | } 15 | 16 | public override string name() 17 | { 18 | return "scanner"; 19 | } 20 | 21 | public override uint part() 22 | { 23 | return scanner.part.flightID; 24 | } 25 | 26 | public override string info() 27 | { 28 | return Lib.ReflectionValue(scanner, "scanning") 29 | ? "enabled" 30 | : "disabled"; 31 | } 32 | 33 | public override void ctrl(bool value) 34 | { 35 | bool scanning = Lib.ReflectionValue(scanner, "scanning"); 36 | if (scanning && !value) scanner.Events["stopScan"].Invoke(); 37 | else if (!scanning && value) scanner.Events["startScan"].Invoke(); 38 | } 39 | 40 | public override void toggle() 41 | { 42 | ctrl(!Lib.ReflectionValue(scanner, "scanning")); 43 | } 44 | 45 | PartModule scanner; 46 | } 47 | 48 | 49 | public sealed class ProtoScannerDevice : Device 50 | { 51 | public ProtoScannerDevice(ProtoPartModuleSnapshot scanner, Part part_prefab, Vessel v, uint part_id) 52 | { 53 | this.scanner = scanner; 54 | this.part_prefab = part_prefab; 55 | this.vessel = v; 56 | this.part_id = part_id; 57 | } 58 | 59 | public override string name() 60 | { 61 | return "scanner"; 62 | } 63 | 64 | public override uint part() 65 | { 66 | return part_id; 67 | } 68 | 69 | public override string info() 70 | { 71 | return Lib.Proto.GetBool(scanner, "scanning") 72 | ? "enabled" 73 | : "disabled"; 74 | } 75 | 76 | public override void ctrl(bool value) 77 | { 78 | bool scanning = Lib.Proto.GetBool(scanner, "scanning"); 79 | if (scanning && !value) SCANsat.stopScanner(vessel, scanner, part_prefab); 80 | else if (!scanning && value) SCANsat.resumeScanner(vessel, scanner, part_prefab); 81 | } 82 | 83 | public override void toggle() 84 | { 85 | ctrl(!Lib.Proto.GetBool(scanner, "scanning")); 86 | } 87 | 88 | ProtoPartModuleSnapshot scanner; 89 | Part part_prefab; 90 | Vessel vessel; 91 | uint part_id; 92 | } 93 | 94 | 95 | } // KERBALISM 96 | 97 | -------------------------------------------------------------------------------- /src/Contracts/CrossBelt.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Contracts; 3 | 4 | 5 | namespace KERBALISM.CONTRACTS { 6 | 7 | 8 | // Cross radiation belt 9 | public sealed class CrossBelt : Contract 10 | { 11 | protected override bool Generate() 12 | { 13 | // never expire 14 | deadlineType = DeadlineType.None; 15 | expiryType = DeadlineType.None; 16 | 17 | // set reward 18 | SetScience(10.0f); 19 | SetReputation(10.0f, 5.0f); 20 | SetFunds(5000.0f, 25000.0f); 21 | 22 | // add parameters 23 | AddParameter(new CrossBeltCondition()); 24 | return true; 25 | } 26 | 27 | protected override string GetHashString() 28 | { 29 | return "CrossBelt"; 30 | } 31 | 32 | protected override string GetTitle() 33 | { 34 | return "Cross the radiation belt"; 35 | } 36 | 37 | protected override string GetDescription() 38 | { 39 | return "A brilliant scientist predicted two belts of super-charged particles surrounding the planet. " 40 | + "Now we need to confirm their existance and find out how deadly they really are."; 41 | } 42 | 43 | protected override string MessageCompleted() 44 | { 45 | return "The mission confirmed the presence of two radiation belts around the planet. " 46 | + "Early data suggest extreme levels of radiation."; 47 | } 48 | 49 | public override bool MeetRequirements() 50 | { 51 | // stop checking when requirements are met 52 | if (!meet_requirements) 53 | { 54 | ProgressTracking progress = ProgressTracking.Instance; 55 | 56 | meet_requirements = 57 | Features.Radiation // radiation is enabled 58 | && progress != null && progress.reachSpace.IsComplete // first suborbit flight completed 59 | && !DB.landmarks.belt_crossing; // belt never crossed before 60 | } 61 | return meet_requirements; 62 | } 63 | 64 | bool meet_requirements; 65 | } 66 | 67 | 68 | public sealed class CrossBeltCondition : ContractParameter 69 | { 70 | protected override string GetHashString() 71 | { 72 | return "CrossBeltCondition"; 73 | } 74 | 75 | protected override string GetTitle() 76 | { 77 | return "Cross the radiation belt"; 78 | } 79 | 80 | protected override void OnUpdate() 81 | { 82 | if (DB.landmarks.belt_crossing) SetComplete(); 83 | } 84 | } 85 | 86 | 87 | } // KERBALISM.CONTRACTS 88 | 89 | -------------------------------------------------------------------------------- /GameData/Kerbalism/Support/RSS.cfg: -------------------------------------------------------------------------------- 1 | // ============================================================================ 2 | // Radiation environments for RSS bodies 3 | // ============================================================================ 4 | 5 | +RadiationBody[Moho]:NEEDS[RealSolarSystem] { @name = Mercury } 6 | +RadiationBody[Eve]:NEEDS[RealSolarSystem] { @name = Venus } 7 | +RadiationBody[Kerbin]:NEEDS[RealSolarSystem] { @name = Earth } 8 | +RadiationBody[Duna]:NEEDS[RealSolarSystem] { @name = Mars } 9 | +RadiationBody[Jool]:NEEDS[RealSolarSystem] { @name = Jupiter } 10 | 11 | RadiationBody:NEEDS[RealSolarSystem] 12 | { 13 | name = Saturn 14 | radiation_model = giant 15 | radiation_inner = 150 16 | radiation_outer = 5 17 | radiation_pause = -0.011 18 | } 19 | 20 | RadiationBody:NEEDS[RealSolarSystem] 21 | { 22 | name = Uranus 23 | radiation_model = giant 24 | radiation_inner = 75 25 | radiation_outer = 4 26 | radiation_pause = -0.008 27 | } 28 | 29 | RadiationBody:NEEDS[RealSolarSystem] 30 | { 31 | name = Neptune 32 | radiation_model = giant 33 | radiation_inner = 50 34 | radiation_outer = 3.5 35 | radiation_pause = -0.007 36 | } 37 | 38 | RadiationBody:NEEDS[RealSolarSystem] 39 | { 40 | name = Pluto 41 | radiation_model = irregular 42 | radiation_pause = -0.002 43 | } 44 | 45 | RadiationBody:NEEDS[RealSolarSystem] 46 | { 47 | name = Callisto 48 | radiation_model = irregular 49 | radiation_pause = -0.003 50 | } 51 | 52 | RadiationBody:NEEDS[RealSolarSystem] 53 | { 54 | name = Io 55 | radiation_model = surface 56 | radiation_pause = 0.041 // surface radiation 57 | } 58 | 59 | RadiationBody:NEEDS[RealSolarSystem] 60 | { 61 | name = Titan 62 | radiation_model = ionosphere 63 | radiation_pause = -0.004 64 | } 65 | 66 | 67 | // ============================================================================ 68 | // Tweak heliopause 69 | // ============================================================================ 70 | 71 | @RadiationModel[heliopause]:NEEDS[RealSolarSystem] 72 | { 73 | @pause_radius = 16000.0 74 | @pause_quality = 0.01 75 | } 76 | 77 | 78 | // ============================================================================ 79 | // Tweak antennas 80 | // ============================================================================ 81 | 82 | @PART[*]:HAS[@MODULE[Antenna]]:NEEDS[RealSolarSystem,FeatureSignal]:FINAL 83 | { 84 | @MODULE[Antenna]:HAS[#type[low_gain]] 85 | { 86 | @dist *= 10.0 87 | } 88 | 89 | @MODULE[Antenna]:HAS[#type[high_gain]] 90 | { 91 | @dist *= 16.0 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /src/Contracts/SpaceHarvest.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Contracts; 4 | 5 | 6 | namespace KERBALISM.CONTRACTS { 7 | 8 | 9 | // First space harvest 10 | public sealed class SpaceHarvest : Contract 11 | { 12 | protected override bool Generate() 13 | { 14 | // never expire 15 | deadlineType = DeadlineType.None; 16 | expiryType = DeadlineType.None; 17 | 18 | // set reward 19 | SetScience(25.0f); 20 | SetReputation(30.0f, 10.0f); 21 | SetFunds(25000.0f, 100000.0f); 22 | 23 | // add parameters 24 | AddParameter(new SpaceHarvestCondition()); 25 | return true; 26 | } 27 | 28 | protected override string GetHashString() 29 | { 30 | return "SpaceHarvest"; 31 | } 32 | 33 | protected override string GetTitle() 34 | { 35 | return "Harvest food in space"; 36 | } 37 | 38 | protected override string GetDescription() 39 | { 40 | return "Now that we got the technology to grow food in space, " 41 | + "we should probably test it. Harvest food from a greenhouse in space."; 42 | } 43 | 44 | protected override string MessageCompleted() 45 | { 46 | return "We harvested food in space, and our scientists says it is actually delicious."; 47 | } 48 | 49 | public override bool MeetRequirements() 50 | { 51 | // stop checking when requirements are met 52 | if (!meet_requirements) 53 | { 54 | var greenhouse = PartLoader.getPartInfoByName("kerbalism-greenhouse"); 55 | 56 | meet_requirements = 57 | greenhouse != null // greenhouse part is present 58 | && greenhouse.tags.Contains("_kerbalism") // greenhouse part is enabled 59 | && ResearchAndDevelopment.PartTechAvailable(greenhouse) // greenhouse part unlocked 60 | && !DB.landmarks.space_harvest; // greenhouse never harvested in space before 61 | } 62 | return meet_requirements; 63 | } 64 | 65 | bool meet_requirements; 66 | } 67 | 68 | 69 | public sealed class SpaceHarvestCondition : ContractParameter 70 | { 71 | protected override string GetHashString() 72 | { 73 | return "SpaceHarvestCondition"; 74 | } 75 | 76 | protected override string GetTitle() 77 | { 78 | return "Harvest food in space"; 79 | } 80 | 81 | protected override void OnUpdate() 82 | { 83 | if (DB.landmarks.space_harvest) SetComplete(); 84 | } 85 | } 86 | 87 | 88 | } // KERBALISM 89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /src/Contracts/SpaceAnalysis.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Contracts; 3 | 4 | 5 | namespace KERBALISM.CONTRACTS { 6 | 7 | 8 | // First sample analysis 9 | public sealed class SpaceAnalysis : Contract 10 | { 11 | protected override bool Generate() 12 | { 13 | // never expire 14 | deadlineType = DeadlineType.None; 15 | expiryType = DeadlineType.None; 16 | 17 | // set reward 18 | SetScience(25.0f); 19 | SetReputation(30.0f, 10.0f); 20 | SetFunds(25000.0f, 100000.0f); 21 | 22 | // add parameters 23 | AddParameter(new SpaceAnalysisCondition()); 24 | return true; 25 | } 26 | 27 | protected override string GetHashString() 28 | { 29 | return "SpaceAnalysis"; 30 | } 31 | 32 | protected override string GetTitle() 33 | { 34 | return "Analyze samples in space"; 35 | } 36 | 37 | protected override string GetDescription() 38 | { 39 | return "The Laboratory can analyze samples in space, in theory. " 40 | + "We should check if this actually work by and analyzing some samples in space."; 41 | } 42 | 43 | protected override string MessageCompleted() 44 | { 45 | return "Our Laboratory analysis was good, perhaps even better than the " 46 | + "ones done usually by our scientists at mission control. But don't tell'em."; 47 | } 48 | 49 | public override bool MeetRequirements() 50 | { 51 | // stop checking when requirements are met 52 | if (!meet_requirements) 53 | { 54 | var lab = PartLoader.getPartInfoByName("Large_Crewed_Lab"); 55 | 56 | meet_requirements = 57 | Features.Science // science is enabled 58 | && lab != null // lab part is present 59 | && ResearchAndDevelopment.PartTechAvailable(lab) // lab part is unlocked 60 | && !DB.landmarks.space_analysis; // never analyzed samples in space before 61 | } 62 | return meet_requirements; 63 | } 64 | 65 | bool meet_requirements; 66 | } 67 | 68 | 69 | public sealed class SpaceAnalysisCondition : ContractParameter 70 | { 71 | protected override string GetHashString() 72 | { 73 | return "SpaceAnalysisCondition"; 74 | } 75 | 76 | protected override string GetTitle() 77 | { 78 | return "Analyze samples in space"; 79 | } 80 | 81 | protected override void OnUpdate() 82 | { 83 | if (DB.landmarks.space_analysis) SetComplete(); 84 | } 85 | } 86 | 87 | 88 | } // KERBALISM 89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /GameData/Kerbalism/Support/ContractConfigurator.cfg: -------------------------------------------------------------------------------- 1 | // Gotmachine 2 | @CONTRACT_TYPE[*]:NEEDS[ContractConfigurator]:FOR[Kerbalism]:FINAL 3 | { 4 | @PARAMETER[*]:HAS[#partModule[ModuleScienceLab]]:NEEDS[FeatureScience] 5 | { 6 | @partModule = Laboratory 7 | } 8 | @PARAMETER[*]:HAS[#partModule[ModuleDataTransmitter]]:NEEDS[FeatureSignal] 9 | { 10 | @partModule = Antenna 11 | } 12 | @PARAMETER[*] 13 | { 14 | @PARAMETER[*]:HAS[#partModule[ModuleScienceLab]]:NEEDS[FeatureScience] 15 | { 16 | @partModule = Laboratory 17 | } 18 | @PARAMETER[*]:HAS[#partModule[ModuleDataTransmitter]]:NEEDS[FeatureSignal] 19 | { 20 | @partModule = Antenna 21 | } 22 | @PARAMETER[*] 23 | { 24 | @PARAMETER[*]:HAS[#partModule[ModuleScienceLab]]:NEEDS[FeatureScience] 25 | { 26 | @partModule = Laboratory 27 | } 28 | @PARAMETER[*]:HAS[#partModule[ModuleDataTransmitter]]:NEEDS[FeatureSignal] 29 | { 30 | @partModule = Antenna 31 | } 32 | @PARAMETER[*] 33 | { 34 | @PARAMETER[*]:HAS[#partModule[ModuleScienceLab]]:NEEDS[FeatureScience] 35 | { 36 | @partModule = Laboratory 37 | } 38 | @PARAMETER[*]:HAS[#partModule[ModuleDataTransmitter]]:NEEDS[FeatureSignal] 39 | { 40 | @partModule = Antenna 41 | } 42 | } 43 | } 44 | } 45 | @REQUIREMENT[*]:HAS[#partModule[ModuleScienceLab]]:NEEDS[FeatureScience] 46 | { 47 | @partModule = Laboratory 48 | } 49 | @REQUIREMENT[*]:HAS[#partModule[ModuleDataTransmitter]]:NEEDS[FeatureSignal] 50 | { 51 | @partModule = Antenna 52 | } 53 | @REQUIREMENT[*] 54 | { 55 | @REQUIREMENT[*]:HAS[#partModule[ModuleScienceLab]]:NEEDS[FeatureScience] 56 | { 57 | @partModule = Laboratory 58 | } 59 | @REQUIREMENT[*]:HAS[#partModule[ModuleDataTransmitter]]:NEEDS[FeatureSignal] 60 | { 61 | @partModule = Antenna 62 | } 63 | @REQUIREMENT[*] 64 | { 65 | @REQUIREMENT[*]:HAS[#partModule[ModuleScienceLab]]:NEEDS[FeatureScience] 66 | { 67 | @partModule = Laboratory 68 | } 69 | @REQUIREMENT[*]:HAS[#partModule[ModuleDataTransmitter]]:NEEDS[FeatureSignal] 70 | { 71 | @partModule = Antenna 72 | } 73 | @REQUIREMENT[*] 74 | { 75 | @REQUIREMENT[*]:HAS[#partModule[ModuleScienceLab]]:NEEDS[FeatureScience] 76 | { 77 | @partModule = Laboratory 78 | } 79 | @REQUIREMENT[*]:HAS[#partModule[ModuleDataTransmitter]]:NEEDS[FeatureSignal] 80 | { 81 | @partModule = Antenna 82 | } 83 | } 84 | } 85 | } 86 | } -------------------------------------------------------------------------------- /src/Automation/Devices/Experiment.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | 6 | namespace KERBALISM { 7 | 8 | 9 | public sealed class ExperimentDevice : Device 10 | { 11 | public ExperimentDevice(Experiment exp) 12 | { 13 | this.exp = exp; 14 | this.exp_name = Lib.SpacesOnCaps(ResearchAndDevelopment.GetExperiment(exp.experiment).experimentTitle).ToLower().Replace("e v a", "eva"); 15 | } 16 | 17 | public override string name() 18 | { 19 | return exp_name; 20 | } 21 | 22 | public override uint part() 23 | { 24 | return exp.part.flightID; 25 | } 26 | 27 | public override string info() 28 | { 29 | return !exp.recording 30 | ? "stopped" 31 | : exp.issue.Length == 0 32 | ? "recording" 33 | : Lib.BuildString("", exp.issue, ""); 34 | } 35 | 36 | public override void ctrl(bool value) 37 | { 38 | if (value != exp.recording) exp.Toggle(); 39 | } 40 | 41 | public override void toggle() 42 | { 43 | ctrl(!exp.recording); 44 | } 45 | 46 | Experiment exp; 47 | string exp_name; 48 | } 49 | 50 | 51 | public sealed class ProtoExperimentDevice : Device 52 | { 53 | public ProtoExperimentDevice(ProtoPartModuleSnapshot exp, Experiment prefab, uint part_id) 54 | { 55 | this.exp = exp; 56 | this.prefab = prefab; 57 | this.part_id = part_id; 58 | this.exp_name = Lib.SpacesOnCaps(ResearchAndDevelopment.GetExperiment(prefab.experiment).experimentTitle).ToLower().Replace("e v a", "eva"); 59 | } 60 | 61 | public override string name() 62 | { 63 | return exp_name; 64 | } 65 | 66 | public override uint part() 67 | { 68 | return part_id; 69 | } 70 | 71 | public override string info() 72 | { 73 | bool recording = Lib.Proto.GetBool(exp, "recording"); 74 | string issue = Lib.Proto.GetString(exp, "issue"); 75 | return !recording 76 | ? "stopped" 77 | : issue.Length == 0 78 | ? "recording" 79 | : Lib.BuildString("", issue, ""); 80 | } 81 | 82 | public override void ctrl(bool value) 83 | { 84 | Lib.Proto.Set(exp, "recording", value); 85 | } 86 | 87 | public override void toggle() 88 | { 89 | ctrl(!Lib.Proto.GetBool(exp, "recording")); 90 | } 91 | 92 | ProtoPartModuleSnapshot exp; 93 | Experiment prefab; 94 | uint part_id; 95 | string exp_name; 96 | } 97 | 98 | 99 | } // KERBALISM 100 | 101 | -------------------------------------------------------------------------------- /src/Utility/Highlighter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | 6 | namespace KERBALISM { 7 | 8 | 9 | public static class Highlighter 10 | { 11 | public static void init() 12 | { 13 | // initialize data 14 | parts = new Dictionary(); 15 | prev_parts = new Dictionary(); 16 | } 17 | 18 | 19 | public static void update() 20 | { 21 | // for each part from previous frame 22 | foreach(var prev_p in prev_parts) 23 | { 24 | // get the part 25 | Part prev_part = FlightGlobals.FindPartByID(prev_p.Key); 26 | 27 | // if it still exist 28 | if (prev_part != null) 29 | { 30 | // note: when solar panels break (the stock mechanic), this throw exceptions inside KSP 31 | try 32 | { 33 | // reset highlight color 34 | prev_part.SetHighlightDefault(); 35 | 36 | // the new color change module overwrite our highlights and was disabled, re-enable it 37 | prev_part.FindModulesImplementing().ForEach(k => k.enabled = true); 38 | } 39 | catch {} 40 | } 41 | } 42 | 43 | // for each part in this farme 44 | foreach(var p in parts) 45 | { 46 | // get the part 47 | Part part = FlightGlobals.FindPartByID(p.Key); 48 | 49 | // if it still exist 50 | if (part != null) 51 | { 52 | // note: when solar panels break (the stock mechanic), this throw exceptions inside KSP 53 | try 54 | { 55 | // set highlight color 56 | part.SetHighlightDefault(); 57 | part.SetHighlightType(Part.HighlightType.AlwaysOn); 58 | part.SetHighlightColor((Color)p.Value); 59 | part.SetHighlight(true, false); 60 | 61 | // the new color change module seem to overwrite our highlights, disable it 62 | part.FindModulesImplementing().ForEach(k => k.enabled = false); 63 | } 64 | catch {} 65 | } 66 | } 67 | 68 | // clear previous parts, and remember current parts as previous 69 | Lib.Swap(ref prev_parts, ref parts); 70 | parts.Clear(); 71 | } 72 | 73 | 74 | public static void set(uint flight_id, Color clr) 75 | { 76 | if (parts.ContainsKey(flight_id)) parts.Remove(flight_id); 77 | parts.Add(flight_id, clr); 78 | } 79 | 80 | 81 | // set of parts to highlight 82 | static Dictionary parts; 83 | 84 | // set of parts highlighted in previous frame 85 | static Dictionary prev_parts; 86 | } 87 | 88 | 89 | } // KERBALISM 90 | 91 | -------------------------------------------------------------------------------- /src/Automation/Devices/Antenna.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | 6 | namespace KERBALISM { 7 | 8 | 9 | public sealed class AntennaDevice : Device 10 | { 11 | public AntennaDevice(Antenna antenna) 12 | { 13 | this.antenna = antenna; 14 | this.animator = antenna.part.FindModuleImplementing(); 15 | } 16 | 17 | public override string name() 18 | { 19 | return "antenna"; 20 | } 21 | 22 | public override uint part() 23 | { 24 | return antenna.part.flightID; 25 | } 26 | 27 | public override string info() 28 | { 29 | return animator == null 30 | ? "fixed" 31 | : antenna.extended 32 | ? "deployed" 33 | : "retracted"; 34 | } 35 | 36 | public override void ctrl(bool value) 37 | { 38 | if (animator != null) 39 | { 40 | if (!antenna.extended && value) animator.DeployModule(); 41 | else if (antenna.extended && !value) animator.RetractModule(); 42 | } 43 | } 44 | 45 | public override void toggle() 46 | { 47 | if (animator != null) 48 | { 49 | ctrl(!antenna.extended); 50 | } 51 | } 52 | 53 | Antenna antenna; 54 | ModuleAnimationGroup animator; 55 | } 56 | 57 | 58 | public sealed class ProtoAntennaDevice : Device 59 | { 60 | public ProtoAntennaDevice(ProtoPartModuleSnapshot antenna, uint part_id) 61 | { 62 | this.antenna = antenna; 63 | this.animator = FlightGlobals.FindProtoPartByID(part_id).FindModule("ModuleAnimationGroup"); 64 | this.part_id = part_id; 65 | 66 | } 67 | 68 | public override string name() 69 | { 70 | return "antenna"; 71 | } 72 | 73 | public override uint part() 74 | { 75 | return part_id; 76 | } 77 | 78 | public override string info() 79 | { 80 | return animator == null 81 | ? "fixed" 82 | : Lib.Proto.GetBool(antenna, "extended") 83 | ? "deployed" 84 | : "retracted"; 85 | } 86 | 87 | public override void ctrl(bool value) 88 | { 89 | if (animator != null) 90 | { 91 | Lib.Proto.Set(antenna, "extended", value); 92 | Lib.Proto.Set(animator, "isDeployed", value); 93 | } 94 | } 95 | 96 | public override void toggle() 97 | { 98 | if (animator != null) 99 | { 100 | ctrl(!Lib.Proto.GetBool(antenna, "extended")); 101 | } 102 | } 103 | 104 | ProtoPartModuleSnapshot antenna; 105 | ProtoPartModuleSnapshot animator; 106 | uint part_id; 107 | } 108 | 109 | 110 | } // KERBALISM 111 | 112 | 113 | 114 | 115 | 116 | -------------------------------------------------------------------------------- /src/Renderer/ParticleRenderer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | 6 | namespace KERBALISM { 7 | 8 | 9 | // a simple particle renderer 10 | public static class ParticleRenderer 11 | { 12 | // pseudo-ctor 13 | public static void init() 14 | { 15 | // load shader 16 | mat = Lib.GetShader("FullPointParticle"); 17 | 18 | // create mesh 19 | mesh = new Mesh(); 20 | mesh.MarkDynamic(); 21 | } 22 | 23 | 24 | // commit a particle to the renderer 25 | // note: this function may trigger actual rendering 26 | public static void commit(Vector3 p, float size, Color32 color) 27 | { 28 | points[point_index].Set(p.x, p.y, p.z); 29 | sizes[point_index].Set(size, 0.0f); 30 | colors[point_index] = color; 31 | indices.Add(point_index); 32 | ++point_index; 33 | 34 | if (point_index == max_particles) 35 | { 36 | // update mesh data 37 | mesh.vertices = points; 38 | mesh.uv = sizes; 39 | mesh.colors32 = colors; 40 | mesh.SetIndices(indices.ToArray(), MeshTopology.Points, 0); 41 | 42 | // enable material 43 | mat.SetPass(0); 44 | 45 | // render mesh 46 | Graphics.DrawMeshNow(mesh, Matrix4x4.identity); 47 | 48 | // cleanup 49 | indices.Clear(); 50 | point_index = 0; 51 | } 52 | } 53 | 54 | 55 | // render all particles 56 | // note: this only render all particles not already rendered during commit 57 | public static void render() 58 | { 59 | if (point_index > 0) 60 | { 61 | // update mesh data 62 | mesh.vertices = points; 63 | mesh.uv = sizes; 64 | mesh.colors32 = colors; 65 | mesh.SetIndices(indices.ToArray(), MeshTopology.Points, 0); 66 | 67 | // enable material 68 | mat.SetPass(0); 69 | 70 | // render mesh 71 | Graphics.DrawMeshNow(mesh, Matrix4x4.identity); 72 | 73 | // cleanup 74 | indices.Clear(); 75 | point_index = 0; 76 | } 77 | } 78 | 79 | 80 | 81 | const int max_particles = 64000; // max particles per-mesh 82 | static Vector3[] points = new Vector3[max_particles]; // mesh data: position 83 | static Vector2[] sizes = new Vector2[max_particles]; // mesh data: size in pixels 84 | static Color32[] colors = new Color32[max_particles]; // mesh data: 32bit color 85 | static List indices = new List(max_particles); // mesh data: indices 86 | static Mesh mesh; // mesh used as set of VBA 87 | static Material mat; // material used 88 | static int point_index; // index of next point in the arrays 89 | } 90 | 91 | 92 | } // KERBALISM -------------------------------------------------------------------------------- /src/Contracts/CrossHeliopause.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Contracts; 4 | 5 | 6 | namespace KERBALISM.CONTRACTS { 7 | 8 | 9 | // Cross the heliopause 10 | public sealed class CrossHeliopause : Contract 11 | { 12 | protected override bool Generate() 13 | { 14 | // never expire 15 | deadlineType = DeadlineType.None; 16 | expiryType = DeadlineType.None; 17 | 18 | // set reward 19 | SetScience(100.0f); 20 | SetReputation(100.0f, 50.0f); 21 | SetFunds(100000.0f, 500000.0f); 22 | 23 | // add parameters 24 | AddParameter(new CrossHeliopauseCondition()); 25 | return true; 26 | } 27 | 28 | protected override string GetHashString() 29 | { 30 | return "CrossHeliopause"; 31 | } 32 | 33 | protected override string GetTitle() 34 | { 35 | return "Cross the heliopause"; 36 | } 37 | 38 | protected override string GetDescription() 39 | { 40 | return "What is out there, beyond the heliopause? The truth is, we don't know. That's where you come in."; 41 | } 42 | 43 | protected override string MessageCompleted() 44 | { 45 | return "We went so far the mind doesn't comprehend it. Beyond the heliopause there are the wonders of interstellar space, and more radiation."; 46 | } 47 | 48 | public override bool MeetRequirements() 49 | { 50 | // stop checking when requirements are met 51 | if (!meet_requirements) 52 | { 53 | ProgressTracking progress = ProgressTracking.Instance; 54 | if (progress == null) return false; 55 | int known = 0; 56 | foreach(var body_progress in progress.celestialBodyNodes) 57 | { known += body_progress.flyBy != null && body_progress.flyBy.IsComplete ? 1 : 0; } 58 | bool end_game = known > FlightGlobals.Bodies.Count / 2; 59 | 60 | meet_requirements = 61 | Features.Radiation // radiation is enabled 62 | && end_game // entered SOI of half the bodies 63 | && Radiation.Info(FlightGlobals.Bodies[0]).model.has_pause // there is an actual heliopause 64 | && !DB.landmarks.heliopause_crossing; // heliopause never crossed before 65 | } 66 | return meet_requirements; 67 | } 68 | 69 | bool meet_requirements; 70 | } 71 | 72 | 73 | // Cross radiation belt - condition 74 | public sealed class CrossHeliopauseCondition : ContractParameter 75 | { 76 | protected override string GetHashString() 77 | { 78 | return "CrossHeliopauseCondition"; 79 | } 80 | 81 | protected override string GetTitle() 82 | { 83 | return "Cross the heliopause"; 84 | } 85 | 86 | protected override void OnUpdate() 87 | { 88 | if (DB.landmarks.heliopause_crossing) SetComplete(); 89 | } 90 | } 91 | 92 | 93 | } // KERBALISM 94 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /src/Utility/CrewSpecs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | 5 | namespace KERBALISM { 6 | 7 | 8 | public sealed class CrewSpecs 9 | { 10 | public CrewSpecs(string value) 11 | { 12 | // if empty or false: not enabled 13 | if (value.Length == 0 || value.ToLower() == "false") 14 | { 15 | trait = string.Empty; 16 | level = 0; 17 | enabled = false; 18 | } 19 | // if true: enabled, any trait 20 | else if (value.ToLower() == "true") 21 | { 22 | trait = string.Empty; 23 | level = 0; 24 | enabled = true; 25 | } 26 | // all other cases: enabled, specified trait and experience 27 | else 28 | { 29 | var tokens = Lib.Tokenize(value, '@'); 30 | trait = tokens.Count > 0 ? tokens[0] : string.Empty; 31 | level = tokens.Count > 1 ? Lib.Parse.ToUInt(tokens[1]) : 0; 32 | enabled = true; 33 | } 34 | } 35 | 36 | // return true if the crew of active vessel satisfy the specs 37 | public bool check() 38 | { 39 | Vessel v = FlightGlobals.ActiveVessel; 40 | return v != null && check(v); 41 | } 42 | 43 | // return true if the crew of specified vessel satisfy the specs 44 | public bool check(Vessel v) 45 | { 46 | return check(Lib.CrewList(v)); 47 | } 48 | 49 | // return true if the specified crew satisfy the specs 50 | public bool check(List crew) 51 | { 52 | for(int i=0; i < crew.Count; ++i) 53 | { 54 | if (check(crew[i])) return true; 55 | } 56 | return false; 57 | } 58 | 59 | // return true if the specified crew member satisfy the specs 60 | public bool check(ProtoCrewMember c) 61 | { 62 | return trait.Length == 0 || (c.trait == trait && c.experienceLevel >= level); 63 | } 64 | 65 | // generate a string for use in warning messages 66 | public string warning() 67 | { 68 | return Lib.BuildString 69 | ( 70 | "", 71 | (trait.Length == 0 ? "Crew" : trait), 72 | " ", 73 | (level == 0 ? string.Empty : "of level " + level + " "), 74 | "is required" 75 | ); 76 | } 77 | 78 | // generate a string for use in part tooltip 79 | public string info() 80 | { 81 | if (!enabled) return "no"; 82 | else if (trait.Length == 0) return "anyone"; 83 | else return Lib.BuildString(trait, (level == 0 ? string.Empty : " (level: " + level + ")")); 84 | } 85 | 86 | // can check if enabled by bool comparison 87 | public static implicit operator bool(CrewSpecs ct) 88 | { 89 | return ct.enabled; 90 | } 91 | 92 | public string trait; // trait specified, or empty for any trait 93 | public uint level; // experience level specified 94 | public bool enabled; // can also specify 'disabled' state 95 | } 96 | 97 | 98 | } // KERBALISM 99 | 100 | -------------------------------------------------------------------------------- /GameData/Kerbalism/Support/SSPX.cfg: -------------------------------------------------------------------------------- 1 | // Stock-alike Station Parts Expansion 2 | 3 | // ============================================================================ 4 | // Comfort providers 5 | // ============================================================================ 6 | 7 | @PART[crewpod-observation-25|crewpod-cupola-375]:NEEDS[StationPartsExpansion,FeatureComfort]:FOR[Kerbalism] 8 | { 9 | MODULE 10 | { 11 | name = Comfort 12 | desc = The very best space observation experience. 13 | bonus = panorama 14 | } 15 | 16 | @tags ^= :$: comfort: 17 | } 18 | 19 | 20 | // ============================================================================ 21 | // Antennas 22 | // ============================================================================ 23 | 24 | @PART[crewpod-observation-25]:NEEDS[StationPartsExpansion,FeatureSignal]:FOR[Kerbalism] 25 | { 26 | MODULE 27 | { 28 | name = Antenna 29 | type = low_gain 30 | cost = 0.1 31 | dist = 5e6 32 | rate = 0.016 33 | } 34 | 35 | MODULE:NEEDS[FeatureReliability] 36 | { 37 | name = Reliability 38 | type = Antenna 39 | title = Antenna 40 | redundancy = Communication 41 | repair = true 42 | mtbf = 72576000 // 8y 43 | extra_cost = 2.0 44 | extra_mass = 1.0 45 | } 46 | 47 | @description ^= :$: A built-in low-gain antenna allows the occupants to transmit their screams while viewing the oncoming space debris. 48 | } 49 | 50 | 51 | // ============================================================================ 52 | // Habitats 53 | // by schrema 54 | // ============================================================================ 55 | 56 | @PART[crewtube-airlock-25]:NEEDS[StationPartsExpansion,FeatureHabitat]:AFTER[Kerbalism] 57 | { 58 | @MODULE[Habitat] 59 | { 60 | volume = 4.9 61 | surface = 7.8 62 | } 63 | } 64 | @PART[crewpod-observation-25]:NEEDS[StationPartsExpansion,FeatureHabitat]:AFTER[Kerbalism] 65 | { 66 | @MODULE[Habitat] 67 | { 68 | volume = 25.98 69 | surface = 32.42 70 | } 71 | } 72 | @PART[crewpod-habitation-375]:NEEDS[StationPartsExpansion,FeatureHabitat]:AFTER[Kerbalism] 73 | { 74 | @MODULE[Habitat] 75 | { 76 | volume = 22.08 77 | surface = 23.56 78 | } 79 | } 80 | @PART[crewtube-25-375-1]:NEEDS[StationPartsExpansion,FeatureHabitat]:AFTER[Kerbalism] 81 | { 82 | @MODULE[Habitat] 83 | { 84 | volume = 8.95 85 | surface = 13.09 86 | } 87 | } 88 | @PART[crewpod-habitation-25]:NEEDS[StationPartsExpansion,FeatureHabitat]:AFTER[Kerbalism] 89 | { 90 | @MODULE[Habitat] 91 | { 92 | volume = 19.63 93 | surface = 36.32 94 | } 95 | } 96 | @PART[crewtube-airlock-125]:NEEDS[StationPartsExpansion,FeatureHabitat]:AFTER[Kerbalism] 97 | { 98 | @MODULE[Habitat] 99 | { 100 | volume = 0.92 101 | surface = 4.17 102 | } 103 | } 104 | @PART[crewpod-cupola-375]:NEEDS[StationPartsExpansion,FeatureHabitat]:AFTER[Kerbalism] 105 | { 106 | @MODULE[Habitat] 107 | { 108 | volume = 13.49 109 | surface = 18.57 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /src/UI/Tooltip.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | 6 | namespace KERBALISM { 7 | 8 | 9 | public sealed class Tooltip 10 | { 11 | public Tooltip() 12 | { 13 | tooltip = string.Empty; 14 | } 15 | 16 | public void draw(Rect screen_rect) 17 | { 18 | // draw tooltip, if there is one specified 19 | if (tooltip.Length > 0) render_tooltip(screen_rect); 20 | 21 | // get tooltip 22 | // - need to be after the drawing, to play nice with unity layout engine 23 | get_tooltip(); 24 | } 25 | 26 | void get_tooltip() 27 | { 28 | // get current tooltip 29 | if (Event.current.type == EventType.Repaint) 30 | { 31 | tooltip = GUI.tooltip; 32 | 33 | // set alignment 34 | if (tooltip.Length > 0) 35 | { 36 | if (tooltip.IndexOf("", StringComparison.Ordinal) != -1) 37 | { 38 | Styles.tooltip.alignment = TextAnchor.MiddleLeft; 39 | tooltip = tooltip.Replace("", ""); 40 | } 41 | else if (tooltip.IndexOf("", StringComparison.Ordinal) != -1) 42 | { 43 | Styles.tooltip.alignment = TextAnchor.MiddleRight; 44 | tooltip = tooltip.Replace("", ""); 45 | } 46 | else Styles.tooltip.alignment = TextAnchor.MiddleCenter; 47 | } 48 | } 49 | } 50 | 51 | 52 | void render_tooltip(Rect screen_rect) 53 | { 54 | // get mouse pos 55 | Vector2 mouse_pos = Mouse.screenPos; 56 | 57 | // correct for non-origin screen rect 58 | mouse_pos -= new Vector2(screen_rect.xMin, screen_rect.yMin); 59 | 60 | // calculate tooltip size 61 | GUIContent tooltip_content = new GUIContent(tooltip); 62 | Vector2 tooltip_size = Styles.tooltip.CalcSize(tooltip_content); 63 | tooltip_size.y = Styles.tooltip.CalcHeight(tooltip_content, tooltip_size.x); 64 | 65 | // calculate tooltip position 66 | Rect tooltip_rect = new Rect(mouse_pos.x - Mathf.Floor(tooltip_size.x / 2.0f), mouse_pos.y - Mathf.Floor(tooltip_size.y / 2.0f), tooltip_size.x, tooltip_size.y); 67 | 68 | // get the mouse out of the way 69 | tooltip_rect.yMin -= Mathf.Floor(tooltip_size.y / 2.0f); 70 | tooltip_rect.yMax -= Mathf.Floor(tooltip_size.y / 2.0f); 71 | 72 | // clamp to screen rect 73 | float offset_x = Math.Max(0.0f, -tooltip_rect.xMin) + Math.Min(0.0f, screen_rect.width - tooltip_rect.xMax); 74 | float offset_y = Math.Max(0.0f, -tooltip_rect.yMin) + Math.Min(0.0f, screen_rect.height - tooltip_rect.yMax); 75 | tooltip_rect.xMin += offset_x; 76 | tooltip_rect.xMax += offset_x; 77 | tooltip_rect.yMin += offset_y; 78 | tooltip_rect.yMax += offset_y; 79 | 80 | // finally, render the tooltip 81 | GUILayout.BeginArea(tooltip_rect, Styles.tooltip_container); 82 | GUILayout.Label(tooltip_content, Styles.tooltip); 83 | GUILayout.EndArea(); 84 | } 85 | 86 | 87 | // tooltip text 88 | string tooltip; 89 | } 90 | 91 | 92 | } // KERBALISM 93 | 94 | -------------------------------------------------------------------------------- /src/System/Loader.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using KSP.UI.Screens; 5 | 6 | 7 | namespace KERBALISM { 8 | 9 | 10 | public sealed class Loader : LoadingSystem 11 | { 12 | public static void init() 13 | { 14 | // log version 15 | Lib.Log("version " + Lib.Version()); 16 | 17 | // parse settings 18 | Settings.parse(); 19 | 20 | // parse profile 21 | Profile.parse(); 22 | 23 | // detect features 24 | Features.detect(); 25 | 26 | // get configs from DB 27 | UrlDir.UrlFile root = null; 28 | foreach (UrlDir.UrlConfig url in GameDatabase.Instance.root.AllConfigs) { root = url.parent; break; } 29 | 30 | // inject MM patches on-the-fly, so that profile/features can be queried with NEEDS[] 31 | inject(root, "Profile", Lib.UppercaseFirst(Settings.Profile)); 32 | if (Features.Reliability) inject(root, "Feature", "Reliability"); 33 | if (Features.Signal) inject(root, "Feature", "Signal"); 34 | if (Features.SpaceWeather) inject(root, "Feature", "SpaceWeather"); 35 | if (Features.Automation) inject(root, "Feature", "Automation"); 36 | if (Features.Science) inject(root, "Feature", "Science"); 37 | if (Features.Radiation) inject(root, "Feature", "Radiation"); 38 | if (Features.Shielding) inject(root, "Feature", "Shielding"); 39 | if (Features.LivingSpace) inject(root, "Feature", "LivingSpace"); 40 | if (Features.Comfort) inject(root, "Feature", "Comfort"); 41 | if (Features.Poisoning) inject(root, "Feature", "Poisoning"); 42 | if (Features.Pressure) inject(root, "Feature", "Pressure"); 43 | if (Features.Habitat) inject(root, "Feature", "Habitat"); 44 | if (Features.Supplies) inject(root, "Feature", "Supplies"); 45 | } 46 | 47 | // inject an MM patch on-the-fly, so that NEEDS[TypeId] can be used in MM patches 48 | static void inject(UrlDir.UrlFile root, string type, string id) 49 | { 50 | root.configs.Add(new UrlDir.UrlConfig(root, new ConfigNode(Lib.BuildString("@Kerbalism:FOR[", type, id, "]")))); 51 | } 52 | 53 | 54 | public override bool IsReady() { return true; } 55 | public override string ProgressTitle() { return "Kerbalism"; } 56 | public override float ProgressFraction() { return 0f; } 57 | public override void StartLoad() { init(); } 58 | } 59 | 60 | 61 | // the name is choosen so that the awake method is called after ModuleManager one 62 | // this is necessary because MM inject its loader at index 1, so we need to inject 63 | // our own after it, at index 1 (so that it run just before MM) 64 | [KSPAddon(KSPAddon.Startup.Instantly, false)] 65 | public sealed class PatchInjector : MonoBehaviour 66 | { 67 | public void Awake() 68 | { 69 | // inject loader 70 | List loaders = LoadingScreen.Instance.loaders; 71 | GameObject go = new GameObject("Kerbalism"); 72 | Loader loader = go.AddComponent(); 73 | int index = loaders.FindIndex(k => k is GameDatabase); 74 | loaders.Insert(index + 1, loader); 75 | } 76 | } 77 | 78 | 79 | } // KERBALISM 80 | 81 | -------------------------------------------------------------------------------- /src/Automation/Devices/Harvester.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | 6 | namespace KERBALISM { 7 | 8 | 9 | public sealed class HarvesterDevice : Device 10 | { 11 | public HarvesterDevice(Harvester harvester) 12 | { 13 | this.harvester = harvester; 14 | this.animator = harvester.part.FindModuleImplementing(); 15 | } 16 | 17 | public override string name() 18 | { 19 | return Lib.BuildString(harvester.resource, " harvester").ToLower(); 20 | } 21 | 22 | public override uint part() 23 | { 24 | return harvester.part.flightID; 25 | } 26 | 27 | public override string info() 28 | { 29 | return animator != null && !harvester.deployed 30 | ? "not deployed" 31 | : !harvester.running 32 | ? "stopped" 33 | : harvester.issue.Length == 0 34 | ? "running" 35 | : Lib.BuildString("", harvester.issue, ""); 36 | } 37 | 38 | public override void ctrl(bool value) 39 | { 40 | if (harvester.deployed) 41 | { 42 | harvester.running = value; 43 | } 44 | } 45 | 46 | public override void toggle() 47 | { 48 | ctrl(!harvester.running); 49 | } 50 | 51 | Harvester harvester; 52 | ModuleAnimationGroup animator; 53 | } 54 | 55 | 56 | public sealed class ProtoHarvesterDevice : Device 57 | { 58 | public ProtoHarvesterDevice(ProtoPartModuleSnapshot harvester, Harvester prefab, uint part_id) 59 | { 60 | this.harvester = harvester; 61 | this.animator = FlightGlobals.FindProtoPartByID(part_id).FindModule("ModuleAnimationGroup"); 62 | this.prefab = prefab; 63 | this.part_id = part_id; 64 | } 65 | 66 | public override string name() 67 | { 68 | return Lib.BuildString(prefab.resource, " harvester").ToLower(); 69 | } 70 | 71 | public override uint part() 72 | { 73 | return part_id; 74 | } 75 | 76 | public override string info() 77 | { 78 | bool deployed = Lib.Proto.GetBool(harvester, "deployed"); 79 | bool running = Lib.Proto.GetBool(harvester, "running"); 80 | string issue = Lib.Proto.GetString(harvester, "issue"); 81 | 82 | return animator != null && !deployed 83 | ? "not deployed" 84 | : !running 85 | ? "stopped" 86 | : issue.Length == 0 87 | ? "running" 88 | : Lib.BuildString("", issue, ""); 89 | } 90 | 91 | public override void ctrl(bool value) 92 | { 93 | if (Lib.Proto.GetBool(harvester, "deployed")) 94 | { 95 | Lib.Proto.Set(harvester, "running", value); 96 | } 97 | } 98 | 99 | public override void toggle() 100 | { 101 | ctrl(!Lib.Proto.GetBool(harvester, "running")); 102 | } 103 | 104 | ProtoPartModuleSnapshot harvester; 105 | ProtoPartModuleSnapshot animator; 106 | Harvester prefab; 107 | uint part_id; 108 | } 109 | 110 | 111 | } // KERBALISM 112 | -------------------------------------------------------------------------------- /src/Contracts/MannedOrbit.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Contracts; 3 | 4 | 5 | namespace KERBALISM.CONTRACTS { 6 | 7 | 8 | // put a kerbal in orbit for 30 days 9 | public sealed class MannedOrbit : Contract 10 | { 11 | protected override bool Generate() 12 | { 13 | // never expire 14 | deadlineType = DeadlineType.None; 15 | expiryType = DeadlineType.None; 16 | 17 | // set reward 18 | SetScience(25.0f); 19 | SetReputation(30.0f, 10.0f); 20 | SetFunds(25000.0f, 100000.0f); 21 | 22 | // add parameters 23 | AddParameter(new MannedOrbitCondition()); 24 | return true; 25 | } 26 | 27 | protected override string GetHashString() 28 | { 29 | return "MannedOrbit"; 30 | } 31 | 32 | protected override string GetTitle() 33 | { 34 | return "Put a Kerbal in orbit for 30 days"; 35 | } 36 | 37 | protected override string GetDescription() 38 | { 39 | return "Obtaining an orbit was easier than we expected. " 40 | + "Now it is time to keep a Kerbal alive in orbit for 30 days."; 41 | } 42 | 43 | protected override string MessageCompleted() 44 | { 45 | return "The mission was a success, albeit the Kerbal is a bit bored. " 46 | + "We have plenty of data about long-term permanence in space"; 47 | } 48 | 49 | public override bool MeetRequirements() 50 | { 51 | // stop checking when requirements are met 52 | if (!meet_requirements) 53 | { 54 | ProgressTracking progress = ProgressTracking.Instance; 55 | 56 | meet_requirements = 57 | Profile.rules.Count > 0 // some rule is specified 58 | && progress != null && progress.celestialBodyHome.orbit.IsComplete // first orbit completed 59 | && !DB.landmarks.manned_orbit; // contract never completed 60 | } 61 | return meet_requirements; 62 | } 63 | 64 | bool meet_requirements; 65 | } 66 | 67 | 68 | public sealed class MannedOrbitCondition : ContractParameter 69 | { 70 | protected override string GetHashString() 71 | { 72 | return "MannedOrbitCondition"; 73 | } 74 | 75 | protected override string GetTitle() 76 | { 77 | return "Put a Kerbal in orbit for 30 days"; 78 | } 79 | 80 | protected override void OnUpdate() 81 | { 82 | foreach(Vessel v in FlightGlobals.Vessels) 83 | { 84 | vessel_info vi = Cache.VesselInfo(v); 85 | if (!vi.is_valid) continue; 86 | bool manned = vi.crew_count > 0; 87 | bool in_orbit = Sim.Apoapsis(v) > v.mainBody.atmosphereDepth && Sim.Periapsis(v) > v.mainBody.atmosphereDepth; 88 | bool for_30days = v.missionTime > 60.0 * 60.0 * Lib.HoursInDay() * 30.0; 89 | if (manned && in_orbit && for_30days) 90 | { 91 | SetComplete(); 92 | DB.landmarks.manned_orbit = true; //< remember that contract was completed 93 | break; 94 | } 95 | } 96 | } 97 | } 98 | 99 | 100 | } // KERBALISM.CONTRACTS 101 | 102 | 103 | 104 | -------------------------------------------------------------------------------- /GameData/Kerbalism/Support/MOLE.cfg: -------------------------------------------------------------------------------- 1 | // Habitat surface/volume 2 | // by schreme 3 | 4 | @PART[WBI_BigCrewModule]::NEEDS[WildBlueIndustries,FeatureHabitat]:AFTER[Kerbalism] 5 | { 6 | @MODULE[Habitat] 7 | { 8 | volume = 6.43 9 | surface = 12.19 10 | } 11 | } 12 | @PART[WBI_AirlockModule]::NEEDS[WildBlueIndustries,FeatureHabitat]:AFTER[Kerbalism] 13 | { 14 | @MODULE[Habitat] 15 | { 16 | volume = 3.67 17 | surface = 7.83 18 | } 19 | } 20 | @PART[WBI_BOW]::NEEDS[WildBlueIndustries,FeatureHabitat]:AFTER[Kerbalism] 21 | { 22 | @MODULE[Habitat] 23 | { 24 | volume = 66.26 25 | surface = 70.68 26 | } 27 | } 28 | @PART[WBI_MOH18,WBI_Mole182,WBI_MOBL18,WBI_StationHub2]::NEEDS[WildBlueIndustries,FeatureHabitat]:AFTER[Kerbalism] 29 | { 30 | @MODULE[Habitat] 31 | { 32 | volume = 5.52 33 | surface = 11.78 34 | } 35 | } 36 | @PART[WBI_Backseat2]::NEEDS[WildBlueIndustries,FeatureHabitat]:AFTER[Kerbalism] 37 | { 38 | @MODULE[Habitat] 39 | { 40 | volume = 1.95 41 | surface = 5.05 42 | } 43 | } 44 | @PART[WBI_Brumby]::NEEDS[WildBlueIndustries,FeatureHabitat]:AFTER[Kerbalism] 45 | { 46 | @MODULE[Habitat] 47 | { 48 | volume = 2.24 49 | surface = 7.27 50 | } 51 | } 52 | 53 | 54 | // Clever hacks to support MOLE solar panels in planner & background simulation 55 | // by gotmachine 56 | @PART[WBI_SolarBatteryModule] 57 | { 58 | -MODULE[WBIDualAxisSolarArray] {} 59 | -MODULE[ModuleDeployableSolarPanel] {} 60 | 61 | // Y-axis of SARJ is the pivot 62 | // Z-axis of suncatcher2 points to the sun. 63 | MODULE 64 | { 65 | name = ModuleDeployablePart 66 | pivotName = SARJ 67 | secondaryTransformName = suncatcher2 // same as raycastTransformName in a ModuleDeployableSolarPanel 68 | trackingSpeed = 0.25 69 | isBreakable = false 70 | showStatus = false 71 | } 72 | 73 | // Y-axis of SolarArrayPivot is the pivot 74 | // Z-axis of suncatcher points to the sun. 75 | MODULE 76 | { 77 | name = ModuleDeployableSolarPanel 78 | animationName = Deploy 79 | pivotName = SolarArrayPivot 80 | raycastTransformName = suncatcher 81 | windResistance = 5 82 | trackingSpeed = 0.25 83 | isBreakable = true 84 | retractable = true 85 | resourceName = ElectricCharge 86 | chargeRate = 24.0 87 | } 88 | } 89 | @PART[WBI_SkylabSolarPanel] 90 | { 91 | -MODULE[WBIModuleMirroredSolarPanel] {} 92 | 93 | // Hacky way to hide the unused "SolarPanelMirror" model so there isn't any ugly clipping 94 | node_stack_disabled = 0.0, -1000.0, 0.0, 0.0, -1.0, 0.0, 0 95 | MODULE 96 | { 97 | name = ModuleJettison 98 | jettisonName = SolarPanelMirror 99 | bottomNodeName = disabled 100 | allowShroudToggle = false 101 | } 102 | 103 | MODULE 104 | { 105 | name = ModuleDeployableSolarPanel 106 | isTracking = false 107 | raycastTransformName = suncatcher 108 | pivotName = suncatcher 109 | animationName = Deploy 110 | retractable = false 111 | isBreakable = true 112 | impactResistance = 8 113 | resourceName = ElectricCharge 114 | chargeRate = 6.0 115 | } 116 | } -------------------------------------------------------------------------------- /src/System/Features.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | 5 | namespace KERBALISM { 6 | 7 | 8 | public static class Features 9 | { 10 | public static void detect() 11 | { 12 | // set user-specified features 13 | Reliability = Settings.Reliability; 14 | Signal = Settings.Signal; 15 | Science = Settings.Science; 16 | SpaceWeather = Settings.SpaceWeather; 17 | Automation = Settings.Automation; 18 | 19 | // force-disable some features based on mods detected 20 | Reliability &= !Lib.HasAssembly("TestFlight"); 21 | Signal &= !Lib.HasAssembly("RemoteTech"); 22 | 23 | // detect all modifiers in use by current profile 24 | HashSet modifiers = new HashSet(); 25 | foreach(Rule rule in Profile.rules) 26 | { 27 | foreach(string s in rule.modifiers) modifiers.Add(s); 28 | } 29 | foreach(Process process in Profile.processes) 30 | { 31 | foreach(string s in process.modifiers) modifiers.Add(s); 32 | } 33 | 34 | // detect features from modifiers 35 | Radiation = modifiers.Contains("radiation"); 36 | Shielding = modifiers.Contains("shielding"); 37 | LivingSpace = modifiers.Contains("living_space"); 38 | Comfort = modifiers.Contains("comfort"); 39 | Poisoning = modifiers.Contains("poisoning"); 40 | Pressure = modifiers.Contains("pressure"); 41 | 42 | // habitat is enabled if any of the values it provides are in use 43 | Habitat = 44 | Shielding 45 | || LivingSpace 46 | || Poisoning 47 | || Pressure 48 | || modifiers.Contains("volume") 49 | || modifiers.Contains("surface"); 50 | 51 | // supplies is enabled if any non-EC supply exist 52 | Supplies = Profile.supplies.Find(k => k.resource != "ElectricCharge") != null; 53 | 54 | // log features 55 | Lib.Log("features:"); 56 | Lib.Log("- Reliability: " + Reliability); 57 | Lib.Log("- Signal: " + Signal); 58 | Lib.Log("- Science: " + Science); 59 | Lib.Log("- SpaceWeather: " + SpaceWeather); 60 | Lib.Log("- Automation: " + Automation); 61 | Lib.Log("- Radiation: " + Radiation); 62 | Lib.Log("- Shielding: " + Shielding); 63 | Lib.Log("- LivingSpace: " + LivingSpace); 64 | Lib.Log("- Comfort: " + Comfort); 65 | Lib.Log("- Poisoning: " + Poisoning); 66 | Lib.Log("- Pressure: " + Pressure); 67 | Lib.Log("- Habitat: " + Habitat); 68 | Lib.Log("- Supplies: " + Supplies); 69 | } 70 | 71 | // user-specified features 72 | public static bool Reliability; 73 | public static bool Signal; 74 | public static bool Science; 75 | public static bool SpaceWeather; 76 | public static bool Automation; 77 | 78 | // features detected automatically from modifiers 79 | public static bool Radiation; 80 | public static bool Shielding; 81 | public static bool LivingSpace; 82 | public static bool Comfort; 83 | public static bool Poisoning; 84 | public static bool Pressure; 85 | 86 | // features detected in other ways 87 | public static bool Habitat; 88 | public static bool Supplies; 89 | } 90 | 91 | 92 | } // KERBALISM 93 | -------------------------------------------------------------------------------- /src/Automation/Devices/Panel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | 6 | namespace KERBALISM { 7 | 8 | 9 | public sealed class PanelDevice : Device 10 | { 11 | public PanelDevice(ModuleDeployableSolarPanel panel) 12 | { 13 | this.panel = panel; 14 | } 15 | 16 | public override string name() 17 | { 18 | return "solar panel"; 19 | } 20 | 21 | public override uint part() 22 | { 23 | return panel.part.flightID; 24 | } 25 | 26 | public override string info() 27 | { 28 | if (!panel.isTracking) return "fixed"; 29 | switch(panel.deployState) 30 | { 31 | case ModuleDeployablePart.DeployState.EXTENDED: return "extended"; 32 | case ModuleDeployablePart.DeployState.RETRACTED: return "retracted"; 33 | case ModuleDeployablePart.DeployState.BROKEN: return "broken"; 34 | case ModuleDeployablePart.DeployState.EXTENDING: return "extending"; 35 | case ModuleDeployablePart.DeployState.RETRACTING: return "retracting"; 36 | } 37 | return "unknown"; 38 | } 39 | 40 | public override void ctrl(bool value) 41 | { 42 | if (!panel.isTracking) return; 43 | if (!value && !panel.retractable) return; 44 | if (panel.deployState == ModuleDeployablePart.DeployState.BROKEN) return; 45 | if (value) panel.Extend(); 46 | else panel.Retract(); 47 | } 48 | 49 | public override void toggle() 50 | { 51 | ctrl(panel.deployState != ModuleDeployablePart.DeployState.EXTENDED); 52 | } 53 | 54 | ModuleDeployableSolarPanel panel; 55 | } 56 | 57 | 58 | public sealed class ProtoPanelDevice : Device 59 | { 60 | public ProtoPanelDevice(ProtoPartModuleSnapshot panel, ModuleDeployableSolarPanel prefab, uint part_id) 61 | { 62 | this.panel = panel; 63 | this.prefab = prefab; 64 | this.part_id = part_id; 65 | } 66 | 67 | public override string name() 68 | { 69 | return "solar panel"; 70 | } 71 | 72 | public override uint part() 73 | { 74 | return part_id; 75 | } 76 | 77 | public override string info() 78 | { 79 | if (!prefab.isTracking) return "fixed"; 80 | string state = Lib.Proto.GetString(panel, "deployState"); 81 | switch(state) 82 | { 83 | case "EXTENDED": return "extended"; 84 | case "RETRACTED": return "retracted"; 85 | case "BROKEN": return "broken"; 86 | } 87 | return "unknown"; 88 | } 89 | 90 | public override void ctrl(bool value) 91 | { 92 | if (!prefab.isTracking) return; 93 | if (!value && !prefab.retractable) return; 94 | if (Lib.Proto.GetString(panel, "deployState") == "BROKEN") return; 95 | Lib.Proto.Set(panel, "deployState", value ? "EXTENDED" : "RETRACTED"); 96 | } 97 | 98 | public override void toggle() 99 | { 100 | ctrl(Lib.Proto.GetString(panel, "deployState") != "EXTENDED"); 101 | } 102 | 103 | ProtoPartModuleSnapshot panel; 104 | ModuleDeployableSolarPanel prefab; 105 | uint part_id; 106 | } 107 | 108 | 109 | } // KERBALISM -------------------------------------------------------------------------------- /GameData/Kerbalism/System/Misc.cfg: -------------------------------------------------------------------------------- 1 | // ============================================================================ 2 | // Stock panel module work correctly at arbitrary warp speed and EC capacity 3 | // ============================================================================ 4 | 5 | @PART[*]:HAS[@MODULE[ModuleDeployableSolarPanel]]:FOR[Kerbalism] 6 | { 7 | MODULE 8 | { 9 | name = WarpFixer 10 | } 11 | } 12 | 13 | 14 | // ============================================================================ 15 | // Use Monoprop as eva propellant, and set the initial amount to zero 16 | // ============================================================================ 17 | 18 | @PART[kerbalEVA,kerbalEVAfemale]:FOR[Kerbalism] 19 | { 20 | @MODULE[KerbalEVA] 21 | { 22 | @propellantResourceName = MonoPropellant 23 | } 24 | 25 | @RESOURCE[EVA?Propellant] 26 | { 27 | @name = MonoPropellant 28 | @amount = 0 29 | @maxAmount = 5 30 | } 31 | } 32 | 33 | 34 | // ============================================================================ 35 | // Replace readings with our own telemetry providers 36 | // ============================================================================ 37 | 38 | @PART[sensorThermometer]:FOR[Kerbalism] 39 | { 40 | !MODULE[ModuleEnviroSensor] {} 41 | 42 | MODULE 43 | { 44 | name = Sensor 45 | type = temperature 46 | } 47 | } 48 | 49 | @PART[sensorBarometer]:FOR[Kerbalism] 50 | { 51 | !MODULE[ModuleEnviroSensor] {} 52 | 53 | MODULE 54 | { 55 | name = Sensor 56 | type = pressure 57 | } 58 | } 59 | 60 | @PART[sensorGravimeter]:FOR[Kerbalism] 61 | { 62 | !MODULE[ModuleEnviroSensor] {} 63 | 64 | MODULE 65 | { 66 | name = Sensor 67 | type = gravioli 68 | } 69 | } 70 | 71 | 72 | // ============================================================================ 73 | // Probe hibernation removal is GO 74 | // ============================================================================ 75 | 76 | @PART[*]:HAS[@MODULE[ModuleCommand]]:FOR[Kerbalism] 77 | { 78 | @MODULE[ModuleCommand] 79 | { 80 | %hasHibernation = false 81 | } 82 | } 83 | 84 | 85 | // ============================================================================ 86 | // Enable/disable parts automatically 87 | // ============================================================================ 88 | 89 | @PART[kerbalism-activeshield]:NEEDS[FeatureRadiation] { %tags = _kerbalism } 90 | @PART[kerbalism-gravityring]:NEEDS[FeatureComfort] { %tags = _kerbalism } 91 | @PART[kerbalism-greenhouse]:HAS[@MODULE[*]]:FINAL { %tags = _kerbalism } 92 | @PART[kerbalism-chemicalplant]:HAS[@MODULE[*]]:FINAL { %tags = _kerbalism } 93 | @PART[kerbalism-container-*]:HAS[@RESOURCE[*]]:FINAL { %tags = _kerbalism } 94 | @PART[kerbalism-container-*]:HAS[@MODULE[*]]:FINAL { %tags = _kerbalism } 95 | @PART[kerbalism-geigercounter]:NEEDS[FeatureRadiation] { %category = Science } 96 | @PART[kerbalism-antenna]:NEEDS[FeatureSignal] { %category = Communication } 97 | 98 | 99 | // ============================================================================ 100 | // Avoid some harmless warning during part loading 101 | // ============================================================================ 102 | 103 | @PART[kerbalism-container-*]:FINAL { !ContainerVolume = _ } 104 | -------------------------------------------------------------------------------- /src/Profile/Process.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | 5 | namespace KERBALISM { 6 | 7 | 8 | public sealed class Process 9 | { 10 | public Process(ConfigNode node) 11 | { 12 | name = Lib.ConfigValue(node, "name", string.Empty); 13 | modifiers = Lib.Tokenize(Lib.ConfigValue(node, "modifier", string.Empty), ','); 14 | 15 | // check that name is specified 16 | if (name.Length == 0) throw new Exception("skipping unnamed process"); 17 | 18 | inputs = new Dictionary(); 19 | foreach(string input in node.GetValues("input")) 20 | { 21 | // get parameters 22 | List tok = Lib.Tokenize(input, '@'); 23 | if (tok.Count != 2) throw new Exception("malformed input on process"); 24 | string input_res = tok[0]; 25 | double input_rate = Lib.Parse.ToDouble(tok[1]); 26 | 27 | // check that resource is specified 28 | if (input_res.Length == 0) throw new Exception("skipping resource-less process"); 29 | 30 | // check that resource exist 31 | if (Lib.GetDefinition(input_res) == null) throw new Exception("resource " + input_res + " doesn't exist"); 32 | 33 | // record input 34 | inputs[input_res] = input_rate; 35 | } 36 | 37 | outputs = new Dictionary(); 38 | foreach(string output in node.GetValues("output")) 39 | { 40 | // get parameters 41 | List tok = Lib.Tokenize(output, '@'); 42 | if (tok.Count != 2) throw new Exception("malformed output on process"); 43 | string output_res = tok[0]; 44 | double output_rate = Lib.Parse.ToDouble(tok[1]); 45 | 46 | // check that resource is specified 47 | if (output_res.Length == 0) throw new Exception("skipping resource-less process"); 48 | 49 | // check that resource exist 50 | if (Lib.GetDefinition(output_res) == null) throw new Exception("resource " + output_res + " doesn't exist"); 51 | 52 | // record output 53 | outputs[output_res] = output_rate; 54 | } 55 | 56 | // parse dump specs 57 | dump = new DumpSpecs(Lib.ConfigValue(node, "dump", "true")); 58 | } 59 | 60 | 61 | public void Execute(Vessel v, vessel_info vi, vessel_resources resources, double elapsed_s) 62 | { 63 | // evaluate modifiers 64 | double k = Modifiers.evaluate(v, vi, resources, modifiers); 65 | 66 | // only execute processes if necessary 67 | if (k > double.Epsilon) 68 | { 69 | // prepare recipe 70 | resource_recipe recipe = new resource_recipe(); 71 | foreach(var p in inputs) 72 | { 73 | recipe.Input(p.Key, p.Value * k * elapsed_s); 74 | } 75 | foreach(var p in outputs) 76 | { 77 | recipe.Output(p.Key, p.Value * k * elapsed_s, dump.check(p.Key)); 78 | } 79 | resources.Transform(recipe); 80 | } 81 | } 82 | 83 | public string name; // unique name for the process 84 | public List modifiers; // if specified, rates are influenced by the product of all environment modifiers 85 | public Dictionary inputs; // input resources and rates 86 | public Dictionary outputs; // output resources and rates 87 | public DumpSpecs dump; // set of output resources that should dump overboard 88 | } 89 | 90 | 91 | 92 | 93 | 94 | } // KERBALISM 95 | 96 | -------------------------------------------------------------------------------- /src/Renderer/ParticleMesh.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | 6 | namespace KERBALISM { 7 | 8 | 9 | // store an arbitrary number of static particles in a set of meshes 10 | public sealed class ParticleMesh 11 | { 12 | // create a particle mesh from a set of points 13 | public ParticleMesh(List points) 14 | { 15 | this.points = points; 16 | } 17 | 18 | 19 | // create a particle mesh by fitting points on an implicit surface defined by a signed distance field 20 | public ParticleMesh(Func dist_func, Vector3 domain_hsize, Vector3 domain_offset, int particle_count, float quality) 21 | { 22 | // store stuff 23 | Vector3 p; 24 | float D; 25 | 26 | // hard-limit on sample count, to avoid infinite sampling when the distance function is positive everywhere 27 | int sample_limit = particle_count * 1000; 28 | 29 | // divide once 30 | float thickness = 1.0f / quality; 31 | 32 | // preallocate position container 33 | points = new List(particle_count); 34 | 35 | // particle-fitting 36 | int samples = 0; 37 | int i = 0; 38 | while(i < particle_count && samples < sample_limit) 39 | { 40 | // generate random position inside bounding volume 41 | p.x = Lib.FastRandomFloat() * domain_hsize.x + domain_offset.x; 42 | p.y = Lib.FastRandomFloat() * domain_hsize.y + domain_offset.y; 43 | p.z = Lib.FastRandomFloat() * domain_hsize.z + domain_offset.z; 44 | 45 | // calculate signed distance 46 | D = dist_func(p); 47 | 48 | // if inside 49 | if (D <= 0.0f && D > -thickness) 50 | { 51 | points.Add(p); 52 | ++i; 53 | } 54 | 55 | // count samples 56 | ++samples; 57 | } 58 | 59 | // some feedback on the samples going above the limit 60 | if (i < particle_count) Lib.Log("particle-fitting reached hard limit at " + Lib.HumanReadablePerc((double)i/(double)particle_count)); 61 | } 62 | 63 | 64 | void compile() 65 | { 66 | // max number of particles that can be stored in a unity mesh 67 | const int max_particles = 64000; 68 | 69 | // create the set of meshes 70 | meshes = new List(points.Count / max_particles + 1); 71 | Mesh m; 72 | List t_points = new List(max_particles); 73 | List t_indexes = new List(max_particles); 74 | for(var i = 0; i < points.Count; ++i) 75 | { 76 | t_points.Add(points[i]); 77 | t_indexes.Add(t_indexes.Count); 78 | if (t_indexes.Count > max_particles || i == points.Count - 1) 79 | { 80 | m = new Mesh(); 81 | m.SetVertices(t_points); 82 | m.SetIndices(t_indexes.ToArray(), MeshTopology.Points, 0); 83 | meshes.Add(m); 84 | t_points.Clear(); 85 | t_indexes.Clear(); 86 | } 87 | } 88 | points = null; 89 | } 90 | 91 | 92 | // render all the meshes 93 | public void render(Matrix4x4 m) 94 | { 95 | if (meshes == null) 96 | { 97 | compile(); 98 | } 99 | 100 | for(var i = 0; i < meshes.Count; ++i) 101 | { 102 | Graphics.DrawMeshNow(meshes[i], m); 103 | } 104 | } 105 | 106 | 107 | List points; // set of points 108 | List meshes; // set of meshes 109 | } 110 | 111 | 112 | } // KERBALISM -------------------------------------------------------------------------------- /src/Profile/Modifiers.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Text; 4 | 5 | 6 | namespace KERBALISM { 7 | 8 | 9 | public static class Modifiers 10 | { 11 | public static double evaluate(Vessel v, vessel_info vi, vessel_resources resources, List modifiers) 12 | { 13 | double k = 1.0; 14 | foreach(string mod in modifiers) 15 | { 16 | switch(mod) 17 | { 18 | case "breathable": 19 | k *= vi.breathable ? 0.0 : 1.0; 20 | break; 21 | 22 | case "temperature": 23 | k *= vi.temp_diff; 24 | break; 25 | 26 | case "radiation": 27 | k *= vi.radiation; 28 | break; 29 | 30 | case "shielding": 31 | k *= 1.0 - vi.shielding; 32 | break; 33 | 34 | case "volume": 35 | k *= vi.volume; 36 | break; 37 | 38 | case "surface": 39 | k *= vi.surface; 40 | break; 41 | 42 | case "living_space": 43 | k /= vi.living_space; 44 | break; 45 | 46 | case "comfort": 47 | k /= vi.comforts.factor; 48 | break; 49 | 50 | case "pressure": 51 | k *= vi.pressure > Settings.PressureThreshold ? 1.0 : Settings.PressureFactor; 52 | break; 53 | 54 | case "poisoning": 55 | k *= vi.poisoning > Settings.PoisoningThreshold ? 1.0 : Settings.PoisoningFactor; 56 | break; 57 | 58 | case "per_capita": 59 | k /= (double)Math.Max(vi.crew_count, 1); 60 | break; 61 | 62 | default: 63 | k *= resources.Info(v, mod).amount; 64 | break; 65 | } 66 | } 67 | return k; 68 | } 69 | 70 | 71 | public static double evaluate(environment_analyzer env, vessel_analyzer va, resource_simulator sim, List modifiers) 72 | { 73 | double k = 1.0; 74 | foreach(string mod in modifiers) 75 | { 76 | switch(mod) 77 | { 78 | case "breathable": 79 | k *= env.breathable ? 0.0 : 1.0; 80 | break; 81 | 82 | case "temperature": 83 | k *= env.temp_diff; 84 | break; 85 | 86 | case "radiation": 87 | k *= Math.Max(Radiation.Nominal, (env.landed ? env.surface_rad : env.magnetopause_rad) + va.emitted); 88 | break; 89 | 90 | case "shielding": 91 | k *= 1.0 - va.shielding; 92 | break; 93 | 94 | case "volume": 95 | k *= va.volume; 96 | break; 97 | 98 | case "surface": 99 | k *= va.surface; 100 | break; 101 | 102 | case "living_space": 103 | k /= va.living_space; 104 | break; 105 | 106 | case "comfort": 107 | k /= va.comforts.factor; 108 | break; 109 | 110 | case "pressure": 111 | k *= va.pressurized ? 1.0 : Settings.PressureFactor; 112 | break; 113 | 114 | case "poisoning": 115 | k *= !va.scrubbed ? 1.0 : Settings.PoisoningFactor; 116 | break; 117 | 118 | case "per_capita": 119 | k /= (double)Math.Max(va.crew_count, 1); 120 | break; 121 | 122 | default: 123 | k *= sim.resource(mod).amount; 124 | break; 125 | } 126 | } 127 | return k; 128 | } 129 | } 130 | 131 | 132 | } // KERBALISM -------------------------------------------------------------------------------- /src/UI/VesselConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | 6 | namespace KERBALISM { 7 | 8 | 9 | public static class VesselConfig 10 | { 11 | public static void config(this Panel p, Vessel v) 12 | { 13 | // avoid corner-case when this is called in a lambda after scene changes 14 | v = FlightGlobals.FindVessel(v.id); 15 | 16 | // if vessel doesn't exist anymore, leave the panel empty 17 | if (v == null) return; 18 | 19 | // get info from the cache 20 | vessel_info vi = Cache.VesselInfo(v); 21 | 22 | // if not a valid vessel, leave the panel empty 23 | if (!vi.is_valid) return; 24 | 25 | // set metadata 26 | p.title(Lib.BuildString(Lib.Ellipsis(v.vesselName, 20), " VESSEL CONFIG")); 27 | 28 | // time-out simulation 29 | if (p.timeout(vi)) return; 30 | 31 | // get data from db 32 | VesselData vd = DB.Vessel(v); 33 | 34 | // toggle rendering 35 | string tooltip; 36 | if (Features.Signal || Features.Reliability) 37 | { 38 | p.section("RENDERING"); 39 | } 40 | if (Features.Signal) 41 | { 42 | tooltip = "Render the connection line\nin mapview and tracking station"; 43 | p.content("show links", string.Empty, tooltip); 44 | p.icon(vd.cfg_showlink ? Icons.toggle_green : Icons.toggle_red, tooltip, () => p.toggle(ref vd.cfg_showlink)); 45 | } 46 | if (Features.Reliability) 47 | { 48 | tooltip = "Highlight failed components"; 49 | p.content("highlight malfunctions", string.Empty, tooltip); 50 | p.icon(vd.cfg_highlights ? Icons.toggle_green : Icons.toggle_red, tooltip, () => p.toggle(ref vd.cfg_highlights)); 51 | } 52 | 53 | // toggle messages 54 | p.section("MESSAGES"); 55 | tooltip = "Receive a message when\nElectricCharge level is low"; 56 | p.content("battery", string.Empty, tooltip); 57 | p.icon(vd.cfg_ec ? Icons.toggle_green : Icons.toggle_red, tooltip, () => p.toggle(ref vd.cfg_ec)); 58 | if (Features.Supplies) 59 | { 60 | tooltip = "Receive a message when\nsupply resources level is low"; 61 | p.content("supply", string.Empty, tooltip); 62 | p.icon(vd.cfg_supply ? Icons.toggle_green : Icons.toggle_red, tooltip, () => p.toggle(ref vd.cfg_supply)); 63 | } 64 | if (Features.Signal) 65 | { 66 | tooltip = "Receive a message when signal is lost or obtained"; 67 | p.content("signal", string.Empty, tooltip); 68 | p.icon(vd.cfg_signal ? Icons.toggle_green : Icons.toggle_red, tooltip, () => p.toggle(ref vd.cfg_signal)); 69 | } 70 | if (Features.Reliability) 71 | { 72 | tooltip = "Receive a message\nwhen a component fail"; 73 | p.content("reliability", string.Empty, tooltip); 74 | p.icon(vd.cfg_malfunction ? Icons.toggle_green : Icons.toggle_red, tooltip, () => p.toggle(ref vd.cfg_malfunction)); 75 | } 76 | if (Features.SpaceWeather) 77 | { 78 | tooltip = "Receive a message\nduring CME events"; 79 | p.content("storm", string.Empty, tooltip); 80 | p.icon(vd.cfg_storm ? Icons.toggle_green : Icons.toggle_red, tooltip, () => p.toggle(ref vd.cfg_storm)); 81 | } 82 | if (Features.Automation) 83 | { 84 | tooltip = "Receive a message when\nscripts are executed"; 85 | p.content("script", string.Empty, tooltip); 86 | p.icon(vd.cfg_script ? Icons.toggle_green : Icons.toggle_red, tooltip, () => p.toggle(ref vd.cfg_script)); 87 | } 88 | } 89 | } 90 | 91 | 92 | } // KERBALISM 93 | 94 | -------------------------------------------------------------------------------- /src/UI/BodyInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | 6 | namespace KERBALISM { 7 | 8 | 9 | public static class BodyInfo 10 | { 11 | public static void body_info(this Panel p) 12 | { 13 | // only show in mapview 14 | if (!MapView.MapIsEnabled) return; 15 | 16 | // only show if there is a selected body and that body is not the sun 17 | CelestialBody body = Lib.SelectedBody(); 18 | if (body == null || (body.flightGlobalsIndex == 0 && !Features.Radiation)) return; 19 | 20 | // shortcut 21 | CelestialBody sun = FlightGlobals.Bodies[0]; 22 | 23 | // for all bodies except the sun 24 | if (body != sun) 25 | { 26 | // calculate simulation values 27 | double atmo_factor = Sim.AtmosphereFactor(body, 0.7071); 28 | double gamma_factor = Sim.GammaTransparency(body, 0.0); 29 | double sun_dist = Sim.Apoapsis(Lib.PlanetarySystem(body)) - sun.Radius - body.Radius; 30 | Vector3d sun_dir = (sun.position - body.position).normalized; 31 | double solar_flux = Sim.SolarFlux(sun_dist) * atmo_factor; 32 | double albedo_flux = Sim.AlbedoFlux(body, body.position + sun_dir * body.Radius); 33 | double body_flux = Sim.BodyFlux(body, 0.0); 34 | double total_flux = solar_flux + albedo_flux + body_flux + Sim.BackgroundFlux(); 35 | double temperature = body.atmosphere ? body.GetTemperature(0.0) : Sim.BlackBodyTemperature(total_flux); 36 | 37 | // calculate night-side temperature 38 | double total_flux_min = Sim.AlbedoFlux(body, body.position - sun_dir * body.Radius) + body_flux + Sim.BackgroundFlux(); 39 | double temperature_min = Sim.BlackBodyTemperature(total_flux_min); 40 | 41 | // calculate radiation at body surface 42 | double radiation = Radiation.ComputeSurface(body, gamma_factor); 43 | 44 | // surface panel 45 | string temperature_str = body.atmosphere 46 | ? Lib.HumanReadableTemp(temperature) 47 | : Lib.BuildString(Lib.HumanReadableTemp(temperature_min), " / ", Lib.HumanReadableTemp(temperature)); 48 | p.section("SURFACE"); 49 | p.content("temperature", temperature_str); 50 | p.content("solar flux", Lib.HumanReadableFlux(solar_flux)); 51 | if (Features.Radiation) p.content("radiation", Lib.HumanReadableRadiation(radiation)); 52 | 53 | // atmosphere panel 54 | if (body.atmosphere) 55 | { 56 | p.section("ATMOSPHERE"); 57 | p.content("breathable", Sim.Breathable(body) ? "yes" : "no"); 58 | p.content("light absorption", Lib.HumanReadablePerc(1.0 - Sim.AtmosphereFactor(body, 0.7071))); 59 | if (Features.Radiation) p.content("gamma absorption", Lib.HumanReadablePerc(1.0 - Sim.GammaTransparency(body, 0.0))); 60 | } 61 | } 62 | 63 | // rendering panel 64 | if (Features.Radiation) 65 | { 66 | p.section("RENDERING"); 67 | p.content("inner belt", Radiation.show_inner ? "show" : "hide", string.Empty, () => p.toggle(ref Radiation.show_inner)); 68 | p.content("outer belt", Radiation.show_outer ? "show" : "hide", string.Empty, () => p.toggle(ref Radiation.show_outer)); 69 | p.content("magnetopause", Radiation.show_pause ? "show" : "hide", string.Empty, () => p.toggle(ref Radiation.show_pause)); 70 | } 71 | 72 | // explain the user how to toggle the BodyInfo window 73 | p.content(string.Empty); 74 | p.content("Press B to open this window again"); 75 | 76 | // set metadata 77 | p.title(Lib.BuildString(Lib.Ellipsis(body.bodyName, 24), " BODY INFO")); 78 | } 79 | } 80 | 81 | 82 | } // KERBALISM -------------------------------------------------------------------------------- /GameData/Kerbalism/Support/SXT.cfg: -------------------------------------------------------------------------------- 1 | @PART[SXTTubeAntenna]:NEEDS[SXT,FeatureSignal]:FOR[Kerbalism] 2 | { 3 | MODULE 4 | { 5 | name = Antenna 6 | type = low_gain 7 | cost = 0.12 8 | dist = 2e8 9 | rate = 0.008 10 | } 11 | 12 | MODULE:NEEDS[FeatureReliability] 13 | { 14 | name = Reliability 15 | type = Antenna 16 | title = Antenna 17 | redundancy = Communication 18 | repair = Engineer 19 | mtbf = 72576000 // 8y 20 | extra_cost = 2.0 21 | extra_mass = 0.25 22 | } 23 | } 24 | 25 | @PART[SXTAntenna]:NEEDS[SXT,FeatureSignal]:FOR[Kerbalism] 26 | { 27 | MODULE 28 | { 29 | name = Antenna 30 | type = low_gain 31 | cost = 0.12 32 | dist = 5e6 33 | rate = 0.012 34 | } 35 | 36 | MODULE:NEEDS[FeatureReliability] 37 | { 38 | name = Reliability 39 | type = Antenna 40 | title = Antenna 41 | redundancy = Communication 42 | repair = Engineer 43 | mtbf = 72576000 // 8y 44 | extra_cost = 2.0 45 | extra_mass = 0.25 46 | } 47 | } 48 | 49 | @PART[LprobeFoil]:NEEDS[SXT,FeatureSignal]:FOR[Kerbalism] 50 | { 51 | MODULE 52 | { 53 | name = Antenna 54 | type = low_gain 55 | cost = 0.12 56 | dist = 5e8 57 | rate = 0.02 58 | } 59 | 60 | MODULE:NEEDS[FeatureReliability] 61 | { 62 | name = Reliability 63 | type = Antenna 64 | title = Antenna 65 | redundancy = Communication 66 | repair = Engineer 67 | mtbf = 72576000 // 8y 68 | extra_cost = 2.0 69 | extra_mass = 0.25 70 | } 71 | } 72 | 73 | @PART[SXTAlouetteI]:NEEDS[SXT,FeatureSignal]:FOR[Kerbalism] 74 | { 75 | MODULE 76 | { 77 | name = Antenna 78 | type = low_gain 79 | cost = 0.12 80 | dist = 5e5 81 | rate = 0.012 82 | } 83 | 84 | MODULE:NEEDS[FeatureReliability] 85 | { 86 | name = Reliability 87 | type = Antenna 88 | title = Antenna 89 | redundancy = Communication 90 | repair = Engineer 91 | mtbf = 72576000 // 8y 92 | extra_cost = 2.0 93 | extra_mass = 0.25 94 | } 95 | } 96 | 97 | @PART[SXTsciencenosecone]:NEEDS[SXT,FeatureSignal]:FOR[Kerbalism] 98 | { 99 | MODULE 100 | { 101 | name = Antenna 102 | type = low_gain 103 | cost = 0.12 104 | dist = 5e6 105 | rate = 0.012 106 | } 107 | 108 | MODULE:NEEDS[FeatureReliability] 109 | { 110 | name = Reliability 111 | type = Antenna 112 | title = Antenna 113 | redundancy = Communication 114 | repair = Engineer 115 | mtbf = 72576000 // 8y 116 | extra_cost = 2.0 117 | extra_mass = 0.25 118 | } 119 | } 120 | 121 | @PART[SXTDLK83EHabitat]:NEEDS[SXT,FeatureComfort]:FOR[Kerbalism] 122 | { 123 | MODULE 124 | { 125 | name = Comfort 126 | bonus = exercise 127 | desc = A treadmill designed to permit exercise in zero-g is included. The crew will love it. 128 | } 129 | 130 | MODULE:NEEDS[FeatureReliability] 131 | { 132 | name = Reliability 133 | type = Comfort 134 | title = Treadmill 135 | repair = Engineer 136 | mtbf = 36288000 // 4y 137 | extra_cost = 0.25 138 | extra_mass = 0.05 139 | } 140 | 141 | @tags ^= :$: comfort: 142 | } 143 | 144 | 145 | @PART[SXTNERVAB]:NEEDS[SXT,FeatureRadiation]:FOR[Kerbalism] 146 | { 147 | MODULE 148 | { 149 | name = Emitter 150 | radiation = 0.0000052221 151 | } 152 | } 153 | @PART[SXTNERVA]:NEEDS[SXT,FeatureRadiation]:FOR[Kerbalism] 154 | { 155 | MODULE 156 | { 157 | name = Emitter 158 | radiation = 0.0000041666 159 | } 160 | } 161 | @PART[SXTnuclearramjet]:NEEDS[SXT,FeatureRadiation]:FOR[Kerbalism] 162 | { 163 | MODULE 164 | { 165 | name = Emitter 166 | radiation = 0.0000083331 167 | } 168 | } -------------------------------------------------------------------------------- /GameData/Kerbalism/Settings.cfg: -------------------------------------------------------------------------------- 1 | Kerbalism 2 | { 3 | // profile used 4 | Profile = default // valid values are: 'default', 'classic, 'none' or custom profiles 5 | 6 | // user-defined features 7 | Reliability = true // component malfunctions and critical failures 8 | Signal = true // communications using low-gain and high-gain antennas 9 | Science = true // science data storage, transmission and analysis 10 | SpaceWeather = true // coronal mass ejections 11 | Automation = true // control vessel components using scripts 12 | 13 | // temperature settings 14 | SurvivalTemperature = 295.0 // ideal living temperature 15 | SurvivalRange = 5.0 // sweet spot around survival temperature 16 | 17 | // quality-of-life settings 18 | IdealLivingSpace = 40.0 // ideal living space per-capita in m^3 19 | ComfortFirmGround = 0.4 // firm-ground comfort factor 20 | ComfortExercise = 0.2 // exercise comfort factor 21 | ComfortNotAlone = 0.1 // not-alone comfort factor 22 | ComfortCallHome = 0.1 // call-home comfort factor 23 | ComfortPanorama = 0.1 // panorama comfort factor 24 | 25 | // pressure settings 26 | PressureFactor = 10.0 // pressurized modifier value for vessels below the threshold 27 | PressureThreshold = 0.9 // level of atmosphere resource that determine pressurized status 28 | 29 | // poisoning settings 30 | PoisoningFactor = 0.0 // poisoning modifier value for vessels below the threshold 31 | PoisoningThreshold = 0.02 // level of waste atmosphere resource that determine co2 poisoning status 32 | 33 | // radiation settings 34 | ShieldingEfficiency = 0.9 // proportion of radiation blocked by shielding (at max amount) 35 | StormRadiation = 5.0 // radiation during a CME event in rad/h 36 | ExternRadiation = 0.04 // radiation outside the heliopause in rad/h 37 | 38 | // storm settings 39 | StormMinTime = 2160000.0 // minimum interval between storms over a system 40 | StormMaxTime = 8640000.0 // maximum interval between storms over a system 41 | StormDuration = 21600.0 // how long a storm last once it hit 42 | StormEjectionSpeed = 1000000.0 // cme speed in m/s 43 | 44 | // signal settings 45 | UnlinkedControl = none // available control for unlinked vessels: 'none', 'limited' or 'full' 46 | ExtendedAntenna = true // antenna only work if extended 47 | 48 | // science settings 49 | ScienceDialog = true // keep showing the stock science dialog 50 | 51 | // reliability settings 52 | QualityScale = 4.0 // scale applied to MTBF for high-quality components 53 | CriticalChance = 0.25 // proportion of malfunctions that lead to critical failures 54 | SafeModeChance = 0.5 // proportion of malfunctions fixed remotely for unmanned vessels 55 | IncentiveRedundancy = false // each malfunction will increase the MTBF of components in the same redundancy group 56 | 57 | // misc 58 | EnforceCoherency = true // detect and avoid issues at high timewarp in external modules 59 | TrackingPivot = true // simulate tracking solar panel around the pivot 60 | HeadLampsCost = 0.002 // EC/s cost if eva headlamps are on 61 | DeathReputation = 100.0 // reputation to remove in case of death 62 | BreakdownReputation = 10.0 // reputation to remove in case of breakdown 63 | StockMessages = false // use the stock message system instead of our own 64 | MessageLength = 4 // duration of messages on screen in seconds 65 | LowQualityRendering = false // use less particles to render the magnetic fields 66 | } 67 | 68 | --------------------------------------------------------------------------------