Rename DummyPuppet to VentriloquistPuppet (#19777)

This commit is contained in:
Leon Friedrich
2023-09-16 16:54:46 +12:00
committed by GitHub
parent a9cc99f80c
commit f7d7f5cc7f
10 changed files with 153 additions and 194 deletions

View File

@@ -1,11 +0,0 @@
using Robust.Shared.GameStates;
namespace Content.Shared.Puppet
{
[RegisterComponent, NetworkedComponent]
public sealed partial class PuppetDummyComponent : Component
{
[DataField("enabled")]
public bool Enabled = false;
}
}

View File

@@ -1,71 +0,0 @@
using Content.Shared.ActionBlocker;
using Content.Shared.Hands;
using Content.Shared.Interaction.Events;
using Content.Shared.Item;
using Content.Shared.Emoting;
using Content.Shared.Movement.Events;
namespace Content.Shared.Puppet
{
public abstract class SharedPuppetDummySystem : EntitySystem
{
[Dependency] private readonly ActionBlockerSystem _blocker = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<PuppetDummyComponent, UseAttemptEvent>(OnUseAttempt);
SubscribeLocalEvent<PuppetDummyComponent, InteractionAttemptEvent>(OnInteractAttempt);
SubscribeLocalEvent<PuppetDummyComponent, DropAttemptEvent>(OnDropAttempt);
SubscribeLocalEvent<PuppetDummyComponent, PickupAttemptEvent>(OnPickupAttempt);
SubscribeLocalEvent<PuppetDummyComponent, UpdateCanMoveEvent>(OnMoveAttempt);
SubscribeLocalEvent<PuppetDummyComponent, EmoteAttemptEvent>(OnEmoteAttempt);
SubscribeLocalEvent<PuppetDummyComponent, ChangeDirectionAttemptEvent>(OnChangeDirectionAttempt);
SubscribeLocalEvent<PuppetDummyComponent, ComponentStartup>(OnStartup);
}
private void OnStartup(EntityUid uid, PuppetDummyComponent component, ComponentStartup args)
{
_blocker.UpdateCanMove(uid);
}
private void OnMoveAttempt(EntityUid uid, PuppetDummyComponent component, UpdateCanMoveEvent args)
{
if (component.LifeStage > ComponentLifeStage.Running)
return;
args.Cancel();
}
private void OnChangeDirectionAttempt(EntityUid uid, PuppetDummyComponent component, ChangeDirectionAttemptEvent args)
{
args.Cancel();
}
private void OnUseAttempt(EntityUid uid, PuppetDummyComponent component, UseAttemptEvent args)
{
args.Cancel();
}
private void OnEmoteAttempt(EntityUid uid, PuppetDummyComponent component, EmoteAttemptEvent args)
{
args.Cancel();
}
private void OnInteractAttempt(EntityUid uid, PuppetDummyComponent component, InteractionAttemptEvent args)
{
args.Cancel();
}
private void OnDropAttempt(EntityUid uid, PuppetDummyComponent component, DropAttemptEvent args)
{
args.Cancel();
}
private void OnPickupAttempt(EntityUid uid, PuppetDummyComponent component, PickupAttemptEvent args)
{
args.Cancel();
}
}
}

View File

@@ -0,0 +1,36 @@
using Content.Shared.ActionBlocker;
using Content.Shared.Hands;
using Content.Shared.Interaction.Events;
using Content.Shared.Item;
using Content.Shared.Emoting;
using Content.Shared.Movement.Events;
namespace Content.Shared.Puppet;
public abstract class SharedVentriloquistPuppetSystem : EntitySystem
{
[Dependency] private readonly ActionBlockerSystem _blocker = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<VentriloquistPuppetComponent, UseAttemptEvent>(Cancel);
SubscribeLocalEvent<VentriloquistPuppetComponent, InteractionAttemptEvent>(Cancel);
SubscribeLocalEvent<VentriloquistPuppetComponent, DropAttemptEvent>(Cancel);
SubscribeLocalEvent<VentriloquistPuppetComponent, PickupAttemptEvent>(Cancel);
SubscribeLocalEvent<VentriloquistPuppetComponent, UpdateCanMoveEvent>(Cancel);
SubscribeLocalEvent<VentriloquistPuppetComponent, EmoteAttemptEvent>(Cancel);
SubscribeLocalEvent<VentriloquistPuppetComponent, ChangeDirectionAttemptEvent>(Cancel);
SubscribeLocalEvent<VentriloquistPuppetComponent, ComponentStartup>(OnStartup);
}
private void OnStartup(EntityUid uid, VentriloquistPuppetComponent component, ComponentStartup args)
{
_blocker.UpdateCanMove(uid);
}
private void Cancel<T>(EntityUid uid, VentriloquistPuppetComponent component, T args) where T : CancellableEntityEventArgs
{
args.Cancel();
}
}

View File

@@ -0,0 +1,8 @@
using Robust.Shared.GameStates;
namespace Content.Shared.Puppet;
[RegisterComponent, NetworkedComponent]
public sealed partial class VentriloquistPuppetComponent : Component
{
}