Port stethoscopes + innate verbs from nyano (#8228)
* port stethoscopes from nyanotrasen * remove mono crash wtf * don't touch puddle * Switch to using action * both verb and action * Address reviews
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
using System.Threading;
|
||||
using Content.Shared.Actions.ActionTypes;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Server.Medical.Components
|
||||
{
|
||||
/// <summary>
|
||||
/// Adds an innate verb when equipped to use a stethoscope.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public sealed class StethoscopeComponent : Component
|
||||
{
|
||||
public bool IsActive = false;
|
||||
|
||||
public CancellationTokenSource? CancelToken;
|
||||
|
||||
[DataField("delay")]
|
||||
public float Delay = 2.5f;
|
||||
|
||||
public EntityTargetAction Action = new()
|
||||
{
|
||||
Icon = new SpriteSpecifier.Texture(new ResourcePath("Clothing/Neck/Misc/stethoscope.rsi/icon.png")),
|
||||
Name = "stethoscope-verb",
|
||||
Priority = -1,
|
||||
Event = new StethoscopeActionEvent(),
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using System.Threading;
|
||||
|
||||
namespace Content.Server.Medical.Components
|
||||
{
|
||||
/// <summary>
|
||||
/// Used to let doctors use the stethoscope on people.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public sealed class WearingStethoscopeComponent : Component
|
||||
{
|
||||
public CancellationTokenSource? CancelToken;
|
||||
|
||||
[DataField("delay")]
|
||||
public float Delay = 2.5f;
|
||||
|
||||
public EntityUid Stethoscope = default!;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user