- add: dildos
This commit is contained in:
28
Content.Shared/_Amour/Vibrator/VibratorComponent.cs
Normal file
28
Content.Shared/_Amour/Vibrator/VibratorComponent.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using Content.Shared.DeviceLinking;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Serialization;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||
|
||||
namespace Content.Shared._Amour.Vibrator;
|
||||
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
public sealed partial class VibratorComponent : Component
|
||||
{
|
||||
[DataField("isVibrating")] public bool IsVibrating = false;
|
||||
|
||||
[DataField("togglePort", customTypeSerializer: typeof(PrototypeIdSerializer<SinkPortPrototype>))]
|
||||
public string TogglePort = "Toggle";
|
||||
}
|
||||
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class VibratorComponentState : ComponentState
|
||||
{
|
||||
public bool IsVibrating;
|
||||
|
||||
public VibratorComponentState(bool isVibrating)
|
||||
{
|
||||
IsVibrating = isVibrating;
|
||||
}
|
||||
}
|
||||
|
||||
39
Content.Shared/_Amour/Vibrator/VibratorSystem.cs
Normal file
39
Content.Shared/_Amour/Vibrator/VibratorSystem.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using Robust.Shared.GameStates;
|
||||
|
||||
namespace Content.Shared._Amour.Vibrator;
|
||||
|
||||
public abstract class SharedVibratorSystem : EntitySystem
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
SubscribeLocalEvent<VibratorComponent,ComponentGetState>(OnGetState);
|
||||
SubscribeLocalEvent<VibratorComponent,ComponentHandleState>(OnHandleState);
|
||||
}
|
||||
|
||||
private void OnHandleState(EntityUid uid, VibratorComponent component, ref ComponentHandleState args)
|
||||
{
|
||||
if(args.Current is not VibratorComponentState state)
|
||||
return;
|
||||
|
||||
component.IsVibrating = state.IsVibrating;
|
||||
ToggleVibrate(uid,component);
|
||||
}
|
||||
|
||||
private void OnGetState(EntityUid uid, VibratorComponent component,ref ComponentGetState args)
|
||||
{
|
||||
args.State = new VibratorComponentState(component.IsVibrating);
|
||||
}
|
||||
|
||||
public void ToggleVibration(EntityUid uid, VibratorComponent? component = null)
|
||||
{
|
||||
if(!Resolve(uid,ref component))
|
||||
return;
|
||||
|
||||
component.IsVibrating = !component.IsVibrating;
|
||||
Dirty(uid,component);
|
||||
}
|
||||
|
||||
public virtual void ToggleVibrate(EntityUid uid, VibratorComponent component)
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user