Files

35 lines
1.2 KiB
C#
Raw Permalink Normal View History

using Content.Server.Atmos.Components;
using Content.Server.Atmos.EntitySystems;
using Content.Shared.Chemistry.Reagent;
2021-11-28 14:56:53 +01:00
using Content.Shared.Database;
using JetBrains.Annotations;
using Robust.Shared.Prototypes;
namespace Content.Server.Chemistry.ReagentEffects
{
[UsedImplicitly]
public sealed partial class FlammableReaction : ReagentEffect
{
[DataField]
2021-11-28 19:25:51 -07:00
public float Multiplier = 0.05f;
2021-11-27 00:31:56 -07:00
public override bool ShouldLog => true;
protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
=> Loc.GetString("reagent-effect-guidebook-flammable-reaction", ("chance", Probability));
2021-11-27 00:31:56 -07:00
public override LogImpact LogImpact => LogImpact.Medium;
public override void Effect(ReagentEffectArgs args)
{
if (!args.EntityManager.TryGetComponent(args.SolutionEntity, out FlammableComponent? flammable))
return;
args.EntityManager.System<FlammableSystem>().AdjustFireStacks(args.SolutionEntity, args.Quantity.Float() * Multiplier, flammable);
if (args.Reagent != null)
args.Source?.RemoveReagent(args.Reagent.ID, args.Quantity);
}
}
}