Recycler Overhaul (#30802)

* Recycler overhaul

* remove
This commit is contained in:
Nemanja
2024-08-18 23:39:00 -04:00
committed by GitHub
parent 1fa447f769
commit 476c7751c4
32 changed files with 207 additions and 253 deletions

View File

@@ -2,7 +2,6 @@ using System.Linq;
using Content.Shared.Administration.Logs;
using Content.Shared.Audio;
using Content.Shared.Body.Components;
using Content.Shared.Coordinates;
using Content.Shared.Database;
using Content.Shared.Emag.Components;
using Content.Shared.Emag.Systems;
@@ -10,7 +9,6 @@ using Content.Shared.Examine;
using Content.Shared.Mobs.Components;
using Content.Shared.Stacks;
using Content.Shared.Whitelist;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Containers;
using Robust.Shared.Map;
@@ -102,7 +100,8 @@ public abstract class SharedMaterialReclaimerSystem : EntitySystem
if (user != null)
{
_adminLog.Add(LogType.Action, LogImpact.High,
_adminLog.Add(LogType.Action,
LogImpact.High,
$"{ToPrettyString(user.Value):player} destroyed {ToPrettyString(item)} in the material reclaimer, {ToPrettyString(uid)}");
}
@@ -171,13 +170,19 @@ public abstract class SharedMaterialReclaimerSystem : EntitySystem
/// <summary>
/// Sets the Enabled field on the reclaimer.
/// </summary>
public void SetReclaimerEnabled(EntityUid uid, bool enabled, MaterialReclaimerComponent? component = null)
public bool SetReclaimerEnabled(EntityUid uid, bool enabled, MaterialReclaimerComponent? component = null)
{
if (!Resolve(uid, ref component, false))
return;
return true;
if (component.Broken && enabled)
return false;
component.Enabled = enabled;
AmbientSound.SetAmbience(uid, enabled && component.Powered);
Dirty(uid, component);
return true;
}
/// <summary>
@@ -189,7 +194,7 @@ public abstract class SharedMaterialReclaimerSystem : EntitySystem
if (HasComp<ActiveMaterialReclaimerComponent>(uid))
return false;
return component.Powered && component.Enabled;
return component.Powered && component.Enabled && !component.Broken;
}
/// <summary>
@@ -200,6 +205,7 @@ public abstract class SharedMaterialReclaimerSystem : EntitySystem
{
return component.Powered &&
component.Enabled &&
!component.Broken &&
HasComp<BodyComponent>(victim) &&
HasComp<EmaggedComponent>(uid);
}