Accent trait limit (#28046)

This commit is contained in:
Ed
2024-06-03 21:47:06 +03:00
committed by GitHub
parent ee8224bce2
commit a4d1601758
14 changed files with 365 additions and 171 deletions

View File

@@ -1,55 +1,63 @@
using Content.Shared.Whitelist;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
// don't worry about it
namespace Content.Shared.Traits;
namespace Content.Shared.Traits
/// <summary>
/// Describes a trait.
/// </summary>
[Prototype]
public sealed partial class TraitPrototype : IPrototype
{
[ViewVariables]
[IdDataField]
public string ID { get; private set; } = default!;
/// <summary>
/// Describes a trait.
/// The name of this trait.
/// </summary>
[Prototype("trait")]
public sealed partial class TraitPrototype : IPrototype
{
[ViewVariables]
[IdDataField]
public string ID { get; private set; } = default!;
[DataField]
public LocId Name { get; private set; } = string.Empty;
/// <summary>
/// The name of this trait.
/// </summary>
[DataField("name")]
public string Name { get; private set; } = "";
/// <summary>
/// The description of this trait.
/// </summary>
[DataField]
public LocId? Description { get; private set; }
/// <summary>
/// The description of this trait.
/// </summary>
[DataField("description")]
public string? Description { get; private set; }
/// <summary>
/// Don't apply this trait to entities this whitelist IS NOT valid for.
/// </summary>
[DataField]
public EntityWhitelist? Whitelist;
/// <summary>
/// Don't apply this trait to entities this whitelist IS NOT valid for.
/// </summary>
[DataField("whitelist")]
public EntityWhitelist? Whitelist;
/// <summary>
/// Don't apply this trait to entities this whitelist IS valid for. (hence, a blacklist)
/// </summary>
[DataField]
public EntityWhitelist? Blacklist;
/// <summary>
/// Don't apply this trait to entities this whitelist IS valid for. (hence, a blacklist)
/// </summary>
[DataField("blacklist")]
public EntityWhitelist? Blacklist;
/// <summary>
/// The components that get added to the player, when they pick this trait.
/// </summary>
[DataField]
public ComponentRegistry Components { get; private set; } = default!;
/// <summary>
/// The components that get added to the player, when they pick this trait.
/// </summary>
[DataField("components")]
public ComponentRegistry Components { get; private set; } = default!;
/// <summary>
/// Gear that is given to the player, when they pick this trait.
/// </summary>
[DataField]
public EntProtoId? TraitGear;
/// <summary>
/// Gear that is given to the player, when they pick this trait.
/// </summary>
[DataField("traitGear", required: false, customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))]
public string? TraitGear;
}
/// <summary>
/// Trait Price. If negative number, points will be added.
/// </summary>
[DataField]
public int Cost = 0;
/// <summary>
/// Adds a trait to a category, allowing you to limit the selection of some traits to the settings of that category.
/// </summary>
[DataField]
public ProtoId<TraitCategoryPrototype>? Category;
}