Files
wwdpublic/Content.Shared/Implants/AddComponentsImplant/AddComponentsImplantComponent.cs
HoboLyra 51ca2f2932 System to Add Components via Implanters (#1970)
# Description

Code handling for adding components to someone via implant. Takes care
of all the lifting so that people can use just YML to make said items.
Mostly for adding more customization and modding ease of use.

No current implimentation besides a sample implant to show the YML
format, as it was made for another server use, but it might be usefull
to others.

Example implant adds the "dispellable" component when implanted, just to
show syntax for YML.
```
  - type: AddComponentsImplant
    componentsToAdd:
    - type: Dispellable
```

# Changelog

🆑
- add: Code files for implanting, removing, and checking for components
as stated in YML
- fix: Fixed naming from old server

(cherry picked from commit f8be08d9e0dcd68e513a9cf5daa0aab7f06f452f)
2025-03-21 16:55:45 +03:00

27 lines
988 B
C#

using Robust.Shared.Prototypes;
namespace Content.Shared.Implants.AddComponentsImplant;
/// <summary>
/// When added to an implanter will add the passed in components to the implanted entity.
/// </summary>
/// <remarks>
/// Warning: Multiple implants with this component adding the same components will not properly remove components
/// unless removed in the inverse order of their injection (Last in, first out).
/// </remarks>
[RegisterComponent]
public sealed partial class AddComponentsImplantComponent : Component
{
/// <summary>
/// What components will be added to the entity. If the component already exists, it will be skipped.
/// </summary>
[DataField(required: true)]
public ComponentRegistry ComponentsToAdd;
/// <summary>
/// What components were added to the entity after implanted. Is used to know what components to remove.
/// </summary>
[DataField]
public ComponentRegistry AddedComponents = new();
}