Skip to content

Commit

Permalink
Re-Enable Recycler Gibbing (DeltaV-Station#822)
Browse files Browse the repository at this point in the history
# Description

WAITER, WAITER, PLEASE FEED ME MORE FELINIDS.

# Changelog

:cl:
- add: Recyclers can now once again eat people when emagged.
- add: The ability for emagged Recyclers to eat people is now controlled
by the CVar "reclaimer.allow_gibbing".
- add: Recyclers require power to eat people. No more dragging emagged
recyclers into crowds.

---------

Signed-off-by: VMSolidus <[email protected]>
Co-authored-by: DEATHB4DEFEAT <[email protected]>
  • Loading branch information
VMSolidus and DEATHB4DEFEAT authored Sep 8, 2024
1 parent 32b0166 commit 7a592e9
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
10 changes: 10 additions & 0 deletions Content.Shared/CCVar/CCVars.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2542,5 +2542,15 @@ public static readonly CVarDef<float>
CVarDef.Create("mood.decreases_speed", true, CVar.SERVER);

#endregion

#region Material Reclaimer

/// <summary>
/// Whether or not a Material Reclaimer is allowed to eat people when emagged.
/// </summary>
public static readonly CVarDef<bool> ReclaimerAllowGibbing =
CVarDef.Create("reclaimer.allow_gibbing", true, CVar.SERVER);

#endregion
}
}
17 changes: 10 additions & 7 deletions Content.Shared/Materials/SharedMaterialReclaimerSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Content.Shared.Administration.Logs;
using Content.Shared.Audio;
using Content.Shared.Body.Components;
using Content.Shared.CCVar;
using Content.Shared.Coordinates;
using Content.Shared.Database;
using Content.Shared.Emag.Components;
Expand All @@ -11,6 +12,7 @@
using Content.Shared.Stacks;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Configuration;
using Robust.Shared.Containers;
using Robust.Shared.Map;
using Robust.Shared.Physics.Events;
Expand All @@ -29,6 +31,7 @@ public abstract class SharedMaterialReclaimerSystem : EntitySystem
[Dependency] protected readonly SharedAmbientSoundSystem AmbientSound = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] protected readonly SharedContainerSystem Container = default!;
[Dependency] private readonly IConfigurationManager _config = default!;

public const string ActiveReclaimerContainerId = "active-material-reclaimer-container";

Expand Down Expand Up @@ -193,16 +196,16 @@ public bool CanStart(EntityUid uid, MaterialReclaimerComponent component)
}

/// <summary>
/// Whether or not the reclaimer satisfies the conditions
/// allowing it to gib/reclaim a living creature.
/// Whether or not the reclaimer satisfies the conditions
/// allowing it to gib/reclaim a living creature.
/// </summary>
public bool CanGib(EntityUid uid, EntityUid victim, MaterialReclaimerComponent component)
{
return false; // DeltaV - Kinda LRP
// return component.Powered &&
// component.Enabled &&
// HasComp<BodyComponent>(victim) &&
// HasComp<EmaggedComponent>(uid);
return _config.GetCVar(CCVars.ReclaimerAllowGibbing)
&& component.Powered
&& component.Enabled
&& HasComp<BodyComponent>(victim)
&& HasComp<EmaggedComponent>(uid);
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,5 @@
interactSuccessString: petting-success-recycler
interactFailureString: petting-failure-generic
interactSuccessSound:
path: /Audio/Items/drill_hit.ogg
path: /Audio/Items/drill_hit.ogg
- type: ApcPowerReceiver

0 comments on commit 7a592e9

Please sign in to comment.