Ghost sprites and a bunch of fixes
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Content.Server.Players;
|
||||
using Content.Server.GameObjects.Components.Observer;
|
||||
using Content.Server.Players;
|
||||
using Robust.Server.Interfaces.Console;
|
||||
using Robust.Server.Interfaces.Player;
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
@@ -30,10 +31,14 @@ namespace Content.Server.Administration
|
||||
}
|
||||
else
|
||||
{
|
||||
var canReturn = mind.CurrentEntity != null && !mind.CurrentEntity.HasComponent<GhostComponent>();
|
||||
var entityManager = IoCManager.Resolve<IEntityManager>();
|
||||
var ghost = entityManager.SpawnEntity("AdminObserver", player.AttachedEntity.Transform.GridPosition);
|
||||
|
||||
mind.Visit(ghost);
|
||||
if(canReturn)
|
||||
mind.Visit(ghost);
|
||||
else
|
||||
mind.TransferTo(ghost);
|
||||
ghost.GetComponent<GhostComponent>().CanReturnToBody = canReturn;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Content.Server.Interfaces.Chat;
|
||||
using Content.Server.GameObjects.Components.Observer;
|
||||
using Content.Server.Interfaces.Chat;
|
||||
using Content.Server.Observer;
|
||||
using Robust.Server.Interfaces.Console;
|
||||
using Robust.Server.Interfaces.Player;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Linq;
|
||||
using Content.Server.GameObjects.Components.Observer;
|
||||
using Content.Server.GameObjects.EntitySystems;
|
||||
using Content.Server.Interfaces;
|
||||
using Content.Server.Interfaces.Chat;
|
||||
|
||||
@@ -1,18 +1,16 @@
|
||||
using System.Threading;
|
||||
using Content.Server.GameObjects.EntitySystems;
|
||||
using Content.Server.Players;
|
||||
using Content.Shared.Observer;
|
||||
using Content.Shared.GameObjects.Components.Observer;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Server.Interfaces.GameObjects;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
using Robust.Shared.Interfaces.Network;
|
||||
using Robust.Shared.Log;
|
||||
using Robust.Shared.ViewVariables;
|
||||
using Timer = Robust.Shared.Timers.Timer;
|
||||
|
||||
|
||||
namespace Content.Server.Observer
|
||||
namespace Content.Server.GameObjects.Components.Observer
|
||||
{
|
||||
[RegisterComponent]
|
||||
public class GhostComponent : SharedGhostComponent, IActionBlocker
|
||||
@@ -46,6 +44,9 @@ namespace Content.Server.Observer
|
||||
actor.playerSession.ContentData().Mind.UnVisit();
|
||||
}
|
||||
break;
|
||||
case PlayerAttachedMsg _:
|
||||
Dirty();
|
||||
break;
|
||||
case PlayerDetachedMsg _:
|
||||
Timer.Spawn(100, Owner.Delete);
|
||||
break;
|
||||
@@ -54,7 +55,6 @@ namespace Content.Server.Observer
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public bool CanInteract() => false;
|
||||
public bool CanUse() => false;
|
||||
public bool CanThrow() => false;
|
||||
@@ -1,4 +1,5 @@
|
||||
using Content.Server.GameObjects;
|
||||
using Content.Server.GameObjects.Components.Observer;
|
||||
using Content.Server.GameObjects.EntitySystems;
|
||||
using Content.Server.Interfaces.GameTicking;
|
||||
using Content.Server.Players;
|
||||
@@ -7,6 +8,7 @@ using Robust.Server.Interfaces.Console;
|
||||
using Robust.Server.Interfaces.Player;
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Log;
|
||||
using Robust.Shared.Map;
|
||||
|
||||
namespace Content.Server.Observer
|
||||
|
||||
Reference in New Issue
Block a user