* contraband system rework to allow restriction by job, not just department * Fixing detective trenchcoat inheritance * removing unnecessary using declarations * trying to fix testing error by re-adding diagnostics using declaration * removing unecessary dependency, making allowedJobs nullable * Adding all of slarti's requested changes except for the hacky job icon method fix * removing accidental whitespace * choosing to use the non-localized version because we're comparing the string against the AllowedJobs field, and the contraband classes that fill that field are written in english * removing unneeded using dec, fixing nesting logic problem * didn't remove the old nesting, doing that now * using localized job title and localizing the allowed jobs string, removing usages of JobTitle field. Also networked the _jobTitle field instead. * rewrite some stuff * fixes * fix energy pen --------- Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
37 lines
1.3 KiB
C#
37 lines
1.3 KiB
C#
using Content.Shared.Roles;
|
|
using Robust.Shared.GameStates;
|
|
using Robust.Shared.Prototypes;
|
|
|
|
namespace Content.Shared.Contraband;
|
|
|
|
/// <summary>
|
|
/// This is used for marking entities that are considered 'contraband' IC and showing it clearly in examine.
|
|
/// </summary>
|
|
[RegisterComponent, NetworkedComponent, Access(typeof(ContrabandSystem)), AutoGenerateComponentState]
|
|
public sealed partial class ContrabandComponent : Component
|
|
{
|
|
/// <summary>
|
|
/// The degree of contraband severity this item is considered to have.
|
|
/// </summary>
|
|
[DataField]
|
|
[AutoNetworkedField]
|
|
public ProtoId<ContrabandSeverityPrototype> Severity = "Restricted";
|
|
|
|
/// <summary>
|
|
/// Which departments is this item restricted to?
|
|
/// By default, command and sec are assumed to be fine with contraband.
|
|
/// If null, no departments are allowed to use this.
|
|
/// </summary>
|
|
[DataField]
|
|
[AutoNetworkedField]
|
|
public HashSet<ProtoId<DepartmentPrototype>> AllowedDepartments = new();
|
|
|
|
/// <summary>
|
|
/// Which jobs is this item restricted to?
|
|
/// If empty, no jobs are allowed to use this beyond the allowed departments.
|
|
/// </summary>
|
|
[DataField]
|
|
[AutoNetworkedField]
|
|
public HashSet<ProtoId<JobPrototype>> AllowedJobs = new();
|
|
}
|