2019-04-15 21:11:38 -06:00
|
|
|
|
using Robust.Server.Interfaces.GameObjects;
|
|
|
|
|
|
using Robust.Shared.Interfaces.GameObjects.Components;
|
|
|
|
|
|
using Robust.Shared.IoC;
|
|
|
|
|
|
using Robust.Shared.Map;
|
|
|
|
|
|
using Robust.Shared.Maths;
|
2018-03-15 12:41:31 -07:00
|
|
|
|
|
|
|
|
|
|
namespace Content.Server.Placement
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Helper function for spawning more complex multi-entity structures
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public static class SpawnHelpers
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Spawns a spotlight ground turret that will track any living entities in range.
|
|
|
|
|
|
/// </summary>
|
2019-12-16 21:44:24 -08:00
|
|
|
|
/// <param name="position"></param>
|
|
|
|
|
|
public static void SpawnLightTurret(GridCoordinates position)
|
2018-03-15 12:41:31 -07:00
|
|
|
|
{
|
|
|
|
|
|
var entMan = IoCManager.Resolve<IServerEntityManager>();
|
2019-12-16 21:44:24 -08:00
|
|
|
|
var tBase = entMan.SpawnEntity("TurretBase", position);
|
2018-03-15 12:41:31 -07:00
|
|
|
|
|
2019-12-16 21:44:24 -08:00
|
|
|
|
var tTop = entMan.SpawnEntity("TurretTopLight", position);
|
|
|
|
|
|
tTop.Transform.AttachParent(tBase);
|
2018-03-15 12:41:31 -07:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|