follow on use inhand (#606)

This commit is contained in:
A.Ne.
2024-11-24 15:36:35 +04:00
committed by GitHub
parent 897a9cf683
commit dbc2fd689a
3 changed files with 29 additions and 1 deletions

View File

@@ -0,0 +1,7 @@
namespace Content.Shared._CP14.Follower;
[RegisterComponent, Access(typeof(CP14FollowOnUseInHandSystem))]
public sealed partial class CP14FollowOnUseInHandComponent : Component
{
}

View File

@@ -0,0 +1,20 @@
using Content.Shared.Follower;
using Content.Shared.Interaction.Events;
namespace Content.Shared._CP14.Follower;
public partial class CP14FollowOnUseInHandSystem : EntitySystem
{
[Dependency] private readonly FollowerSystem _followerSystem = default!;
public override void Initialize()
{
SubscribeLocalEvent<CP14FollowOnUseInHandComponent, UseInHandEvent>(OnUseInHand);
}
private void OnUseInHand(EntityUid uid, CP14FollowOnUseInHandComponent component, UseInHandEvent args)
{
_followerSystem.StartFollowingEntity(uid, args.User);
}
}

View File

@@ -92,6 +92,7 @@
- Opaque
- type: LandAtCursor
- type: MovementIgnoreGravity
- type: CP14FollowOnUseInHand
- type: PointLight
radius: 5.0
energy: 1
@@ -124,4 +125,4 @@
components:
- type: CP14SpellStorage
spells:
- CP14ActionSpellSphereOfLight
- CP14ActionSpellSphereOfLight