diff --git a/Robust.Shared.Scripting/ScriptGlobalsShared.cs b/Robust.Shared.Scripting/ScriptGlobalsShared.cs index d1f22e0a5..00e181089 100644 --- a/Robust.Shared.Scripting/ScriptGlobalsShared.cs +++ b/Robust.Shared.Scripting/ScriptGlobalsShared.cs @@ -3,6 +3,7 @@ using System.Diagnostics.CodeAnalysis; using JetBrains.Annotations; using Robust.Shared.GameObjects; using Robust.Shared.Interfaces.GameObjects; +using Robust.Shared.Interfaces.Map; using Robust.Shared.IoC; using Robust.Shared.Map; using Robust.Shared.Prototypes; @@ -17,6 +18,7 @@ namespace Robust.Shared.Scripting [field: Dependency] public IEntityManager ent { get; } = default!; [field: Dependency] public IComponentManager comp { get; } = default!; [field: Dependency] public IPrototypeManager prot { get; } = default!; + [field: Dependency] public IMapManager map { get; } = default!; public IEnumerable protos() where T : class, IPrototype { @@ -35,6 +37,31 @@ namespace Robust.Shared.Scripting return new GridCoordinates((float)x, (float)y, gridId); } + public EntityUid eid(int i) + { + return new EntityUid(i); + } + + public IEntity getent(int i) + { + return getent(eid(i)); + } + + public IEntity getent(EntityUid uid) + { + return ent.GetEntity(uid); + } + + public IMapGrid getgrid(int i) + { + return map.GetGrid(new GridId(i)); + } + + public IMapGrid getgrid(GridId mapId) + { + return map.GetGrid(mapId); + } + public IEntity spawn(string prototype, GridCoordinates position) { return ent.SpawnEntity(prototype, position);