# Conflicts: # .github/workflows/validate-rgas.yml # .github/workflows/validate-rsis.yml # Content.Client/Changelog/ChangelogTab.xaml.cs # Content.Client/Humanoid/HumanoidAppearanceSystem.cs # Content.Client/Options/UI/OptionsMenu.xaml.cs # Content.Client/SubFloor/SubFloorHideSystem.cs # Content.Client/UserInterface/Systems/Ghost/Widgets/GhostGui.xaml.cs # Content.Server/Advertise/EntitySystems/SpeakOnUIClosedSystem.cs # Content.Server/Antag/AntagSelectionSystem.cs # Content.Server/Arcade/SpaceVillainGame/SpaceVillainArcadeSystem.cs # Content.Server/Explosion/EntitySystems/TriggerSystem.cs # Content.Server/Mindshield/MindShieldSystem.cs # Content.Server/Objectives/Systems/KillPersonConditionSystem.cs # Content.Server/Standing/StandingStateSystem.cs # Content.Server/Station/Systems/StationJobsSystem.Roundstart.cs # Content.Server/VendingMachines/VendingMachineSystem.cs # Content.Server/Zombies/ZombieSystem.Transform.cs # Content.Server/Zombies/ZombieSystem.cs # Content.Shared/Damage/Systems/DamageableSystem.cs # Content.Shared/Humanoid/HumanoidAppearanceComponent.cs # Content.Shared/Humanoid/Markings/MarkingManager.cs # Content.Shared/Humanoid/NamingSystem.cs # Content.Shared/Humanoid/Prototypes/SpeciesPrototype.cs # Content.Shared/Humanoid/SharedHumanoidAppearanceSystem.cs # Content.Shared/Implants/Components/SubdermalImplantComponent.cs # Content.Shared/Standing/StandingStateSystem.cs # Content.Shared/VendingMachines/SharedVendingMachineSystem.cs # Content.Shared/VendingMachines/VendingMachineComponent.cs # Resources/Audio/Lobby/attributions.yml # Resources/Locale/en-US/_strings/administration/commands/forceghost.ftl # Resources/Locale/en-US/_strings/clothing/components/fire-protection-component.ftl # Resources/Locale/en-US/_strings/components/storage-voice-control-component.ftl # Resources/Locale/en-US/_strings/prototypes/roles/antags.ftl # Resources/Locale/en-US/_strings/reagents/meta/physical-desc.ftl # Resources/Locale/en-US/lathe/lathe-categories.ftl # Resources/Prototypes/Access/command.yml # Resources/Prototypes/Catalog/Fills/Books/bookshelf.yml # Resources/Prototypes/Catalog/Fills/Lockers/heads.yml # Resources/Prototypes/Catalog/Fills/Lockers/misc.yml # Resources/Prototypes/Catalog/VendingMachines/Inventories/chemvend.yml # Resources/Prototypes/Catalog/thief_toolbox_sets.yml # Resources/Prototypes/Datasets/Names/Operation_prefix.yml # Resources/Prototypes/Datasets/Names/Operation_suffix.yml # Resources/Prototypes/Datasets/Names/arachnid_first.yml # Resources/Prototypes/Datasets/Names/arachnid_last.yml # Resources/Prototypes/Datasets/Names/borg.yml # Resources/Prototypes/Datasets/Names/cargo_shuttle.yml # Resources/Prototypes/Datasets/Names/clown.yml # Resources/Prototypes/Datasets/Names/diona.yml # Resources/Prototypes/Datasets/Names/fake_human_first.yml # Resources/Prototypes/Datasets/Names/fake_human_last.yml # Resources/Prototypes/Datasets/Names/first.yml # Resources/Prototypes/Datasets/Names/first_female.yml # Resources/Prototypes/Datasets/Names/first_male.yml # Resources/Prototypes/Datasets/Names/fortunes.yml # Resources/Prototypes/Datasets/Names/hologram.yml # Resources/Prototypes/Datasets/Names/last.yml # Resources/Prototypes/Datasets/Names/military.yml # Resources/Prototypes/Datasets/Names/moth_first_female.yml # Resources/Prototypes/Datasets/Names/moth_first_male.yml # Resources/Prototypes/Datasets/Names/moth_last.yml # Resources/Prototypes/Datasets/Names/mushman_first.yml # Resources/Prototypes/Datasets/Names/mushman_last.yml # Resources/Prototypes/Datasets/Names/ninja.yml # Resources/Prototypes/Datasets/Names/ninja_title.yml # Resources/Prototypes/Datasets/Names/regalrat.yml # Resources/Prototypes/Datasets/Names/reptilian_female.yml # Resources/Prototypes/Datasets/Names/reptilian_male.yml # Resources/Prototypes/Datasets/Names/revenant.yml # Resources/Prototypes/Datasets/Names/skeleton_first.yml # Resources/Prototypes/Datasets/Names/syndicate.yml # Resources/Prototypes/Datasets/Names/vox.yml # Resources/Prototypes/Datasets/Names/wizard_first.yml # Resources/Prototypes/Datasets/Names/wizard_last.yml # Resources/Prototypes/Datasets/adjectives.yml # Resources/Prototypes/Datasets/corporations.yml # Resources/Prototypes/Datasets/criminal_records.yml # Resources/Prototypes/Datasets/rat_king_commands.yml # Resources/Prototypes/Datasets/verbs.yml # Resources/Prototypes/Entities/Clothing/Head/specific.yml # Resources/Prototypes/Entities/Clothing/OuterClothing/coats.yml # Resources/Prototypes/Entities/Clothing/OuterClothing/specific.yml # Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml # Resources/Prototypes/Entities/Mobs/NPCs/revenant.yml # Resources/Prototypes/Entities/Mobs/Player/human.yml # Resources/Prototypes/Entities/Mobs/Player/humanoid.yml # Resources/Prototypes/Entities/Mobs/Species/arachnid.yml # Resources/Prototypes/Entities/Mobs/Species/base.yml # Resources/Prototypes/Entities/Mobs/Species/moth.yml # Resources/Prototypes/Entities/Mobs/Species/vox.yml # Resources/Prototypes/Entities/Objects/Devices/pda.yml # Resources/Prototypes/Entities/Objects/Misc/paper.yml # Resources/Prototypes/Entities/Objects/Misc/subdermal_implants.yml # Resources/Prototypes/Entities/Objects/Weapons/Guns/Ammunition/Cartridges/shotgun.yml # Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml # Resources/Prototypes/Entities/Stations/nanotrasen.yml # Resources/Prototypes/Entities/Structures/Furniture/carpets.yml # Resources/Prototypes/Entities/Structures/Storage/Closets/wall_lockers.yml # Resources/Prototypes/GameRules/roundstart.yml # Resources/Prototypes/Procedural/salvage_loot.yml # Resources/Prototypes/Reagents/Consumable/Drink/alcohol.yml # Resources/Prototypes/Recipes/Lathes/biogen.yml # Resources/Prototypes/Recipes/Lathes/categories.yml # Resources/Prototypes/Roles/Jobs/Security/warden.yml # Resources/Prototypes/Species/arachnid.yml # Resources/Prototypes/Species/diona.yml # Resources/Prototypes/Species/moth.yml # Resources/Prototypes/ai_factions.yml # Resources/Prototypes/game_presets.yml # Resources/ServerInfo/Guidebook/Mobs/SlimePerson.xml # Resources/ServerInfo/Guidebook/ServerRules/SpaceLaw/SpaceLaw.xml # Resources/ServerInfo/Guidebook/Service/Botany.xml # Resources/Textures/Clothing/Eyes/Glasses/glasses.rsi/meta.json # Resources/Textures/Clothing/Eyes/Glasses/jamjar.rsi/meta.json # Resources/Textures/Clothing/Eyes/Glasses/mercglasses.rsi/meta.json # Resources/Textures/Clothing/Eyes/Glasses/meson.rsi/meta.json # Resources/Textures/Clothing/Eyes/Glasses/ninjavisor.rsi/meta.json # Resources/Textures/Clothing/Eyes/Glasses/outlawglasses.rsi/meta.json # Resources/Textures/Clothing/Eyes/Glasses/science.rsi/meta.json # Resources/Textures/Clothing/Eyes/Glasses/secglasses.rsi/meta.json # Resources/Textures/Clothing/Eyes/Glasses/sunglasses.rsi/meta.json # Resources/Textures/Clothing/Eyes/Glasses/thermal.rsi/meta.json # Resources/Textures/Clothing/Eyes/Hud/beergoggles.rsi/inhand-left.png # Resources/Textures/Clothing/Eyes/Hud/beergoggles.rsi/inhand-right.png # Resources/Textures/Clothing/Eyes/Hud/beergoggles.rsi/meta.json # Resources/Textures/Clothing/Eyes/Hud/synd.rsi/meta.json # Resources/Textures/Clothing/Eyes/Hud/syndagent.rsi/meta.json # Resources/Textures/Clothing/Head/Hats/capcap.rsi/inhand-left.png # Resources/Textures/Clothing/Head/Hats/capcap.rsi/inhand-right.png # Resources/Textures/Clothing/Head/Hats/capcap.rsi/meta.json # Resources/Textures/Interface/Misc/program_icons.rsi/meta.json # Resources/Textures/Objects/Misc/Lights/lights.rsi/meta.json # Resources/Textures/Objects/Misc/bureaucracy.rsi/meta.json # Resources/Textures/Objects/Specific/Hydroponics/aloe.rsi/meta.json # Resources/Textures/Objects/Specific/Hydroponics/apple.rsi/meta.json # Resources/Textures/Objects/Specific/Hydroponics/carrot.rsi/meta.json # Resources/Textures/Objects/Specific/Hydroponics/chanterelle.rsi/meta.json # Resources/Textures/Objects/Specific/Hydroponics/chili.rsi/meta.json # Resources/Textures/Objects/Specific/Hydroponics/eggplant.rsi/meta.json # Resources/Textures/Objects/Specific/Hydroponics/gatfruit.rsi/meta.json # Resources/Textures/Objects/Specific/Hydroponics/lemon.rsi/meta.json # Resources/Textures/Objects/Specific/Hydroponics/onion_red.rsi/meta.json # Resources/Textures/Objects/Specific/Hydroponics/potato.rsi/meta.json # Resources/Textures/Objects/Specific/Hydroponics/sugarcane.rsi/meta.json # Resources/Textures/Objects/Specific/Hydroponics/tomato.rsi/meta.json # Resources/Textures/Objects/Specific/Robotics/borgmodule.rsi/meta.json # Resources/Textures/Objects/Specific/Robotics/cyborg_parts.rsi/meta.json # Resources/Textures/Objects/Tools/spray_painter.rsi/meta.json # Resources/Textures/Objects/Weapons/Grenades/flashbang.rsi/meta.json # Resources/Textures/Objects/Weapons/Grenades/grenade.rsi/meta.json # Resources/Textures/Objects/Weapons/Grenades/nukenade.rsi/meta.json # Resources/migration.yml # Tools/actions_changelogs_since_last_run.py
206 lines
7.9 KiB
C#
206 lines
7.9 KiB
C#
using Content.Shared.Access;
|
|
using Content.Shared.Guidebook;
|
|
using Content.Shared.Humanoid.Prototypes;
|
|
using Content.Shared.Players.PlayTimeTracking;
|
|
using Content.Shared.StatusIcon;
|
|
using Robust.Shared.Prototypes;
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
|
|
using Robust.Shared.Utility;
|
|
|
|
namespace Content.Shared.Roles
|
|
{
|
|
/// <summary>
|
|
/// Describes information for a single job on the station.
|
|
/// </summary>
|
|
[Prototype]
|
|
public sealed partial class JobPrototype : IPrototype
|
|
{
|
|
[ViewVariables]
|
|
[IdDataField]
|
|
public string ID { get; private set; } = default!;
|
|
|
|
[DataField("playTimeTracker", required: true, customTypeSerializer: typeof(PrototypeIdSerializer<PlayTimeTrackerPrototype>))]
|
|
public string PlayTimeTracker { get; private set; } = string.Empty;
|
|
|
|
/// <summary>
|
|
/// Who is the supervisor for this job.
|
|
/// </summary>
|
|
[DataField("supervisors")]
|
|
public string Supervisors { get; private set; } = "nobody";
|
|
|
|
/// <summary>
|
|
/// The name of this job as displayed to players.
|
|
/// </summary>
|
|
[DataField("name")]
|
|
public string Name { get; private set; } = string.Empty;
|
|
|
|
[ViewVariables(VVAccess.ReadOnly)]
|
|
public string LocalizedName => Loc.GetString(Name);
|
|
|
|
/// <summary>
|
|
/// The name of this job as displayed to players.
|
|
/// </summary>
|
|
[DataField("description")]
|
|
public string? Description { get; private set; }
|
|
|
|
[ViewVariables(VVAccess.ReadOnly)]
|
|
public string? LocalizedDescription => Description is null ? null : Loc.GetString(Description);
|
|
|
|
/// <summary>
|
|
/// Requirements for the job.
|
|
/// </summary>
|
|
[DataField, Access(typeof(SharedRoleSystem), Other = AccessPermissions.None)]
|
|
public HashSet<JobRequirement>? Requirements;
|
|
|
|
/// <summary>
|
|
/// When true - the station will have anouncement about arrival of this player.
|
|
/// </summary>
|
|
[DataField("joinNotifyCrew")]
|
|
public bool JoinNotifyCrew { get; private set; } = false;
|
|
|
|
/// <summary>
|
|
/// When true - the player will recieve a message about importancy of their job.
|
|
/// </summary>
|
|
[DataField("requireAdminNotify")]
|
|
public bool RequireAdminNotify { get; private set; } = false;
|
|
|
|
/// <summary>
|
|
/// Should this job appear in preferences menu?
|
|
/// </summary>
|
|
[DataField("setPreference")]
|
|
public bool SetPreference { get; private set; } = true;
|
|
|
|
/// <summary>
|
|
/// Should the selected traits be applied for this job?
|
|
/// </summary>
|
|
[DataField]
|
|
public bool ApplyTraits { get; private set; } = true;
|
|
|
|
/// <summary>
|
|
/// Whether this job should show in the ID Card Console.
|
|
/// If set to null, it will default to SetPreference's value.
|
|
/// </summary>
|
|
[DataField]
|
|
public bool? OverrideConsoleVisibility { get; private set; } = null;
|
|
|
|
[DataField("canBeAntag")]
|
|
public bool CanBeAntag { get; private set; } = true;
|
|
|
|
// Sunrise-Start
|
|
[DataField("radioBold")]
|
|
public bool RadioIsBold { get; }
|
|
// Sunrise-End
|
|
|
|
/// <summary>
|
|
/// The "weight" or importance of this job. If this number is large, the job system will assign this job
|
|
/// before assigning other jobs.
|
|
/// </summary>
|
|
[DataField("weight")]
|
|
public int Weight { get; private set; }
|
|
|
|
/// <summary>
|
|
/// How to sort this job relative to other jobs in the UI.
|
|
/// Jobs with a higher value with sort before jobs with a lower value.
|
|
/// If not set, <see cref="Weight"/> is used as a fallback.
|
|
/// </summary>
|
|
[DataField]
|
|
public int? DisplayWeight { get; private set; }
|
|
|
|
public int RealDisplayWeight => DisplayWeight ?? Weight;
|
|
|
|
/// <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;
|
|
|
|
[DataField]
|
|
public ProtoId<StartingGearPrototype>? StartingGear { get; private set; }
|
|
|
|
/// <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;
|
|
|
|
/// <summary>
|
|
/// Entity to use as a preview in the lobby/character editor.
|
|
/// Same restrictions as <see cref="JobEntity"/> apply.
|
|
/// </summary>
|
|
[DataField]
|
|
public EntProtoId? JobPreviewEntity = null;
|
|
|
|
[DataField]
|
|
public ProtoId<JobIconPrototype> Icon { get; private set; } = "JobIconUnknown";
|
|
|
|
[DataField("special", serverOnly: true)]
|
|
public JobSpecial[] Special { get; private set; } = Array.Empty<JobSpecial>();
|
|
|
|
[DataField("access")]
|
|
public IReadOnlyCollection<ProtoId<AccessLevelPrototype>> Access { get; private set; } = Array.Empty<ProtoId<AccessLevelPrototype>>();
|
|
|
|
[DataField("accessGroups")]
|
|
public IReadOnlyCollection<ProtoId<AccessGroupPrototype>> AccessGroups { get; private set; } = Array.Empty<ProtoId<AccessGroupPrototype>>();
|
|
|
|
[DataField("extendedAccess")]
|
|
public IReadOnlyCollection<ProtoId<AccessLevelPrototype>> ExtendedAccess { get; private set; } = Array.Empty<ProtoId<AccessLevelPrototype>>();
|
|
|
|
[DataField("extendedAccessGroups")]
|
|
public IReadOnlyCollection<ProtoId<AccessGroupPrototype>> ExtendedAccessGroups { get; private set; } = Array.Empty<ProtoId<AccessGroupPrototype>>();
|
|
|
|
[DataField]
|
|
public bool Whitelisted;
|
|
|
|
/// <summary>
|
|
/// Optional list of guides associated with this role. If the guides are opened, the first entry in this list
|
|
/// will be used to select the currently selected guidebook.
|
|
/// </summary>
|
|
[DataField]
|
|
public List<ProtoId<GuideEntryPrototype>>? Guides;
|
|
|
|
// Sunrise-Start
|
|
/// <summary>
|
|
/// Вот так работает расизм по мнению буржуев
|
|
/// </summary>
|
|
[DataField("speciesBlacklist", customTypeSerializer: typeof(PrototypeIdListSerializer<SpeciesPrototype>))]
|
|
public List<string> SpeciesBlacklist = new();
|
|
|
|
/// <summary>
|
|
/// Для космической тюрьмы
|
|
/// </summary>
|
|
[DataField("alwaysUseSpawner")]
|
|
public bool AlwaysUseSpawner { get; }
|
|
|
|
[DataField]
|
|
public SpriteSpecifier PreviewIcon = new SpriteSpecifier.Rsi(new ResPath("/Textures/_Sunrise/Interface/Misc/job_preview.rsi"), "test");
|
|
// Sunrise-End
|
|
}
|
|
|
|
/// <summary>
|
|
/// Sorts <see cref="JobPrototype"/>s appropriately for display in the UI,
|
|
/// respecting their <see cref="JobPrototype.Weight"/>.
|
|
/// </summary>
|
|
public sealed class JobUIComparer : IComparer<JobPrototype>
|
|
{
|
|
public static readonly JobUIComparer Instance = new();
|
|
|
|
public int Compare(JobPrototype? x, JobPrototype? y)
|
|
{
|
|
if (ReferenceEquals(x, y))
|
|
return 0;
|
|
if (ReferenceEquals(null, y))
|
|
return 1;
|
|
if (ReferenceEquals(null, x))
|
|
return -1;
|
|
|
|
var cmp = -x.RealDisplayWeight.CompareTo(y.RealDisplayWeight);
|
|
if (cmp != 0)
|
|
return cmp;
|
|
return string.Compare(x.ID, y.ID, StringComparison.Ordinal);
|
|
}
|
|
}
|
|
}
|