Adds tritium fire reaction and water vapor, fix gas reactions (#1623)

hehe Tritfire go BRRRR
This commit is contained in:
Víctor Aguilera Puerto
2020-08-08 19:16:24 +02:00
committed by GitHub
parent cc9f16e738
commit b5a976b173
8 changed files with 144 additions and 14 deletions

View File

@@ -35,6 +35,13 @@ namespace Content.Server.Atmos
[ViewVariables]
public float LastShare { get; private set; } = 0;
[ViewVariables]
public readonly Dictionary<GasReaction, float> ReactionResults = new Dictionary<GasReaction, float>()
{
// We initialize the dictionary here.
{ GasReaction.Fire, 0f }
};
[ViewVariables]
public float HeatCapacity
{
@@ -107,8 +114,6 @@ namespace Content.Server.Atmos
}
}
public float ReactionResultFire { get; set; }
[ViewVariables]
public float ThermalEnergy => Temperature * HeatCapacity;
@@ -452,19 +457,25 @@ namespace Content.Server.Atmos
temperature < prototype.MinimumTemperatureRequirement)
continue;
var doReaction = true;
for (var i = 0; i < prototype.MinimumRequirements.Length; i++)
{
if(i > Atmospherics.TotalNumberOfGases)
throw new IndexOutOfRangeException("Reaction Gas Minimum Requirements Array Prototype exceeds total number of gases!");
var req = prototype.MinimumRequirements[i];
if (GetMoles(i) < req)
continue;
reaction = prototype.React(this, holder);
if(reaction.HasFlag(ReactionResult.StopReactions))
break;
if (!(GetMoles(i) < req)) continue;
doReaction = false;
break;
}
if (!doReaction)
continue;
reaction = prototype.React(this, holder);
if(reaction.HasFlag(ReactionResult.StopReactions))
break;
}
return reaction;