* Fire extinguishers now put out candles This did not actually require any changes to flammable or extinguishers directly, the only necessary changes were to make the collision actually work. Vapor entities (also used for fire extinguishers) now have a collision layer, so they can hit items. Added a new FlammableSetCollisionWake component to actually enable collision on candles while they are lit, because otherwise CollisionWake on entities gets in the way too. * Extinguishing items is now relayed to held/worn items This means held candles get extinguished too. Involved moving the core logic of ExtinguishReaction into an event so that it can be relayed via the existing hand/inventory relay logic. * Add helper functions for subscribing to relayed events. Use these in FlammableSystem * Make extinguishers work on cigarettes too A bunch of renaming to make the rest of my code work with SmokableComponent --------- Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
43 lines
1.2 KiB
C#
43 lines
1.2 KiB
C#
using Content.Shared.Inventory;
|
|
using Content.Shared.Nutrition.Components;
|
|
|
|
namespace Content.Shared.Atmos;
|
|
|
|
// NOTE: These components are currently not raised on the client, only on the server.
|
|
|
|
/// <summary>
|
|
/// An entity has had an existing effect applied to it.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// This does not necessarily mean the effect is strong enough to fully extinguish the entity in one go.
|
|
/// </remarks>
|
|
[ByRefEvent]
|
|
public struct ExtinguishEvent : IInventoryRelayEvent
|
|
{
|
|
/// <summary>
|
|
/// Amount of firestacks changed. Should be a negative number.
|
|
/// </summary>
|
|
public float FireStacksAdjustment;
|
|
|
|
SlotFlags IInventoryRelayEvent.TargetSlots => SlotFlags.WITHOUT_POCKET;
|
|
}
|
|
|
|
/// <summary>
|
|
/// A flammable entity has been extinguished.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// This can occur on both <c>Flammable</c> entities as well as <see cref="SmokableComponent"/>.
|
|
/// </remarks>
|
|
/// <seealso cref="ExtinguishEvent"/>
|
|
[ByRefEvent]
|
|
public struct ExtinguishedEvent;
|
|
|
|
/// <summary>
|
|
/// A flammable entity has been ignited.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// This can occur on both <c>Flammable</c> entities as well as <see cref="SmokableComponent"/>.
|
|
/// </remarks>
|
|
[ByRefEvent]
|
|
public struct IgnitedEvent;
|