Files
OldThink/Content.Server/Chemistry/ReagentEffects/FlammableReaction.cs
mirrorcult 1ab7170adb Refactor reaction effects to use reagent effects (#5426)
* reaction effect refactor

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

26 lines
970 B
C#

using System.Collections.Generic;
using Content.Server.Atmos.Components;
using Content.Server.Atmos.EntitySystems;
using Content.Shared.Chemistry.Components;
using Content.Shared.Chemistry.Reagent;
using Content.Shared.FixedPoint;
using JetBrains.Annotations;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Set;
namespace Content.Server.Chemistry.ReagentEffects
{
[UsedImplicitly]
public class FlammableReaction : ReagentEffect
{
public override void Effect(ReagentEffectArgs args)
{
if (!args.EntityManager.TryGetComponent(args.SolutionEntity, out FlammableComponent? flammable)) return;
EntitySystem.Get<FlammableSystem>().AdjustFireStacks(args.SolutionEntity, args.Quantity.Float() / 5f, flammable);
args.Source?.RemoveReagent(args.Reagent.ID, args.Quantity);
}
}
}