Skip to content

Commit

Permalink
prevent telegnomes from interacting with anything (#2117)
Browse files Browse the repository at this point in the history
* disable interaction for telegnomes, add access for the components

* make client and server systems extend shared system

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>
  • Loading branch information
deltanedas authored Nov 9, 2024
1 parent 6ee37b2 commit b6b2971
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
using Content.Shared.Abilities.Psionics;

namespace Content.Client.Abilities.Psionics;

public sealed class TelegnosisPowerSystem : SharedTelegnosisPowerSystem;
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace Content.Server.Abilities.Psionics
{
public sealed class TelegnosisPowerSystem : EntitySystem
public sealed class TelegnosisPowerSystem : SharedTelegnosisPowerSystem
{
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly StatusEffectsSystem _statusEffects = default!;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using Content.Shared.Interaction.Events;

namespace Content.Shared.Abilities.Psionics;

public abstract class SharedTelegnosisPowerSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<TelegnosticProjectionComponent, InteractionAttemptEvent>(OnInteractionAttempt);
}

private void OnInteractionAttempt(Entity<TelegnosticProjectionComponent> ent, ref InteractionAttemptEvent args)
{
// no astrally stealing someones shoes
args.Cancelled = true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

namespace Content.Shared.Abilities.Psionics
{
[RegisterComponent]
[RegisterComponent, Access(typeof(SharedTelegnosisPowerSystem))]
public sealed partial class TelegnosisPowerComponent : Component
{
[DataField("prototype")]
Expand All @@ -20,4 +20,4 @@ public sealed partial class TelegnosisPowerComponent : Component
[DataField("telegnosisActionEntity")]
public EntityUid? TelegnosisActionEntity;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
namespace Content.Shared.Abilities.Psionics
{
[RegisterComponent]
public sealed partial class TelegnosticProjectionComponent : Component
{}
}
namespace Content.Shared.Abilities.Psionics;

[RegisterComponent, Access(typeof(SharedTelegnosisPowerSystem))]
public sealed partial class TelegnosticProjectionComponent : Component;

0 comments on commit b6b2971

Please sign in to comment.