Kill bobby 2.0 (#6023)
This commit is contained in:
@@ -9,11 +9,13 @@ using Robust.Shared.Serialization.Manager.Attributes;
|
||||
namespace Content.Server.Ghost.Components
|
||||
{
|
||||
[RegisterComponent]
|
||||
[ComponentReference(typeof(IGhostOnMove))]
|
||||
public class GhostOnMoveComponent : Component,IGhostOnMove
|
||||
public class GhostOnMoveComponent : Component
|
||||
{
|
||||
public override string Name => "GhostOnMove";
|
||||
|
||||
[DataField("canReturn")] public bool CanReturn { get; set; } = true;
|
||||
|
||||
[DataField("mustBeDead")]
|
||||
public bool MustBeDead = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ using Content.Server.Visible;
|
||||
using Content.Server.Warps;
|
||||
using Content.Shared.Examine;
|
||||
using Content.Shared.Ghost;
|
||||
using Content.Shared.MobState.Components;
|
||||
using Content.Shared.Movement.EntitySystems;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Server.GameObjects;
|
||||
@@ -53,6 +54,7 @@ namespace Content.Server.Ghost
|
||||
// Let's not ghost if our mind is visiting...
|
||||
if (EntityManager.HasComponent<VisitingMindComponent>(uid)) return;
|
||||
if (!EntityManager.TryGetComponent<MindComponent>(uid, out var mind) || !mind.HasMind || mind.Mind!.IsVisitingEntity) return;
|
||||
if (component.MustBeDead && TryComp<MobStateComponent>(uid, out var state) && !state.IsDead()) return;
|
||||
|
||||
_ticker.OnGhostAttempt(mind.Mind!, component.CanReturn);
|
||||
}
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
namespace Content.Server.Ghost
|
||||
{
|
||||
public interface IGhostOnMove
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using Robust.Server.Player;
|
||||
using Content.Server.Mind.Commands;
|
||||
using Robust.Server.Player;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.ViewVariables;
|
||||
|
||||
Reference in New Issue
Block a user