committed by
GitHub
parent
e8e1c9dd1f
commit
415b7e96fd
@@ -53,7 +53,7 @@ namespace Content.Server.GameObjects.Components.Construction
|
||||
{
|
||||
// Oh boy we get to finish construction!
|
||||
var entMgr = IoCManager.Resolve<IServerEntityManager>();
|
||||
var ent = entMgr.ForceSpawnEntityAt(Prototype.Result, Transform.LocalPosition);
|
||||
var ent = entMgr.ForceSpawnEntityAt(Prototype.Result, Transform.GridPosition);
|
||||
ent.GetComponent<ITransformComponent>().LocalRotation = Transform.LocalRotation;
|
||||
Owner.Delete();
|
||||
return true;
|
||||
@@ -105,9 +105,9 @@ namespace Content.Server.GameObjects.Components.Construction
|
||||
return false;
|
||||
}
|
||||
if (matStep.Material == MaterialType.Cable)
|
||||
AudioSystem.Play("/Audio/items/zip.ogg", Transform.LocalPosition);
|
||||
AudioSystem.Play("/Audio/items/zip.ogg", Transform.GridPosition);
|
||||
else
|
||||
AudioSystem.Play("/Audio/items/deconstruct.ogg", Transform.LocalPosition);
|
||||
AudioSystem.Play("/Audio/items/deconstruct.ogg", Transform.GridPosition);
|
||||
return true;
|
||||
case ConstructionStepTool toolStep:
|
||||
switch (toolStep.Tool)
|
||||
@@ -115,7 +115,7 @@ namespace Content.Server.GameObjects.Components.Construction
|
||||
case ToolType.Crowbar:
|
||||
if (slapped.HasComponent<CrowbarComponent>())
|
||||
{
|
||||
AudioSystem.Play("/Audio/items/crowbar.ogg", Transform.LocalPosition);
|
||||
AudioSystem.Play("/Audio/items/crowbar.ogg", Transform.GridPosition);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -123,16 +123,16 @@ namespace Content.Server.GameObjects.Components.Construction
|
||||
if (slapped.TryGetComponent(out WelderComponent welder) && welder.TryUse(toolStep.Amount))
|
||||
{
|
||||
if (random.NextDouble() > 0.5)
|
||||
AudioSystem.Play("/Audio/items/welder.ogg", Transform.LocalPosition);
|
||||
AudioSystem.Play("/Audio/items/welder.ogg", Transform.GridPosition);
|
||||
else
|
||||
AudioSystem.Play("/Audio/items/welder2.ogg", Transform.LocalPosition);
|
||||
AudioSystem.Play("/Audio/items/welder2.ogg", Transform.GridPosition);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
case ToolType.Wrench:
|
||||
if (slapped.HasComponent<WrenchComponent>())
|
||||
{
|
||||
AudioSystem.Play("/Audio/items/ratchet.ogg", Transform.LocalPosition);
|
||||
AudioSystem.Play("/Audio/items/ratchet.ogg", Transform.GridPosition);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -140,16 +140,16 @@ namespace Content.Server.GameObjects.Components.Construction
|
||||
if (slapped.HasComponent<ScrewdriverComponent>())
|
||||
{
|
||||
if (random.NextDouble() > 0.5)
|
||||
AudioSystem.Play("/Audio/items/screwdriver.ogg", Transform.LocalPosition);
|
||||
AudioSystem.Play("/Audio/items/screwdriver.ogg", Transform.GridPosition);
|
||||
else
|
||||
AudioSystem.Play("/Audio/items/screwdriver2.ogg", Transform.LocalPosition);
|
||||
AudioSystem.Play("/Audio/items/screwdriver2.ogg", Transform.GridPosition);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
case ToolType.Wirecutters:
|
||||
if (slapped.HasComponent<WirecutterComponent>())
|
||||
{
|
||||
AudioSystem.Play("/Audio/items/wirecutter.ogg", Transform.LocalPosition);
|
||||
AudioSystem.Play("/Audio/items/wirecutter.ogg", Transform.GridPosition);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -33,13 +33,13 @@ namespace Content.Server.GameObjects.Components.Construction
|
||||
}
|
||||
}
|
||||
|
||||
void TryStartStructureConstruction(GridLocalCoordinates loc, string prototypeName, Angle angle, int ack)
|
||||
void TryStartStructureConstruction(GridCoordinates loc, string prototypeName, Angle angle, int ack)
|
||||
{
|
||||
var protoMan = IoCManager.Resolve<IPrototypeManager>();
|
||||
var prototype = protoMan.Index<ConstructionPrototype>(prototypeName);
|
||||
|
||||
var transform = Owner.GetComponent<ITransformComponent>();
|
||||
if (!loc.InRange(transform.LocalPosition, InteractionSystem.INTERACTION_RANGE))
|
||||
if (!loc.InRange(transform.GridPosition, InteractionSystem.INTERACTION_RANGE))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ namespace Content.Server.GameObjects
|
||||
|
||||
// TODO: The item should be dropped to the container our owner is in, if any.
|
||||
var itemTransform = item.Owner.GetComponent<ITransformComponent>();
|
||||
itemTransform.LocalPosition = Owner.GetComponent<ITransformComponent>().LocalPosition;
|
||||
itemTransform.GridPosition = Owner.GetComponent<ITransformComponent>().GridPosition;
|
||||
Dirty();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ namespace Content.Server.GameObjects
|
||||
return null;
|
||||
}
|
||||
|
||||
public bool Drop(string slot, GridLocalCoordinates coords)
|
||||
public bool Drop(string slot, GridCoordinates coords)
|
||||
{
|
||||
if (!CanDrop(slot))
|
||||
{
|
||||
@@ -188,13 +188,13 @@ namespace Content.Server.GameObjects
|
||||
item.RemovedFromSlot();
|
||||
|
||||
// TODO: The item should be dropped to the container our owner is in, if any.
|
||||
item.Owner.Transform.LocalPosition = coords;
|
||||
item.Owner.Transform.GridPosition = coords;
|
||||
|
||||
Dirty();
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool Drop(IEntity entity, GridLocalCoordinates coords)
|
||||
public bool Drop(IEntity entity, GridCoordinates coords)
|
||||
{
|
||||
if (entity == null)
|
||||
{
|
||||
@@ -227,7 +227,7 @@ namespace Content.Server.GameObjects
|
||||
item.RemovedFromSlot();
|
||||
|
||||
// TODO: The item should be dropped to the container our owner is in, if any.
|
||||
item.Owner.Transform.LocalPosition = Owner.Transform.LocalPosition;
|
||||
item.Owner.Transform.GridPosition = Owner.Transform.GridPosition;
|
||||
|
||||
Dirty();
|
||||
return true;
|
||||
@@ -451,7 +451,7 @@ namespace Content.Server.GameObjects
|
||||
if (playerEntity == Owner && used != null)
|
||||
{
|
||||
InteractionSystem.Interaction(Owner, used, slot.ContainedEntity,
|
||||
GridLocalCoordinates.Nullspace);
|
||||
GridCoordinates.Nullspace);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
@@ -148,7 +148,7 @@ namespace Content.Server.GameObjects.Components.Interactable
|
||||
|
||||
if (!user.TryGetComponent(out HandsComponent hands)
|
||||
|| !hands.PutInHand(cell.Owner.GetComponent<ItemComponent>()))
|
||||
cell.Owner.Transform.LocalPosition = user.Transform.LocalPosition;
|
||||
cell.Owner.Transform.GridPosition = user.Transform.GridPosition;
|
||||
}
|
||||
|
||||
[Verb]
|
||||
|
||||
@@ -256,7 +256,7 @@ namespace Content.Server.GameObjects
|
||||
var ourtransform = Owner.GetComponent<ITransformComponent>();
|
||||
var playertransform = playerentity.GetComponent<ITransformComponent>();
|
||||
|
||||
if (playertransform.LocalPosition.InRange(ourtransform.LocalPosition, 2)
|
||||
if (playertransform.GridPosition.InRange(ourtransform.GridPosition, 2)
|
||||
&& (ourtransform.IsMapTransform || playertransform.ContainsEntity(ourtransform)))
|
||||
{
|
||||
var remove = (RemoveEntityMessage)message;
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Content.Server.GameObjects.Components.Power
|
||||
{
|
||||
public class PowerDebugTool : SharedPowerDebugTool, IAfterAttack
|
||||
{
|
||||
void IAfterAttack.Afterattack(IEntity user, GridLocalCoordinates clicklocation, IEntity attacked)
|
||||
void IAfterAttack.Afterattack(IEntity user, GridCoordinates clicklocation, IEntity attacked)
|
||||
{
|
||||
if (attacked == null)
|
||||
{
|
||||
@@ -65,7 +65,7 @@ namespace Content.Server.GameObjects.Components.Power
|
||||
foreach (var provider in device.AvailableProviders)
|
||||
{
|
||||
var providerTransform = provider.Owner.GetComponent<ITransformComponent>();
|
||||
builder.AppendFormat(" {0} ({1}) @ {2}", provider.Owner.Name, provider.Owner.Uid, providerTransform.LocalPosition);
|
||||
builder.AppendFormat(" {0} ({1}) @ {2}", provider.Owner.Name, provider.Owner.Uid, providerTransform.GridPosition);
|
||||
if (device.Provider == provider)
|
||||
{
|
||||
builder.Append(" (CURRENT)");
|
||||
|
||||
@@ -32,11 +32,11 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
|
||||
serializer.DataField(ref ArcWidth, "arcwidth", 90);
|
||||
}
|
||||
|
||||
void IAfterAttack.Afterattack(IEntity user, GridLocalCoordinates clicklocation, IEntity attacked)
|
||||
void IAfterAttack.Afterattack(IEntity user, GridCoordinates clicklocation, IEntity attacked)
|
||||
{
|
||||
var location = user.GetComponent<ITransformComponent>().LocalPosition;
|
||||
var location = user.GetComponent<ITransformComponent>().GridPosition;
|
||||
var angle = new Angle(clicklocation.ToWorld().Position - location.ToWorld().Position);
|
||||
var entities = IoCManager.Resolve<IServerEntityManager>().GetEntitiesInArc(user.GetComponent<ITransformComponent>().LocalPosition, Range, angle, ArcWidth);
|
||||
var entities = IoCManager.Resolve<IServerEntityManager>().GetEntitiesInArc(user.GetComponent<ITransformComponent>().GridPosition, Range, angle, ArcWidth);
|
||||
|
||||
foreach (var entity in entities)
|
||||
{
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Hitscan
|
||||
rangedWeapon.FireHandler = Fire;
|
||||
}
|
||||
|
||||
private void Fire(IEntity user, GridLocalCoordinates clickLocation)
|
||||
private void Fire(IEntity user, GridCoordinates clickLocation)
|
||||
{
|
||||
var userPosition = user.Transform.WorldPosition; //Remember world positions are ephemeral and can only be used instantaneously
|
||||
var angle = new Angle(clickLocation.Position - userPosition);
|
||||
@@ -72,7 +72,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Hitscan
|
||||
Born = time,
|
||||
DeathTime = time + TimeSpan.FromSeconds(1),
|
||||
Size = new Vector2(dist, 1f),
|
||||
Coordinates = user.Transform.LocalPosition.Translated(offset),
|
||||
Coordinates = user.Transform.GridPosition.Translated(offset),
|
||||
//Rotated from east facing
|
||||
Rotation = (float) angle.Theta,
|
||||
ColorDelta = new Vector4(0, 0, 0, -1500f),
|
||||
|
||||
@@ -59,9 +59,9 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Projectile
|
||||
serializer.DataField(ref _spreadStdDev, "spreadstddev", 3);
|
||||
}
|
||||
|
||||
private void Fire(IEntity user, GridLocalCoordinates clickLocation)
|
||||
private void Fire(IEntity user, GridCoordinates clickLocation)
|
||||
{
|
||||
var userPosition = user.Transform.LocalPosition; //Remember world positions are ephemeral and can only be used instantaneously
|
||||
var userPosition = user.Transform.GridPosition; //Remember world positions are ephemeral and can only be used instantaneously
|
||||
var angle = new Angle(clickLocation.Position - userPosition.Position);
|
||||
|
||||
if (Spread)
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged
|
||||
|
||||
public Func<bool> WeaponCanFireHandler;
|
||||
public Func<IEntity, bool> UserCanFireHandler;
|
||||
public Action<IEntity, GridLocalCoordinates> FireHandler;
|
||||
public Action<IEntity, GridCoordinates> FireHandler;
|
||||
|
||||
private const int MaxFireDelayAttempts = 2;
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged
|
||||
return UserCanFireHandler == null || UserCanFireHandler(user);
|
||||
}
|
||||
|
||||
private void Fire(IEntity user, GridLocalCoordinates clickLocation)
|
||||
private void Fire(IEntity user, GridCoordinates clickLocation)
|
||||
{
|
||||
_lastFireTime = IoCManager.Resolve<IGameTiming>().CurTime;
|
||||
FireHandler?.Invoke(user, clickLocation);
|
||||
@@ -60,7 +60,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged
|
||||
}
|
||||
}
|
||||
|
||||
private void _tryFire(IEntity user, GridLocalCoordinates coordinates, int attemptCount)
|
||||
private void _tryFire(IEntity user, GridCoordinates coordinates, int attemptCount)
|
||||
{
|
||||
if (!user.TryGetComponent(out HandsComponent hands) || hands.GetActiveHand.Owner != Owner)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user