Files
tbd-station-14/Content.Server/Atmos/Reactions/MiasmicSubsumationReaction.cs
Kara 7a553781cc Frezon (#9980)
* stuff i'll have to fix anyway when n2o gets merged

* everything except the finished reactions

* freon coolant reaction but with bad curve

* miasmic subsumation

* freon production

* nitrogen and diff temp scaling

* uhh meant to change that

* #

* hitting that frezon boof
2022-07-27 04:55:28 -05:00

26 lines
882 B
C#

using Content.Server.Atmos.EntitySystems;
using Content.Shared.Atmos;
using JetBrains.Annotations;
namespace Content.Server.Atmos.Reactions;
/// <summary>
/// Converts frezon into miasma when the two come into contact. Does not occur at very high temperatures.
/// </summary>
[UsedImplicitly]
public sealed class MiasmicSubsumationReaction : IGasReactionEffect
{
public ReactionResult React(GasMixture mixture, IGasMixtureHolder? holder, AtmosphereSystem atmosphereSystem)
{
var initialMiasma = mixture.GetMoles(Gas.Miasma);
var initialFrezon = mixture.GetMoles(Gas.Frezon);
var convert = Math.Min(Math.Min(initialFrezon, initialMiasma), Atmospherics.MiasmicSubsumationMaxConversionRate);
mixture.AdjustMoles(Gas.Miasma, convert);
mixture.AdjustMoles(Gas.Frezon, -convert);
return ReactionResult.Reacting;
}
}