Turret Entities (#38)
* Spotlight Turret. * Used new turret sprite, credit: @Lobstrex (Lob)#5692 * Moved AimShootLifeProcessor.cs to content. * Update Submodule Try 2.
This commit is contained in:
committed by
Pieter-Jan Briers
parent
98bd1552b9
commit
071ed3f1ed
30
Content.Server/Placement/SpawnHelpers.cs
Normal file
30
Content.Server/Placement/SpawnHelpers.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
using SS14.Server.Interfaces.GameObjects;
|
||||
using SS14.Shared.Interfaces.Map;
|
||||
using SS14.Shared.IoC;
|
||||
using SS14.Shared.Map;
|
||||
using SS14.Shared.Maths;
|
||||
|
||||
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>
|
||||
/// <param name="grid"></param>
|
||||
/// <param name="localPosition"></param>
|
||||
public static void SpawnLightTurret(IMapGrid grid, Vector2 localPosition)
|
||||
{
|
||||
var entMan = IoCManager.Resolve<IServerEntityManager>();
|
||||
var tBase = entMan.SpawnEntity("TurretBase");
|
||||
tBase.GetComponent<IServerTransformComponent>().LocalPosition = new LocalCoordinates(localPosition, grid);
|
||||
|
||||
var tTop = entMan.SpawnEntity("TurretTopLight");
|
||||
tTop.GetComponent<IServerTransformComponent>().LocalPosition = new LocalCoordinates(localPosition, grid);
|
||||
tTop.GetComponent<IServerTransformComponent>().AttachParent(tBase);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user