Rename Miasma to Ammonia (#22791)
* Rename Miasma to Ammonia * Namespace changes * Map change????? why
This commit is contained in:
@@ -28,7 +28,7 @@ namespace Content.Server.Atmos.Portable
|
||||
Gas.Plasma,
|
||||
Gas.Tritium,
|
||||
Gas.WaterVapor,
|
||||
Gas.Miasma,
|
||||
Gas.Ammonia,
|
||||
Gas.NitrousOxide,
|
||||
Gas.Frezon
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@ using Content.Shared.Atmos;
|
||||
using Content.Server.Atmos.EntitySystems;
|
||||
using Content.Server.Body.Components;
|
||||
using Content.Server.Temperature.Components;
|
||||
using Content.Shared.Atmos.Miasma;
|
||||
using Content.Shared.Atmos.Rotting;
|
||||
using Content.Shared.Examine;
|
||||
using Content.Shared.Mobs;
|
||||
using Content.Shared.Mobs.Components;
|
||||
@@ -14,7 +14,7 @@ using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Physics.Components;
|
||||
using Robust.Shared.Timing;
|
||||
|
||||
namespace Content.Server.Atmos.Miasma;
|
||||
namespace Content.Server.Atmos.Rotting;
|
||||
|
||||
public sealed class RottingSystem : EntitySystem
|
||||
{
|
||||
@@ -119,7 +119,7 @@ public sealed class RottingSystem : EntitySystem
|
||||
|
||||
var molsToDump = perishable.MolsPerSecondPerUnitMass * physics.FixturesMass * (float) component.TotalRotTime.TotalSeconds;
|
||||
var tileMix = _atmosphere.GetTileMixture(uid, excite: true);
|
||||
tileMix?.AdjustMoles(Gas.Miasma, molsToDump);
|
||||
tileMix?.AdjustMoles(Gas.Ammonia, molsToDump);
|
||||
}
|
||||
|
||||
private void OnExamined(EntityUid uid, RottingComponent component, ExaminedEvent args)
|
||||
@@ -127,9 +127,9 @@ public sealed class RottingSystem : EntitySystem
|
||||
var stage = RotStage(uid, component);
|
||||
var description = stage switch
|
||||
{
|
||||
>= 2 => "miasma-extremely-bloated",
|
||||
>= 1 => "miasma-bloated",
|
||||
_ => "miasma-rotting"
|
||||
>= 2 => "rotting-extremely-bloated",
|
||||
>= 1 => "rotting-bloated",
|
||||
_ => "rotting-rotting"
|
||||
};
|
||||
args.PushMarkup(Loc.GetString(description));
|
||||
}
|
||||
@@ -213,7 +213,7 @@ public sealed class RottingSystem : EntitySystem
|
||||
// or just remove the mass mechanics altogether because they aren't good.
|
||||
var molRate = perishable.MolsPerSecondPerUnitMass * (float) rotting.RotUpdateRate.TotalSeconds;
|
||||
var tileMix = _atmosphere.GetTileMixture(uid, excite: true);
|
||||
tileMix?.AdjustMoles(Gas.Miasma, molRate * physics.FixturesMass);
|
||||
tileMix?.AdjustMoles(Gas.Ammonia, molRate * physics.FixturesMass);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user