Files
tbd-station-14/Content.Server/Chemistry/ReagentEffects/AdjustTemperature.cs
mirrorcult 1ab7170adb Refactor reaction effects to use reagent effects (#5426)
* reaction effect refactor

* works now
2021-11-21 00:35:02 -07:00

23 lines
747 B
C#

using Content.Server.Temperature.Components;
using Content.Server.Temperature.Systems;
using Content.Shared.Chemistry.Reagent;
using Robust.Shared.Serialization.Manager.Attributes;
namespace Content.Server.Chemistry.ReagentEffects
{
public 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);
}
}
}
}