committed by
GitHub
parent
e8e1c9dd1f
commit
415b7e96fd
@@ -45,7 +45,7 @@ namespace Content.Client
|
||||
PopupMessage(_eyeManager.WorldToScreen(message.Coordinates), message.Message);
|
||||
}
|
||||
|
||||
public override void PopupMessage(GridLocalCoordinates coordinates, IEntity viewer, string message)
|
||||
public override void PopupMessage(GridCoordinates coordinates, IEntity viewer, string message)
|
||||
{
|
||||
if (viewer != _playerManager.LocalPlayer.ControlledEntity)
|
||||
{
|
||||
@@ -59,7 +59,7 @@ namespace Content.Client
|
||||
{
|
||||
var label = new PopupLabel {Text = message};
|
||||
var minimumSize = label.CombinedMinimumSize;
|
||||
label.InitialPos = label.Position = coordinates.AsVector - minimumSize / 2;
|
||||
label.InitialPos = label.Position = coordinates.Position - minimumSize / 2;
|
||||
_userInterfaceManager.StateRoot.AddChild(label);
|
||||
_aliveLabels.Add(label);
|
||||
}
|
||||
|
||||
@@ -192,7 +192,7 @@ namespace Content.Client.Construction
|
||||
if (prototype.Type != ConstructionType.Structure)
|
||||
{
|
||||
// In-hand attackby doesn't exist so this is the best alternative.
|
||||
var loc = Owner.Owner.GetComponent<ITransformComponent>().LocalPosition;
|
||||
var loc = Owner.Owner.GetComponent<ITransformComponent>().GridPosition;
|
||||
Owner.SpawnGhost(prototype, loc, Direction.North);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace Content.Client.Construction
|
||||
Owner = owner;
|
||||
}
|
||||
|
||||
public override bool HijackPlacementRequest(GridLocalCoordinates coords)
|
||||
public override bool HijackPlacementRequest(GridCoordinates coords)
|
||||
{
|
||||
if (Prototype != null)
|
||||
{
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace Content.Client.GameObjects.Components.Construction
|
||||
Button?.Dispose();
|
||||
}
|
||||
|
||||
public void SpawnGhost(ConstructionPrototype prototype, GridLocalCoordinates loc, Direction dir)
|
||||
public void SpawnGhost(ConstructionPrototype prototype, GridCoordinates loc, Direction dir)
|
||||
{
|
||||
var entMgr = IoCManager.Resolve<IClientEntityManager>();
|
||||
var ghost = entMgr.ForceSpawnEntityAt("constructionghost", loc);
|
||||
@@ -80,7 +80,7 @@ namespace Content.Client.GameObjects.Components.Construction
|
||||
{
|
||||
var ghost = Ghosts[ghostId];
|
||||
var transform = ghost.Owner.GetComponent<ITransformComponent>();
|
||||
var msg = new TryStartStructureConstructionMessage(transform.LocalPosition, ghost.Prototype.ID, transform.LocalRotation, ghostId);
|
||||
var msg = new TryStartStructureConstructionMessage(transform.GridPosition, ghost.Prototype.ID, transform.LocalRotation, ghostId);
|
||||
SendNetworkMessage(msg);
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Content.Client.GameObjects.Components.Weapons.Ranged
|
||||
private TimeSpan _lastFireTime;
|
||||
private int _tick;
|
||||
|
||||
public void TryFire(GridLocalCoordinates worldPos)
|
||||
public void TryFire(GridCoordinates worldPos)
|
||||
{
|
||||
var curTime = IoCManager.Resolve<IGameTiming>().CurTime;
|
||||
var span = curTime - _lastFireTime;
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace Content.Client.GameObjects.EntitySystems
|
||||
RaiseNetworkEvent(new VerbSystemMessages.RequestVerbsMessage(_currentEntity));
|
||||
|
||||
var size = vBox.CombinedMinimumSize;
|
||||
var box = UIBox2.FromDimensions(screenCoordinates.AsVector, size);
|
||||
var box = UIBox2.FromDimensions(screenCoordinates.Position, size);
|
||||
_currentPopup.Open(box);
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace Content.Server.Administration
|
||||
{
|
||||
var entityManager = IoCManager.Resolve<IEntityManager>();
|
||||
var ghost = entityManager.ForceSpawnEntityAt("AdminObserver",
|
||||
player.AttachedEntity.Transform.LocalPosition);
|
||||
player.AttachedEntity.Transform.GridPosition);
|
||||
|
||||
mind.Visit(ghost);
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
inputSys.BindMap.BindFunction(ContentKeyFunctions.ExamineEntity, new PointerInputCmdHandler(HandleExamine));
|
||||
}
|
||||
|
||||
private void HandleExamine(ICommonSession session, GridLocalCoordinates coords, EntityUid uid)
|
||||
private void HandleExamine(ICommonSession session, GridCoordinates coords, EntityUid uid)
|
||||
{
|
||||
if (!(session is IPlayerSession svSession))
|
||||
return;
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
/// <param name="attackwith"></param>
|
||||
/// <param name="clicklocation"></param>
|
||||
/// <returns></returns>
|
||||
bool RangedAttackby(IEntity user, IEntity attackwith, GridLocalCoordinates clicklocation);
|
||||
bool RangedAttackby(IEntity user, IEntity attackwith, GridCoordinates clicklocation);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -72,7 +72,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
/// <param name="user"></param>
|
||||
/// <param name="clicklocation"></param>
|
||||
/// <param name="attacked">The entity that was clicked on out of range. May be null if no entity was clicked on.true</param>
|
||||
void Afterattack(IEntity user, GridLocalCoordinates clicklocation, IEntity attacked);
|
||||
void Afterattack(IEntity user, GridCoordinates clicklocation, IEntity attacked);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -115,7 +115,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
inputSys.BindMap.BindFunction(ContentKeyFunctions.ActivateItemInWorld, new PointerInputCmdHandler((HandleUseItemInWorld)));
|
||||
}
|
||||
|
||||
private void HandleUseItemInWorld(ICommonSession session, GridLocalCoordinates coords, EntityUid uid)
|
||||
private void HandleUseItemInWorld(ICommonSession session, GridCoordinates coords, EntityUid uid)
|
||||
{
|
||||
if(!EntityManager.TryGetEntity(uid, out var used))
|
||||
return;
|
||||
@@ -128,13 +128,13 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
if(playerEnt == null || !playerEnt.IsValid())
|
||||
return;
|
||||
|
||||
if (!playerEnt.Transform.LocalPosition.InRange(used.Transform.LocalPosition, INTERACTION_RANGE))
|
||||
if (!playerEnt.Transform.GridPosition.InRange(used.Transform.GridPosition, INTERACTION_RANGE))
|
||||
return;
|
||||
|
||||
activateComp.Activate(playerEnt);
|
||||
}
|
||||
|
||||
private void HandleUseItemInHand(ICommonSession session, GridLocalCoordinates coords, EntityUid uid)
|
||||
private void HandleUseItemInHand(ICommonSession session, GridCoordinates coords, EntityUid uid)
|
||||
{
|
||||
// client sanitization
|
||||
if(!coords.IsValidLocation())
|
||||
@@ -152,7 +152,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
UserInteraction(((IPlayerSession)session).AttachedEntity, coords, uid);
|
||||
}
|
||||
|
||||
private void UserInteraction(IEntity player, GridLocalCoordinates coordinates, EntityUid clickedUid)
|
||||
private void UserInteraction(IEntity player, GridCoordinates coordinates, EntityUid clickedUid)
|
||||
{
|
||||
//Get entity clicked upon from UID if valid UID, if not assume no entity clicked upon and null
|
||||
if (!EntityManager.TryGetEntity(clickedUid, out var attacked))
|
||||
@@ -244,7 +244,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
/// <param name="user"></param>
|
||||
/// <param name="weapon"></param>
|
||||
/// <param name="clicklocation"></param>
|
||||
public static void InteractAfterattack(IEntity user, IEntity weapon, GridLocalCoordinates clicklocation)
|
||||
public static void InteractAfterattack(IEntity user, IEntity weapon, GridCoordinates clicklocation)
|
||||
{
|
||||
List<IAfterAttack> afterattacks = weapon.GetAllComponents<IAfterAttack>().ToList();
|
||||
|
||||
@@ -261,7 +261,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
/// <param name="user"></param>
|
||||
/// <param name="weapon"></param>
|
||||
/// <param name="attacked"></param>
|
||||
public static void Interaction(IEntity user, IEntity weapon, IEntity attacked, GridLocalCoordinates clicklocation)
|
||||
public static void Interaction(IEntity user, IEntity weapon, IEntity attacked, GridCoordinates clicklocation)
|
||||
{
|
||||
List<IAttackby> interactables = attacked.GetAllComponents<IAttackby>().ToList();
|
||||
|
||||
@@ -347,7 +347,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
/// <param name="user"></param>
|
||||
/// <param name="weapon"></param>
|
||||
/// <param name="attacked"></param>
|
||||
public static void RangedInteraction(IEntity user, IEntity weapon, IEntity attacked, GridLocalCoordinates clicklocation)
|
||||
public static void RangedInteraction(IEntity user, IEntity weapon, IEntity attacked, GridCoordinates clicklocation)
|
||||
{
|
||||
List<IRangedAttackby> rangedusables = attacked.GetAllComponents<IRangedAttackby>().ToList();
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
handsComp.SwapHands();
|
||||
}
|
||||
|
||||
private static void HandleDrop(ICommonSession session, GridLocalCoordinates coords, EntityUid uid)
|
||||
private static void HandleDrop(ICommonSession session, GridCoordinates coords, EntityUid uid)
|
||||
{
|
||||
var ent = ((IPlayerSession) session).AttachedEntity;
|
||||
|
||||
@@ -118,7 +118,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
|
||||
var transform = ent.Transform;
|
||||
|
||||
if (transform.LocalPosition.InRange(coords, InteractionSystem.INTERACTION_RANGE))
|
||||
if (transform.GridPosition.InRange(coords, InteractionSystem.INTERACTION_RANGE))
|
||||
{
|
||||
handsComp.Drop(handsComp.ActiveIndex, coords);
|
||||
}
|
||||
@@ -136,7 +136,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
handsComp.ActivateItem();
|
||||
}
|
||||
|
||||
private static void HandleThrowItem(ICommonSession session, GridLocalCoordinates coords, EntityUid uid)
|
||||
private static void HandleThrowItem(ICommonSession session, GridCoordinates coords, EntityUid uid)
|
||||
{
|
||||
var plyEnt = ((IPlayerSession)session).AttachedEntity;
|
||||
|
||||
@@ -159,7 +159,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
else
|
||||
{
|
||||
stackComp.Use(1);
|
||||
throwEnt = throwEnt.EntityManager.ForceSpawnEntityAt(throwEnt.Prototype.ID, plyEnt.Transform.LocalPosition);
|
||||
throwEnt = throwEnt.EntityManager.ForceSpawnEntityAt(throwEnt.Prototype.ID, plyEnt.Transform.GridPosition);
|
||||
}
|
||||
|
||||
if (!throwEnt.TryGetComponent(out CollidableComponent colComp))
|
||||
|
||||
@@ -63,7 +63,7 @@ namespace Content.Server.GameTicking
|
||||
private const float LobbyDuration = 20;
|
||||
|
||||
[ViewVariables] private bool _initialized;
|
||||
[ViewVariables(VVAccess.ReadWrite)] private GridLocalCoordinates _spawnPoint;
|
||||
[ViewVariables(VVAccess.ReadWrite)] private GridCoordinates _spawnPoint;
|
||||
[ViewVariables] private GameRunLevel _runLevel;
|
||||
|
||||
[ViewVariables] private bool LobbyEnabled => _configurationManager.GetCVar<bool>("game.lobbyenabled");
|
||||
@@ -272,7 +272,7 @@ namespace Content.Server.GameTicking
|
||||
var startTime = _gameTiming.RealTime;
|
||||
var grid = _mapLoader.LoadBlueprint(newMap, MapFile);
|
||||
|
||||
_spawnPoint = new GridLocalCoordinates(Vector2.Zero, grid);
|
||||
_spawnPoint = new GridCoordinates(Vector2.Zero, grid);
|
||||
|
||||
var timeSpan = _gameTiming.RealTime - startTime;
|
||||
Logger.InfoS("ticker", $"Loaded map in {timeSpan.TotalMilliseconds:N2}ms.");
|
||||
|
||||
@@ -107,7 +107,7 @@ namespace Content.Server.Interfaces.GameObjects
|
||||
/// <param name="slot">The slot to drop the item from.</param>
|
||||
/// <param name="coords"></param>
|
||||
/// <returns>True if an item was dropped, false otherwise.</returns>
|
||||
bool Drop(string slot, GridLocalCoordinates coords);
|
||||
bool Drop(string slot, GridCoordinates coords);
|
||||
|
||||
/// <summary>
|
||||
/// Drop the specified entity in our hands to a certain position.
|
||||
@@ -128,7 +128,7 @@ namespace Content.Server.Interfaces.GameObjects
|
||||
/// <exception cref="ArgumentException">
|
||||
/// Thrown if <see cref="entity"/> is not actually held in any hand.
|
||||
/// </exception>
|
||||
bool Drop(IEntity entity, GridLocalCoordinates coords);
|
||||
bool Drop(IEntity entity, GridCoordinates coords);
|
||||
|
||||
/// <summary>
|
||||
/// Drop the item contained in a slot into another container.
|
||||
|
||||
@@ -21,11 +21,11 @@ namespace Content.Server.Placement
|
||||
{
|
||||
var entMan = IoCManager.Resolve<IServerEntityManager>();
|
||||
var tBase = entMan.SpawnEntity("TurretBase");
|
||||
tBase.GetComponent<ITransformComponent>().LocalPosition = new GridLocalCoordinates(localPosition, grid);
|
||||
tBase.GetComponent<ITransformComponent>().GridPosition = new GridCoordinates(localPosition, grid);
|
||||
|
||||
var tTop = entMan.SpawnEntity("TurretTopLight");
|
||||
var topTransform = tTop.GetComponent<ITransformComponent>();
|
||||
topTransform.LocalPosition = new GridLocalCoordinates(localPosition, grid);
|
||||
topTransform.GridPosition = new GridCoordinates(localPosition, grid);
|
||||
topTransform.AttachParent(tBase);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace Content.Server
|
||||
_initialized = true;
|
||||
}
|
||||
|
||||
public override void PopupMessage(GridLocalCoordinates coordinates, IEntity viewer, string message)
|
||||
public override void PopupMessage(GridCoordinates coordinates, IEntity viewer, string message)
|
||||
{
|
||||
if (!viewer.TryGetComponent(out IActorComponent actor))
|
||||
{
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace Content.Shared.GameObjects.Components.Construction
|
||||
/// <summary>
|
||||
/// Position to start building.
|
||||
/// </summary>
|
||||
public readonly GridLocalCoordinates Location;
|
||||
public readonly GridCoordinates Location;
|
||||
|
||||
/// <summary>
|
||||
/// The construction prototype to start building.
|
||||
@@ -38,7 +38,7 @@ namespace Content.Shared.GameObjects.Components.Construction
|
||||
/// </summary>
|
||||
public readonly int Ack;
|
||||
|
||||
public TryStartStructureConstructionMessage(GridLocalCoordinates loc, string prototypeName, Angle angle, int ack)
|
||||
public TryStartStructureConstructionMessage(GridCoordinates loc, string prototypeName, Angle angle, int ack)
|
||||
{
|
||||
Directed = true;
|
||||
Location = loc;
|
||||
|
||||
@@ -33,10 +33,10 @@ namespace Content.Shared.GameObjects.Components.Weapons.Ranged
|
||||
[Serializable, NetSerializable]
|
||||
protected class FireMessage : ComponentMessage
|
||||
{
|
||||
public readonly GridLocalCoordinates Target;
|
||||
public readonly GridCoordinates Target;
|
||||
public readonly int Tick;
|
||||
|
||||
public FireMessage(GridLocalCoordinates target, int tick)
|
||||
public FireMessage(GridCoordinates target, int tick)
|
||||
{
|
||||
Target = target;
|
||||
Tick = tick;
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Content.Shared.Interfaces
|
||||
public interface ISharedNotifyManager
|
||||
{
|
||||
void PopupMessage(IEntity source, IEntity viewer, string message);
|
||||
void PopupMessage(GridLocalCoordinates coordinates, IEntity viewer, string message);
|
||||
void PopupMessage(GridCoordinates coordinates, IEntity viewer, string message);
|
||||
}
|
||||
|
||||
public static class NotifyManagerExt
|
||||
|
||||
@@ -14,10 +14,10 @@ namespace Content.Shared
|
||||
{
|
||||
// TODO: we might eventually want for this to pass the actual entity,
|
||||
// so the notify could track the entity movement visually.
|
||||
PopupMessage(source.Transform.LocalPosition, viewer, message);
|
||||
PopupMessage(source.Transform.GridPosition, viewer, message);
|
||||
}
|
||||
|
||||
public abstract void PopupMessage(GridLocalCoordinates coordinates, IEntity viewer, string message);
|
||||
public abstract void PopupMessage(GridCoordinates coordinates, IEntity viewer, string message);
|
||||
|
||||
protected class MsgDoNotify : NetMessage
|
||||
{
|
||||
@@ -30,7 +30,7 @@ namespace Content.Shared
|
||||
#endregion
|
||||
|
||||
public string Message { get; set; }
|
||||
public GridLocalCoordinates Coordinates;
|
||||
public GridCoordinates Coordinates;
|
||||
|
||||
public override void ReadFromBuffer(NetIncomingMessage buffer)
|
||||
{
|
||||
|
||||
2
engine
2
engine
Submodule engine updated: 6873ad70f4...6d9a1a4e43
Reference in New Issue
Block a user