Bows & arrows (#19771)

This commit is contained in:
Kara
2023-09-22 02:45:21 -07:00
committed by GitHub
parent 1ba1ab6d61
commit f8d194b117
51 changed files with 507 additions and 22 deletions

View File

@@ -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);
}