- add: interface for interaction

This commit is contained in:
2024-02-20 14:28:01 +03:00
parent c3135f160e
commit 28c8b45eec
32 changed files with 319 additions and 14 deletions

View File

@@ -1,5 +1,7 @@
using Content.Server.Chemistry.Containers.EntitySystems;
using Content.Shared._Amour.Arousal;
using Content.Shared._Amour.Hole;
using Content.Shared.Chemistry.Components;
namespace Content.Server._Amour.Hole;
@@ -11,6 +13,7 @@ public sealed partial class HoleSystem
{
SubscribeLocalEvent<HoleSolutionComponent,ComponentInit>(OnSolutionInit);
SubscribeLocalEvent<HoleSolutionComponent,EntityUnpausedEvent>(OnUnpaused);
SubscribeLocalEvent<HoleSolutionComponent,ArousalSplash>(OnSplash);
}
private void OnSolutionInit(EntityUid uid, HoleSolutionComponent component, ComponentInit args)
@@ -25,6 +28,40 @@ public sealed partial class HoleSystem
component.NextGenerationTime += args.PausedTime;
}
public void SplitSolution(Entity<HoleSolutionComponent?> entity, Entity<SolutionComponent?>? to = null)
{
if(!Resolve(entity,ref entity.Comp))
return;
if (!to.HasValue)
{
entity.Comp.Solution.SplitSolution(entity.Comp.Solution.Volume);
}
else
{
var entityUid = to.Value;
if(Resolve(entityUid, ref entityUid.Comp))
{
_solutionContainer.AddSolution(
new Entity<SolutionComponent>(entityUid.Owner,entityUid.Comp)
, entity.Comp.Solution);
}
}
}
private void OnSplash(EntityUid uid, HoleSolutionComponent component, ref ArousalSplash args)
{
if(!TryComp<HoleContainerComponent>(uid,out var holeContainer))
return;
var holeUid = GetEntity(holeContainer.MainHole);
if(!TryComp<HoleComponent>(holeUid,out var holeComponent))
return;
SplitSolution(holeUid.Value);
}
private void UpdateSolution(float frameTime)
{
return;