(Smaller) Construction PR - (IC Construction) (#2575)

* Disable Pulling When Buckling an entity

* Projectile Improvements

If you shoot at a person that is critted now it will only hit if you aim at that person otherwise go "above" him and hit other targets.
- Dead people are still unhitable

* Update Content.Server/GameObjects/Components/Buckle/BuckleComponent.cs

Co-authored-by: Víctor Aguilera Puerto <6766154+Zumorica@users.noreply.github.com>

* Firelock In Progress

* Revert "Projectile Improvements"

This reverts commit 5821afc798e49e530d4086d7a9ddbe097805fdc4.

* Firelock Graph

* Revert "Merge branch 'master' into test2"

This reverts commit c69661cc7d9dcdc6d8c0dd45770f9eb94b231463, reversing
changes made to 5f1de8b8d24cd52190addb3df5617cb1012fd52c.

* Bunch of stuff

- Metal Rods
- Reinforced Glass
- SetStackCount Condition
- Tables
- Lattice

* Output2 to FloorTileItemComponent

* Plating, Underplating and Tiles (+FloorTile Improvements)

* Turf Fixes

+ APC Electronics

* Reinforced Glass In-hand textures

* All the fixes

* Final Changes

* (Hopefully) Last commit

* Update Resources/Prototypes/Entities/Constructible/Doors/firelock_frame.yml

Co-authored-by: Paul Ritter <ritter.paul1@googlemail.com>

* Update Content.Server/GameObjects/Components/Atmos/FirelockComponent.cs

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>

* A Few more things

* Edit FirelockComponent.cs

Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com>
Co-authored-by: Víctor Aguilera Puerto <6766154+Zumorica@users.noreply.github.com>
Co-authored-by: Paul Ritter <ritter.paul1@googlemail.com>
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
Git-Nivrak
2020-11-20 16:58:06 +02:00
committed by GitHub
parent ab1ce4b541
commit 6d2882c7cf
39 changed files with 821 additions and 79 deletions

View File

@@ -0,0 +1,36 @@
#nullable enable
using System.Threading.Tasks;
using Content.Server.GameObjects.Components.Stack;
using Content.Shared.Construction;
using JetBrains.Annotations;
using Robust.Shared.Interfaces.GameObjects;
using System;
using Robust.Shared.Log;
using Robust.Shared.Serialization;
namespace Content.Server.Construction.Completions
{
[UsedImplicitly]
public class SetStackCount : IGraphAction
{
public int Amount { get; private set; }
public void ExposeData(ObjectSerializer serializer)
{
serializer.DataField(this, x => x.Amount, "amount", 1);
}
public async Task PerformAction(IEntity entity, IEntity? user)
{
if (entity.Deleted) return;
if(!entity.TryGetComponent(out StackComponent? stackComponent)) return;
stackComponent.Count = Math.Min(stackComponent.MaxCount, Amount);
if (Amount > stackComponent.MaxCount)
{
Logger.Warning("StackCount is bigger than maximum stack capacity, for entity " + entity.Name);
}
}
}
}

View File

@@ -1,6 +1,9 @@
#nullable enable
using System;
using System.Threading.Tasks;
using Content.Server.GameObjects.Components.Stack;
using Content.Shared.Construction;
using Content.Shared.Utility;
using JetBrains.Annotations;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.IoC;
@@ -20,6 +23,7 @@ namespace Content.Server.Construction.Completions
serializer.DataField(this, x => x.Amount, "amount", 1);
}
public async Task PerformAction(IEntity entity, IEntity? user)
{
if (entity.Deleted || string.IsNullOrEmpty(Prototype)) return;
@@ -27,10 +31,21 @@ namespace Content.Server.Construction.Completions
var entityManager = IoCManager.Resolve<IEntityManager>();
var coordinates = entity.Transform.Coordinates;
for (var i = 0; i < Amount; i++)
if (EntityPrototypeHelpers.HasComponent<StackComponent>(Prototype))
{
entityManager.SpawnEntity(Prototype, coordinates);
var _entity = entityManager.SpawnEntity(Prototype, coordinates);
StackComponent stackComponent = _entity.GetComponent<StackComponent>();
stackComponent.Count = Math.Min(stackComponent.MaxCount, Amount);
}
else
{
for (var i = 0; i < Amount; i++)
{
entityManager.SpawnEntity(Prototype, coordinates);
}
}
}
}
}

View File

@@ -0,0 +1,42 @@
using System.Threading.Tasks;
using Content.Server.GameObjects.Components.Atmos;
using Content.Server.GameObjects.Components.Doors;
using Content.Shared.Construction;
using JetBrains.Annotations;
using Robust.Shared.GameObjects.Components;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Localization;
using Robust.Shared.Log;
using Robust.Shared.Serialization;
using Robust.Shared.Utility;
namespace Content.Server.Construction.Conditions
{
[UsedImplicitly]
public class DoorWelded : IEdgeCondition
{
public bool Welded { get; private set; }
public void ExposeData(ObjectSerializer serializer)
{
serializer.DataField(this, x => x.Welded, "welded", true);
}
public async Task<bool> Condition(IEntity entity)
{
if (!entity.TryGetComponent(out ServerDoorComponent doorComponent)) return false;
return doorComponent.IsWeldedShut == Welded;
}
public void DoExamine(IEntity entity, FormattedMessage message, bool inDetailsRange)
{
if (!entity.TryGetComponent(out ServerDoorComponent doorComponent)) return;
if (doorComponent.State == ServerDoorComponent.DoorState.Closed && Welded)
message.AddMarkup(Loc.GetString("First, weld the door.\n"));
else if (doorComponent.IsWeldedShut && !Welded)
{
message.AddMarkup(Loc.GetString("First, unweld the door.\n"));
}
}
}
}