mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 18:31:17 +03:00
* Solving #43723 by making zombies clumsy (they are unable to hold anything in their hands, passing items to them will fail). Also made zombies uncuff themselves whenever they transform (seeing as they no longer lose their hands meaning that cuffs would otherwise remain on them) * Cleaning up the code * Renamed ClumsyHoldStatusEffectComponent.cs to ClumsyGrabStatusEffectComponent.cs (and renamed associated files). I think "ClumsyGrab" works better than "ClumsyHold" (as the effect happens when the item is first grabbed, not whilst the item is being held). everything still works Reordered appropriate functions in ClumsyStatusTest.cs and ClumsyStatusEffectSystem.cs to retain alphabetical order. * oopsies :p * Appeased the YAMLLinter (at the cost of a somewhat hackier implementation). ZombieSystem.Transform.cs now applies the zombie clumsiness via creating a new PermanentStatusEffectComponent with StatusEffectClumsyZombie as its status effect. * requested changes have been made (also re-added newline to end of clumsy-component.ftl because it has a newline at the end of it on the master branch, I guess it's probably supposed to be there) * reordering so private members (including new one) are before the internal member * hands are forcibly emptied - even if something's glued to them. * UnZombify should remove the lingering ZombieClumsy status effect (still needs to revert the rest of the zombification process, but at least the new bit I added can be undone) * Minor refactor of my own refactor. New order of operations: 1. Uncuffs zombie (if needed) 2. Attempts to `DropAll` items from hands 3. Iterates through hand containers to empty them (removes otherwise unremovable items from hands) Will refactor process to force drop all items if #45844 becomes implementable + is merged. * formatting * how the hell did the metabolizer code go missing!? * uncuffing now happens in a safer way less likely to accidentally infinitely loop * tweaking that one comment I was asked to tweak (this is unrelated to the hand malarkey) hopefully it won't lead to any merge conflicts later on * formatting * file style --------- Co-authored-by: Pok245 <113675512+Pok27@users.noreply.github.com>
39 lines
1.2 KiB
C#
39 lines
1.2 KiB
C#
using Robust.Shared.GameStates;
|
|
|
|
namespace Content.Shared.Clumsy.Components;
|
|
|
|
/// <summary>
|
|
/// Afflicted entity will occasionally fail to pick up items or receive items into their hands.
|
|
/// </summary>
|
|
[RegisterComponent, NetworkedComponent]
|
|
[Access(typeof(ClumsyStatusEffectSystem))]
|
|
public sealed partial class ClumsyGrabStatusEffectComponent : Component
|
|
{
|
|
/// <summary>
|
|
/// How often they fail.
|
|
/// </summary>
|
|
[DataField]
|
|
public float ClumsyChance = 0.5f;
|
|
|
|
/// <summary>
|
|
/// Popup played to the afflicted when they fail to grab the item.
|
|
/// </summary>
|
|
/// <value> Parameters passed in:
|
|
/// <list type="bullet">
|
|
/// <item><c>item</c> - The item which got dropped.</item>
|
|
/// </list>
|
|
/// </value>
|
|
[DataField]
|
|
public LocId? SelfFailedMessage = "clumsy-grab-fail-message-user";
|
|
|
|
/// <summary>
|
|
/// Popup played to others when the afflicted fails to grab the item.
|
|
/// </summary>
|
|
/// <value> Parameters passed in:
|
|
/// <list type="bullet">
|
|
/// <item><c>item</c> - The item which got dropped.</item>
|
|
/// </list>
|
|
/// </value>
|
|
[DataField]
|
|
public LocId? OtherFailedMessage = "clumsy-grab-fail-message-others";
|
|
}
|