Bows & arrows (#19771)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.Wieldable.Components;
|
||||
|
||||
@@ -33,3 +34,9 @@ public sealed partial class WieldableComponent : Component
|
||||
[DataField("wieldTime")]
|
||||
public float WieldTime = 1.5f;
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public enum WieldableVisuals : byte
|
||||
{
|
||||
Wielded
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ public sealed class WieldableSystem : EntitySystem
|
||||
[Dependency] private readonly SharedItemSystem _itemSystem = default!;
|
||||
[Dependency] private readonly SharedPopupSystem _popupSystem = default!;
|
||||
[Dependency] private readonly SharedAudioSystem _audioSystem = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -224,6 +225,7 @@ public sealed class WieldableSystem : EntitySystem
|
||||
|
||||
var ev = new ItemWieldedEvent();
|
||||
RaiseLocalEvent(uid, ref ev);
|
||||
_appearance.SetData(uid, WieldableVisuals.Wielded, true);
|
||||
|
||||
Dirty(component);
|
||||
args.Handled = true;
|
||||
@@ -254,6 +256,8 @@ public sealed class WieldableSystem : EntitySystem
|
||||
("user", args.User.Value), ("item", uid)), args.User.Value, Filter.PvsExcept(args.User.Value), true);
|
||||
}
|
||||
|
||||
_appearance.SetData(uid, WieldableVisuals.Wielded, false);
|
||||
|
||||
Dirty(component);
|
||||
_virtualItemSystem.DeleteInHandsMatching(args.User.Value, uid);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user