Files
Delta-v/Content.Server/Light/EntitySystems/MatchboxSystem.cs
T
deltanedasanddeltanedas 67b0a95b2f add ghetto surgery real (#884)
* move MatchstickComponent to shared

* add Speed field to ISurgeryTool, add Tweezers and Tending tools

* add support for ghetto surgery tools

* use Tending and Tweezers for some steps

* GHETTO SURGERY!!!

* add qualities to fire axe

* fix popups

* :trollface:

* disable coil hemostat

* add examine verb for a tools uses

* work#

* round the speed to 2 decimal places

* remove .

* webedit ops

* shitcode

* undo breaking change

* fix

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>
2024-12-27 16:50:53 +00:00

31 lines
1.0 KiB
C#

using Content.Server.Light.Components;
using Content.Server.Storage.EntitySystems;
using Content.Shared.Interaction;
using Content.Shared.Smoking;
using Content.Shared.Smoking.Components;
namespace Content.Server.Light.EntitySystems
{
public sealed class MatchboxSystem : EntitySystem
{
[Dependency] private readonly MatchstickSystem _stickSystem = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<MatchboxComponent, InteractUsingEvent>(OnInteractUsing, before: new[] { typeof(StorageSystem) });
}
private void OnInteractUsing(EntityUid uid, MatchboxComponent component, InteractUsingEvent args)
{
if (!args.Handled
&& EntityManager.TryGetComponent(args.Used, out MatchstickComponent? matchstick)
&& matchstick.CurrentState == SmokableState.Unlit)
{
_stickSystem.Ignite((args.Used, matchstick), args.User);
args.Handled = true;
}
}
}
}