Magic 3 (#340)
* - add: Some tweaks and localization. * - add: Teleport spell. * - tweak: Tweak wizard hardsuit. * - add: Turn off shield on cast. * - add: New wizard clothes & update wizard shuttle, * - remove: Remove old clothes from shuttle. * - fix: No teleporting to centcomm.
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
using Content.Server.Pinpointer;
|
||||
using Content.Server.Warps;
|
||||
|
||||
namespace Content.Server._White.Wizard.Teleport;
|
||||
|
||||
public sealed class TeleportLocationSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly SharedTransformSystem _transformSystem = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<SpawnTeleportLocationComponent, MapInitEvent>(OnMapInit,
|
||||
after: new[] {typeof(NavMapSystem)});
|
||||
}
|
||||
|
||||
private void OnMapInit(Entity<SpawnTeleportLocationComponent> ent, ref MapInitEvent args)
|
||||
{
|
||||
if (!TryComp(ent, out WarpPointComponent? warpPoint) || warpPoint.Location == null)
|
||||
return;
|
||||
|
||||
var newEnt = Spawn(null, Transform(ent).Coordinates);
|
||||
var xForm = EnsureComp<TransformComponent>(newEnt);
|
||||
_transformSystem.AttachToGridOrMap(newEnt, xForm);
|
||||
var location = EnsureComp<TeleportLocationComponent>(newEnt);
|
||||
location.Location = warpPoint.Location;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user