Files
Delta-v/Content.Shared/Tools/Components/ToolComponent.cs
T
BarryNorfolk 23ae0b3758 Oni/refactor (#2805)
* Add ability for GunComponent to track their holders

* Add new component to allow Players to modify gun attributes

* Allow users of melee weapons to also modify their weapons damage

* Allow user stamina damage modifiers

* Allow users of tools to also modify tool attributes

* Delete old Oni component and systems

* Replace oni components

* Set default max spread angle to 180 degrees

* Change modifier to multiplier to better reflect the math

* Add documentation.

* Add NetworkedComponent to new components
2025-02-01 11:04:12 +00:00

44 lines
1.2 KiB
C#

using Content.Shared.Tools.Systems;
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
using Robust.Shared.Utility;
namespace Content.Shared.Tools.Components;
[RegisterComponent, NetworkedComponent]
[Access(typeof(SharedToolSystem))]
public sealed partial class ToolComponent : Component
{
[DataField]
public PrototypeFlags<ToolQualityPrototype> Qualities = [];
/// <summary>
/// For tool interactions that have a delay before action this will modify the rate, time to wait is divided by this value
/// </summary>
[DataField]
public float SpeedModifier = 1;
[DataField]
public SoundSpecifier? UseSound;
}
/// <summary>
/// Attempt event called *before* any do afters to see if the tool usage should succeed or not.
/// Raised on both the tool and then target.
/// </summary>
public sealed class ToolUseAttemptEvent(EntityUid user, float fuel) : CancellableEntityEventArgs
{
public EntityUid User { get; } = user;
public float Fuel = fuel;
}
/// <summary>
/// Event raised on the user of a tool to see if they can actually use it.
/// </summary>
[ByRefEvent]
public struct ToolUserAttemptUseEvent(EntityUid? target)
{
public EntityUid? Target = target;
public bool Cancelled = false;
}