Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the inability to drag clumsy entities into the biomass reclaimer #33844

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
using Content.Shared.Medical;
using Content.Shared.Mind;
using Content.Shared.Materials;
using Content.Shared.Medical.BiomassReclaimer;
using Content.Shared.Mobs.Components;
using Content.Shared.Mobs.Systems;
using Content.Shared.Nutrition.Components;
Expand All @@ -30,7 +31,6 @@
using Robust.Shared.Audio.Systems;
using Robust.Shared.Configuration;
using Robust.Shared.Physics.Components;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;

namespace Content.Server.Medical.BiomassReclaimer
Expand Down
12 changes: 8 additions & 4 deletions Content.Shared/Clumsy/ClumsySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Content.Shared.Damage;
using Content.Shared.IdentityManagement;
using Content.Shared.Medical;
using Content.Shared.Medical.BiomassReclaimer;
using Content.Shared.Popups;
using Content.Shared.Stunnable;
using Content.Shared.Weapons.Ranged.Events;
Expand Down Expand Up @@ -38,7 +39,7 @@ public override void Initialize()
private void BeforeHyposprayEvent(Entity<ClumsyComponent> ent, ref SelfBeforeHyposprayInjectsEvent args)
{
// Clumsy people sometimes inject themselves! Apparently syringes are clumsy proof...

// checks if ClumsyHypo is false, if so, skips.
if (!ent.Comp.ClumsyHypo)
return;
Expand All @@ -54,7 +55,7 @@ private void BeforeHyposprayEvent(Entity<ClumsyComponent> ent, ref SelfBeforeHyp
private void BeforeDefibrillatorZapsEvent(Entity<ClumsyComponent> ent, ref SelfBeforeDefibrillatorZapsEvent args)
{
// Clumsy people sometimes defib themselves!

// checks if ClumsyDefib is false, if so, skips.
if (!ent.Comp.ClumsyDefib)
return;
Expand Down Expand Up @@ -97,14 +98,17 @@ private void BeforeGunShotEvent(Entity<ClumsyComponent> ent, ref SelfBeforeGunSh
private void OnBeforeClimbEvent(Entity<ClumsyComponent> ent, ref SelfBeforeClimbEvent args)
{
// checks if ClumsyVaulting is false, if so, skips.
if (!ent.Comp.ClumsyVaulting)
if (!ent.Comp.ClumsyVaulting
|| HasComp<BiomassReclaimerComponent>(args.BeingClimbedOn))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'm definitely not a fan of hard coding this component check, as slarticodefast said. Is this check even needed with the other check in place?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably don't even need to use SelfBeforeClimbEvent here and can use normal drag drop without any climbing for inserting into the reclaimer, similar ot the cryopod.

return;

// This event is called in shared, thats why it has all the extra prediction stuff.
var rand = new System.Random((int)_timing.CurTick.Value);

// If someone is putting you on the table, always get past the guard.
if (!_cfg.GetCVar(CCVars.GameTableBonk) && args.PuttingOnTable == ent.Owner && !rand.Prob(ent.Comp.ClumsyDefaultCheck))
if (_cfg.GetCVar(CCVars.GameTableBonk)
|| args.PuttingOnTable != ent.Owner
|| !rand.Prob(ent.Comp.ClumsyDefaultCheck))
return;

HitHeadClumsy(ent, args.BeingClimbedOn);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
using Content.Shared.Storage;
using Robust.Shared.GameStates;

namespace Content.Server.Medical.BiomassReclaimer
namespace Content.Shared.Medical.BiomassReclaimer
{
[RegisterComponent]
[RegisterComponent, NetworkedComponent]
public sealed partial class BiomassReclaimerComponent : Component
{
/// <summary>
Expand All @@ -15,7 +16,7 @@ public sealed partial class BiomassReclaimerComponent : Component
/// <summary>
/// The interval for <see cref="RandomMessTimer"/>.
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField]
[DataField]
public TimeSpan RandomMessInterval = TimeSpan.FromSeconds(5);

/// <summary>
Expand Down Expand Up @@ -47,31 +48,31 @@ public sealed partial class BiomassReclaimerComponent : Component
/// <summary>
/// How many units of biomass it produces for each unit of mass.
/// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)]
[DataField]
public float YieldPerUnitMass = 0.4f;

/// <summary>
/// How many seconds to take to insert an entity per unit of its mass.
/// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)]
[DataField]
public float BaseInsertionDelay = 0.1f;

/// <summary>
/// How much to multiply biomass yield from botany produce.
/// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)]
[DataField]
public float ProduceYieldMultiplier = 0.25f;

/// <summary>
/// The time it takes to process a mob, per mass.
/// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)]
[DataField]
public float ProcessingTimePerUnitMass = 0.5f;

/// <summary>
/// Will this refuse to gib a living mob?
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField]
[DataField]
public bool SafetyEnabled = true;
}
}
Loading