-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 237.2.0 * feat: /tg/ gases * Revert "237.2.0" This reverts commit 08ecd6b. * fix: sound * Revert "237.2.0" This reverts commit 08ecd6b. * tweak: AI rewie * fix: tupo * Revert "237.2.0" This reverts commit 08ecd6b. * fix: tupo
- Loading branch information
Showing
55 changed files
with
2,606 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
Content.Server/_White/Atmos/Reactions/BZProductionReaction.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
using Content.Server.Atmos; | ||
using Content.Server.Atmos.EntitySystems; | ||
using Content.Shared.Atmos; | ||
using Content.Shared.Atmos.Reactions; | ||
using JetBrains.Annotations; | ||
|
||
namespace Content.Server._White.Atmos.Reactions; | ||
|
||
[UsedImplicitly] | ||
public sealed partial class BZProductionReaction : IGasReactionEffect | ||
{ | ||
public ReactionResult React(GasMixture mixture, IGasMixtureHolder? holder, AtmosphereSystem atmosphereSystem, float heatScale) | ||
{ | ||
var initialHyperNoblium = mixture.GetMoles(Gas.HyperNoblium); | ||
if (initialHyperNoblium >= 5.0f && mixture.Temperature > 20f) | ||
return ReactionResult.NoReaction; | ||
|
||
var initialNitrousOxide = mixture.GetMoles(Gas.NitrousOxide); | ||
var initialPlasma = mixture.GetMoles(Gas.Plasma); | ||
|
||
var environmentEfficiency = mixture.Volume / mixture.Pressure; | ||
var ratioEfficiency = Math.Min(initialNitrousOxide / initialPlasma, 1); | ||
|
||
var BZFormed = Math.Min(0.01f * ratioEfficiency * environmentEfficiency, Math.Min(initialNitrousOxide * 0.4f, initialPlasma * 0.8f)); | ||
|
||
if (initialNitrousOxide - BZFormed * 0.4f < 0 || initialPlasma - (0.8f - BZFormed) < 0 || BZFormed <= 0) | ||
return ReactionResult.NoReaction; | ||
|
||
var oldHeatCapacity = atmosphereSystem.GetHeatCapacity(mixture, true); | ||
|
||
var amountDecomposed = 0.0f; | ||
var nitrousOxideDecomposedFactor = Math.Max(4.0f * (initialPlasma / (initialNitrousOxide + initialPlasma) - 0.75f), 0); | ||
if (nitrousOxideDecomposedFactor > 0) | ||
{ | ||
amountDecomposed = 0.4f * BZFormed * nitrousOxideDecomposedFactor; | ||
mixture.AdjustMoles(Gas.Oxygen, amountDecomposed); | ||
mixture.AdjustMoles(Gas.Nitrogen, 0.5f * amountDecomposed); | ||
} | ||
|
||
mixture.AdjustMoles(Gas.BZ, Math.Max(0f, BZFormed * (1.0f - nitrousOxideDecomposedFactor))); | ||
mixture.AdjustMoles(Gas.NitrousOxide, -0.4f * BZFormed); | ||
mixture.AdjustMoles(Gas.Plasma, -0.8f * BZFormed * (1.0f - nitrousOxideDecomposedFactor)); | ||
|
||
var energyReleased = BZFormed * (Atmospherics.BZFormationEnergy + nitrousOxideDecomposedFactor * (Atmospherics.NitrousOxideDecompositionEnergy - Atmospherics.BZFormationEnergy)); | ||
|
||
var newHeatCapacity = atmosphereSystem.GetHeatCapacity(mixture, true); | ||
if (newHeatCapacity > Atmospherics.MinimumHeatCapacity) | ||
mixture.Temperature = Math.Max((mixture.Temperature * oldHeatCapacity + energyReleased) / newHeatCapacity, Atmospherics.TCMB); | ||
|
||
return ReactionResult.Reacting; | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
Content.Server/_White/Atmos/Reactions/HalonOxygenAbsorptionReaction.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using Content.Server.Atmos; | ||
using Content.Server.Atmos.EntitySystems; | ||
using Content.Shared.Atmos; | ||
using Content.Shared.Atmos.Reactions; | ||
using JetBrains.Annotations; | ||
|
||
namespace Content.Server._White.Atmos.Reactions; | ||
|
||
[UsedImplicitly] | ||
public sealed partial class HalonOxygenAbsorptionReaction : IGasReactionEffect | ||
{ | ||
public ReactionResult React(GasMixture mixture, IGasMixtureHolder? holder, AtmosphereSystem atmosphereSystem, float heatScale) | ||
{ | ||
var initialHyperNoblium = mixture.GetMoles(Gas.HyperNoblium); | ||
if (initialHyperNoblium >= 5.0f && mixture.Temperature > 20f) | ||
return ReactionResult.NoReaction; | ||
|
||
var initialHalon = mixture.GetMoles(Gas.Halon); | ||
var initialOxygen = mixture.GetMoles(Gas.Oxygen); | ||
|
||
var temperature = mixture.Temperature; | ||
|
||
var heatEfficiency = Math.Min(temperature / (Atmospherics.FireMinimumTemperatureToExist * 10f), Math.Min(initialHalon, initialOxygen*20f)); | ||
if (heatEfficiency <= 0f || initialHalon - heatEfficiency < 0f || initialOxygen - heatEfficiency * 20f < 0f) | ||
return ReactionResult.NoReaction; | ||
|
||
var oldHeatCapacity = atmosphereSystem.GetHeatCapacity(mixture, true); | ||
|
||
mixture.AdjustMoles(Gas.Halon, -heatEfficiency); | ||
mixture.AdjustMoles(Gas.Oxygen, -heatEfficiency*20f); | ||
mixture.AdjustMoles(Gas.CarbonDioxide, heatEfficiency*5f); | ||
|
||
var energyUsed = heatEfficiency * Atmospherics.HalonCombustionEnergy; | ||
var newHeatCapacity = atmosphereSystem.GetHeatCapacity(mixture, true); | ||
if (newHeatCapacity > Atmospherics.MinimumHeatCapacity) | ||
mixture.Temperature = Math.Max((mixture.Temperature * oldHeatCapacity + energyUsed) / newHeatCapacity, Atmospherics.TCMB); | ||
|
||
return ReactionResult.Reacting; | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
Content.Server/_White/Atmos/Reactions/HealiumProductionReaction.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
using Content.Server.Atmos; | ||
using Content.Server.Atmos.EntitySystems; | ||
using Content.Shared.Atmos; | ||
using Content.Shared.Atmos.Reactions; | ||
using JetBrains.Annotations; | ||
|
||
namespace Content.Server._White.Atmos.Reactions; | ||
|
||
[UsedImplicitly] | ||
public sealed partial class HealiumProductionReaction : IGasReactionEffect | ||
{ | ||
public ReactionResult React(GasMixture mixture, IGasMixtureHolder? holder, AtmosphereSystem atmosphereSystem, float heatScale) | ||
{ | ||
var initialHyperNoblium = mixture.GetMoles(Gas.HyperNoblium); | ||
if (initialHyperNoblium >= 5.0f && mixture.Temperature > 20f) | ||
return ReactionResult.NoReaction; | ||
|
||
var initialBZ = mixture.GetMoles(Gas.BZ); | ||
var initialFrezon = mixture.GetMoles(Gas.Frezon); | ||
|
||
var temperature = mixture.Temperature; | ||
var heatEfficiency = Math.Min(temperature*0.3f, Math.Min(initialFrezon*2.75f, initialBZ*0.25f)); | ||
|
||
if (heatEfficiency <= 0 || initialFrezon - heatEfficiency * 2.75f < 0 || initialBZ - heatEfficiency * 0.25f < 0) | ||
return ReactionResult.NoReaction; | ||
|
||
var oldHeatCapacity = atmosphereSystem.GetHeatCapacity(mixture, true); | ||
|
||
mixture.AdjustMoles(Gas.Frezon, -heatEfficiency*2.75f); | ||
mixture.AdjustMoles(Gas.BZ, -heatEfficiency*0.25f); | ||
mixture.AdjustMoles(Gas.Healium, heatEfficiency*3); | ||
|
||
var energyReleased = heatEfficiency * Atmospherics.HealiumFormationEnergy; | ||
|
||
var newHeatCapacity = atmosphereSystem.GetHeatCapacity(mixture, true); | ||
if (newHeatCapacity > Atmospherics.MinimumHeatCapacity) | ||
mixture.Temperature = Math.Max((mixture.Temperature * oldHeatCapacity + energyReleased) / newHeatCapacity, Atmospherics.TCMB); | ||
|
||
return ReactionResult.Reacting; | ||
} | ||
} |
Oops, something went wrong.