Add YAML gas reactions (#22803)

* Add YAML gas reactions

* Convert more reactions

* Use enum names

* Convert more names

* Add migration for MiasmaCanister

* Prevent reactants from going negative

* Fix energy conservation, lift energy calculation

* Fix comment

* Comment

* Add rate multiplier
This commit is contained in:
Kevin Zheng
2023-12-21 23:30:56 -08:00
committed by GitHub
parent 0828c32abf
commit 054321d2c2
9 changed files with 189 additions and 269 deletions

View File

@@ -10,6 +10,7 @@ namespace Content.Server.Atmos.EntitySystems
public sealed partial class AtmosphereSystem
{
[Dependency] private readonly IPrototypeManager _protoMan = default!;
[Dependency] private readonly GenericGasReactionSystem _reaction = default!;
private GasReactionPrototype[] _gasReactions = Array.Empty<GasReactionPrototype>();
private float[] _gasSpecificHeats = new float[Atmospherics.TotalNumberOfGases];
@@ -346,7 +347,7 @@ namespace Content.Server.Atmos.EntitySystems
break;
}
return reaction;
return _reaction.ReactAll(GasReactions, mixture, holder);
}
public enum GasCompareResult