Files
wwdpublic/Content.Server/Carrying/CarriableComponent.cs
VMSolidus 664f482c33 Carrying System Refactor (#580)
# Description

This is a very simple and apparently minor update to the Carrying
System, bringing it up to date with more modern code. The biggest
difference is that rather than having a private one-off implementation
of one of the original Nyano MassContest functions, it uses the new
public Reworked MassContests. With this change, pick up durations no
longer infinitely scale with arbitrary mass, meaning that a hypothetical
2000kg Lamia doesn't have an arbitrarily infinitesimal pickup duration
when trying to pick up a 10kg Harpy. Carrying is also more strictly
limited by mass, rather than by carrying duration, meaning that if a
target character is more than 25% heavier than your character, it will
not be possible to shoulder them. You'll just have to either drag them,
or get a roller bed to move overly massive characters.

The last thing I did was just cleanup all of the code, so that has nice,
Single-IF exit conditions, rather than 30+ line blocks of IF(THING)
RETURN;

Oh, and entities can now set their own internal base PickupDuration, so
that entities can declare however easy or difficult they should be to
pick up!

# MEDIA


https://github.com/user-attachments/assets/9ee0f1dd-ac75-406f-8bbd-9a130594d46d


# Changelog

🆑
- tweak: The Carrying system has been reworked as a means of better
supporting having extremely large species and characters. 10kg Harpies
should no longer be oppressed by 2000kg Lamia with infinitely short
carry attempts.
2024-08-05 18:11:37 +01:00

25 lines
657 B
C#

using System.Threading;
namespace Content.Server.Carrying
{
[RegisterComponent]
public sealed partial class CarriableComponent : Component
{
/// <summary>
/// Number of free hands required
/// to carry the entity
/// </summary>
[DataField]
public int FreeHandsRequired = 2;
public CancellationTokenSource? CancelToken;
/// <summary>
/// The base duration (In Seconds) of how long it should take to pick up this entity
/// before Contests are considered.
/// </summary>
[DataField]
public float PickupDuration = 3;
}
}