mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-09-30 16:17:27 +00:00
* 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>
31 lines
1.0 KiB
C#
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;
|
|
}
|
|
}
|
|
}
|
|
}
|