Rename Miasma to Ammonia (#22791)
* Rename Miasma to Ammonia * Namespace changes * Map change????? why
This commit is contained in:
@@ -5,25 +5,25 @@ using JetBrains.Annotations;
|
||||
namespace Content.Server.Atmos.Reactions;
|
||||
|
||||
[UsedImplicitly]
|
||||
public sealed partial class MiasmaOxygenReaction : IGasReactionEffect
|
||||
public sealed partial class AmmoniaOxygenReaction : IGasReactionEffect
|
||||
{
|
||||
public ReactionResult React(GasMixture mixture, IGasMixtureHolder? holder, AtmosphereSystem atmosphereSystem, float heatScale)
|
||||
{
|
||||
var nMiasma = mixture.GetMoles(Gas.Miasma);
|
||||
var nAmmonia = mixture.GetMoles(Gas.Ammonia);
|
||||
var nOxygen = mixture.GetMoles(Gas.Oxygen);
|
||||
var nTotal = mixture.TotalMoles;
|
||||
|
||||
// Concentration-dependent reaction rate
|
||||
var fMiasma = nMiasma/nTotal;
|
||||
var fAmmonia = nAmmonia/nTotal;
|
||||
var fOxygen = nOxygen/nTotal;
|
||||
var rate = MathF.Pow(fMiasma, 2) * MathF.Pow(fOxygen, 2);
|
||||
var rate = MathF.Pow(fAmmonia, 2) * MathF.Pow(fOxygen, 2);
|
||||
|
||||
var deltaMoles = nMiasma / Atmospherics.MiasmaOxygenReactionRate * 2 * rate;
|
||||
var deltaMoles = nAmmonia / Atmospherics.AmmoniaOxygenReactionRate * 2 * rate;
|
||||
|
||||
if (deltaMoles <= 0 || nMiasma - deltaMoles < 0)
|
||||
if (deltaMoles <= 0 || nAmmonia - deltaMoles < 0)
|
||||
return ReactionResult.NoReaction;
|
||||
|
||||
mixture.AdjustMoles(Gas.Miasma, -deltaMoles);
|
||||
mixture.AdjustMoles(Gas.Ammonia, -deltaMoles);
|
||||
mixture.AdjustMoles(Gas.Oxygen, -deltaMoles);
|
||||
mixture.AdjustMoles(Gas.NitrousOxide, deltaMoles / 2);
|
||||
mixture.AdjustMoles(Gas.WaterVapor, deltaMoles * 1.5f);
|
||||
@@ -1,25 +0,0 @@
|
||||
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 partial class MiasmicSubsumationReaction : IGasReactionEffect
|
||||
{
|
||||
public ReactionResult React(GasMixture mixture, IGasMixtureHolder? holder, AtmosphereSystem atmosphereSystem, float heatScale)
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user