атмос гейминг indeed (#513)
* fix hypernob + plasma and trit fire * add 11 new gas types * actually fix hypernob --------- Co-authored-by: halicopter <kirillhalic@gmail.com>
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
using Content.Server.Atmos.EntitySystems;
|
||||
using Content.Shared.Atmos;
|
||||
using JetBrains.Annotations;
|
||||
|
||||
namespace Content.Server.Atmos.Reactions;
|
||||
|
||||
[UsedImplicitly]
|
||||
public sealed class NitriumDecompositionReaction : IGasReactionEffect
|
||||
{
|
||||
public ReactionResult React(GasMixture mixture, IGasMixtureHolder? holder, AtmosphereSystem atmosphereSystem)
|
||||
{
|
||||
var initialHyperNoblium = mixture.GetMoles(Gas.HyperNoblium);
|
||||
if (initialHyperNoblium >= 5.0f && mixture.Temperature > 20f)
|
||||
return ReactionResult.NoReaction;
|
||||
|
||||
var initialNitrium = mixture.GetMoles(Gas.Nitrium);
|
||||
|
||||
var temperature = mixture.Temperature;
|
||||
var heatEfficiency = Math.Min(temperature / Atmospherics.NitriumDecompositionTempDivisor, initialNitrium);
|
||||
|
||||
if (heatEfficiency <= 0 || initialNitrium - heatEfficiency < 0)
|
||||
return ReactionResult.NoReaction;
|
||||
|
||||
var oldHeatCapacity = atmosphereSystem.GetHeatCapacity(mixture);
|
||||
|
||||
mixture.AdjustMoles(Gas.Nitrium, -heatEfficiency);
|
||||
mixture.AdjustMoles(Gas.Hydrogen, heatEfficiency);
|
||||
mixture.AdjustMoles(Gas.Nitrogen, heatEfficiency);
|
||||
|
||||
var energyReleased = heatEfficiency * Atmospherics.NitriumDecompositionEnergy;
|
||||
|
||||
var newHeatCapacity = atmosphereSystem.GetHeatCapacity(mixture);
|
||||
if (newHeatCapacity > Atmospherics.MinimumHeatCapacity)
|
||||
mixture.Temperature = Math.Max((mixture.Temperature * oldHeatCapacity + energyReleased) / newHeatCapacity, Atmospherics.TCMB);
|
||||
|
||||
return ReactionResult.Reacting;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user