- add: dildos

This commit is contained in:
2024-02-12 18:00:47 +03:00
parent 7bc240ade4
commit 443bacc44c
42 changed files with 510 additions and 0 deletions

View 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;
}
}

View 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)
{
}
}