From dbc2fd689ae6b385dd72a00b83358b0c9b25eace Mon Sep 17 00:00:00 2001 From: "A.Ne." <138010940+comasqw@users.noreply.github.com> Date: Sun, 24 Nov 2024 15:36:35 +0400 Subject: [PATCH] follow on use inhand (#606) --- .../CP14FollowOnUseInHandComponent.cs | 7 +++++++ .../Follower/CP14FollowOnUseInHandSystem.cs | 20 +++++++++++++++++++ .../LightDarkness/T0_sphere_of_light.yml | 3 ++- 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 Content.Shared/_CP14/Follower/CP14FollowOnUseInHandComponent.cs create mode 100644 Content.Shared/_CP14/Follower/CP14FollowOnUseInHandSystem.cs diff --git a/Content.Shared/_CP14/Follower/CP14FollowOnUseInHandComponent.cs b/Content.Shared/_CP14/Follower/CP14FollowOnUseInHandComponent.cs new file mode 100644 index 0000000000..1cf144abc6 --- /dev/null +++ b/Content.Shared/_CP14/Follower/CP14FollowOnUseInHandComponent.cs @@ -0,0 +1,7 @@ +namespace Content.Shared._CP14.Follower; + +[RegisterComponent, Access(typeof(CP14FollowOnUseInHandSystem))] +public sealed partial class CP14FollowOnUseInHandComponent : Component +{ + +} diff --git a/Content.Shared/_CP14/Follower/CP14FollowOnUseInHandSystem.cs b/Content.Shared/_CP14/Follower/CP14FollowOnUseInHandSystem.cs new file mode 100644 index 0000000000..43210c052f --- /dev/null +++ b/Content.Shared/_CP14/Follower/CP14FollowOnUseInHandSystem.cs @@ -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(OnUseInHand); + } + + private void OnUseInHand(EntityUid uid, CP14FollowOnUseInHandComponent component, UseInHandEvent args) + { + _followerSystem.StartFollowingEntity(uid, args.User); + } +} diff --git a/Resources/Prototypes/_CP14/Entities/Actions/Spells/LightDarkness/T0_sphere_of_light.yml b/Resources/Prototypes/_CP14/Entities/Actions/Spells/LightDarkness/T0_sphere_of_light.yml index 70abee99b9..953d563aff 100644 --- a/Resources/Prototypes/_CP14/Entities/Actions/Spells/LightDarkness/T0_sphere_of_light.yml +++ b/Resources/Prototypes/_CP14/Entities/Actions/Spells/LightDarkness/T0_sphere_of_light.yml @@ -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 \ No newline at end of file + - CP14ActionSpellSphereOfLight