Merge branch 'master' into buckle-locker-fix-1262

This commit is contained in:
DrSmugleaf
2020-07-07 00:20:07 +02:00
267 changed files with 3520 additions and 1075 deletions

View File

@@ -5,7 +5,7 @@ using Robust.Shared.GameObjects.Systems;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Map;
namespace Content.Server.GameObjects.EntitySystems
namespace Content.Server.Interfaces.GameObjects.Components.Interaction
{
/// <summary>
/// This interface gives components behavior on getting destoyed.

View File

@@ -3,7 +3,7 @@ using JetBrains.Annotations;
using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.Systems;
namespace Content.Server.GameObjects.EntitySystems
namespace Content.Server.Interfaces.GameObjects.Components.Interaction
{
[UsedImplicitly]
internal class BaseChargerSystem : EntitySystem

View File

@@ -3,7 +3,7 @@ using JetBrains.Annotations;
using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.Systems;
namespace Content.Server.GameObjects.EntitySystems
namespace Content.Server.Interfaces.GameObjects.Components.Interaction
{
/// <summary>
/// Triggers metabolism updates for <see cref="BloodstreamComponent"/>

View File

@@ -4,7 +4,7 @@ using JetBrains.Annotations;
using Robust.Shared.GameObjects.Systems;
using Robust.Shared.Interfaces.GameObjects;
namespace Content.Server.GameObjects.EntitySystems
namespace Content.Server.Interfaces.GameObjects.Components.Interaction
{
/// <summary>
/// This interface gives components behavior on whether entities solution (implying SolutionComponent is in place) is changed

View File

@@ -9,7 +9,7 @@ using Robust.Shared.IoC;
using Robust.Shared.Maths;
using Robust.Shared.Utility;
namespace Content.Server.GameObjects.EntitySystems
namespace Content.Server.GameObjects.EntitySystems.Click
{
public interface IExamine
{
@@ -62,7 +62,7 @@ namespace Content.Server.GameObjects.EntitySystems
var inDetailsRange = Get<SharedInteractionSystem>()
.InRangeUnobstructed(examiner.Transform.MapPosition, entity.Transform.MapPosition,
ExamineDetailsRange, predicate: entity0 => entity0 == examiner || entity0 == entity, insideBlockerValid: true);
ExamineDetailsRange, predicate: entity0 => entity0 == examiner || entity0 == entity, ignoreInsideBlocker: true);
//Add component statuses from components that report one
foreach (var examineComponent in entity.GetAllComponents<IExamine>())

View File

@@ -3,8 +3,10 @@ using System.Linq;
using Content.Server.GameObjects.Components.Mobs;
using Content.Server.GameObjects.Components.Timing;
using Content.Server.Interfaces.GameObjects;
using Content.Server.Interfaces.GameObjects.Components.Interaction;
using Content.Server.Utility;
using Content.Shared.GameObjects.Components.Inventory;
using Content.Shared.GameObjects.EntitySystemMessages;
using Content.Shared.GameObjects.EntitySystems;
using Content.Shared.Input;
using JetBrains.Annotations;
@@ -18,294 +20,14 @@ using Robust.Shared.Input.Binding;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.GameObjects.Components;
using Robust.Shared.Interfaces.Map;
using Robust.Shared.Interfaces.Physics;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Log;
using Robust.Shared.Map;
using Robust.Shared.Maths;
using Robust.Shared.Players;
namespace Content.Server.GameObjects.EntitySystems
namespace Content.Server.GameObjects.EntitySystems.Click
{
/// <summary>
/// This interface gives components behavior when being clicked on by a user with an object in their hand
/// who is in range and has unobstructed reach of the target entity (allows inside blockers).
/// </summary>
public interface IInteractUsing
{
/// <summary>
/// Called when using one object on another when user is in range of the target entity.
/// </summary>
bool InteractUsing(InteractUsingEventArgs eventArgs);
}
public class InteractUsingEventArgs : EventArgs, ITargetedInteractEventArgs
{
public IEntity User { get; set; }
public GridCoordinates ClickLocation { get; set; }
public IEntity Using { get; set; }
public IEntity Target { get; set; }
}
public interface ITargetedInteractEventArgs
{
/// <summary>
/// Performer of the attack
/// </summary>
IEntity User { get; }
/// <summary>
/// Target of the attack
/// </summary>
IEntity Target { get; }
}
/// <summary>
/// This interface gives components behavior when being clicked on by a user with an empty hand
/// who is in range and has unobstructed reach of the target entity (allows inside blockers).
/// </summary>
public interface IInteractHand
{
/// <summary>
/// Called when a player directly interacts with an empty hand when user is in range of the target entity.
/// </summary>
bool InteractHand(InteractHandEventArgs eventArgs);
}
public class InteractHandEventArgs : EventArgs, ITargetedInteractEventArgs
{
public IEntity User { get; set; }
public IEntity Target { get; set; }
}
/// <summary>
/// This interface gives components behavior when being clicked on by a user with an object
/// outside the range of direct use
/// </summary>
public interface IRangedInteract
{
/// <summary>
/// Called when we try to interact with an entity out of range
/// </summary>
/// <returns></returns>
bool RangedInteract(RangedInteractEventArgs eventArgs);
}
[PublicAPI]
public class RangedInteractEventArgs : EventArgs
{
public IEntity User { get; set; }
public IEntity Using { get; set; }
public GridCoordinates ClickLocation { get; set; }
}
/// <summary>
/// This interface gives components a behavior when clicking on another object and no interaction occurs,
/// at any range.
/// </summary>
public interface IAfterInteract
{
/// <summary>
/// Called when we interact with nothing, or when we interact with an entity out of range that has no behavior
/// </summary>
void AfterInteract(AfterInteractEventArgs eventArgs);
}
public class AfterInteractEventArgs : EventArgs
{
public IEntity User { get; set; }
public GridCoordinates ClickLocation { get; set; }
public IEntity Target { get; set; }
}
/// <summary>
/// This interface gives components behavior when using the entity in your hands
/// </summary>
public interface IUse
{
/// <summary>
/// Called when we activate an object we are holding to use it
/// </summary>
/// <returns></returns>
bool UseEntity(UseEntityEventArgs eventArgs);
}
public class UseEntityEventArgs : EventArgs
{
public IEntity User { get; set; }
}
/// <summary>
/// This interface gives components behavior when being activated in the world when the user
/// is in range and has unobstructed access to the target entity (allows inside blockers).
/// </summary>
public interface IActivate
{
/// <summary>
/// Called when this component is activated by another entity who is in range.
/// </summary>
void Activate(ActivateEventArgs eventArgs);
}
public class ActivateEventArgs : EventArgs, ITargetedInteractEventArgs
{
public IEntity User { get; set; }
public IEntity Target { get; set; }
}
/// <summary>
/// This interface gives components behavior when thrown.
/// </summary>
public interface IThrown
{
void Thrown(ThrownEventArgs eventArgs);
}
public class ThrownEventArgs : EventArgs
{
public ThrownEventArgs(IEntity user)
{
User = user;
}
public IEntity User { get; }
}
/// <summary>
/// This interface gives components behavior when landing after being thrown.
/// </summary>
public interface ILand
{
void Land(LandEventArgs eventArgs);
}
public class LandEventArgs : EventArgs
{
public LandEventArgs(IEntity user, GridCoordinates landingLocation)
{
User = user;
LandingLocation = landingLocation;
}
public IEntity User { get; }
public GridCoordinates LandingLocation { get; }
}
/// <summary>
/// This interface gives components behavior when their owner is put in an inventory slot.
/// </summary>
public interface IEquipped
{
void Equipped(EquippedEventArgs eventArgs);
}
public class EquippedEventArgs : EventArgs
{
public EquippedEventArgs(IEntity user, EquipmentSlotDefines.Slots slot)
{
User = user;
Slot = slot;
}
public IEntity User { get; }
public EquipmentSlotDefines.Slots Slot { get; }
}
/// <summary>
/// This interface gives components behavior when their owner is removed from an inventory slot.
/// </summary>
public interface IUnequipped
{
void Unequipped(UnequippedEventArgs eventArgs);
}
public class UnequippedEventArgs : EventArgs
{
public UnequippedEventArgs(IEntity user, EquipmentSlotDefines.Slots slot)
{
User = user;
Slot = slot;
}
public IEntity User { get; }
public EquipmentSlotDefines.Slots Slot { get; }
}
/// <summary>
/// This interface gives components behavior when being used to "attack".
/// </summary>
public interface IAttack
{
void Attack(AttackEventArgs eventArgs);
}
public class AttackEventArgs : EventArgs
{
public AttackEventArgs(IEntity user, GridCoordinates clickLocation)
{
User = user;
ClickLocation = clickLocation;
}
public IEntity User { get; }
public GridCoordinates ClickLocation { get; }
}
/// <summary>
/// This interface gives components behavior when they're held on the selected hand.
/// </summary>
public interface IHandSelected
{
void HandSelected(HandSelectedEventArgs eventArgs);
}
public class HandSelectedEventArgs : EventArgs
{
public HandSelectedEventArgs(IEntity user)
{
User = user;
}
public IEntity User { get; }
}
/// <summary>
/// This interface gives components behavior when they're held on a deselected hand.
/// </summary>
public interface IHandDeselected
{
void HandDeselected(HandDeselectedEventArgs eventArgs);
}
public class HandDeselectedEventArgs : EventArgs
{
public HandDeselectedEventArgs(IEntity user)
{
User = user;
}
public IEntity User { get; }
}
/// <summary>
/// This interface gives components behavior when they're dropped by a mob.
/// </summary>
public interface IDropped
{
void Dropped(DroppedEventArgs eventArgs);
}
public class DroppedEventArgs : EventArgs
{
public DroppedEventArgs(IEntity user)
{
User = user;
}
public IEntity User { get; }
}
/// <summary>
/// Governs interactions during clicking on entities
/// </summary>
@@ -318,6 +40,8 @@ namespace Content.Server.GameObjects.EntitySystems
public override void Initialize()
{
SubscribeNetworkEvent<DragDropMessage>(HandleDragDropMessage);
CommandBinds.Builder
.Bind(EngineKeyFunctions.Use,
new PointerInputCmdHandler(HandleClientUseItemInHand))
@@ -334,6 +58,30 @@ namespace Content.Server.GameObjects.EntitySystems
base.Shutdown();
}
private void HandleDragDropMessage(DragDropMessage msg, EntitySessionEventArgs args)
{
var performer = args.SenderSession.AttachedEntity;
if (!EntityManager.TryGetEntity(msg.Dropped, out var dropped)) return;
if (!EntityManager.TryGetEntity(msg.Target, out var target)) return;
var interactionArgs = new DragDropEventArgs(performer, msg.DropLocation, dropped, target);
// must be in range of both the target and the object they are drag / dropping
if (!InteractionChecks.InRangeUnobstructed(interactionArgs)) return;
// trigger dragdrops on the dropped entity
foreach (var dragDrop in dropped.GetAllComponents<IDragDrop>())
{
if (dragDrop.DragDrop(interactionArgs)) return;
}
// trigger dragdropons on the targeted entity
foreach (var dragDropOn in target.GetAllComponents<IDragDropOn>())
{
if (dragDropOn.DragDropOn(interactionArgs)) return;
}
}
private bool HandleActivateItemInWorld(ICommonSession session, GridCoordinates coords, EntityUid uid)
{
if (!EntityManager.TryGetEntity(uid, out var used))
@@ -572,7 +320,7 @@ namespace Content.Server.GameObjects.EntitySystems
/// </summary>
private void InteractAfter(IEntity user, IEntity weapon, GridCoordinates clickLocation)
{
var message = new AfterAttackMessage(user, weapon, null, clickLocation);
var message = new AfterInteractMessage(user, weapon, null, clickLocation);
RaiseLocalEvent(message);
if (message.Handled)
{
@@ -594,7 +342,7 @@ namespace Content.Server.GameObjects.EntitySystems
/// </summary>
public void Interaction(IEntity user, IEntity weapon, IEntity attacked, GridCoordinates clickLocation)
{
var attackMsg = new AttackByMessage(user, weapon, attacked, clickLocation);
var attackMsg = new InteractUsingMessage(user, weapon, attacked, clickLocation);
RaiseLocalEvent(attackMsg);
if (attackMsg.Handled)
{
@@ -620,7 +368,7 @@ namespace Content.Server.GameObjects.EntitySystems
}
}
var afterAtkMsg = new AfterAttackMessage(user, weapon, attacked, clickLocation);
var afterAtkMsg = new AfterInteractMessage(user, weapon, attacked, clickLocation);
RaiseLocalEvent(afterAtkMsg);
if (afterAtkMsg.Handled)
{
@@ -906,7 +654,7 @@ namespace Content.Server.GameObjects.EntitySystems
/// </summary>
public void RangedInteraction(IEntity user, IEntity weapon, IEntity attacked, GridCoordinates clickLocation)
{
var rangedMsg = new RangedAttackMessage(user, weapon, attacked, clickLocation);
var rangedMsg = new RangedInteractMessage(user, weapon, attacked, clickLocation);
RaiseLocalEvent(rangedMsg);
if (rangedMsg.Handled)
return;
@@ -927,7 +675,7 @@ namespace Content.Server.GameObjects.EntitySystems
}
}
var afterAtkMsg = new AfterAttackMessage(user, weapon, attacked, clickLocation);
var afterAtkMsg = new AfterInteractMessage(user, weapon, attacked, clickLocation);
RaiseLocalEvent(afterAtkMsg);
if (afterAtkMsg.Handled)
return;
@@ -988,422 +736,4 @@ namespace Content.Server.GameObjects.EntitySystems
}
}
}
/// <summary>
/// Raised when being clicked on or "attacked" by a user with an object in their hand
/// </summary>
[PublicAPI]
public class AttackByMessage : EntitySystemMessage
{
/// <summary>
/// If this message has already been "handled" by a previous system.
/// </summary>
public bool Handled { get; set; }
/// <summary>
/// Entity that triggered the attack.
/// </summary>
public IEntity User { get; }
/// <summary>
/// Entity that the User attacked with.
/// </summary>
public IEntity ItemInHand { get; }
/// <summary>
/// Entity that was attacked.
/// </summary>
public IEntity Attacked { get; }
/// <summary>
/// The original location that was clicked by the user.
/// </summary>
public GridCoordinates ClickLocation { get; }
public AttackByMessage(IEntity user, IEntity itemInHand, IEntity attacked, GridCoordinates clickLocation)
{
User = user;
ItemInHand = itemInHand;
Attacked = attacked;
ClickLocation = clickLocation;
}
}
/// <summary>
/// Raised when being clicked on or "attacked" by a user with an empty hand.
/// </summary>
[PublicAPI]
public class AttackHandMessage : EntitySystemMessage
{
/// <summary>
/// If this message has already been "handled" by a previous system.
/// </summary>
public bool Handled { get; set; }
/// <summary>
/// Entity that triggered the attack.
/// </summary>
public IEntity User { get; }
/// <summary>
/// Entity that was attacked.
/// </summary>
public IEntity Attacked { get; }
public AttackHandMessage(IEntity user, IEntity attacked)
{
User = user;
Attacked = attacked;
}
}
/// <summary>
/// Raised when being clicked by objects outside the range of direct use.
/// </summary>
[PublicAPI]
public class RangedAttackMessage : EntitySystemMessage
{
/// <summary>
/// If this message has already been "handled" by a previous system.
/// </summary>
public bool Handled { get; set; }
/// <summary>
/// Entity that triggered the attack.
/// </summary>
public IEntity User { get; }
/// <summary>
/// Entity that the User attacked with.
/// </summary>
public IEntity ItemInHand { get; set; }
/// <summary>
/// Entity that was attacked.
/// </summary>
public IEntity Attacked { get; }
/// <summary>
/// Location that the user clicked outside of their interaction range.
/// </summary>
public GridCoordinates ClickLocation { get; }
public RangedAttackMessage(IEntity user, IEntity itemInHand, IEntity attacked, GridCoordinates clickLocation)
{
User = user;
ItemInHand = itemInHand;
ClickLocation = clickLocation;
Attacked = attacked;
}
}
/// <summary>
/// Raised when clicking on another object and no attack event was handled.
/// </summary>
[PublicAPI]
public class AfterAttackMessage : EntitySystemMessage
{
/// <summary>
/// If this message has already been "handled" by a previous system.
/// </summary>
public bool Handled { get; set; }
/// <summary>
/// Entity that triggered the attack.
/// </summary>
public IEntity User { get; }
/// <summary>
/// Entity that the User attacked with.
/// </summary>
public IEntity ItemInHand { get; set; }
/// <summary>
/// Entity that was attacked. This can be null if the attack did not click on an entity.
/// </summary>
public IEntity Attacked { get; }
/// <summary>
/// Location that the user clicked outside of their interaction range.
/// </summary>
public GridCoordinates ClickLocation { get; }
public AfterAttackMessage(IEntity user, IEntity itemInHand, IEntity attacked, GridCoordinates clickLocation)
{
User = user;
Attacked = attacked;
ClickLocation = clickLocation;
ItemInHand = itemInHand;
}
}
/// <summary>
/// Raised when using the entity in your hands.
/// </summary>
[PublicAPI]
public class UseInHandMessage : EntitySystemMessage
{
/// <summary>
/// If this message has already been "handled" by a previous system.
/// </summary>
public bool Handled { get; set; }
/// <summary>
/// Entity holding the item in their hand.
/// </summary>
public IEntity User { get; }
/// <summary>
/// Item that was used.
/// </summary>
public IEntity Used { get; }
public UseInHandMessage(IEntity user, IEntity used)
{
User = user;
Used = used;
}
}
/// <summary>
/// Raised when throwing the entity in your hands.
/// </summary>
[PublicAPI]
public class ThrownMessage : EntitySystemMessage
{
/// <summary>
/// If this message has already been "handled" by a previous system.
/// </summary>
public bool Handled { get; set; }
/// <summary>
/// Entity that threw the item.
/// </summary>
public IEntity User { get; }
/// <summary>
/// Item that was thrown.
/// </summary>
public IEntity Thrown { get; }
public ThrownMessage(IEntity user, IEntity thrown)
{
User = user;
Thrown = thrown;
}
}
/// <summary>
/// Raised when an entity that was thrown lands.
/// </summary>
[PublicAPI]
public class LandMessage : EntitySystemMessage
{
/// <summary>
/// If this message has already been "handled" by a previous system.
/// </summary>
public bool Handled { get; set; }
/// <summary>
/// Entity that threw the item.
/// </summary>
public IEntity User { get; }
/// <summary>
/// Item that was thrown.
/// </summary>
public IEntity Thrown { get; }
/// <summary>
/// Location where the item landed.
/// </summary>
public GridCoordinates LandLocation { get; }
public LandMessage(IEntity user, IEntity thrown, GridCoordinates landLocation)
{
User = user;
Thrown = thrown;
LandLocation = landLocation;
}
}
/// <summary>
/// Raised when equipping the entity in an inventory slot.
/// </summary>
[PublicAPI]
public class EquippedMessage : EntitySystemMessage
{
/// <summary>
/// If this message has already been "handled" by a previous system.
/// </summary>
public bool Handled { get; set; }
/// <summary>
/// Entity that equipped the item.
/// </summary>
public IEntity User { get; }
/// <summary>
/// Item that was equipped.
/// </summary>
public IEntity Equipped { get; }
/// <summary>
/// Slot where the item was placed.
/// </summary>
public EquipmentSlotDefines.Slots Slot { get; }
public EquippedMessage(IEntity user, IEntity equipped, EquipmentSlotDefines.Slots slot)
{
User = user;
Equipped = equipped;
Slot = slot;
}
}
/// <summary>
/// Raised when removing the entity from an inventory slot.
/// </summary>
[PublicAPI]
public class UnequippedMessage : EntitySystemMessage
{
/// <summary>
/// If this message has already been "handled" by a previous system.
/// </summary>
public bool Handled { get; set; }
/// <summary>
/// Entity that equipped the item.
/// </summary>
public IEntity User { get; }
/// <summary>
/// Item that was equipped.
/// </summary>
public IEntity Equipped { get; }
/// <summary>
/// Slot where the item was removed from.
/// </summary>
public EquipmentSlotDefines.Slots Slot { get; }
public UnequippedMessage(IEntity user, IEntity equipped, EquipmentSlotDefines.Slots slot)
{
User = user;
Equipped = equipped;
Slot = slot;
}
}
/// <summary>
/// Raised when an entity that was thrown lands.
/// </summary>
[PublicAPI]
public class DroppedMessage : EntitySystemMessage
{
/// <summary>
/// If this message has already been "handled" by a previous system.
/// </summary>
public bool Handled { get; set; }
/// <summary>
/// Entity that dropped the item.
/// </summary>
public IEntity User { get; }
/// <summary>
/// Item that was dropped.
/// </summary>
public IEntity Dropped { get; }
public DroppedMessage(IEntity user, IEntity dropped)
{
User = user;
Dropped = dropped;
}
}
/// <summary>
/// Raised when an entity item in a hand is selected.
/// </summary>
[PublicAPI]
public class HandSelectedMessage : EntitySystemMessage
{
/// <summary>
/// If this message has already been "handled" by a previous system.
/// </summary>
public bool Handled { get; set; }
/// <summary>
/// Entity that owns the selected hand.
/// </summary>
public IEntity User { get; }
/// <summary>
/// The item in question.
/// </summary>
public IEntity Item { get; }
public HandSelectedMessage(IEntity user, IEntity item)
{
User = user;
Item = item;
}
}
/// <summary>
/// Raised when an entity item in a hand is deselected.
/// </summary>
[PublicAPI]
public class HandDeselectedMessage : EntitySystemMessage
{
/// <summary>
/// If this message has already been "handled" by a previous system.
/// </summary>
public bool Handled { get; set; }
/// <summary>
/// Entity that owns the deselected hand.
/// </summary>
public IEntity User { get; }
/// <summary>
/// The item in question.
/// </summary>
public IEntity Item { get; }
public HandDeselectedMessage(IEntity user, IEntity item)
{
User = user;
Item = item;
}
}
/// <summary>
/// Raised when an entity is activated in the world.
/// </summary>
[PublicAPI]
public class ActivateInWorldMessage : EntitySystemMessage
{
/// <summary>
/// If this message has already been "handled" by a previous system.
/// </summary>
public bool Handled { get; set; }
/// <summary>
/// Entity that activated the world entity.
/// </summary>
public IEntity User { get; }
/// <summary>
/// Entity that was activated in the world.
/// </summary>
public IEntity Activated { get; }
public ActivateInWorldMessage(IEntity user, IEntity activated)
{
User = user;
Activated = activated;
}
}
}

View File

@@ -11,7 +11,7 @@ using Robust.Shared.Log;
using Robust.Shared.Players;
using Robust.Shared.Random;
namespace Content.Server.GameObjects.EntitySystems
namespace Content.Server.Interfaces.GameObjects.Components.Interaction
{
[UsedImplicitly]
public sealed class CombatModeSystem : SharedCombatModeSystem

View File

@@ -4,6 +4,7 @@ using Content.Server.GameObjects.Components.Construction;
using Content.Server.GameObjects.Components.Interactable;
using Content.Server.GameObjects.Components.Items.Storage;
using Content.Server.GameObjects.Components.Stack;
using Content.Server.Interfaces.GameObjects.Components.Interaction;
using Content.Server.Interfaces;
using Content.Server.Utility;
using Content.Shared.Construction;
@@ -53,7 +54,7 @@ namespace Content.Server.GameObjects.EntitySystems
SubscribeNetworkEvent<TryStartStructureConstructionMessage>(HandleStartStructureConstruction);
SubscribeNetworkEvent<TryStartItemConstructionMessage>(HandleStartItemConstruction);
SubscribeLocalEvent<AfterAttackMessage>(HandleToolInteraction);
SubscribeLocalEvent<AfterInteractMessage>(HandleToolInteraction);
}
private void HandleStartStructureConstruction(TryStartStructureConstructionMessage msg, EntitySessionEventArgs args)
@@ -72,7 +73,7 @@ namespace Content.Server.GameObjects.EntitySystems
TryStartItemConstruction(placingEnt, msg.PrototypeName);
}
private void HandleToolInteraction(AfterAttackMessage msg)
private void HandleToolInteraction(AfterInteractMessage msg)
{
if(msg.Handled)
return;
@@ -239,7 +240,7 @@ namespace Content.Server.GameObjects.EntitySystems
var prototype = _prototypeManager.Index<ConstructionPrototype>(prototypeName);
if (!InteractionChecks.InRangeUnobstructed(placingEnt, loc.ToMap(_mapManager),
ignoredEnt: placingEnt, insideBlockerValid: prototype.CanBuildInImpassable))
ignoredEnt: placingEnt, ignoreInsideBlocker: prototype.CanBuildInImpassable))
{
return false;
}
@@ -437,7 +438,7 @@ namespace Content.Server.GameObjects.EntitySystems
{
return false;
}
var sound = EntitySystemManager.GetEntitySystem<AudioSystem>();
switch (step)

View File

@@ -1,7 +1,8 @@
using Robust.Shared.GameObjects;
using Content.Server.GameObjects;
using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.Systems;
namespace Content.Server.GameObjects.EntitySystems
namespace Content.Server.Interfaces.GameObjects.Components.Interaction
{
class DoorSystem : EntitySystem
{

View File

@@ -16,7 +16,7 @@ using Robust.Shared.Map;
using Robust.Shared.Maths;
using Robust.Shared.Random;
namespace Content.Server.GameObjects.EntitySystems
namespace Content.Server.Interfaces.GameObjects.Components.Interaction
{
[UsedImplicitly]
public class GravitySystem: EntitySystem

View File

@@ -2,7 +2,7 @@ using Content.Server.GameObjects.Components.Interactable;
using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.Systems;
namespace Content.Server.GameObjects.EntitySystems
namespace Content.Server.Interfaces.GameObjects.Components.Interaction
{
public class HandHeldLightSystem : EntitySystem
{

View File

@@ -20,8 +20,10 @@ using Robust.Shared.Players;
using System;
using Content.Server.GameObjects.Components.Items.Storage;
using Content.Shared.GameObjects.EntitySystems;
using Content.Server.GameObjects;
using Content.Server.GameObjects.EntitySystems.Click;
namespace Content.Server.GameObjects.EntitySystems
namespace Content.Server.Interfaces.GameObjects.Components.Interaction
{
[UsedImplicitly]
internal sealed class HandsSystem : EntitySystem

View File

@@ -3,7 +3,7 @@ using JetBrains.Annotations;
using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.Systems;
namespace Content.Server.GameObjects.EntitySystems
namespace Content.Server.Interfaces.GameObjects.Components.Interaction
{
[UsedImplicitly]
public class HungerSystem : EntitySystem

View File

@@ -2,7 +2,7 @@ using Content.Server.GameObjects.Components.Instruments;
using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.Systems;
namespace Content.Server.GameObjects.EntitySystems
namespace Content.Server.Interfaces.GameObjects.Components.Interaction
{
public class InstrumentSystem : EntitySystem
{

View File

@@ -2,7 +2,7 @@ using Content.Server.GameObjects.Components.Research;
using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.Systems;
namespace Content.Server.GameObjects.EntitySystems
namespace Content.Server.Interfaces.GameObjects.Components.Interaction
{
public class LatheSystem : EntitySystem
{

View File

@@ -2,7 +2,7 @@ using Content.Server.GameObjects.Components.Medical;
using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.Systems;
namespace Content.Server.GameObjects.EntitySystems
namespace Content.Server.Interfaces.GameObjects.Components.Interaction
{
public class MedicalScannerSystem : EntitySystem
{

View File

@@ -5,7 +5,7 @@ using Robust.Shared.GameObjects.Systems;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Maths;
namespace Content.Server.GameObjects.EntitySystems
namespace Content.Server.Interfaces.GameObjects.Components.Interaction
{
public sealed class MeleeWeaponSystem : EntitySystem
{

View File

@@ -2,7 +2,7 @@ using Content.Server.GameObjects.Components.Kitchen;
using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.Systems;
namespace Content.Server.GameObjects.EntitySystems
namespace Content.Server.Interfaces.GameObjects.Components.Interaction
{
public class MicrowaveSystem : EntitySystem
{

View File

@@ -1,5 +1,5 @@
using Content.Server.GameObjects.Components;
using Content.Server.GameObjects.Components.Items.Storage;
using Content.Server.GameObjects;
using Content.Server.GameObjects.Components;
using Content.Server.GameObjects.Components.Mobs;
using Content.Server.GameObjects.Components.Movement;
using Content.Server.GameObjects.Components.Sound;
@@ -80,7 +80,7 @@ namespace Content.Server.GameObjects.EntitySystems
protected override void SetController(PhysicsComponent physics)
{
((PhysicsComponent) physics).SetController<MoverController>();
physics.SetController<MoverController>();
}
private static void PlayerAttached(PlayerAttachSystemMessage ev)
@@ -97,6 +97,11 @@ namespace Content.Server.GameObjects.EntitySystems
{
ev.Entity.RemoveComponent<PlayerInputMoverComponent>();
}
if (ev.Entity.TryGetComponent(out PhysicsComponent physics))
{
(physics.Controller as MoverController)?.StopMoving();
}
}
protected override void HandleFootsteps(IMoverComponent mover)

View File

@@ -0,0 +1,19 @@
using Content.Server.GameObjects.Components.NodeContainer.NodeGroups;
using Robust.Shared.GameObjects.Systems;
using Robust.Shared.IoC;
namespace Content.Server.GameObjects.EntitySystems
{
public class NodeGroupSystem : EntitySystem
{
#pragma warning disable 649
[Dependency] private readonly INodeGroupManager _groupManager;
#pragma warning restore 649
public override void Update(float frameTime)
{
base.Update(frameTime);
_groupManager.Update(frameTime);
}
}
}

View File

@@ -3,7 +3,7 @@ using JetBrains.Annotations;
using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.Systems;
namespace Content.Server.GameObjects.EntitySystems
namespace Content.Server.Interfaces.GameObjects.Components.Interaction
{
[UsedImplicitly]
public class PortalSystem : EntitySystem

View File

@@ -6,7 +6,7 @@ using System.Collections.Generic;
using Robust.Shared.IoC;
using Robust.Server.Interfaces.Timing;
namespace Content.Server.GameObjects.EntitySystems
namespace Content.Server.Interfaces.GameObjects.Components.Interaction
{
public sealed class ApcSystem : EntitySystem
{

View File

@@ -2,7 +2,7 @@
using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.Systems;
namespace Content.Server.GameObjects.EntitySystems
namespace Content.Server.Interfaces.GameObjects.Components.Interaction
{
internal class PowerSmesSystem : EntitySystem
{

View File

@@ -16,7 +16,7 @@ using CannyFastMath;
using Math = CannyFastMath.Math;
using MathF = CannyFastMath.MathF;
namespace Content.Server.GameObjects.EntitySystems
namespace Content.Server.Interfaces.GameObjects.Components.Interaction
{
/// <summary>
/// Responsible for maintaining the solar-panel sun angle and updating <see cref='SolarPanelComponent'/> coverage.

View File

@@ -3,7 +3,7 @@ using JetBrains.Annotations;
using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.Systems;
namespace Content.Server.GameObjects.EntitySystems
namespace Content.Server.Interfaces.GameObjects.Components.Interaction
{
[UsedImplicitly]
internal sealed class ProjectileSystem : EntitySystem

View File

@@ -6,7 +6,7 @@ using Robust.Shared.Interfaces.Map;
using Robust.Shared.IoC;
using Robust.Shared.Map;
namespace Content.Server.GameObjects.EntitySystems
namespace Content.Server.Interfaces.GameObjects.Components.Interaction
{
public class PuddleSystem : EntitySystem
{

View File

@@ -4,7 +4,7 @@ using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.Systems;
using Robust.Shared.Interfaces.GameObjects;
namespace Content.Server.GameObjects.EntitySystems
namespace Content.Server.Interfaces.GameObjects.Components.Interaction
{
public class ResearchSystem : EntitySystem
{

View File

@@ -6,7 +6,7 @@ using Robust.Shared.Interfaces.Timing;
using Robust.Shared.IoC;
using Timer = Robust.Shared.Timers.Timer;
namespace Content.Server.GameObjects.EntitySystems
namespace Content.Server.Interfaces.GameObjects.Components.Interaction
{
public class RoundEndSystem : EntitySystem
{

View File

@@ -3,7 +3,7 @@ using JetBrains.Annotations;
using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.Systems;
namespace Content.Server.GameObjects.EntitySystems
namespace Content.Server.Interfaces.GameObjects.Components.Interaction
{
/// <summary>
/// Triggers digestion updates on <see cref="StomachComponent"/>

View File

@@ -1,12 +1,13 @@
using System.Collections.Generic;
using Content.Server.GameObjects.Components.Items.Storage;
using Content.Server.GameObjects;
using Content.Server.GameObjects.EntitySystems.Click;
using Robust.Server.GameObjects.EntitySystemMessages;
using Robust.Server.Interfaces.Player;
using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.Systems;
using Robust.Shared.Interfaces.GameObjects;
namespace Content.Server.GameObjects.EntitySystems
namespace Content.Server.Interfaces.GameObjects.Components.Interaction
{
class StorageSystem : EntitySystem
{

View File

@@ -4,7 +4,7 @@ using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.Systems;
using Robust.Shared.Interfaces.GameObjects;
namespace Content.Server.GameObjects.EntitySystems
namespace Content.Server.Interfaces.GameObjects.Components.Interaction
{
public class StunSystem : EntitySystem
{

View File

@@ -1,7 +1,8 @@
using Robust.Shared.GameObjects;
using Content.Server.GameObjects;
using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.Systems;
namespace Content.Server.GameObjects.EntitySystems
namespace Content.Server.Interfaces.GameObjects.Components.Interaction
{
class TemperatureSystem : EntitySystem
{

View File

@@ -3,7 +3,7 @@ using JetBrains.Annotations;
using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.Systems;
namespace Content.Server.GameObjects.EntitySystems
namespace Content.Server.Interfaces.GameObjects.Components.Interaction
{
[UsedImplicitly]
public class ThirstSystem : EntitySystem

View File

@@ -5,7 +5,7 @@ using Robust.Shared.GameObjects.Systems;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Timers;
namespace Content.Server.GameObjects.EntitySystems
namespace Content.Server.Interfaces.GameObjects.Components.Interaction
{
/// <summary>
/// This interface gives components behavior when being "triggered" by timer or other conditions
@@ -50,4 +50,4 @@ namespace Content.Server.GameObjects.EntitySystems
});
}
}
}
}

View File

@@ -8,7 +8,7 @@ using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.IoC;
using static Content.Shared.GameObjects.EntitySystemMessages.VerbSystemMessages;
namespace Content.Server.GameObjects.EntitySystems
namespace Content.Server.Interfaces.GameObjects.Components.Interaction
{
public class VerbSystem : EntitySystem
{

View File

@@ -3,7 +3,7 @@ using System.Linq;
using Content.Server.GameObjects.Components.Interactable;
using Robust.Shared.GameObjects.Systems;
namespace Content.Server.GameObjects.EntitySystems
namespace Content.Server.Interfaces.GameObjects.Components.Interaction
{
/// <summary>
/// Despite the name, it's only really used for the welder logic in tools. Go figure.

View File

@@ -3,7 +3,7 @@ using Robust.Shared.GameObjects.Systems;
using Robust.Shared.ViewVariables;
using static Content.Shared.GameObjects.Components.SharedWiresComponent;
namespace Content.Server.GameObjects.EntitySystems
namespace Content.Server.Interfaces.GameObjects.Components.Interaction
{
public class WireHackingSystem : EntitySystem
{