Ghost sprites and a bunch of fixes

This commit is contained in:
zumorica
2020-04-05 02:29:04 +02:00
parent 0902844457
commit a0d114c672
9 changed files with 57 additions and 16 deletions

View File

@@ -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;
}
}
}

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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