Beds, Medical Beds, Stasis Beds (#6695)

This commit is contained in:
Rane
2022-04-15 18:53:52 -04:00
committed by GitHub
parent 3383350c03
commit 5376aed6ea
36 changed files with 534 additions and 31 deletions

View File

@@ -1,4 +1,3 @@
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using Content.Server.Body.Components;
@@ -7,8 +6,6 @@ using Content.Server.Mind.Components;
using Content.Shared.Body.Components;
using Content.Shared.MobState.Components;
using Content.Shared.Movement.EntitySystems;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Timing;
namespace Content.Server.Body.Systems
@@ -22,6 +19,7 @@ namespace Content.Server.Body.Systems
{
base.Initialize();
SubscribeLocalEvent<BodyComponent, RelayMoveInputEvent>(OnRelayMoveInput);
SubscribeLocalEvent<BodyComponent, ApplyMetabolicMultiplierEvent>(OnApplyMetabolicMultiplier);
}
private void OnRelayMoveInput(EntityUid uid, BodyComponent component, RelayMoveInputEvent args)
@@ -40,6 +38,15 @@ namespace Content.Server.Body.Systems
}
}
private void OnApplyMetabolicMultiplier(EntityUid uid, BodyComponent component, ApplyMetabolicMultiplierEvent args)
{
foreach (var (part, _) in component.Parts)
foreach (var mechanism in part.Mechanisms)
{
RaiseLocalEvent(mechanism.Owner, args, false);
}
}
/// <summary>
/// Returns a list of ValueTuples of <see cref="T"/> and MechanismComponent on each mechanism
/// in the given body.