- add: interface for interaction
This commit is contained in:
9
Content.Shared/_Amour/Arousal/ArousalComponent.cs
Normal file
9
Content.Shared/_Amour/Arousal/ArousalComponent.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
namespace Content.Shared._Amour.Arousal;
|
||||
|
||||
[RegisterComponent]
|
||||
public sealed partial class ArousalComponent : Component
|
||||
{
|
||||
[ViewVariables] public short Arousal;
|
||||
[DataField] public short ArousalExide;
|
||||
}
|
||||
|
||||
5
Content.Shared/_Amour/Arousal/ArousalEvents.cs
Normal file
5
Content.Shared/_Amour/Arousal/ArousalEvents.cs
Normal file
@@ -0,0 +1,5 @@
|
||||
namespace Content.Shared._Amour.Arousal;
|
||||
|
||||
public record struct ArousalUpdated(Entity<ArousalComponent> Entity);
|
||||
|
||||
public record struct ArousalSplash(Entity<ArousalComponent> Entity);
|
||||
51
Content.Shared/_Amour/Arousal/ArousalSystem.cs
Normal file
51
Content.Shared/_Amour/Arousal/ArousalSystem.cs
Normal file
@@ -0,0 +1,51 @@
|
||||
using Content.Shared.Alert;
|
||||
|
||||
namespace Content.Shared._Amour.Arousal;
|
||||
|
||||
public sealed class ArousalSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly AlertsSystem _alerts = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<ArousalComponent,ComponentInit>(OnComponentInit);
|
||||
}
|
||||
|
||||
private void OnComponentInit(EntityUid uid, ArousalComponent component, ComponentInit args)
|
||||
{
|
||||
UpdateAlarm(new Entity<ArousalComponent?>(uid,component));
|
||||
}
|
||||
|
||||
private void UpdateAlarm(Entity<ArousalComponent?> entity)
|
||||
{
|
||||
if(!Resolve(entity,ref entity.Comp))
|
||||
return;
|
||||
|
||||
if (entity.Comp.Arousal is > 100 or < 0)
|
||||
{
|
||||
entity.Comp.Arousal = 0;
|
||||
RaiseLocalEvent(entity,new ArousalSplash(new Entity<ArousalComponent>(entity,entity.Comp)));
|
||||
}
|
||||
RaiseLocalEvent(entity,new ArousalUpdated(new Entity<ArousalComponent>(entity,entity.Comp)));
|
||||
|
||||
_alerts.ShowAlert(entity,AlertType.Arousal,(short)(entity.Comp.Arousal/10));
|
||||
}
|
||||
|
||||
public void SetArousal(Entity<ArousalComponent?> entity, short count)
|
||||
{
|
||||
if(!Resolve(entity,ref entity.Comp))
|
||||
return;
|
||||
|
||||
entity.Comp.Arousal = count;
|
||||
UpdateAlarm(entity);
|
||||
}
|
||||
|
||||
public void AddArousal(Entity<ArousalComponent?> entity, short count)
|
||||
{
|
||||
if(!Resolve(entity,ref entity.Comp))
|
||||
return;
|
||||
|
||||
SetArousal(entity,(short) (entity.Comp.Arousal + count));
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,6 @@
|
||||
using Robust.Shared.Containers;
|
||||
using Content.Shared._Amour.Arousal;
|
||||
using Content.Shared._Amour.HumanoidAppearanceExtension;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Shared._Amour.Hole;
|
||||
@@ -10,6 +12,15 @@ public abstract partial class SharedHoleSystem
|
||||
public void InitializeContainer()
|
||||
{
|
||||
SubscribeLocalEvent<HoleContainerComponent,ComponentInit>(OnContainerInit);
|
||||
SubscribeLocalEvent<HoleContainerComponent,HumanoidAppearanceLoadedEvent>(OnAppearanceLoaded);
|
||||
}
|
||||
|
||||
private void OnAppearanceLoaded(EntityUid uid, HoleContainerComponent component, HumanoidAppearanceLoadedEvent args)
|
||||
{
|
||||
foreach (var genitals in args.Profile.Appearance.Genitals)
|
||||
{
|
||||
AddHole(new Entity<HoleContainerComponent?>(uid,component),genitals.GenitalId,genitals.Color);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnContainerInit(EntityUid uid, HoleContainerComponent component, ComponentInit args)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Robust.Shared.Containers;
|
||||
using Content.Shared._Amour.Arousal;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.GameStates;
|
||||
|
||||
namespace Content.Shared._Amour.Hole;
|
||||
@@ -24,7 +25,9 @@ public abstract partial class SharedHoleSystem : EntitySystem
|
||||
|
||||
public virtual void Exide(Entity<HoleComponent?> entity, bool value = true)
|
||||
{
|
||||
if(!Resolve(entity.Owner,ref entity.Comp)) return;
|
||||
if(!Resolve(entity.Owner,ref entity.Comp))
|
||||
return;
|
||||
|
||||
entity.Comp.IsExcited = value;
|
||||
Dirty(entity);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
using Content.Shared.Humanoid;
|
||||
using Content.Shared.Preferences;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared._Amour.HumanoidAppearanceExtension;
|
||||
|
||||
public record struct HumanoidAppearanceLoadingEvent(
|
||||
Entity<HumanoidAppearanceComponent> Entity,
|
||||
HumanoidCharacterProfile Profile);
|
||||
|
||||
public record struct HumanoidAppearanceLoadedEvent(
|
||||
Entity<HumanoidAppearanceComponent> Entity,
|
||||
HumanoidCharacterProfile Profile);
|
||||
Reference in New Issue
Block a user