Merge branch 'master-upstream' into expl_int_analyzer

# Conflicts:
#	Content.Server/GameObjects/Components/Body/Part/BodyPartComponent.cs
#	Content.Server/GameObjects/Components/Botany/PlantHolderComponent.cs
#	Content.Server/GameObjects/Components/Chemistry/PillComponent.cs
#	Content.Server/GameObjects/Components/Interactable/TilePryingComponent.cs
#	Content.Server/GameObjects/Components/Items/FloorTileItemComponent.cs
#	Content.Server/GameObjects/Components/Items/RCD/RCDAmmoComponent.cs
#	Content.Server/GameObjects/Components/Items/RCD/RCDComponent.cs
#	Content.Server/GameObjects/Components/Medical/HealingComponent.cs
#	Content.Server/GameObjects/Components/Power/WirePlacerComponent.cs
#	Content.Shared/Chemistry/Solution.cs
This commit is contained in:
Paul
2021-02-04 17:50:28 +01:00
499 changed files with 6357 additions and 8689 deletions

View File

@@ -8,6 +8,7 @@ using Content.Server.GameObjects.Components.Body.Respiratory;
using Content.Server.Utility;
using Content.Shared.Atmos;
using Content.Shared.GameObjects.Components.Body.Behavior;
using Content.Shared.GameObjects.Components.Mobs.State;
using Robust.Shared.Interfaces.Timing;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
@@ -99,6 +100,11 @@ namespace Content.Server.GameObjects.Components.Body.Behavior
public override void Update(float frameTime)
{
if (Body != null && Body.Owner.TryGetComponent(out IMobStateComponent? mobState) && mobState.IsCritical())
{
return;
}
if (Status == LungStatus.None)
{
Status = LungStatus.Inhaling;

View File

@@ -1,4 +1,4 @@
#nullable enable
#nullable enable
using System;
using Content.Server.Commands.Observer;
using Content.Shared.Audio;
@@ -8,11 +8,12 @@ using Content.Shared.GameObjects.Components.Damage;
using Content.Shared.GameObjects.Components.Mobs.State;
using Content.Shared.GameObjects.Components.Movement;
using Content.Shared.Utility;
using Robust.Server.Console;
using Robust.Server.GameObjects.Components.Container;
using Robust.Server.GameObjects.EntitySystems;
using Robust.Server.Interfaces.Console;
using Robust.Server.Interfaces.Player;
using Robust.Shared.Audio;
using Robust.Shared.Console;
using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.Systems;
using Robust.Shared.IoC;
@@ -89,9 +90,9 @@ namespace Content.Server.GameObjects.Components.Body
if (Owner.TryGetComponent(out IMobStateComponent? mobState) &&
mobState.IsDead())
{
var shell = IoCManager.Resolve<IConsoleShell>();
var host = IoCManager.Resolve<IServerConsoleHost>();
new Ghost().Execute(shell, (IPlayerSession) session, Array.Empty<string>());
new Ghost().Execute(new ConsoleShell(host, session), string.Empty, Array.Empty<string>());
}
}

View File

@@ -36,11 +36,11 @@ namespace Content.Server.GameObjects.Components.Body
}
}
async Task IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs)
async Task<bool> IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs)
{
if (eventArgs.Target == null)
{
return;
return false;
}
CloseAllSurgeryUIs();
@@ -61,6 +61,8 @@ namespace Content.Server.GameObjects.Components.Body
eventArgs.Target.PopupMessage(eventArgs.User, Loc.GetString("You can't fit it in!"));
}
}
return true;
}
private void SendBodyPartListToUser(AfterInteractEventArgs eventArgs, IBody body)

View File

@@ -99,12 +99,12 @@ namespace Content.Server.GameObjects.Components.Body.Part
}
}
async Task IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs)
async Task<bool> IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs)
{
// TODO BODY
if (eventArgs.Target == null)
{
return;
return false;
}
CloseAllSurgeryUIs();
@@ -116,6 +116,8 @@ namespace Content.Server.GameObjects.Components.Body.Part
{
SendSlots(eventArgs, body);
}
return true;
}
private void SendSlots(AfterInteractEventArgs eventArgs, IBody body)

View File

@@ -59,5 +59,15 @@ namespace Content.Server.GameObjects.Components.Body.Respiratory
return true;
}
public bool AreInternalsWorking()
{
return BreathToolEntity != null &&
GasTankEntity != null &&
BreathToolEntity.TryGetComponent(out BreathToolComponent? breathTool) &&
breathTool.IsFunctional &&
GasTankEntity.TryGetComponent(out GasTankComponent? gasTank) &&
gasTank.Air != null;
}
}
}

View File

@@ -50,16 +50,16 @@ namespace Content.Server.GameObjects.Components.Body.Surgery
public IEntity? PerformerCache { get; private set; }
async Task IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs)
async Task<bool> IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs)
{
if (eventArgs.Target == null)
{
return;
return false;
}
if (!eventArgs.User.TryGetComponent(out IActorComponent? actor))
{
return;
return false;
}
CloseAllSurgeryUIs();
@@ -101,20 +101,22 @@ namespace Content.Server.GameObjects.Components.Body.Surgery
if (!part.SurgeryCheck(_surgeryType))
{
NotUsefulPopup();
return;
return true;
}
// ...do the surgery.
if (part.AttemptSurgery(_surgeryType, part, this,
eventArgs.User))
{
return;
return true;
}
// Log error if the surgery fails somehow.
Logger.Debug($"Error when trying to perform surgery on ${nameof(IBodyPart)} {eventArgs.User.Name}");
throw new InvalidOperationException();
}
return true;
}
public float BaseOperationTime { get => _baseOperateTime; set => _baseOperateTime = value; }