Files
tbd-station-14/Content.Shared/EntityEffects/EffectConditions/SolutionTemperature.cs
āda f6475bd264 EntityEffectConditions changed to be inclusive of min/max (#36289)
* soo hungry going back for more lipolicide

* too much lipolicide.....

* fixes

* it moved

* typo

---------

Co-authored-by: iaada <iaada@users.noreply.github.com>
2025-07-29 23:44:46 -07:00

37 lines
1.1 KiB
C#

using Robust.Shared.Prototypes;
namespace Content.Shared.EntityEffects.EffectConditions;
/// <summary>
/// Requires the solution to be above or below a certain temperature.
/// Used for things like explosives.
/// </summary>
public sealed partial class SolutionTemperature : EntityEffectCondition
{
[DataField]
public float Min = 0.0f;
[DataField]
public float Max = float.PositiveInfinity;
public override bool Condition(EntityEffectBaseArgs args)
{
if (args is EntityEffectReagentArgs reagentArgs)
{
return reagentArgs?.Source != null &&
reagentArgs.Source.Temperature >= Min &&
reagentArgs.Source.Temperature <= Max;
}
// TODO: Someone needs to figure out how to do this for non-reagent effects.
throw new NotImplementedException();
}
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));
}
}