2021-12-24 01:22:34 -08:00
|
|
|
using Content.Shared.Chemistry.Reagent;
|
2023-06-04 16:45:02 -04:00
|
|
|
using Robust.Shared.Prototypes;
|
2021-12-24 01:22:34 -08:00
|
|
|
|
|
|
|
|
namespace Content.Server.Chemistry.ReagentEffectConditions
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Requires the solution to be above or below a certain temperature.
|
|
|
|
|
/// Used for things like explosives.
|
|
|
|
|
/// </summary>
|
2023-08-22 18:14:33 -07:00
|
|
|
public sealed partial class SolutionTemperature : ReagentEffectCondition
|
2021-12-24 01:22:34 -08:00
|
|
|
{
|
2023-12-29 04:47:43 -08:00
|
|
|
[DataField]
|
2021-12-24 01:22:34 -08:00
|
|
|
public float Min = 0.0f;
|
|
|
|
|
|
2023-12-29 04:47:43 -08:00
|
|
|
[DataField]
|
2021-12-24 01:22:34 -08:00
|
|
|
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;
|
|
|
|
|
}
|
2023-06-04 16:45:02 -04:00
|
|
|
|
|
|
|
|
public override string GuidebookExplanation(IPrototypeManager prototype)
|
|
|
|
|
{
|
|
|
|
|
return Loc.GetString("reagent-effect-condition-guidebook-solution-temperature",
|
|
|
|
|
("max", float.IsPositiveInfinity(Max) ? (float) int.MaxValue : Max),
|
|
|
|
|
("min", Min));
|
|
|
|
|
}
|
2021-12-24 01:22:34 -08:00
|
|
|
}
|
|
|
|
|
}
|