Files
tbd-station-14/Content.Server/Chemistry/ReagentEffects/AdjustTemperature.cs
2022-06-04 17:17:48 +10:00

22 lines
698 B
C#

using Content.Server.Temperature.Components;
using Content.Server.Temperature.Systems;
using Content.Shared.Chemistry.Reagent;
namespace Content.Server.Chemistry.ReagentEffects
{
public sealed class AdjustTemperature : ReagentEffect
{
[DataField("amount")]
public float Amount;
public override void Effect(ReagentEffectArgs args)
{
if (args.EntityManager.TryGetComponent(args.SolutionEntity, out TemperatureComponent? temp))
{
var sys = args.EntityManager.EntitySysManager.GetEntitySystem<TemperatureSystem>();
sys.ChangeHeat(args.SolutionEntity, Amount, true, temp);
}
}
}
}