2021-12-01 00:40:46 +11:00
|
|
|
using Content.Shared.Access;
|
2022-08-07 08:00:42 +02:00
|
|
|
using Content.Shared.Players.PlayTimeTracking;
|
2019-11-17 11:18:39 -05:00
|
|
|
using Robust.Shared.Prototypes;
|
2021-12-30 00:48:18 +11:00
|
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
2021-12-01 00:40:46 +11:00
|
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
|
2019-11-17 11:18:39 -05:00
|
|
|
|
2020-08-13 14:40:27 +02:00
|
|
|
namespace Content.Shared.Roles
|
2019-11-17 11:18:39 -05:00
|
|
|
{
|
2020-01-19 18:31:14 +01:00
|
|
|
/// <summary>
|
|
|
|
|
/// Describes information for a single job on the station.
|
|
|
|
|
/// </summary>
|
2019-11-17 11:18:39 -05:00
|
|
|
[Prototype("job")]
|
2022-02-16 00:23:23 -07:00
|
|
|
public sealed class JobPrototype : IPrototype
|
2019-11-17 11:18:39 -05:00
|
|
|
{
|
2021-03-05 01:08:38 +01:00
|
|
|
[ViewVariables]
|
2022-04-03 02:01:22 +02:00
|
|
|
[IdDataFieldAttribute]
|
2021-03-05 01:08:38 +01:00
|
|
|
public string ID { get; } = default!;
|
|
|
|
|
|
2022-08-07 08:00:42 +02:00
|
|
|
[ViewVariables, DataField("playTimeTracker", required: true, customTypeSerializer: typeof(PrototypeIdSerializer<PlayTimeTrackerPrototype>))]
|
|
|
|
|
public string PlayTimeTracker { get; } = string.Empty;
|
|
|
|
|
|
2021-10-06 13:51:11 +02:00
|
|
|
[DataField("supervisors")]
|
|
|
|
|
public string Supervisors { get; } = "nobody";
|
|
|
|
|
|
2020-01-19 18:31:14 +01:00
|
|
|
/// <summary>
|
|
|
|
|
/// The name of this job as displayed to players.
|
|
|
|
|
/// </summary>
|
2021-05-04 15:37:16 +02:00
|
|
|
[DataField("name")]
|
2021-03-05 01:08:38 +01:00
|
|
|
public string Name { get; } = string.Empty;
|
2019-11-17 11:18:39 -05:00
|
|
|
|
2022-06-28 15:55:05 +03:00
|
|
|
[ViewVariables(VVAccess.ReadOnly)]
|
|
|
|
|
public string LocalizedName => Loc.GetString(Name);
|
|
|
|
|
|
2022-08-07 08:00:42 +02:00
|
|
|
[DataField("requirements")]
|
|
|
|
|
public HashSet<JobRequirement>? Requirements;
|
|
|
|
|
|
2021-10-06 13:51:11 +02:00
|
|
|
[DataField("joinNotifyCrew")]
|
|
|
|
|
public bool JoinNotifyCrew { get; } = false;
|
|
|
|
|
|
|
|
|
|
[DataField("requireAdminNotify")]
|
|
|
|
|
public bool RequireAdminNotify { get; } = false;
|
|
|
|
|
|
2021-12-19 07:36:16 -08:00
|
|
|
[DataField("setPreference")]
|
|
|
|
|
public bool SetPreference { get; } = true;
|
|
|
|
|
|
2021-11-21 20:33:50 -06:00
|
|
|
[DataField("canBeAntag")]
|
|
|
|
|
public bool CanBeAntag { get; } = true;
|
|
|
|
|
|
2020-01-19 18:31:14 +01:00
|
|
|
/// <summary>
|
|
|
|
|
/// Whether this job is a head.
|
|
|
|
|
/// The job system will try to pick heads before other jobs on the same priority level.
|
|
|
|
|
/// </summary>
|
2022-05-10 13:43:30 -05:00
|
|
|
[DataField("weight")]
|
|
|
|
|
public int Weight { get; private set; }
|
2020-01-19 18:31:14 +01:00
|
|
|
|
2022-09-15 15:37:54 -04:00
|
|
|
/// <summary>
|
|
|
|
|
/// A numerical score for how much easier this job is for antagonists.
|
|
|
|
|
/// For traitors, reduces starting TC by this amount. Other gamemodes can use it for whatever they find fitting.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataField("antagAdvantage")]
|
|
|
|
|
public int AntagAdvantage = 0;
|
|
|
|
|
|
2021-12-30 00:48:18 +11:00
|
|
|
[DataField("startingGear", customTypeSerializer: typeof(PrototypeIdSerializer<StartingGearPrototype>))]
|
2021-03-05 01:08:38 +01:00
|
|
|
public string? StartingGear { get; private set; }
|
2020-01-24 16:31:18 +01:00
|
|
|
|
2022-07-10 21:10:03 -04:00
|
|
|
/// <summary>
|
|
|
|
|
/// Use this to spawn in as a non-humanoid (borg, test subject, etc.)
|
|
|
|
|
/// Starting gear will be ignored.
|
|
|
|
|
/// If you want to just add special attributes to a humanoid, use AddComponentSpecial instead.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataField("jobEntity", customTypeSerializer: typeof(PrototypeIdSerializer<EntityPrototype>))]
|
|
|
|
|
public string? JobEntity = null;
|
|
|
|
|
|
2021-05-04 15:37:16 +02:00
|
|
|
[DataField("icon")] public string Icon { get; } = string.Empty;
|
2020-07-26 14:08:09 +02:00
|
|
|
|
2021-09-16 15:17:19 +02:00
|
|
|
[DataField("special", serverOnly:true)]
|
|
|
|
|
public JobSpecial[] Special { get; private set; } = Array.Empty<JobSpecial>();
|
2019-11-17 11:18:39 -05:00
|
|
|
|
2021-12-01 00:40:46 +11:00
|
|
|
[DataField("access", customTypeSerializer: typeof(PrototypeIdListSerializer<AccessLevelPrototype>))]
|
2021-03-05 01:08:38 +01:00
|
|
|
public IReadOnlyCollection<string> Access { get; } = Array.Empty<string>();
|
2022-02-11 19:01:14 -07:00
|
|
|
|
|
|
|
|
[DataField("accessGroups", customTypeSerializer: typeof(PrototypeIdListSerializer<AccessGroupPrototype>))]
|
|
|
|
|
public IReadOnlyCollection<string> AccessGroups { get; } = Array.Empty<string>();
|
2022-05-27 06:01:07 +02:00
|
|
|
|
|
|
|
|
[DataField("extendedAccess", customTypeSerializer: typeof(PrototypeIdListSerializer<AccessLevelPrototype>))]
|
|
|
|
|
public IReadOnlyCollection<string> ExtendedAccess { get; } = Array.Empty<string>();
|
|
|
|
|
|
|
|
|
|
[DataField("extendedAccessGroups", customTypeSerializer: typeof(PrototypeIdListSerializer<AccessGroupPrototype>))]
|
|
|
|
|
public IReadOnlyCollection<string> ExtendedAccessGroups { get; } = Array.Empty<string>();
|
2019-11-17 11:18:39 -05:00
|
|
|
}
|
|
|
|
|
}
|