2021-11-10 03:11:28 -07:00
|
|
|
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;
|
2021-11-10 03:11:28 -07:00
|
|
|
using JetBrains.Annotations;
|
2023-06-04 16:45:02 -04:00
|
|
|
using Robust.Shared.Prototypes;
|
2021-11-10 03:11:28 -07:00
|
|
|
|
|
|
|
|
namespace Content.Server.Chemistry.ReagentEffects
|
|
|
|
|
{
|
|
|
|
|
[UsedImplicitly]
|
2023-08-22 18:14:33 -07:00
|
|
|
public sealed partial class FlammableReaction : ReagentEffect
|
2021-11-10 03:11:28 -07:00
|
|
|
{
|
2023-12-29 04:47:43 -08:00
|
|
|
[DataField]
|
2021-11-28 19:25:51 -07:00
|
|
|
public float Multiplier = 0.05f;
|
2022-02-16 00:23:23 -07:00
|
|
|
|
2021-11-27 00:31:56 -07:00
|
|
|
public override bool ShouldLog => true;
|
2023-06-04 16:45:02 -04:00
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
2021-11-21 00:35:02 -07:00
|
|
|
public override void Effect(ReagentEffectArgs args)
|
2021-11-10 03:11:28 -07:00
|
|
|
{
|
2023-05-13 15:10:32 +12:00
|
|
|
if (!args.EntityManager.TryGetComponent(args.SolutionEntity, out FlammableComponent? flammable))
|
|
|
|
|
return;
|
2021-11-10 03:11:28 -07:00
|
|
|
|
2023-05-13 15:10:32 +12:00
|
|
|
args.EntityManager.System<FlammableSystem>().AdjustFireStacks(args.SolutionEntity, args.Quantity.Float() * Multiplier, flammable);
|
|
|
|
|
|
|
|
|
|
if (args.Reagent != null)
|
|
|
|
|
args.Source?.RemoveReagent(args.Reagent.ID, args.Quantity);
|
2021-11-10 03:11:28 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|