From: Tom Leys Date: Wed, 17 May 2023 19:22:56 +0000 (+1200) Subject: Plasma still creates tritium down to 1 to 32 concentration (#16517) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=e4ccd13845a48cd8eb987d770a89bb002917157e;p=space-station-14.git Plasma still creates tritium down to 1 to 32 concentration (#16517) - But it's less efficient --- diff --git a/Content.Server/Atmos/Reactions/PlasmaFireReaction.cs b/Content.Server/Atmos/Reactions/PlasmaFireReaction.cs index c0e830f250..cd8a773344 100644 --- a/Content.Server/Atmos/Reactions/PlasmaFireReaction.cs +++ b/Content.Server/Atmos/Reactions/PlasmaFireReaction.cs @@ -34,7 +34,11 @@ namespace Content.Server.Atmos.Reactions var initialPlasmaMoles = mixture.GetMoles(Gas.Plasma); // Supersaturation makes tritium. - var supersaturation = initialOxygenMoles / initialPlasmaMoles > Atmospherics.SuperSaturationThreshold; + var oxyRatio = initialOxygenMoles / initialPlasmaMoles; + // Efficiency of reaction decreases from 1% Plasma to 3% plasma: + var supersaturation = Math.Clamp((oxyRatio - Atmospherics.SuperSaturationEnds) / + (Atmospherics.SuperSaturationThreshold - + Atmospherics.SuperSaturationEnds), 0.0f, 1.0f); if (initialOxygenMoles > initialPlasmaMoles * Atmospherics.PlasmaOxygenFullburn) plasmaBurnRate = initialPlasmaMoles * temperatureScale / Atmospherics.PlasmaBurnRateDelta; @@ -46,7 +50,10 @@ namespace Content.Server.Atmos.Reactions plasmaBurnRate = MathF.Min(plasmaBurnRate, MathF.Min(initialPlasmaMoles, initialOxygenMoles / oxygenBurnRate)); mixture.SetMoles(Gas.Plasma, initialPlasmaMoles - plasmaBurnRate); mixture.SetMoles(Gas.Oxygen, initialOxygenMoles - plasmaBurnRate * oxygenBurnRate); - mixture.AdjustMoles(supersaturation ? Gas.Tritium : Gas.CarbonDioxide, plasmaBurnRate); + + // supersaturation adjusts the ratio of produced tritium to unwanted CO2 + mixture.AdjustMoles(Gas.Tritium, plasmaBurnRate * supersaturation); + mixture.AdjustMoles(Gas.CarbonDioxide, plasmaBurnRate * (1.0f - supersaturation)); energyReleased += Atmospherics.FirePlasmaEnergyReleased * plasmaBurnRate; mixture.ReactionResults[GasReaction.Fire] += plasmaBurnRate * (1 + oxygenBurnRate); diff --git a/Content.Shared/Atmos/Atmospherics.cs b/Content.Shared/Atmos/Atmospherics.cs index e2be8d73ff..293866ed77 100644 --- a/Content.Shared/Atmos/Atmospherics.cs +++ b/Content.Shared/Atmos/Atmospherics.cs @@ -187,6 +187,7 @@ namespace Content.Shared.Atmos public const float FireGrowthRate = 40000f; public const float SuperSaturationThreshold = 96f; + public const float SuperSaturationEnds = SuperSaturationThreshold / 3; public const float OxygenBurnRateBase = 1.4f; public const float PlasmaMinimumBurnTemperature = (100f+T0C);