Merge branch 'master' into 2020-04-28-tool-component

# Conflicts:
#	Content.Server/GameObjects/Components/AnchorableComponent.cs
#	Content.Server/GameObjects/Components/Gravity/GravityGeneratorComponent.cs
#	Content.Server/GameObjects/Components/Interactable/Tools/CrowbarComponent.cs
#	Content.Server/GameObjects/Components/Power/PowerTransferComponent.cs
#	Content.Server/GameObjects/Components/WiresComponent.cs
#	Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs
#	Resources/Prototypes/Entities/Items/tools.yml
This commit is contained in:
zumorica
2020-05-23 12:02:34 +02:00
305 changed files with 33490 additions and 982 deletions

View File

@@ -4,6 +4,7 @@ using Content.Server.GameObjects.Components.Interactable;
using Content.Server.GameObjects.Components.Stack;
using Content.Server.GameObjects.EntitySystems;
using Content.Server.Interfaces;
using Content.Server.Utility;
using Content.Shared.Construction;
using Content.Shared.GameObjects.Components;
using Content.Shared.GameObjects.Components.Interactable;
@@ -11,6 +12,7 @@ using Robust.Server.GameObjects;
using Robust.Server.GameObjects.EntitySystems;
using Robust.Server.Interfaces.GameObjects;
using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.Systems;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.GameObjects.Components;
using Robust.Shared.Interfaces.Random;
@@ -19,6 +21,8 @@ using Robust.Shared.Localization;
using Robust.Shared.ViewVariables;
using static Content.Shared.Construction.ConstructionStepMaterial;
using static Content.Shared.Construction.ConstructionStepTool;
using Robust.Shared.Utility;
using Robust.Shared.Utility;
namespace Content.Server.GameObjects.Components.Construction
{
@@ -47,18 +51,16 @@ namespace Content.Server.GameObjects.Components.Construction
Sprite = Owner.GetComponent<SpriteComponent>();
Transform = Owner.GetComponent<ITransformComponent>();
var systemman = IoCManager.Resolve<IEntitySystemManager>();
}
public bool AttackBy(AttackByEventArgs eventArgs)
{
var playerEntity = eventArgs.User;
var interactionSystem = _entitySystemManager.GetEntitySystem<InteractionSystem>();
if (!interactionSystem.InRangeUnobstructed(playerEntity.Transform.MapPosition, Owner.Transform.WorldPosition, ignoredEnt: Owner, insideBlockerValid: Prototype.CanBuildInImpassable))
// default interaction check for AttackBy allows inside blockers, so we will check if its blocked if
// we're not allowed to build on impassable stuff
if (Prototype.CanBuildInImpassable == false)
{
_notifyManager.PopupMessage(Owner.Transform.GridPosition, playerEntity,
_localizationManager.GetString("You can't reach there!"));
return false;
if (!InteractionChecks.InRangeUnobstructed(eventArgs, false))
return false;
}
var stage = Prototype.Stages[Stage];
@@ -125,7 +127,7 @@ namespace Content.Server.GameObjects.Components.Construction
{
return false;
}
var sound = IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<AudioSystem>();
var sound = EntitySystem.Get<AudioSystem>();
switch (step)
{