using Content.Server.Atmos.EntitySystems;
using Content.Shared.Atmos.Components;
using Content.Shared.EntityEffects;
using Content.Shared.EntityEffects.Effects.Atmos;
namespace Content.Server.EntityEffects.Effects.Atmos;
///
/// Adds a number of FireStacks modified by scale to this entity.
/// The amount of FireStacks added is modified by scale.
///
///
public sealed partial class FlammableEntityEffectSystem : EntityEffectSystem
{
[Dependency] private readonly FlammableSystem _flammable = default!;
protected override void Effect(Entity entity, ref EntityEffectEvent args)
{
// The multiplier is determined by if the entity is already on fire, and if the multiplier for existing FireStacks has a value.
// If both of these are true, we use the MultiplierOnExisting value, otherwise we use the standard Multiplier.
var multiplier = entity.Comp.FireStacks == 0f || args.Effect.MultiplierOnExisting == null ? args.Effect.Multiplier : args.Effect.MultiplierOnExisting.Value;
_flammable.AdjustFireStacks(entity, args.Scale * multiplier, entity.Comp);
}
}