Key distribution system (#625)
* data restruct * yay * Update arenas.yml * fixes * auto labeling * shuffle
This commit is contained in:
@@ -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;
|
||||
}
|
||||
15
Content.Shared/_CP14/LockKey/CP14LockGroupPrototype.cs
Normal file
15
Content.Shared/_CP14/LockKey/CP14LockGroupPrototype.cs
Normal 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!;
|
||||
}
|
||||
32
Content.Shared/_CP14/LockKey/CP14LockTypePrototype.cs
Normal file
32
Content.Shared/_CP14/LockKey/CP14LockTypePrototype.cs
Normal 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;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
Reference in New Issue
Block a user