Inline Transform

This commit is contained in:
Vera Aguilera Puerto
2021-12-03 14:20:34 +01:00
parent 69b270017b
commit a5b57c8e10
283 changed files with 742 additions and 709 deletions

View File

@@ -302,7 +302,7 @@ namespace Content.Server.Chemistry.Components
var actualVolume = FixedPoint2.Min(individualVolume, FixedPoint2.New(30));
for (int i = 0; i < bottleAmount; i++)
{
var bottle = IoCManager.Resolve<IEntityManager>().SpawnEntity("ChemistryEmptyBottle01", Owner.Transform.Coordinates);
var bottle = IoCManager.Resolve<IEntityManager>().SpawnEntity("ChemistryEmptyBottle01", IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner.Uid).Coordinates);
//Adding label
LabelComponent labelComponent = bottle.EnsureComponent<LabelComponent>();
@@ -327,7 +327,7 @@ namespace Content.Server.Chemistry.Components
}
//Put it on the floor
bottle.Transform.Coordinates = user.Transform.Coordinates;
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(bottle.Uid).Coordinates = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(user.Uid).Coordinates;
//Give it an offset
bottle.RandomOffset(0.2f);
}
@@ -344,7 +344,7 @@ namespace Content.Server.Chemistry.Components
var actualVolume = FixedPoint2.Min(individualVolume, FixedPoint2.New(50));
for (int i = 0; i < pillAmount; i++)
{
var pill = IoCManager.Resolve<IEntityManager>().SpawnEntity("pill", Owner.Transform.Coordinates);
var pill = IoCManager.Resolve<IEntityManager>().SpawnEntity("pill", IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner.Uid).Coordinates);
//Adding label
LabelComponent labelComponent = pill.EnsureComponent<LabelComponent>();
@@ -375,7 +375,7 @@ namespace Content.Server.Chemistry.Components
}
//Put it on the floor
pill.Transform.Coordinates = user.Transform.Coordinates;
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(pill.Uid).Coordinates = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(user.Uid).Coordinates;
//Give it an offset
pill.RandomOffset(0.2f);
}

View File

@@ -79,7 +79,7 @@ namespace Content.Server.Chemistry.Components
{
if (!string.IsNullOrEmpty(_foamedMetalPrototype))
{
IoCManager.Resolve<IEntityManager>().SpawnEntity(_foamedMetalPrototype, Owner.Transform.Coordinates);
IoCManager.Resolve<IEntityManager>().SpawnEntity(_foamedMetalPrototype, IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner.Uid).Coordinates);
}
IoCManager.Resolve<IEntityManager>().QueueDeleteEntity(Owner.Uid);

View File

@@ -80,7 +80,7 @@ namespace Content.Server.Chemistry.Components
{
target.PopupMessage(Loc.GetString("hypospray-component-feel-prick-message"));
var meleeSys = EntitySystem.Get<MeleeWeaponSystem>();
var angle = Angle.FromWorldVec(target.Transform.WorldPosition - user.Transform.WorldPosition);
var angle = Angle.FromWorldVec(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(target.Uid).WorldPosition - IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(user.Uid).WorldPosition);
meleeSys.SendLunge(angle, user);
}

View File

@@ -70,8 +70,8 @@ namespace Content.Server.Chemistry.Components
void SpreadToDir(Direction dir)
{
var grid = MapManager.GetGrid(Owner.Transform.GridID);
var coords = Owner.Transform.Coordinates;
var grid = MapManager.GetGrid(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner.Uid).GridID);
var coords = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner.Uid).Coordinates;
foreach (var neighbor in grid.GetInDir(coords, dir))
{
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(neighbor,
@@ -132,8 +132,8 @@ namespace Content.Server.Chemistry.Components
return;
var chemistry = EntitySystem.Get<ReactiveSystem>();
var mapGrid = MapManager.GetGrid(Owner.Transform.GridID);
var tile = mapGrid.GetTileRef(Owner.Transform.Coordinates.ToVector2i(IoCManager.Resolve<IEntityManager>(), MapManager));
var mapGrid = MapManager.GetGrid(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner.Uid).GridID);
var tile = mapGrid.GetTileRef(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Owner.Uid).Coordinates.ToVector2i(IoCManager.Resolve<IEntityManager>(), MapManager));
var solutionFraction = 1 / Math.Floor(averageExposures);