Key distribution system (#625)

* data restruct

* yay

* Update arenas.yml

* fixes

* auto labeling

* shuffle
This commit is contained in:
Ed
2024-12-03 12:34:07 +03:00
committed by GitHub
parent 7e6e4709c4
commit f6630e1ec9
40 changed files with 1262 additions and 724 deletions

View File

@@ -1,19 +0,0 @@
using Robust.Shared.Prototypes;
namespace Content.Shared._CP14.LockKey;
/// <summary>
/// A prototype of the lock category. Need a roundstart mapping to ensure that keys and locks will fit together despite randomization.
/// </summary>
[Prototype("CP14LockCategory")]
public sealed partial class CP14LockCategoryPrototype : IPrototype
{
[ViewVariables]
[IdDataField]
public string ID { get; private set; } = default!;
/// <summary>
/// The number of elements that will be generated for the category.
/// </summary>
[DataField] public int Complexity = 3;
}

View File

@@ -0,0 +1,15 @@
using Robust.Shared.Prototypes;
namespace Content.Shared._CP14.LockKey;
/// <summary>
/// Group Affiliation. Used for “abstract key” mechanics,
/// where the key takes one of the free forms from identical rooms (10 different kinds of tavern rooms for example).
/// </summary>
[Prototype("CP14LockGroup")]
public sealed partial class CP14LockGroupPrototype : IPrototype
{
[ViewVariables]
[IdDataField]
public string ID { get; private set; } = default!;
}

View File

@@ -0,0 +1,32 @@
using Robust.Shared.Prototypes;
namespace Content.Shared._CP14.LockKey;
/// <summary>
/// A lock or key shape, pre-generated at the start of the round.
/// Allows a group of doors and keys to have the same shape within the same round and fit together,
/// but is randomized from round to round
/// </summary>
[Prototype("CP14LockType")]
public sealed partial class CP14LockTypePrototype : IPrototype
{
[ViewVariables]
[IdDataField]
public string ID { get; private set; } = default!;
/// <summary>
/// The number of elements that will be generated for the category.
/// </summary>
[DataField]
public int Complexity = 3;
/// <summary>
/// Group Affiliation. Used for “abstract key” mechanics,
/// where the key takes one of the free forms from identical rooms (10 different kinds of tavern rooms for example).
/// </summary>
[DataField]
public ProtoId<CP14LockGroupPrototype>? Group;
[DataField]
public LocId? Name;
}

View File

@@ -15,5 +15,5 @@ public sealed partial class CP14KeyComponent : Component
/// If not null, automatically generates a key for the specified category on initialization. This ensures that the lock will be opened with a key of the same category.
/// </summary>
[DataField]
public ProtoId<CP14LockCategoryPrototype>? AutoGenerateShape = null;
public ProtoId<CP14LockTypePrototype>? AutoGenerateShape = null;
}

View File

@@ -5,10 +5,10 @@ namespace Content.Shared._CP14.LockKey.Components;
/// <summary>
/// A component of a lock that stores its keyhole shape, complexity, and current state.
/// </summary>
[RegisterComponent]
[RegisterComponent, AutoGenerateComponentState]
public sealed partial class CP14LockComponent : Component
{
[DataField]
[DataField, AutoNetworkedField]
public List<int>? LockShape = null;
[DataField]
@@ -30,5 +30,5 @@ public sealed partial class CP14LockComponent : Component
/// If not null, automatically generates a lock for the specified category on initialization. This ensures that the lock will be opened with a key of the same category.
/// </summary>
[DataField]
public ProtoId<CP14LockCategoryPrototype>? AutoGenerateShape = null;
public ProtoId<CP14LockTypePrototype>? AutoGenerateShape = null;
}

View File

@@ -0,0 +1,13 @@
using Robust.Shared.Prototypes;
namespace Content.Shared._CP14.LockKey.Components;
/// <summary>
///
/// </summary>
[RegisterComponent]
public sealed partial class CP14StationKeyDistributionComponent : Component
{
[DataField]
public List<ProtoId<CP14LockTypePrototype>> Keys = new();
}