Kill bobby 2.0 (#6023)
This commit is contained in:
@@ -41,13 +41,13 @@ namespace Content.Server.Body.Systems
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a list of ValueTuples of <see cref="T"/> and SharedMechanismComponent on each mechanism
|
||||
/// Returns a list of ValueTuples of <see cref="T"/> and MechanismComponent on each mechanism
|
||||
/// in the given body.
|
||||
/// </summary>
|
||||
/// <param name="uid">The entity to check for the component on.</param>
|
||||
/// <param name="body">The body to check for mechanisms on.</param>
|
||||
/// <typeparam name="T">The component to check for.</typeparam>
|
||||
public IEnumerable<(T Comp, SharedMechanismComponent Mech)> GetComponentsOnMechanisms<T>(EntityUid uid,
|
||||
public IEnumerable<(T Comp, MechanismComponent Mech)> GetComponentsOnMechanisms<T>(EntityUid uid,
|
||||
SharedBodyComponent? body=null) where T : Component
|
||||
{
|
||||
if (!Resolve(uid, ref body))
|
||||
@@ -62,7 +62,7 @@ namespace Content.Server.Body.Systems
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tries to get a list of ValueTuples of <see cref="T"/> and SharedMechanismComponent on each mechanism
|
||||
/// Tries to get a list of ValueTuples of <see cref="T"/> and MechanismComponent on each mechanism
|
||||
/// in the given body.
|
||||
/// </summary>
|
||||
/// <param name="uid">The entity to check for the component on.</param>
|
||||
@@ -71,7 +71,7 @@ namespace Content.Server.Body.Systems
|
||||
/// <typeparam name="T">The component to check for.</typeparam>
|
||||
/// <returns>Whether any were found.</returns>
|
||||
public bool TryGetComponentsOnMechanisms<T>(EntityUid uid,
|
||||
[NotNullWhen(true)] out IEnumerable<(T Comp, SharedMechanismComponent Mech)>? comps,
|
||||
[NotNullWhen(true)] out IEnumerable<(T Comp, MechanismComponent Mech)>? comps,
|
||||
SharedBodyComponent? body=null) where T: Component
|
||||
{
|
||||
if (!Resolve(uid, ref body))
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
using Content.Server.Body.Components;
|
||||
using Content.Server.Ghost;
|
||||
using Content.Server.Ghost.Components;
|
||||
using Content.Server.Mind.Components;
|
||||
using Content.Shared.Body.Components;
|
||||
using Content.Shared.Body.Events;
|
||||
using Content.Shared.MobState.Components;
|
||||
using Content.Shared.Movement.Components;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
@@ -14,12 +15,12 @@ namespace Content.Server.Body.Systems
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<BrainComponent, AddedToBodyEvent>((uid, component, args) => HandleMind((args.Body).Owner, uid));
|
||||
SubscribeLocalEvent<BrainComponent, AddedToPartEvent>((uid, component, args) => HandleMind((args.Part).Owner, uid));
|
||||
SubscribeLocalEvent<BrainComponent, AddedToPartInBodyEvent>((uid, component, args) => HandleMind((args.Body).Owner, uid));
|
||||
SubscribeLocalEvent<BrainComponent, AddedToBodyEvent>((uid, _, args) => HandleMind((args.Body).Owner, uid));
|
||||
SubscribeLocalEvent<BrainComponent, AddedToPartEvent>((uid, _, args) => HandleMind((args.Part).Owner, uid));
|
||||
SubscribeLocalEvent<BrainComponent, AddedToPartInBodyEvent>((uid, _, args) => HandleMind((args.Body).Owner, uid));
|
||||
SubscribeLocalEvent<BrainComponent, RemovedFromBodyEvent>(OnRemovedFromBody);
|
||||
SubscribeLocalEvent<BrainComponent, RemovedFromPartEvent>((uid, component, args) => HandleMind(uid, (args.Old).Owner));
|
||||
SubscribeLocalEvent<BrainComponent, RemovedFromPartInBodyEvent>((uid, component, args) => HandleMind((args.OldBody).Owner, uid));
|
||||
SubscribeLocalEvent<BrainComponent, RemovedFromPartEvent>((uid, _, args) => HandleMind(uid, (args.Old).Owner));
|
||||
SubscribeLocalEvent<BrainComponent, RemovedFromPartInBodyEvent>((uid, _, args) => HandleMind((args.OldBody).Owner, uid));
|
||||
}
|
||||
|
||||
private void OnRemovedFromBody(EntityUid uid, BrainComponent component, RemovedFromBodyEvent args)
|
||||
@@ -36,8 +37,9 @@ namespace Content.Server.Body.Systems
|
||||
EntityManager.EnsureComponent<MindComponent>(newEntity);
|
||||
var oldMind = EntityManager.EnsureComponent<MindComponent>(oldEntity);
|
||||
|
||||
if (!EntityManager.HasComponent<IGhostOnMove>(newEntity))
|
||||
EntityManager.AddComponent<GhostOnMoveComponent>(newEntity);
|
||||
EnsureComp<GhostOnMoveComponent>(newEntity);
|
||||
if (HasComp<BodyComponent>(newEntity))
|
||||
Comp<GhostOnMoveComponent>(newEntity).MustBeDead = true;
|
||||
|
||||
// TODO: This is an awful solution.
|
||||
if (!EntityManager.HasComponent<IMoverComponent>(newEntity))
|
||||
|
||||
@@ -57,7 +57,7 @@ public class LungSystem : EntitySystem
|
||||
|
||||
public void Gasp(EntityUid uid,
|
||||
LungComponent? lung=null,
|
||||
SharedMechanismComponent? mech=null)
|
||||
MechanismComponent? mech=null)
|
||||
{
|
||||
if (!Resolve(uid, ref lung, ref mech))
|
||||
return;
|
||||
@@ -76,7 +76,7 @@ public class LungSystem : EntitySystem
|
||||
|
||||
public void UpdateLung(EntityUid uid,
|
||||
LungComponent? lung=null,
|
||||
SharedMechanismComponent? mech=null)
|
||||
MechanismComponent? mech=null)
|
||||
{
|
||||
if (!Resolve(uid, ref lung, ref mech))
|
||||
return;
|
||||
@@ -128,7 +128,7 @@ public class LungSystem : EntitySystem
|
||||
/// </summary>
|
||||
public void Inhale(EntityUid uid, float frameTime,
|
||||
LungComponent? lung=null,
|
||||
SharedMechanismComponent? mech=null)
|
||||
MechanismComponent? mech=null)
|
||||
{
|
||||
if (!Resolve(uid, ref lung, ref mech))
|
||||
return;
|
||||
@@ -159,7 +159,7 @@ public class LungSystem : EntitySystem
|
||||
/// </summary>
|
||||
public void TakeGasFrom(EntityUid uid, float frameTime, GasMixture from,
|
||||
LungComponent? lung=null,
|
||||
SharedMechanismComponent? mech=null)
|
||||
MechanismComponent? mech=null)
|
||||
{
|
||||
if (!Resolve(uid, ref lung, ref mech))
|
||||
return;
|
||||
@@ -186,7 +186,7 @@ public class LungSystem : EntitySystem
|
||||
/// </summary>
|
||||
public void Exhale(EntityUid uid, float frameTime,
|
||||
LungComponent? lung=null,
|
||||
SharedMechanismComponent? mech=null)
|
||||
MechanismComponent? mech=null)
|
||||
{
|
||||
if (!Resolve(uid, ref lung, ref mech))
|
||||
return;
|
||||
@@ -204,7 +204,7 @@ public class LungSystem : EntitySystem
|
||||
/// </summary>
|
||||
public void PushGasTo(EntityUid uid, GasMixture to,
|
||||
LungComponent? lung=null,
|
||||
SharedMechanismComponent? mech=null)
|
||||
MechanismComponent? mech=null)
|
||||
{
|
||||
if (!Resolve(uid, ref lung, ref mech))
|
||||
return;
|
||||
|
||||
@@ -3,6 +3,7 @@ using Content.Server.Body.Components;
|
||||
using Content.Server.Chemistry.Components.SolutionManager;
|
||||
using Content.Server.Chemistry.EntitySystems;
|
||||
using Content.Shared.Administration.Logs;
|
||||
using Content.Shared.Body.Components;
|
||||
using Content.Shared.Chemistry.Components;
|
||||
using Content.Shared.Chemistry.Reagent;
|
||||
using Content.Shared.Database;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Content.Server.Body.Components;
|
||||
using Content.Server.Chemistry.Components.SolutionManager;
|
||||
using Content.Server.Chemistry.EntitySystems;
|
||||
using Content.Shared.Body.Components;
|
||||
using Content.Shared.Chemistry.Components;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
|
||||
Reference in New Issue
Block a user