Adds temperature to solutions (#5834)

This commit is contained in:
TemporalOroboros
2021-12-24 01:22:34 -08:00
committed by GitHub
parent c94f93732b
commit 201952e618
18 changed files with 858 additions and 21 deletions

View File

@@ -0,0 +1,30 @@
using Content.Shared.Chemistry.Components;
using Content.Shared.Chemistry.Reagent;
using Robust.Shared.Serialization.Manager.Attributes;
namespace Content.Server.Chemistry.ReagentEffectConditions
{
/// <summary>
/// Requires the solution to be above or below a certain temperature.
/// Used for things like explosives.
/// </summary>
public class SolutionTemperature : ReagentEffectCondition
{
[DataField("min")]
public float Min = 0.0f;
[DataField("max")]
public float Max = float.PositiveInfinity;
public override bool Condition(ReagentEffectArgs args)
{
if (args.Source == null)
return false;
if (args.Source.Temperature < Min)
return false;
if (args.Source.Temperature > Max)
return false;
return true;
}
}
}