Replace ValidatePrototypeId uses with ProtoId or EntProtoId (#38814)

* The easy ones

* For certain values of easy

* Easy test

* Hair

* Fix sandbox violations

* Sort usings
This commit is contained in:
Tayrtahn
2025-07-07 15:57:05 -04:00
committed by GitHub
parent 41f737e8f3
commit c565b44965
77 changed files with 187 additions and 297 deletions

View File

@@ -18,14 +18,10 @@ public sealed class ChemistryGuideDataSystem : SharedChemistryGuideDataSystem
{ {
[Dependency] private readonly SharedSolutionContainerSystem _solutionContainer = default!; [Dependency] private readonly SharedSolutionContainerSystem _solutionContainer = default!;
[ValidatePrototypeId<MixingCategoryPrototype>] private static readonly ProtoId<MixingCategoryPrototype> DefaultMixingCategory = "DummyMix";
private const string DefaultMixingCategory = "DummyMix"; private static readonly ProtoId<MixingCategoryPrototype> DefaultGrindCategory = "DummyGrind";
[ValidatePrototypeId<MixingCategoryPrototype>] private static readonly ProtoId<MixingCategoryPrototype> DefaultJuiceCategory = "DummyJuice";
private const string DefaultGrindCategory = "DummyGrind"; private static readonly ProtoId<MixingCategoryPrototype> DefaultCondenseCategory = "DummyCondense";
[ValidatePrototypeId<MixingCategoryPrototype>]
private const string DefaultJuiceCategory = "DummyJuice";
[ValidatePrototypeId<MixingCategoryPrototype>]
private const string DefaultCondenseCategory = "DummyCondense";
private readonly Dictionary<string, List<ReagentSourceData>> _reagentSources = new(); private readonly Dictionary<string, List<ReagentSourceData>> _reagentSources = new();

View File

@@ -27,8 +27,7 @@ public sealed partial class FlatpackCreatorMenu : FancyWindow
private EntityUid _owner; private EntityUid _owner;
[ValidatePrototypeId<EntityPrototype>] public static readonly EntProtoId NoBoardEffectId = "FlatpackerNoBoardEffect";
public const string NoBoardEffectId = "FlatpackerNoBoardEffect";
private EntityUid? _currentBoard = EntityUid.Invalid; private EntityUid? _currentBoard = EntityUid.Invalid;

View File

@@ -33,8 +33,7 @@ public sealed partial class CriminalRecordsConsoleWindow : FancyWindow
public readonly EntityUid Console; public readonly EntityUid Console;
[ValidatePrototypeId<LocalizedDatasetPrototype>] private static readonly ProtoId<LocalizedDatasetPrototype> ReasonPlaceholders = "CriminalRecordsWantedReasonPlaceholders";
private const string ReasonPlaceholders = "CriminalRecordsWantedReasonPlaceholders";
public Action<uint?>? OnKeySelected; public Action<uint?>? OnKeySelected;
public Action<StationRecordFilterType, string>? OnFiltersChanged; public Action<StationRecordFilterType, string>? OnFiltersChanged;
@@ -296,7 +295,7 @@ public sealed partial class CriminalRecordsConsoleWindow : FancyWindow
var field = "reason"; var field = "reason";
var title = Loc.GetString("criminal-records-status-" + status.ToString().ToLower()); var title = Loc.GetString("criminal-records-status-" + status.ToString().ToLower());
var placeholders = _proto.Index<LocalizedDatasetPrototype>(ReasonPlaceholders); var placeholders = _proto.Index(ReasonPlaceholders);
var placeholder = Loc.GetString("criminal-records-console-reason-placeholder", ("placeholder", _random.Pick(placeholders))); // just funny it doesn't actually get used var placeholder = Loc.GetString("criminal-records-console-reason-placeholder", ("placeholder", _random.Pick(placeholders))); // just funny it doesn't actually get used
var prompt = Loc.GetString("criminal-records-console-reason"); var prompt = Loc.GetString("criminal-records-console-reason");
var entry = new QuickDialogEntry(field, QuickDialogEntryType.LongText, prompt, placeholder); var entry = new QuickDialogEntry(field, QuickDialogEntryType.LongText, prompt, placeholder);

View File

@@ -21,8 +21,7 @@ namespace Content.Client.Guidebook.Controls;
[UsedImplicitly, GenerateTypedNameReferences] [UsedImplicitly, GenerateTypedNameReferences]
public sealed partial class GuideReagentReaction : BoxContainer, ISearchableControl public sealed partial class GuideReagentReaction : BoxContainer, ISearchableControl
{ {
[ValidatePrototypeId<MixingCategoryPrototype>] private static readonly ProtoId<MixingCategoryPrototype> DefaultMixingCategory = "DummyMix";
private const string DefaultMixingCategory = "DummyMix";
private readonly IPrototypeManager _protoMan; private readonly IPrototypeManager _protoMan;
@@ -55,7 +54,7 @@ public sealed partial class GuideReagentReaction : BoxContainer, ISearchableCont
} }
else else
{ {
mixingCategories.Add(protoMan.Index<MixingCategoryPrototype>(DefaultMixingCategory)); mixingCategories.Add(protoMan.Index(DefaultMixingCategory));
} }
SetMixingCategory(mixingCategories, prototype, sysMan); SetMixingCategory(mixingCategories, prototype, sysMan);
} }

View File

@@ -103,8 +103,7 @@ namespace Content.Client.Lobby.UI
private bool _isDirty; private bool _isDirty;
[ValidatePrototypeId<GuideEntryPrototype>] private static readonly ProtoId<GuideEntryPrototype> DefaultSpeciesGuidebook = "Species";
private const string DefaultSpeciesGuidebook = "Species";
public event Action<List<ProtoId<GuideEntryPrototype>>>? OnOpenGuidebook; public event Action<List<ProtoId<GuideEntryPrototype>>>? OnOpenGuidebook;
@@ -809,9 +808,9 @@ namespace Content.Client.Lobby.UI
var species = Profile?.Species ?? SharedHumanoidAppearanceSystem.DefaultSpecies; var species = Profile?.Species ?? SharedHumanoidAppearanceSystem.DefaultSpecies;
var page = DefaultSpeciesGuidebook; var page = DefaultSpeciesGuidebook;
if (_prototypeManager.HasIndex<GuideEntryPrototype>(species)) if (_prototypeManager.HasIndex<GuideEntryPrototype>(species))
page = species; page = new ProtoId<GuideEntryPrototype>(species.Id); // Gross. See above todo comment.
if (_prototypeManager.TryIndex<GuideEntryPrototype>(DefaultSpeciesGuidebook, out var guideRoot)) if (_prototypeManager.TryIndex(DefaultSpeciesGuidebook, out var guideRoot))
{ {
var dict = new Dictionary<ProtoId<GuideEntryPrototype>, GuideEntry>(); var dict = new Dictionary<ProtoId<GuideEntryPrototype>, GuideEntry>();
dict.Add(DefaultSpeciesGuidebook, guideRoot); dict.Add(DefaultSpeciesGuidebook, guideRoot);
@@ -1434,17 +1433,13 @@ namespace Content.Client.Lobby.UI
{ {
return; return;
} }
var hairMarking = Profile.Appearance.HairStyleId switch var hairMarking = Profile.Appearance.HairStyleId == HairStyles.DefaultHairStyle
{ ? new List<Marking>()
HairStyles.DefaultHairStyle => new List<Marking>(), : new() { new(Profile.Appearance.HairStyleId, new List<Color>() { Profile.Appearance.HairColor }) };
_ => new() { new(Profile.Appearance.HairStyleId, new List<Color>() { Profile.Appearance.HairColor }) },
};
var facialHairMarking = Profile.Appearance.FacialHairStyleId switch var facialHairMarking = Profile.Appearance.FacialHairStyleId == HairStyles.DefaultFacialHairStyle
{ ? new List<Marking>()
HairStyles.DefaultFacialHairStyle => new List<Marking>(), : new() { new(Profile.Appearance.FacialHairStyleId, new List<Color>() { Profile.Appearance.FacialHairColor }) };
_ => new() { new(Profile.Appearance.FacialHairStyleId, new List<Color>() { Profile.Appearance.FacialHairColor }) },
};
HairStylePicker.UpdateData( HairStylePicker.UpdateData(
hairMarking, hairMarking,

View File

@@ -23,8 +23,7 @@ public sealed class NetworkConfiguratorSystem : SharedNetworkConfiguratorSystem
[Dependency] private readonly ActionsSystem _actions = default!; [Dependency] private readonly ActionsSystem _actions = default!;
[Dependency] private readonly IInputManager _inputManager = default!; [Dependency] private readonly IInputManager _inputManager = default!;
[ValidatePrototypeId<EntityPrototype>] private static readonly EntProtoId Action = "ActionClearNetworkLinkOverlays";
private const string Action = "ActionClearNetworkLinkOverlays";
public override void Initialize() public override void Initialize()
{ {

View File

@@ -13,8 +13,7 @@ public sealed class ShowJobIconsSystem : EquipmentHudSystem<ShowJobIconsComponen
[Dependency] private readonly IPrototypeManager _prototype = default!; [Dependency] private readonly IPrototypeManager _prototype = default!;
[Dependency] private readonly AccessReaderSystem _accessReader = default!; [Dependency] private readonly AccessReaderSystem _accessReader = default!;
[ValidatePrototypeId<JobIconPrototype>] private static readonly ProtoId<JobIconPrototype> JobIconForNoId = "JobIconNoId";
private const string JobIconForNoId = "JobIconNoId";
public override void Initialize() public override void Initialize()
{ {
@@ -52,7 +51,7 @@ public sealed class ShowJobIconsSystem : EquipmentHudSystem<ShowJobIconsComponen
} }
} }
if (_prototype.TryIndex<JobIconPrototype>(iconId, out var iconPrototype)) if (_prototype.TryIndex(iconId, out var iconPrototype))
ev.StatusIcons.Add(iconPrototype); ev.StatusIcons.Add(iconPrototype);
else else
Log.Error($"Invalid job icon prototype: {iconPrototype}"); Log.Error($"Invalid job icon prototype: {iconPrototype}");

View File

@@ -14,8 +14,7 @@ public sealed class ParallaxSystem : SharedParallaxSystem
[Dependency] private readonly IParallaxManager _parallax = default!; [Dependency] private readonly IParallaxManager _parallax = default!;
[Dependency] private readonly SharedMapSystem _map = default!; [Dependency] private readonly SharedMapSystem _map = default!;
[ValidatePrototypeId<ParallaxPrototype>] private static readonly ProtoId<ParallaxPrototype> Fallback = "Default";
private const string Fallback = "Default";
public const int ParallaxZIndex = 0; public const int ParallaxZIndex = 0;

View File

@@ -15,8 +15,7 @@ namespace Content.Client.Power.Generation.Teg;
/// <seealso cref="TegCirculatorComponent"/> /// <seealso cref="TegCirculatorComponent"/>
public sealed class TegSystem : EntitySystem public sealed class TegSystem : EntitySystem
{ {
[ValidatePrototypeId<EntityPrototype>] private static readonly EntProtoId ArrowPrototype = "TegCirculatorArrow";
private const string ArrowPrototype = "TegCirculatorArrow";
public override void Initialize() public override void Initialize()
{ {

View File

@@ -25,7 +25,6 @@ public sealed partial class BorgSelectTypeMenu : FancyWindow
public event Action<ProtoId<BorgTypePrototype>>? ConfirmedBorgType; public event Action<ProtoId<BorgTypePrototype>>? ConfirmedBorgType;
[ValidatePrototypeId<GuideEntryPrototype>]
private static readonly List<ProtoId<GuideEntryPrototype>> GuidebookEntries = new() { "Cyborgs", "Robotics" }; private static readonly List<ProtoId<GuideEntryPrototype>> GuidebookEntries = new() { "Cyborgs", "Robotics" };
public BorgSelectTypeMenu() public BorgSelectTypeMenu()

View File

@@ -84,12 +84,13 @@ public sealed partial class LawDisplay : Control
radioChannelButton.OnPressed += _ => radioChannelButton.OnPressed += _ =>
{ {
switch (radioChannel) if (radioChannel == SharedChatSystem.CommonChannel)
{ {
case SharedChatSystem.CommonChannel: _chatManager.SendMessage($"{SharedChatSystem.RadioCommonPrefix} {lawIdentifierPlaintext}: {lawDescriptionPlaintext}", ChatSelectChannel.Radio);
_chatManager.SendMessage($"{SharedChatSystem.RadioCommonPrefix} {lawIdentifierPlaintext}: {lawDescriptionPlaintext}", ChatSelectChannel.Radio); break; }
default: else
_chatManager.SendMessage($"{SharedChatSystem.RadioChannelPrefix}{radioChannelProto.KeyCode} {lawIdentifierPlaintext}: {lawDescriptionPlaintext}", ChatSelectChannel.Radio); break; {
_chatManager.SendMessage($"{SharedChatSystem.RadioChannelPrefix}{radioChannelProto.KeyCode} {lawIdentifierPlaintext}: {lawDescriptionPlaintext}", ChatSelectChannel.Radio);
} }
_nextAllowedPress[radioChannelButton] = _timing.CurTime + PressCooldown; _nextAllowedPress[radioChannelButton] = _timing.CurTime + PressCooldown;
}; };

View File

@@ -12,7 +12,7 @@ namespace Content.Client.UserInterface.RichText;
/// </summary> /// </summary>
public sealed class MonoTag : IMarkupTag public sealed class MonoTag : IMarkupTag
{ {
[ValidatePrototypeId<FontPrototype>] public const string MonoFont = "Monospace"; public static readonly ProtoId<FontPrototype> MonoFont = "Monospace";
[Dependency] private readonly IResourceCache _resourceCache = default!; [Dependency] private readonly IResourceCache _resourceCache = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!; [Dependency] private readonly IPrototypeManager _prototypeManager = default!;

View File

@@ -67,8 +67,7 @@ public sealed partial class ChatUIController : UIController
[UISystemDependency] private readonly MindSystem? _mindSystem = default!; [UISystemDependency] private readonly MindSystem? _mindSystem = default!;
[UISystemDependency] private readonly RoleCodewordSystem? _roleCodewordSystem = default!; [UISystemDependency] private readonly RoleCodewordSystem? _roleCodewordSystem = default!;
[ValidatePrototypeId<ColorPalettePrototype>] private static readonly ProtoId<ColorPalettePrototype> ChatNamePalette = "ChatNames";
private const string ChatNamePalette = "ChatNames";
private string[] _chatNameColors = default!; private string[] _chatNameColors = default!;
private bool _chatNameColorsEnabled; private bool _chatNameColorsEnabled;
@@ -232,7 +231,7 @@ public sealed partial class ChatUIController : UIController
gameplayStateLoad.OnScreenLoad += OnScreenLoad; gameplayStateLoad.OnScreenLoad += OnScreenLoad;
gameplayStateLoad.OnScreenUnload += OnScreenUnload; gameplayStateLoad.OnScreenUnload += OnScreenUnload;
var nameColors = _prototypeManager.Index<ColorPalettePrototype>(ChatNamePalette).Colors.Values.ToArray(); var nameColors = _prototypeManager.Index(ChatNamePalette).Colors.Values.ToArray();
_chatNameColors = new string[nameColors.Length]; _chatNameColors = new string[nameColors.Length];
for (var i = 0; i < nameColors.Length; i++) for (var i = 0; i < nameColors.Length; i++)
{ {

View File

@@ -19,8 +19,7 @@ public sealed class InfoUIController : UIController, IOnStateExited<GameplayStat
private RulesPopup? _rulesPopup; private RulesPopup? _rulesPopup;
private RulesAndInfoWindow? _infoWindow; private RulesAndInfoWindow? _infoWindow;
[ValidatePrototypeId<GuideEntryPrototype>] private static readonly ProtoId<GuideEntryPrototype> DefaultRuleset = "DefaultRuleset";
private const string DefaultRuleset = "DefaultRuleset";
public ProtoId<GuideEntryPrototype> RulesEntryId = DefaultRuleset; public ProtoId<GuideEntryPrototype> RulesEntryId = DefaultRuleset;
@@ -92,7 +91,7 @@ public sealed class InfoUIController : UIController, IOnStateExited<GameplayStat
{ {
if (!_prototype.TryIndex(RulesEntryId, out var guideEntryPrototype)) if (!_prototype.TryIndex(RulesEntryId, out var guideEntryPrototype))
{ {
guideEntryPrototype = _prototype.Index<GuideEntryPrototype>(DefaultRuleset); guideEntryPrototype = _prototype.Index(DefaultRuleset);
Log.Error($"Couldn't find the following prototype: {RulesEntryId}. Falling back to {DefaultRuleset}, please check that the server has the rules set up correctly"); Log.Error($"Couldn't find the following prototype: {RulesEntryId}. Falling back to {DefaultRuleset}, please check that the server has the rules set up correctly");
return guideEntryPrototype; return guideEntryPrototype;
} }

View File

@@ -39,8 +39,7 @@ public sealed partial class GunSystem : SharedGunSystem
[Dependency] private readonly SharedTransformSystem _xform = default!; [Dependency] private readonly SharedTransformSystem _xform = default!;
[Dependency] private readonly SpriteSystem _sprite = default!; [Dependency] private readonly SpriteSystem _sprite = default!;
[ValidatePrototypeId<EntityPrototype>] public static readonly EntProtoId HitscanProto = "HitscanEffect";
public const string HitscanProto = "HitscanEffect";
public bool SpreadOverlay public bool SpreadOverlay
{ {

View File

@@ -4,7 +4,6 @@ using Content.Shared.Tag;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using Robust.Shared.Reflection; using Robust.Shared.Reflection;
using Robust.Shared.Serialization.Manager.Attributes;
namespace Content.IntegrationTests.Tests.Linter; namespace Content.IntegrationTests.Tests.Linter;
@@ -66,25 +65,25 @@ public sealed class StaticFieldValidationTest
[Reflect(false)] [Reflect(false)]
private sealed class StringValid private sealed class StringValid
{ {
[ValidatePrototypeId<TagPrototype>] public static string Tag = "StaticFieldTestTag"; public static readonly ProtoId<TagPrototype> Tag = "StaticFieldTestTag";
} }
[Reflect(false)] [Reflect(false)]
private sealed class StringInvalid private sealed class StringInvalid
{ {
[ValidatePrototypeId<TagPrototype>] public static string Tag = string.Empty; public static readonly ProtoId<TagPrototype> Tag = string.Empty;
} }
[Reflect(false)] [Reflect(false)]
private sealed class StringArrayValid private sealed class StringArrayValid
{ {
[ValidatePrototypeId<TagPrototype>] public static string[] Tag = ["StaticFieldTestTag", "StaticFieldTestTag"]; public static readonly ProtoId<TagPrototype>[] Tag = ["StaticFieldTestTag", "StaticFieldTestTag"];
} }
[Reflect(false)] [Reflect(false)]
private sealed class StringArrayInvalid private sealed class StringArrayInvalid
{ {
[ValidatePrototypeId<TagPrototype>] public static string[] Tag = [string.Empty, "StaticFieldTestTag", string.Empty]; public static readonly ProtoId<TagPrototype>[] Tag = [string.Empty, "StaticFieldTestTag", string.Empty];
} }
[Reflect(false)] [Reflect(false)]

View File

@@ -22,25 +22,14 @@ public sealed partial class AdminVerbSystem
[Dependency] private readonly GameTicker _gameTicker = default!; [Dependency] private readonly GameTicker _gameTicker = default!;
[Dependency] private readonly OutfitSystem _outfit = default!; [Dependency] private readonly OutfitSystem _outfit = default!;
[ValidatePrototypeId<EntityPrototype>] private static readonly EntProtoId DefaultTraitorRule = "Traitor";
private const string DefaultTraitorRule = "Traitor"; private static readonly EntProtoId DefaultInitialInfectedRule = "Zombie";
private static readonly EntProtoId DefaultNukeOpRule = "LoneOpsSpawn";
private static readonly EntProtoId DefaultRevsRule = "Revolutionary";
private static readonly EntProtoId DefaultThiefRule = "Thief";
private static readonly ProtoId<StartingGearPrototype> PirateGearId = "PirateGear";
[ValidatePrototypeId<EntityPrototype>] private static readonly EntProtoId ParadoxCloneRuleId = "ParadoxCloneSpawn";
private const string DefaultInitialInfectedRule = "Zombie";
[ValidatePrototypeId<EntityPrototype>]
private const string DefaultNukeOpRule = "LoneOpsSpawn";
[ValidatePrototypeId<EntityPrototype>]
private const string DefaultRevsRule = "Revolutionary";
[ValidatePrototypeId<EntityPrototype>]
private const string DefaultThiefRule = "Thief";
[ValidatePrototypeId<StartingGearPrototype>]
private const string PirateGearId = "PirateGear";
private readonly EntProtoId _paradoxCloneRuleId = "ParadoxCloneSpawn";
// All antag verbs have names so invokeverb works. // All antag verbs have names so invokeverb works.
private void AddAntagVerbs(GetVerbsEvent<Verb> args) private void AddAntagVerbs(GetVerbsEvent<Verb> args)
@@ -172,7 +161,7 @@ public sealed partial class AdminVerbSystem
Icon = new SpriteSpecifier.Rsi(new("/Textures/Interface/Misc/job_icons.rsi"), "ParadoxClone"), Icon = new SpriteSpecifier.Rsi(new("/Textures/Interface/Misc/job_icons.rsi"), "ParadoxClone"),
Act = () => Act = () =>
{ {
var ruleEnt = _gameTicker.AddGameRule(_paradoxCloneRuleId); var ruleEnt = _gameTicker.AddGameRule(ParadoxCloneRuleId);
if (!TryComp<ParadoxCloneRuleComponent>(ruleEnt, out var paradoxCloneRuleComp)) if (!TryComp<ParadoxCloneRuleComponent>(ruleEnt, out var paradoxCloneRuleComp))
return; return;

View File

@@ -44,8 +44,7 @@ public sealed partial class AnomalySystem : SharedAnomalySystem
public const float MinParticleVariation = 0.8f; public const float MinParticleVariation = 0.8f;
public const float MaxParticleVariation = 1.2f; public const float MaxParticleVariation = 1.2f;
[ValidatePrototypeId<WeightedRandomPrototype>] private static readonly ProtoId<WeightedRandomPrototype> WeightListProto = "AnomalyBehaviorList";
const string WeightListProto = "AnomalyBehaviorList";
/// <inheritdoc/> /// <inheritdoc/>
public override void Initialize() public override void Initialize()
@@ -189,7 +188,7 @@ public sealed partial class AnomalySystem : SharedAnomalySystem
#region Behavior #region Behavior
private string GetRandomBehavior() private string GetRandomBehavior()
{ {
var weightList = _prototype.Index<WeightedRandomPrototype>(WeightListProto); var weightList = _prototype.Index(WeightListProto);
return weightList.Pick(_random); return weightList.Pick(_random);
} }

View File

@@ -17,8 +17,7 @@ namespace Content.Server.Body.Commands
[Dependency] private readonly IPrototypeManager _protoManager = default!; [Dependency] private readonly IPrototypeManager _protoManager = default!;
[Dependency] private readonly IRobustRandom _random = default!; [Dependency] private readonly IRobustRandom _random = default!;
[ValidatePrototypeId<EntityPrototype>] private static readonly EntProtoId DefaultHandPrototype = "LeftHandHuman";
public const string DefaultHandPrototype = "LeftHandHuman";
public string Command => "addhand"; public string Command => "addhand";
public string Description => "Adds a hand to your entity."; public string Description => "Adds a hand to your entity.";

View File

@@ -29,8 +29,7 @@ public sealed partial class CargoSystem
[Dependency] private readonly NameIdentifierSystem _nameIdentifier = default!; [Dependency] private readonly NameIdentifierSystem _nameIdentifier = default!;
[Dependency] private readonly EntityWhitelistSystem _whitelistSys = default!; [Dependency] private readonly EntityWhitelistSystem _whitelistSys = default!;
[ValidatePrototypeId<NameIdentifierGroupPrototype>] private static readonly ProtoId<NameIdentifierGroupPrototype> BountyNameIdentifierGroup = "Bounty";
private const string BountyNameIdentifierGroup = "Bounty";
private EntityQuery<StackComponent> _stackQuery; private EntityQuery<StackComponent> _stackQuery;
private EntityQuery<ContainerManagerComponent> _containerQuery; private EntityQuery<ContainerManagerComponent> _containerQuery;

View File

@@ -16,8 +16,7 @@ public sealed class CrewManifestCartridgeSystem : EntitySystem
[Dependency] private readonly CrewManifestSystem _crewManifest = default!; [Dependency] private readonly CrewManifestSystem _crewManifest = default!;
[Dependency] private readonly StationSystem _stationSystem = default!; [Dependency] private readonly StationSystem _stationSystem = default!;
[ValidatePrototypeId<EntityPrototype>] private static readonly EntProtoId CartridgePrototypeName = "CrewManifestCartridge";
private const string CartridgePrototypeName = "CrewManifestCartridge";
/// <summary> /// <summary>
/// Flag that shows that if crew manifest is allowed to be viewed from 'unsecure' entities, /// Flag that shows that if crew manifest is allowed to be viewed from 'unsecure' entities,

View File

@@ -809,8 +809,7 @@ public sealed partial class ChatSystem : SharedChatSystem
return message; return message;
} }
[ValidatePrototypeId<ReplacementAccentPrototype>] public static readonly ProtoId<ReplacementAccentPrototype> ChatSanitize_Accent = "chatsanitize";
public const string ChatSanitize_Accent = "chatsanitize";
public string SanitizeMessageReplaceWords(string message) public string SanitizeMessageReplaceWords(string message)
{ {

View File

@@ -39,8 +39,7 @@ namespace Content.Server.Chemistry.EntitySystems
[Dependency] private readonly LabelSystem _labelSystem = default!; [Dependency] private readonly LabelSystem _labelSystem = default!;
[Dependency] private readonly ISharedAdminLogManager _adminLogger = default!; [Dependency] private readonly ISharedAdminLogManager _adminLogger = default!;
[ValidatePrototypeId<EntityPrototype>] private static readonly EntProtoId PillPrototypeId = "Pill";
private const string PillPrototypeId = "Pill";
public override void Initialize() public override void Initialize()
{ {

View File

@@ -6,6 +6,7 @@ using Robust.Shared.Console;
using Robust.Shared.Map; using Robust.Shared.Map;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;
using Robust.Shared.Map.Components; using Robust.Shared.Map.Components;
using Robust.Shared.Prototypes;
namespace Content.Server.Construction.Commands; namespace Content.Server.Construction.Commands;
@@ -20,12 +21,9 @@ public sealed class TileWallsCommand : IConsoleCommand
public string Description => "Puts an underplating tile below every wall on a grid."; public string Description => "Puts an underplating tile below every wall on a grid.";
public string Help => $"Usage: {Command} <gridId> | {Command}"; public string Help => $"Usage: {Command} <gridId> | {Command}";
[ValidatePrototypeId<ContentTileDefinition>] public static readonly ProtoId<ContentTileDefinition> TilePrototypeId = "Plating";
public const string TilePrototypeId = "Plating"; public static readonly ProtoId<TagPrototype> WallTag = "Wall";
public static readonly ProtoId<TagPrototype> DiagonalTag = "Diagonal";
[ValidatePrototypeId<TagPrototype>]
public const string WallTag = "Wall";
public const string DiagonalTag = "Diagonal";
public void Execute(IConsoleShell shell, string argStr, string[] args) public void Execute(IConsoleShell shell, string argStr, string[] args)
{ {

View File

@@ -2,6 +2,7 @@ using Content.Server.Administration;
using Content.Shared.Administration; using Content.Shared.Administration;
using Content.Shared.StatusEffect; using Content.Shared.StatusEffect;
using Robust.Shared.Console; using Robust.Shared.Console;
using Robust.Shared.Prototypes;
namespace Content.Server.Electrocution; namespace Content.Server.Electrocution;
@@ -13,8 +14,7 @@ public sealed class ElectrocuteCommand : LocalizedEntityCommands
public override string Command => "electrocute"; public override string Command => "electrocute";
[ValidatePrototypeId<StatusEffectPrototype>] private static readonly ProtoId<StatusEffectPrototype> ElectrocutionStatusEffect = "Electrocution";
private const string ElectrocutionStatusEffect = "Electrocution";
public override void Execute(IConsoleShell shell, string argStr, string[] args) public override void Execute(IConsoleShell shell, string argStr, string[] args)
{ {

View File

@@ -58,12 +58,8 @@ public sealed class ElectrocutionSystem : SharedElectrocutionSystem
[Dependency] private readonly MetaDataSystem _metaData = default!; [Dependency] private readonly MetaDataSystem _metaData = default!;
[Dependency] private readonly TurfSystem _turf = default!; [Dependency] private readonly TurfSystem _turf = default!;
[ValidatePrototypeId<StatusEffectPrototype>] private static readonly ProtoId<StatusEffectPrototype> StatusEffectKey = "Electrocution";
private const string StatusEffectKey = "Electrocution"; private static readonly ProtoId<DamageTypePrototype> DamageType = "Shock";
[ValidatePrototypeId<DamageTypePrototype>]
private const string DamageType = "Shock";
private static readonly ProtoId<TagPrototype> WindowTag = "Window"; private static readonly ProtoId<TagPrototype> WindowTag = "Window";
// Multiply and shift the log scale for shock damage. // Multiply and shift the log scale for shock damage.
@@ -408,7 +404,7 @@ public sealed class ElectrocutionSystem : SharedElectrocutionSystem
if (shockDamage is { } dmg) if (shockDamage is { } dmg)
{ {
var actual = _damageable.TryChangeDamage(uid, var actual = _damageable.TryChangeDamage(uid,
new DamageSpecifier(_prototypeManager.Index<DamageTypePrototype>(DamageType), dmg), origin: sourceUid); new DamageSpecifier(_prototypeManager.Index(DamageType), dmg), origin: sourceUid);
if (actual != null) if (actual != null)
{ {

View File

@@ -70,14 +70,13 @@ public sealed partial class ExplosionSystem : SharedExplosionSystem
/// find errors. However some components, like rogue arrows, or some commands like the admin-smite need to have /// find errors. However some components, like rogue arrows, or some commands like the admin-smite need to have
/// a "default" option specified outside of yaml data-fields. Hence this const string. /// a "default" option specified outside of yaml data-fields. Hence this const string.
/// </remarks> /// </remarks>
[ValidatePrototypeId<ExplosionPrototype>] public static readonly ProtoId<ExplosionPrototype> DefaultExplosionPrototypeId = "Default";
public const string DefaultExplosionPrototypeId = "Default";
public override void Initialize() public override void Initialize()
{ {
base.Initialize(); base.Initialize();
DebugTools.Assert(_prototypeManager.HasIndex<ExplosionPrototype>(DefaultExplosionPrototypeId)); DebugTools.Assert(_prototypeManager.HasIndex(DefaultExplosionPrototypeId));
// handled in ExplosionSystem.GridMap.cs // handled in ExplosionSystem.GridMap.cs
SubscribeLocalEvent<GridRemovalEvent>(OnGridRemoved); SubscribeLocalEvent<GridRemovalEvent>(OnGridRemoved);

View File

@@ -60,16 +60,11 @@ public sealed partial class PuddleSystem : SharedPuddleSystem
[Dependency] private readonly SharedTransformSystem _transform = default!; [Dependency] private readonly SharedTransformSystem _transform = default!;
[Dependency] private readonly TurfSystem _turf = default!; [Dependency] private readonly TurfSystem _turf = default!;
[ValidatePrototypeId<ReagentPrototype>] private static readonly ProtoId<ReagentPrototype> Blood = "Blood";
private const string Blood = "Blood"; private static readonly ProtoId<ReagentPrototype> Slime = "Slime";
private static readonly ProtoId<ReagentPrototype> CopperBlood = "CopperBlood";
[ValidatePrototypeId<ReagentPrototype>] private static readonly string[] StandoutReagents = [Blood, Slime, CopperBlood];
private const string Slime = "Slime";
[ValidatePrototypeId<ReagentPrototype>]
private const string CopperBlood = "CopperBlood";
private static string[] _standoutReagents = [Blood, Slime, CopperBlood];
// Using local deletion queue instead of the standard queue so that we can easily "undelete" if a puddle // Using local deletion queue instead of the standard queue so that we can easily "undelete" if a puddle
// loses & then gains reagents in a single tick. // loses & then gains reagents in a single tick.
@@ -362,10 +357,10 @@ public sealed partial class PuddleSystem : SharedPuddleSystem
// Kinda EH // Kinda EH
// Could potentially do alpha per-solution but future problem. // Could potentially do alpha per-solution but future problem.
color = solution.GetColorWithout(_prototypeManager, _standoutReagents); color = solution.GetColorWithout(_prototypeManager, StandoutReagents);
color = color.WithAlpha(0.7f); color = color.WithAlpha(0.7f);
foreach (var standout in _standoutReagents) foreach (var standout in StandoutReagents)
{ {
var quantity = solution.GetTotalPrototypeQuantity(standout); var quantity = solution.GetTotalPrototypeQuantity(standout);
if (quantity <= FixedPoint2.Zero) if (quantity <= FixedPoint2.Zero)

View File

@@ -36,11 +36,8 @@ namespace Content.Server.GameTicking
[Dependency] private readonly SharedJobSystem _jobs = default!; [Dependency] private readonly SharedJobSystem _jobs = default!;
[Dependency] private readonly AdminSystem _admin = default!; [Dependency] private readonly AdminSystem _admin = default!;
[ValidatePrototypeId<EntityPrototype>] public static readonly EntProtoId ObserverPrototypeName = "MobObserver";
public const string ObserverPrototypeName = "MobObserver"; public static readonly EntProtoId AdminObserverPrototypeName = "AdminObserver";
[ValidatePrototypeId<EntityPrototype>]
public const string AdminObserverPrototypeName = "AdminObserver";
/// <summary> /// <summary>
/// How many players have joined the round through normal methods. /// How many players have joined the round through normal methods.

View File

@@ -93,7 +93,7 @@ namespace Content.Server.GameTicking
InitializePlayer(); InitializePlayer();
InitializeLobbyBackground(); InitializeLobbyBackground();
InitializeGamePreset(); InitializeGamePreset();
DebugTools.Assert(_prototypeManager.Index<JobPrototype>(FallbackOverflowJob).Name == FallbackOverflowJobName, DebugTools.Assert(_prototypeManager.Index(FallbackOverflowJob).Name == FallbackOverflowJobName,
"Overflow role does not have the correct name!"); "Overflow role does not have the correct name!");
InitializeGameRules(); InitializeGameRules();
InitializeReplays(); InitializeReplays();

View File

@@ -25,6 +25,7 @@ using Robust.Shared.Random;
using Robust.Shared.Utility; using Robust.Shared.Utility;
using System.Linq; using System.Linq;
using Content.Shared.Store.Components; using Content.Shared.Store.Components;
using Robust.Shared.Prototypes;
namespace Content.Server.GameTicking.Rules; namespace Content.Server.GameTicking.Rules;
@@ -38,11 +39,8 @@ public sealed class NukeopsRuleSystem : GameRuleSystem<NukeopsRuleComponent>
[Dependency] private readonly StoreSystem _store = default!; [Dependency] private readonly StoreSystem _store = default!;
[Dependency] private readonly TagSystem _tag = default!; [Dependency] private readonly TagSystem _tag = default!;
[ValidatePrototypeId<CurrencyPrototype>] private static readonly ProtoId<CurrencyPrototype> TelecrystalCurrencyPrototype = "Telecrystal";
private const string TelecrystalCurrencyPrototype = "Telecrystal"; private static readonly ProtoId<TagPrototype> NukeOpsUplinkTagPrototype = "NukeOpsUplink";
[ValidatePrototypeId<TagPrototype>]
private const string NukeOpsUplinkTagPrototype = "NukeOpsUplink";
public override void Initialize() public override void Initialize()

View File

@@ -70,8 +70,7 @@ namespace Content.Server.Kitchen.EntitySystems
[Dependency] private readonly IAdminLogManager _adminLogger = default!; [Dependency] private readonly IAdminLogManager _adminLogger = default!;
[Dependency] private readonly SharedSuicideSystem _suicide = default!; [Dependency] private readonly SharedSuicideSystem _suicide = default!;
[ValidatePrototypeId<EntityPrototype>] private static readonly EntProtoId MalfunctionSpark = "Spark";
private const string MalfunctionSpark = "Spark";
private static readonly ProtoId<TagPrototype> MetalTag = "Metal"; private static readonly ProtoId<TagPrototype> MetalTag = "Metal";
private static readonly ProtoId<TagPrototype> PlasticTag = "Plastic"; private static readonly ProtoId<TagPrototype> PlasticTag = "Plastic";

View File

@@ -146,7 +146,7 @@ namespace Content.Server.Mapping
// map successfully created. run misc helpful mapping commands // map successfully created. run misc helpful mapping commands
if (player.AttachedEntity is { Valid: true } playerEntity && if (player.AttachedEntity is { Valid: true } playerEntity &&
EntityManager.GetComponent<MetaDataComponent>(playerEntity).EntityPrototype?.ID != GameTicker.AdminObserverPrototypeName) (EntityManager.GetComponent<MetaDataComponent>(playerEntity).EntityPrototype is not { } proto || proto != GameTicker.AdminObserverPrototypeName))
{ {
shell.ExecuteCommand("aghost"); shell.ExecuteCommand("aghost");
} }

View File

@@ -17,9 +17,9 @@ using Content.Shared.Interaction;
using Content.Shared.Interaction.Events; using Content.Shared.Interaction.Events;
using Content.Shared.Inventory; using Content.Shared.Inventory;
using Content.Shared.Jittering; using Content.Shared.Jittering;
using Content.Shared.Materials;
using Content.Shared.Medical; using Content.Shared.Medical;
using Content.Shared.Mind; using Content.Shared.Mind;
using Content.Shared.Materials;
using Content.Shared.Mobs.Components; using Content.Shared.Mobs.Components;
using Content.Shared.Mobs.Systems; using Content.Shared.Mobs.Systems;
using Content.Shared.Nutrition.Components; using Content.Shared.Nutrition.Components;
@@ -30,6 +30,7 @@ using Robust.Server.Player;
using Robust.Shared.Audio.Systems; using Robust.Shared.Audio.Systems;
using Robust.Shared.Configuration; using Robust.Shared.Configuration;
using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Components;
using Robust.Shared.Prototypes;
using Robust.Shared.Random; using Robust.Shared.Random;
namespace Content.Server.Medical.BiomassReclaimer namespace Content.Server.Medical.BiomassReclaimer
@@ -53,8 +54,7 @@ namespace Content.Server.Medical.BiomassReclaimer
[Dependency] private readonly SharedMindSystem _minds = default!; [Dependency] private readonly SharedMindSystem _minds = default!;
[Dependency] private readonly InventorySystem _inventory = default!; [Dependency] private readonly InventorySystem _inventory = default!;
[ValidatePrototypeId<MaterialPrototype>] public static readonly ProtoId<MaterialPrototype> BiomassPrototype = "Biomass";
public const string BiomassPrototype = "Biomass";
public override void Update(float frameTime) public override void Update(float frameTime)
{ {

View File

@@ -32,8 +32,7 @@ namespace Content.Server.Medical
[Dependency] private readonly ForensicsSystem _forensics = default!; [Dependency] private readonly ForensicsSystem _forensics = default!;
[Dependency] private readonly BloodstreamSystem _bloodstream = default!; [Dependency] private readonly BloodstreamSystem _bloodstream = default!;
[ValidatePrototypeId<SoundCollectionPrototype>] private static readonly ProtoId<SoundCollectionPrototype> VomitCollection = "Vomit";
private const string VomitCollection = "Vomit";
private readonly SoundSpecifier _vomitSound = new SoundCollectionSpecifier(VomitCollection, private readonly SoundSpecifier _vomitSound = new SoundCollectionSpecifier(VomitCollection,
AudioParams.Default.WithVariation(0.2f).WithVolume(-4f)); AudioParams.Default.WithVariation(0.2f).WithVolume(-4f));

View File

@@ -54,8 +54,7 @@ public sealed partial class DungeonSystem : SharedDungeonSystem
private readonly JobQueue _dungeonJobQueue = new(DungeonJobTime); private readonly JobQueue _dungeonJobQueue = new(DungeonJobTime);
private readonly Dictionary<DungeonJob.DungeonJob, CancellationTokenSource> _dungeonJobs = new(); private readonly Dictionary<DungeonJob.DungeonJob, CancellationTokenSource> _dungeonJobs = new();
[ValidatePrototypeId<ContentTileDefinition>] public static readonly ProtoId<ContentTileDefinition> FallbackTileId = "FloorSteel";
public const string FallbackTileId = "FloorSteel";
public override void Initialize() public override void Initialize()
{ {

View File

@@ -47,8 +47,7 @@ public sealed partial class RevenantSystem : EntitySystem
[Dependency] private readonly VisibilitySystem _visibility = default!; [Dependency] private readonly VisibilitySystem _visibility = default!;
[Dependency] private readonly TurfSystem _turf = default!; [Dependency] private readonly TurfSystem _turf = default!;
[ValidatePrototypeId<EntityPrototype>] private static readonly EntProtoId RevenantShopId = "ActionRevenantShop";
private const string RevenantShopId = "ActionRevenantShop";
public override void Initialize() public override void Initialize()
{ {

View File

@@ -8,6 +8,7 @@ using Content.Shared.Radio;
using Content.Shared.Salvage.Magnet; using Content.Shared.Salvage.Magnet;
using Robust.Shared.Exceptions; using Robust.Shared.Exceptions;
using Robust.Shared.Map; using Robust.Shared.Map;
using Robust.Shared.Prototypes;
namespace Content.Server.Salvage; namespace Content.Server.Salvage;
@@ -15,8 +16,7 @@ public sealed partial class SalvageSystem
{ {
[Dependency] private readonly IRuntimeLog _runtimeLog = default!; [Dependency] private readonly IRuntimeLog _runtimeLog = default!;
[ValidatePrototypeId<RadioChannelPrototype>] private static readonly ProtoId<RadioChannelPrototype> MagnetChannel = "Supply";
private const string MagnetChannel = "Supply";
private EntityQuery<SalvageMobRestrictionsComponent> _salvMobQuery; private EntityQuery<SalvageMobRestrictionsComponent> _salvMobQuery;
private EntityQuery<MobStateComponent> _mobStateQuery; private EntityQuery<MobStateComponent> _mobStateQuery;

View File

@@ -255,7 +255,7 @@ public sealed class SpawnSalvageMissionJob : Job<bool>
} }
} }
var allLoot = _prototypeManager.Index<SalvageLootPrototype>(SharedSalvageSystem.ExpeditionsLootProto); var allLoot = _prototypeManager.Index(SharedSalvageSystem.ExpeditionsLootProto);
var lootBudget = difficultyProto.LootBudget; var lootBudget = difficultyProto.LootBudget;
foreach (var rule in allLoot.LootRules) foreach (var rule in allLoot.LootRules)

View File

@@ -25,11 +25,8 @@ public sealed class FTLDiskCommand : LocalizedCommands
public override string Command => "ftldisk"; public override string Command => "ftldisk";
[ValidatePrototypeId<EntityPrototype>] public static readonly EntProtoId CoordinatesDisk = "CoordinatesDisk";
public const string CoordinatesDisk = "CoordinatesDisk"; public static readonly EntProtoId DiskCase = "DiskCase";
[ValidatePrototypeId<EntityPrototype>]
public const string DiskCase = "DiskCase";
public override void Execute(IConsoleShell shell, string argStr, string[] args) public override void Execute(IConsoleShell shell, string argStr, string[] args)
{ {
if (args.Length == 0) if (args.Length == 0)

View File

@@ -6,6 +6,7 @@ using Content.Shared.Access;
using Content.Shared.CCVar; using Content.Shared.CCVar;
using Content.Shared.Database; using Content.Shared.Database;
using Content.Shared.DeviceNetwork; using Content.Shared.DeviceNetwork;
using Content.Shared.DeviceNetwork.Components;
using Content.Shared.Popups; using Content.Shared.Popups;
using Content.Shared.Shuttles.BUIStates; using Content.Shared.Shuttles.BUIStates;
using Content.Shared.Shuttles.Events; using Content.Shared.Shuttles.Events;
@@ -13,7 +14,7 @@ using Content.Shared.Shuttles.Systems;
using Content.Shared.UserInterface; using Content.Shared.UserInterface;
using Robust.Shared.Map; using Robust.Shared.Map;
using Robust.Shared.Player; using Robust.Shared.Player;
using Content.Shared.DeviceNetwork.Components; using Robust.Shared.Prototypes;
using Timer = Robust.Shared.Timing.Timer; using Timer = Robust.Shared.Timing.Timer;
namespace Content.Server.Shuttles.Systems; namespace Content.Server.Shuttles.Systems;
@@ -65,8 +66,7 @@ public sealed partial class EmergencyShuttleSystem
private CancellationTokenSource? _roundEndCancelToken; private CancellationTokenSource? _roundEndCancelToken;
[ValidatePrototypeId<AccessLevelPrototype>] private static readonly ProtoId<AccessLevelPrototype> EmergencyRepealAllAccess = "EmergencyShuttleRepealAll";
private const string EmergencyRepealAllAccess = "EmergencyShuttleRepealAll";
private static readonly Color DangerColor = Color.Red; private static readonly Color DangerColor = Color.Red;
/// <summary> /// <summary>

View File

@@ -21,6 +21,7 @@ using Content.Shared.Access.Systems;
using Content.Shared.CCVar; using Content.Shared.CCVar;
using Content.Shared.Database; using Content.Shared.Database;
using Content.Shared.DeviceNetwork; using Content.Shared.DeviceNetwork;
using Content.Shared.DeviceNetwork.Components;
using Content.Shared.GameTicking; using Content.Shared.GameTicking;
using Content.Shared.Localizations; using Content.Shared.Localizations;
using Content.Shared.Shuttles.Components; using Content.Shared.Shuttles.Components;
@@ -33,10 +34,10 @@ using Robust.Shared.Configuration;
using Robust.Shared.EntitySerialization.Systems; using Robust.Shared.EntitySerialization.Systems;
using Robust.Shared.Map.Components; using Robust.Shared.Map.Components;
using Robust.Shared.Player; using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Random; using Robust.Shared.Random;
using Robust.Shared.Timing; using Robust.Shared.Timing;
using Robust.Shared.Utility; using Robust.Shared.Utility;
using Content.Shared.DeviceNetwork.Components;
namespace Content.Server.Shuttles.Systems; namespace Content.Server.Shuttles.Systems;
@@ -73,8 +74,7 @@ public sealed partial class EmergencyShuttleSystem : EntitySystem
private bool _emergencyShuttleEnabled; private bool _emergencyShuttleEnabled;
[ValidatePrototypeId<TagPrototype>] private static readonly ProtoId<TagPrototype> DockTag = "DockEmergency";
private const string DockTag = "DockEmergency";
public override void Initialize() public override void Initialize()
{ {

View File

@@ -1,12 +1,14 @@
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using Content.Server.Actions; using Content.Server.Actions;
using Content.Server.Administration.Logs; using Content.Server.Administration.Logs;
using Content.Server.Administration.Managers; using Content.Server.Administration.Managers;
using Content.Shared.Body.Events;
using Content.Server.DeviceNetwork.Systems; using Content.Server.DeviceNetwork.Systems;
using Content.Server.Explosion.EntitySystems; using Content.Server.Explosion.EntitySystems;
using Content.Server.Hands.Systems; using Content.Server.Hands.Systems;
using Content.Server.PowerCell; using Content.Server.PowerCell;
using Content.Shared.Alert; using Content.Shared.Alert;
using Content.Shared.Body.Events;
using Content.Shared.Database; using Content.Shared.Database;
using Content.Shared.IdentityManagement; using Content.Shared.IdentityManagement;
using Content.Shared.Interaction; using Content.Shared.Interaction;
@@ -29,10 +31,9 @@ using Robust.Server.GameObjects;
using Robust.Shared.Configuration; using Robust.Shared.Configuration;
using Robust.Shared.Containers; using Robust.Shared.Containers;
using Robust.Shared.Player; using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Random; using Robust.Shared.Random;
using Robust.Shared.Timing; using Robust.Shared.Timing;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
namespace Content.Server.Silicons.Borgs; namespace Content.Server.Silicons.Borgs;
@@ -61,8 +62,7 @@ public sealed partial class BorgSystem : SharedBorgSystem
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!; [Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
[Dependency] private readonly ISharedPlayerManager _player = default!; [Dependency] private readonly ISharedPlayerManager _player = default!;
[ValidatePrototypeId<JobPrototype>] public static readonly ProtoId<JobPrototype> BorgJobId = "Borg";
public const string BorgJobId = "Borg";
/// <inheritdoc/> /// <inheritdoc/>
public override void Initialize() public override void Initialize()

View File

@@ -22,42 +22,24 @@ public sealed class IonStormSystem : EntitySystem
[Dependency] private readonly IRobustRandom _robustRandom = default!; [Dependency] private readonly IRobustRandom _robustRandom = default!;
// funny // funny
[ValidatePrototypeId<DatasetPrototype>] private static readonly ProtoId<DatasetPrototype> Threats = "IonStormThreats";
private const string Threats = "IonStormThreats"; private static readonly ProtoId<DatasetPrototype> Objects = "IonStormObjects";
[ValidatePrototypeId<DatasetPrototype>] private static readonly ProtoId<DatasetPrototype> Crew = "IonStormCrew";
private const string Objects = "IonStormObjects"; private static readonly ProtoId<DatasetPrototype> Adjectives = "IonStormAdjectives";
[ValidatePrototypeId<DatasetPrototype>] private static readonly ProtoId<DatasetPrototype> Verbs = "IonStormVerbs";
private const string Crew = "IonStormCrew"; private static readonly ProtoId<DatasetPrototype> NumberBase = "IonStormNumberBase";
[ValidatePrototypeId<DatasetPrototype>] private static readonly ProtoId<DatasetPrototype> NumberMod = "IonStormNumberMod";
private const string Adjectives = "IonStormAdjectives"; private static readonly ProtoId<DatasetPrototype> Areas = "IonStormAreas";
[ValidatePrototypeId<DatasetPrototype>] private static readonly ProtoId<DatasetPrototype> Feelings = "IonStormFeelings";
private const string Verbs = "IonStormVerbs"; private static readonly ProtoId<DatasetPrototype> FeelingsPlural = "IonStormFeelingsPlural";
[ValidatePrototypeId<DatasetPrototype>] private static readonly ProtoId<DatasetPrototype> Musts = "IonStormMusts";
private const string NumberBase = "IonStormNumberBase"; private static readonly ProtoId<DatasetPrototype> Requires = "IonStormRequires";
[ValidatePrototypeId<DatasetPrototype>] private static readonly ProtoId<DatasetPrototype> Actions = "IonStormActions";
private const string NumberMod = "IonStormNumberMod"; private static readonly ProtoId<DatasetPrototype> Allergies = "IonStormAllergies";
[ValidatePrototypeId<DatasetPrototype>] private static readonly ProtoId<DatasetPrototype> AllergySeverities = "IonStormAllergySeverities";
private const string Areas = "IonStormAreas"; private static readonly ProtoId<DatasetPrototype> Concepts = "IonStormConcepts";
[ValidatePrototypeId<DatasetPrototype>] private static readonly ProtoId<DatasetPrototype> Drinks = "IonStormDrinks";
private const string Feelings = "IonStormFeelings"; private static readonly ProtoId<DatasetPrototype> Foods = "IonStormFoods";
[ValidatePrototypeId<DatasetPrototype>]
private const string FeelingsPlural = "IonStormFeelingsPlural";
[ValidatePrototypeId<DatasetPrototype>]
private const string Musts = "IonStormMusts";
[ValidatePrototypeId<DatasetPrototype>]
private const string Requires = "IonStormRequires";
[ValidatePrototypeId<DatasetPrototype>]
private const string Actions = "IonStormActions";
[ValidatePrototypeId<DatasetPrototype>]
private const string Allergies = "IonStormAllergies";
[ValidatePrototypeId<DatasetPrototype>]
private const string AllergySeverities = "IonStormAllergySeverities";
[ValidatePrototypeId<DatasetPrototype>]
private const string Concepts = "IonStormConcepts";
[ValidatePrototypeId<DatasetPrototype>]
private const string Drinks = "IonStormDrinks";
[ValidatePrototypeId<DatasetPrototype>]
private const string Foods = "IonStormFoods";
/// <summary> /// <summary>
/// Randomly alters the laws of an individual silicon. /// Randomly alters the laws of an individual silicon.

View File

@@ -3,6 +3,7 @@ using System.Text.RegularExpressions;
using Content.Shared.Speech.Components; using Content.Shared.Speech.Components;
using Content.Shared.Speech.EntitySystems; using Content.Shared.Speech.EntitySystems;
using Content.Shared.StatusEffect; using Content.Shared.StatusEffect;
using Robust.Shared.Prototypes;
namespace Content.Server.Speech.EntitySystems; namespace Content.Server.Speech.EntitySystems;
@@ -10,9 +11,7 @@ public sealed class RatvarianLanguageSystem : SharedRatvarianLanguageSystem
{ {
[Dependency] private readonly StatusEffectsSystem _statusEffects = default!; [Dependency] private readonly StatusEffectsSystem _statusEffects = default!;
private static readonly ProtoId<StatusEffectPrototype> RatvarianKey = "RatvarianLanguage";
[ValidatePrototypeId<StatusEffectPrototype>]
private const string RatvarianKey = "RatvarianLanguage";
// This is the word of Ratvar and those who speak it shall abide by His rules: // This is the word of Ratvar and those who speak it shall abide by His rules:
/* /*

View File

@@ -3,6 +3,7 @@ using Content.Server.Speech.Components;
using Content.Shared.Drunk; using Content.Shared.Drunk;
using Content.Shared.Speech.EntitySystems; using Content.Shared.Speech.EntitySystems;
using Content.Shared.StatusEffect; using Content.Shared.StatusEffect;
using Robust.Shared.Prototypes;
using Robust.Shared.Random; using Robust.Shared.Random;
using Robust.Shared.Timing; using Robust.Shared.Timing;
@@ -14,10 +15,7 @@ public sealed class SlurredSystem : SharedSlurredSystem
[Dependency] private readonly IRobustRandom _random = default!; [Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly IGameTiming _timing = default!; [Dependency] private readonly IGameTiming _timing = default!;
private static readonly ProtoId<StatusEffectPrototype> SlurKey = "SlurredSpeech";
[ValidatePrototypeId<StatusEffectPrototype>]
private const string SlurKey = "SlurredSpeech";
public override void Initialize() public override void Initialize()
{ {

View File

@@ -1,5 +1,6 @@
using Content.Shared.Damage; using Content.Shared.Damage;
using Content.Shared.Spreader; using Content.Shared.Spreader;
using Robust.Shared.Prototypes;
using Robust.Shared.Random; using Robust.Shared.Random;
using Robust.Shared.Timing; using Robust.Shared.Timing;
using Robust.Shared.Utility; using Robust.Shared.Utility;
@@ -14,8 +15,7 @@ public sealed class KudzuSystem : EntitySystem
[Dependency] private readonly SharedAppearanceSystem _appearance = default!; [Dependency] private readonly SharedAppearanceSystem _appearance = default!;
[Dependency] private readonly DamageableSystem _damageable = default!; [Dependency] private readonly DamageableSystem _damageable = default!;
[ValidatePrototypeId<EdgeSpreaderPrototype>] private static readonly ProtoId<EdgeSpreaderPrototype> KudzuGroup = "Kudzu";
private const string KudzuGroup = "Kudzu";
/// <inheritdoc/> /// <inheritdoc/>
public override void Initialize() public override void Initialize()

View File

@@ -14,8 +14,7 @@ namespace Content.Server.StoreDiscount.Systems;
/// </summary> /// </summary>
public sealed class StoreDiscountSystem : EntitySystem public sealed class StoreDiscountSystem : EntitySystem
{ {
[ValidatePrototypeId<StoreCategoryPrototype>] private static readonly ProtoId<StoreCategoryPrototype> DiscountedStoreCategoryPrototypeKey = "DiscountedItems";
private const string DiscountedStoreCategoryPrototypeKey = "DiscountedItems";
[Dependency] private readonly IRobustRandom _random = default!; [Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!; [Dependency] private readonly IPrototypeManager _prototypeManager = default!;

View File

@@ -36,8 +36,7 @@ public sealed class TemperatureSystem : EntitySystem
private float _accumulatedFrametime; private float _accumulatedFrametime;
[ValidatePrototypeId<AlertCategoryPrototype>] public static readonly ProtoId<AlertCategoryPrototype> TemperatureAlertCategory = "Temperature";
public const string TemperatureAlertCategory = "Temperature";
public override void Initialize() public override void Initialize()
{ {

View File

@@ -22,10 +22,9 @@ public sealed class UplinkSystem : EntitySystem
[Dependency] private readonly SharedSubdermalImplantSystem _subdermalImplant = default!; [Dependency] private readonly SharedSubdermalImplantSystem _subdermalImplant = default!;
[Dependency] private readonly SharedMindSystem _mind = default!; [Dependency] private readonly SharedMindSystem _mind = default!;
[ValidatePrototypeId<CurrencyPrototype>] public static readonly ProtoId<CurrencyPrototype> TelecrystalCurrencyPrototype = "Telecrystal";
public const string TelecrystalCurrencyPrototype = "Telecrystal"; private static readonly EntProtoId FallbackUplinkImplant = "UplinkImplant";
private const string FallbackUplinkImplant = "UplinkImplant"; private static readonly ProtoId<ListingPrototype> FallbackUplinkCatalog = "UplinkUplinkImplanter";
private const string FallbackUplinkCatalog = "UplinkUplinkImplanter";
/// <summary> /// <summary>
/// Adds an uplink to the target /// Adds an uplink to the target
@@ -89,8 +88,6 @@ public sealed class UplinkSystem : EntitySystem
/// </summary> /// </summary>
private bool ImplantUplink(EntityUid user, FixedPoint2 balance, bool giveDiscounts) private bool ImplantUplink(EntityUid user, FixedPoint2 balance, bool giveDiscounts)
{ {
var implantProto = new string(FallbackUplinkImplant);
if (!_proto.TryIndex<ListingPrototype>(FallbackUplinkCatalog, out var catalog)) if (!_proto.TryIndex<ListingPrototype>(FallbackUplinkCatalog, out var catalog))
return false; return false;
@@ -102,7 +99,7 @@ public sealed class UplinkSystem : EntitySystem
else else
balance = balance - cost; balance = balance - cost;
var implant = _subdermalImplant.AddImplant(user, implantProto); var implant = _subdermalImplant.AddImplant(user, FallbackUplinkImplant);
if (!HasComp<StoreComponent>(implant)) if (!HasComp<StoreComponent>(implant))
return false; return false;

View File

@@ -14,8 +14,7 @@ namespace Content.Server.Xenoarchaeology.Artifact;
[ToolshedCommand, AdminCommand(AdminFlags.Debug)] [ToolshedCommand, AdminCommand(AdminFlags.Debug)]
public sealed class XenoArtifactCommand : ToolshedCommand public sealed class XenoArtifactCommand : ToolshedCommand
{ {
[ValidatePrototypeId<EntityPrototype>] public static readonly EntProtoId ArtifactPrototype = "BaseXenoArtifact";
public const string ArtifactPrototype = "BaseXenoArtifact";
/// <summary> List existing artifacts. </summary> /// <summary> List existing artifacts. </summary>
[CommandImplementation("list")] [CommandImplementation("list")]

View File

@@ -24,13 +24,10 @@ public abstract class SharedChatSystem : EntitySystem
public const char WhisperPrefix = ','; public const char WhisperPrefix = ',';
public const char DefaultChannelKey = 'h'; public const char DefaultChannelKey = 'h';
[ValidatePrototypeId<RadioChannelPrototype>] public static readonly ProtoId<RadioChannelPrototype> CommonChannel = "Common";
public const string CommonChannel = "Common";
public static string DefaultChannelPrefix = $"{RadioChannelPrefix}{DefaultChannelKey}"; public static readonly string DefaultChannelPrefix = $"{RadioChannelPrefix}{DefaultChannelKey}";
public static readonly ProtoId<SpeechVerbPrototype> DefaultSpeechVerb = "Default";
[ValidatePrototypeId<SpeechVerbPrototype>]
public const string DefaultSpeechVerb = "Default";
[Dependency] private readonly IPrototypeManager _prototypeManager = default!; [Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly SharedPopupSystem _popup = default!; [Dependency] private readonly SharedPopupSystem _popup = default!;
@@ -43,7 +40,7 @@ public abstract class SharedChatSystem : EntitySystem
public override void Initialize() public override void Initialize()
{ {
base.Initialize(); base.Initialize();
DebugTools.Assert(_prototypeManager.HasIndex<RadioChannelPrototype>(CommonChannel)); DebugTools.Assert(_prototypeManager.HasIndex(CommonChannel));
SubscribeLocalEvent<PrototypesReloadedEventArgs>(OnPrototypeReload); SubscribeLocalEvent<PrototypesReloadedEventArgs>(OnPrototypeReload);
CacheRadios(); CacheRadios();
} }
@@ -67,13 +64,13 @@ public abstract class SharedChatSystem : EntitySystem
public SpeechVerbPrototype GetSpeechVerb(EntityUid source, string message, SpeechComponent? speech = null) public SpeechVerbPrototype GetSpeechVerb(EntityUid source, string message, SpeechComponent? speech = null)
{ {
if (!Resolve(source, ref speech, false)) if (!Resolve(source, ref speech, false))
return _prototypeManager.Index<SpeechVerbPrototype>(DefaultSpeechVerb); return _prototypeManager.Index(DefaultSpeechVerb);
// check for a suffix-applicable speech verb // check for a suffix-applicable speech verb
SpeechVerbPrototype? current = null; SpeechVerbPrototype? current = null;
foreach (var (str, id) in speech.SuffixSpeechVerbs) foreach (var (str, id) in speech.SuffixSpeechVerbs)
{ {
var proto = _prototypeManager.Index<SpeechVerbPrototype>(id); var proto = _prototypeManager.Index(id);
if (message.EndsWith(Loc.GetString(str)) && proto.Priority >= (current?.Priority ?? 0)) if (message.EndsWith(Loc.GetString(str)) && proto.Priority >= (current?.Priority ?? 0))
{ {
current = proto; current = proto;
@@ -81,7 +78,7 @@ public abstract class SharedChatSystem : EntitySystem
} }
// if no applicable suffix verb return the normal one used by the entity // if no applicable suffix verb return the normal one used by the entity
return current ?? _prototypeManager.Index<SpeechVerbPrototype>(speech.SpeechVerb); return current ?? _prototypeManager.Index(speech.SpeechVerb);
} }
/// <summary> /// <summary>

View File

@@ -2,6 +2,7 @@ using Content.Shared.ActionBlocker;
using Content.Shared.Clothing; using Content.Shared.Clothing;
using Content.Shared.Inventory; using Content.Shared.Inventory;
using Robust.Shared.Player; using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Timing; using Robust.Shared.Timing;
namespace Content.Shared.Chat.TypingIndicator; namespace Content.Shared.Chat.TypingIndicator;
@@ -18,8 +19,7 @@ public abstract class SharedTypingIndicatorSystem : EntitySystem
/// <summary> /// <summary>
/// Default ID of <see cref="TypingIndicatorPrototype"/> /// Default ID of <see cref="TypingIndicatorPrototype"/>
/// </summary> /// </summary>
[ValidatePrototypeId<TypingIndicatorPrototype>] public static readonly ProtoId<TypingIndicatorPrototype> InitialIndicatorId = "default";
public const string InitialIndicatorId = "default";
public override void Initialize() public override void Initialize()
{ {

View File

@@ -23,6 +23,7 @@ using Robust.Shared.Timing;
using Robust.Shared.Audio.Systems; using Robust.Shared.Audio.Systems;
using Robust.Shared.Network; using Robust.Shared.Network;
using Robust.Shared.Map.Components; using Robust.Shared.Map.Components;
using Robust.Shared.Prototypes;
namespace Content.Shared.Doors.Systems; namespace Content.Shared.Doors.Systems;
@@ -46,9 +47,7 @@ public abstract partial class SharedDoorSystem : EntitySystem
[Dependency] private readonly SharedMapSystem _mapSystem = default!; [Dependency] private readonly SharedMapSystem _mapSystem = default!;
[Dependency] private readonly SharedPowerReceiverSystem _powerReceiver = default!; [Dependency] private readonly SharedPowerReceiverSystem _powerReceiver = default!;
public static readonly ProtoId<TagPrototype> DoorBumpTag = "DoorBumpOpener";
[ValidatePrototypeId<TagPrototype>]
public const string DoorBumpTag = "DoorBumpOpener";
/// <summary> /// <summary>
/// A set of doors that are currently opening, closing, or just queued to open/close after some delay. /// A set of doors that are currently opening, closing, or just queued to open/close after some delay.

View File

@@ -1,13 +1,13 @@
using Content.Shared.Speech.EntitySystems; using Content.Shared.Speech.EntitySystems;
using Content.Shared.StatusEffect; using Content.Shared.StatusEffect;
using Content.Shared.Traits.Assorted; using Content.Shared.Traits.Assorted;
using Robust.Shared.Prototypes;
namespace Content.Shared.Drunk; namespace Content.Shared.Drunk;
public abstract class SharedDrunkSystem : EntitySystem public abstract class SharedDrunkSystem : EntitySystem
{ {
[ValidatePrototypeId<StatusEffectPrototype>] public static readonly ProtoId<StatusEffectPrototype> DrunkKey = "Drunk";
public const string DrunkKey = "Drunk";
[Dependency] private readonly StatusEffectsSystem _statusEffectsSystem = default!; [Dependency] private readonly StatusEffectsSystem _statusEffectsSystem = default!;
[Dependency] private readonly SharedSlurredSystem _slurredSystem = default!; [Dependency] private readonly SharedSlurredSystem _slurredSystem = default!;

View File

@@ -1,12 +1,12 @@
using Content.Shared.Eye.Blinding.Components; using Content.Shared.Eye.Blinding.Components;
using Content.Shared.StatusEffect; using Content.Shared.StatusEffect;
using Robust.Shared.Prototypes;
namespace Content.Shared.Eye.Blinding.Systems; namespace Content.Shared.Eye.Blinding.Systems;
public sealed class TemporaryBlindnessSystem : EntitySystem public sealed class TemporaryBlindnessSystem : EntitySystem
{ {
[ValidatePrototypeId<StatusEffectPrototype>] public static readonly ProtoId<StatusEffectPrototype> BlindingStatusEffect = "TemporaryBlindness";
public const string BlindingStatusEffect = "TemporaryBlindness";
[Dependency] private readonly BlindableSystem _blindableSystem = default!; [Dependency] private readonly BlindableSystem _blindableSystem = default!;

View File

@@ -1,6 +1,7 @@
using Content.Shared.Chemistry.Components; using Content.Shared.Chemistry.Components;
using Content.Shared.Tag; using Content.Shared.Tag;
using Robust.Shared.Audio; using Robust.Shared.Audio;
using Robust.Shared.Prototypes;
namespace Content.Shared.Fluids.Components; namespace Content.Shared.Fluids.Components;
@@ -17,8 +18,7 @@ public sealed partial class DrainComponent : Component
{ {
public const string SolutionName = "drainBuffer"; public const string SolutionName = "drainBuffer";
[ValidatePrototypeId<TagPrototype>] public static readonly ProtoId<TagPrototype> PlungerTag = "Plunger";
public const string PlungerTag = "Plunger";
[ViewVariables] [ViewVariables]
public Entity<SolutionComponent>? Solution = null; public Entity<SolutionComponent>? Solution = null;

View File

@@ -18,8 +18,7 @@ namespace Content.Shared.GameTicking
// See ideally these would be pulled from the job definition or something. // See ideally these would be pulled from the job definition or something.
// But this is easier, and at least it isn't hardcoded. // But this is easier, and at least it isn't hardcoded.
//TODO: Move these, they really belong in StationJobsSystem or a cvar. //TODO: Move these, they really belong in StationJobsSystem or a cvar.
[ValidatePrototypeId<JobPrototype>] public static readonly ProtoId<JobPrototype> FallbackOverflowJob = "Passenger";
public const string FallbackOverflowJob = "Passenger";
public const string FallbackOverflowJobName = "job-name-passenger"; public const string FallbackOverflowJobName = "job-name-passenger";

View File

@@ -4,6 +4,7 @@ using Content.Shared.Movement.Components;
using Robust.Shared.GameStates; using Robust.Shared.GameStates;
using Robust.Shared.Physics; using Robust.Shared.Physics;
using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Components;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization; using Robust.Shared.Serialization;
using Robust.Shared.Timing; using Robust.Shared.Timing;
@@ -14,8 +15,7 @@ namespace Content.Shared.Gravity
[Dependency] protected readonly IGameTiming Timing = default!; [Dependency] protected readonly IGameTiming Timing = default!;
[Dependency] private readonly AlertsSystem _alerts = default!; [Dependency] private readonly AlertsSystem _alerts = default!;
[ValidatePrototypeId<AlertPrototype>] public static readonly ProtoId<AlertPrototype> WeightlessAlert = "Weightless";
public const string WeightlessAlert = "Weightless";
private EntityQuery<GravityComponent> _gravityQuery; private EntityQuery<GravityComponent> _gravityQuery;

View File

@@ -1,14 +1,13 @@
using Content.Shared.Humanoid.Markings; using Content.Shared.Humanoid.Markings;
using Robust.Shared.Prototypes;
namespace Content.Shared.Humanoid namespace Content.Shared.Humanoid
{ {
public static class HairStyles public static class HairStyles
{ {
[ValidatePrototypeId<MarkingPrototype>] public static readonly ProtoId<MarkingPrototype> DefaultHairStyle = "HairBald";
public const string DefaultHairStyle = "HairBald";
[ValidatePrototypeId<MarkingPrototype>] public static readonly ProtoId<MarkingPrototype> DefaultFacialHairStyle = "FacialHairShaved";
public const string DefaultFacialHairStyle = "FacialHairShaved";
public static readonly IReadOnlyList<Color> RealisticHairColors = new List<Color> public static readonly IReadOnlyList<Color> RealisticHairColors = new List<Color>
{ {

View File

@@ -131,10 +131,10 @@ public sealed partial class HumanoidCharacterAppearance : ICharacterAppearance,
var newHairStyle = hairStyles.Count > 0 var newHairStyle = hairStyles.Count > 0
? random.Pick(hairStyles) ? random.Pick(hairStyles)
: HairStyles.DefaultHairStyle; : HairStyles.DefaultHairStyle.Id;
var newFacialHairStyle = facialHairStyles.Count == 0 || sex == Sex.Female var newFacialHairStyle = facialHairStyles.Count == 0 || sex == Sex.Female
? HairStyles.DefaultFacialHairStyle ? HairStyles.DefaultFacialHairStyle.Id
: random.Pick(facialHairStyles); : random.Pick(facialHairStyles);
var newHairColor = random.Pick(HairStyles.RealisticHairColors); var newHairColor = random.Pick(HairStyles.RealisticHairColors);

View File

@@ -41,8 +41,7 @@ public abstract class SharedHumanoidAppearanceSystem : EntitySystem
[Dependency] private readonly GrammarSystem _grammarSystem = default!; [Dependency] private readonly GrammarSystem _grammarSystem = default!;
[Dependency] private readonly SharedIdentitySystem _identity = default!; [Dependency] private readonly SharedIdentitySystem _identity = default!;
[ValidatePrototypeId<SpeciesPrototype>] public static readonly ProtoId<SpeciesPrototype> DefaultSpecies = "Human";
public const string DefaultSpecies = "Human";
public override void Initialize() public override void Initialize()
{ {

View File

@@ -15,6 +15,7 @@ using Content.Shared.Strip.Components;
using Content.Shared.Whitelist; using Content.Shared.Whitelist;
using Robust.Shared.Audio.Systems; using Robust.Shared.Audio.Systems;
using Robust.Shared.Containers; using Robust.Shared.Containers;
using Robust.Shared.Prototypes;
using Robust.Shared.Timing; using Robust.Shared.Timing;
using Robust.Shared.Utility; using Robust.Shared.Utility;
@@ -35,8 +36,7 @@ public abstract partial class InventorySystem
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!; [Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
[Dependency] private readonly SharedStrippableSystem _strippable = default!; [Dependency] private readonly SharedStrippableSystem _strippable = default!;
[ValidatePrototypeId<ItemSizePrototype>] private static readonly ProtoId<ItemSizePrototype> PocketableItemSize = "Small";
private const string PocketableItemSize = "Small";
private void InitializeEquip() private void InitializeEquip()
{ {

View File

@@ -30,8 +30,7 @@ public abstract class SharedVirtualItemSystem : EntitySystem
[Dependency] private readonly SharedHandsSystem _handsSystem = default!; [Dependency] private readonly SharedHandsSystem _handsSystem = default!;
[Dependency] private readonly SharedPopupSystem _popup = default!; [Dependency] private readonly SharedPopupSystem _popup = default!;
[ValidatePrototypeId<EntityPrototype>] private static readonly EntProtoId VirtualItem = "VirtualItem";
private const string VirtualItem = "VirtualItem";
public override void Initialize() public override void Initialize()
{ {

View File

@@ -15,8 +15,7 @@ namespace Content.Shared.Maps
[Prototype("tile")] [Prototype("tile")]
public sealed partial class ContentTileDefinition : IPrototype, IInheritingPrototype, ITileDefinition public sealed partial class ContentTileDefinition : IPrototype, IInheritingPrototype, ITileDefinition
{ {
[ValidatePrototypeId<ToolQualityPrototype>] public static readonly ProtoId<ToolQualityPrototype> PryingToolQuality = "Prying";
public const string PryingToolQuality = "Prying";
public const string SpaceID = "Space"; public const string SpaceID = "Space";

View File

@@ -25,14 +25,9 @@ public sealed class HungerSystem : EntitySystem
[Dependency] private readonly MovementSpeedModifierSystem _movementSpeedModifier = default!; [Dependency] private readonly MovementSpeedModifierSystem _movementSpeedModifier = default!;
[Dependency] private readonly SharedJetpackSystem _jetpack = default!; [Dependency] private readonly SharedJetpackSystem _jetpack = default!;
[ValidatePrototypeId<SatiationIconPrototype>] private static readonly ProtoId<SatiationIconPrototype> HungerIconOverfedId = "HungerIconOverfed";
private const string HungerIconOverfedId = "HungerIconOverfed"; private static readonly ProtoId<SatiationIconPrototype> HungerIconPeckishId = "HungerIconPeckish";
private static readonly ProtoId<SatiationIconPrototype> HungerIconStarvingId = "HungerIconStarving";
[ValidatePrototypeId<SatiationIconPrototype>]
private const string HungerIconPeckishId = "HungerIconPeckish";
[ValidatePrototypeId<SatiationIconPrototype>]
private const string HungerIconStarvingId = "HungerIconStarving";
public override void Initialize() public override void Initialize()
{ {

View File

@@ -23,14 +23,9 @@ public sealed class ThirstSystem : EntitySystem
[Dependency] private readonly MovementSpeedModifierSystem _movement = default!; [Dependency] private readonly MovementSpeedModifierSystem _movement = default!;
[Dependency] private readonly SharedJetpackSystem _jetpack = default!; [Dependency] private readonly SharedJetpackSystem _jetpack = default!;
[ValidatePrototypeId<SatiationIconPrototype>] private static readonly ProtoId<SatiationIconPrototype> ThirstIconOverhydratedId = "ThirstIconOverhydrated";
private const string ThirstIconOverhydratedId = "ThirstIconOverhydrated"; private static readonly ProtoId<SatiationIconPrototype> ThirstIconThirstyId = "ThirstIconThirsty";
private static readonly ProtoId<SatiationIconPrototype> ThirstIconParchedId = "ThirstIconParched";
[ValidatePrototypeId<SatiationIconPrototype>]
private const string ThirstIconThirstyId = "ThirstIconThirsty";
[ValidatePrototypeId<SatiationIconPrototype>]
private const string ThirstIconParchedId = "ThirstIconParched";
public override void Initialize() public override void Initialize()
{ {

View File

@@ -1,4 +1,5 @@
using Content.Shared.Dataset; using Content.Shared.Dataset;
using Robust.Shared.Prototypes;
namespace Content.Shared.Players.PlayTimeTracking; namespace Content.Shared.Players.PlayTimeTracking;
@@ -7,12 +8,10 @@ public static class PlayTimeTrackingShared
/// <summary> /// <summary>
/// The prototype ID of the play time tracker that represents overall playtime, i.e. not tied to any one role. /// The prototype ID of the play time tracker that represents overall playtime, i.e. not tied to any one role.
/// </summary> /// </summary>
[ValidatePrototypeId<PlayTimeTrackerPrototype>] public static readonly ProtoId<PlayTimeTrackerPrototype> TrackerOverall = "Overall";
public const string TrackerOverall = "Overall";
/// <summary> /// <summary>
/// The prototype ID of the play time tracker that represents admin time, when a player is in game as admin. /// The prototype ID of the play time tracker that represents admin time, when a player is in game as admin.
/// </summary> /// </summary>
[ValidatePrototypeId<PlayTimeTrackerPrototype>] public static readonly ProtoId<PlayTimeTrackerPrototype> TrackerAdmin = "Admin";
public const string TrackerAdmin = "Admin";
} }

View File

@@ -198,8 +198,10 @@ namespace Content.Shared.Preferences
/// </summary> /// </summary>
/// <param name="species">The species to use in this default profile. The default species is <see cref="SharedHumanoidAppearanceSystem.DefaultSpecies"/>.</param> /// <param name="species">The species to use in this default profile. The default species is <see cref="SharedHumanoidAppearanceSystem.DefaultSpecies"/>.</param>
/// <returns>Humanoid character profile with default settings.</returns> /// <returns>Humanoid character profile with default settings.</returns>
public static HumanoidCharacterProfile DefaultWithSpecies(string species = SharedHumanoidAppearanceSystem.DefaultSpecies) public static HumanoidCharacterProfile DefaultWithSpecies(string? species = null)
{ {
species ??= SharedHumanoidAppearanceSystem.DefaultSpecies;
return new() return new()
{ {
Species = species, Species = species,
@@ -221,8 +223,10 @@ namespace Content.Shared.Preferences
return RandomWithSpecies(species); return RandomWithSpecies(species);
} }
public static HumanoidCharacterProfile RandomWithSpecies(string species = SharedHumanoidAppearanceSystem.DefaultSpecies) public static HumanoidCharacterProfile RandomWithSpecies(string? species = null)
{ {
species ??= SharedHumanoidAppearanceSystem.DefaultSpecies;
var prototypeManager = IoCManager.Resolve<IPrototypeManager>(); var prototypeManager = IoCManager.Resolve<IPrototypeManager>();
var random = IoCManager.Resolve<IRobustRandom>(); var random = IoCManager.Resolve<IRobustRandom>();

View File

@@ -33,7 +33,7 @@ public abstract partial class SharedFultonSystem : EntitySystem
[Dependency] protected readonly SharedTransformSystem TransformSystem = default!; [Dependency] protected readonly SharedTransformSystem TransformSystem = default!;
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!; [Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
[ValidatePrototypeId<EntityPrototype>] public const string EffectProto = "FultonEffect"; public static readonly EntProtoId EffectProto = "FultonEffect";
protected static readonly Vector2 EffectOffset = Vector2.Zero; protected static readonly Vector2 EffectOffset = Vector2.Zero;
public override void Initialize() public override void Initialize()

View File

@@ -23,8 +23,7 @@ public abstract partial class SharedSalvageSystem : EntitySystem
/// <summary> /// <summary>
/// Main loot table for salvage expeditions. /// Main loot table for salvage expeditions.
/// </summary> /// </summary>
[ValidatePrototypeId<SalvageLootPrototype>] public static readonly ProtoId<SalvageLootPrototype> ExpeditionsLootProto = "SalvageLoot";
public const string ExpeditionsLootProto = "SalvageLoot";
public string GetFTLName(LocalizedDatasetPrototype dataset, int seed) public string GetFTLName(LocalizedDatasetPrototype dataset, int seed)
{ {

View File

@@ -15,7 +15,6 @@ namespace Content.Shared.Silicons.Borgs;
[Prototype] [Prototype]
public sealed partial class BorgTypePrototype : IPrototype public sealed partial class BorgTypePrototype : IPrototype
{ {
[ValidatePrototypeId<SoundCollectionPrototype>]
private static readonly ProtoId<SoundCollectionPrototype> DefaultFootsteps = new("FootstepBorg"); private static readonly ProtoId<SoundCollectionPrototype> DefaultFootsteps = new("FootstepBorg");
[IdDataField] [IdDataField]

View File

@@ -21,8 +21,7 @@ public abstract class SharedBorgSwitchableTypeSystem : EntitySystem
[Dependency] protected readonly IPrototypeManager Prototypes = default!; [Dependency] protected readonly IPrototypeManager Prototypes = default!;
[Dependency] private readonly InteractionPopupSystem _interactionPopup = default!; [Dependency] private readonly InteractionPopupSystem _interactionPopup = default!;
[ValidatePrototypeId<EntityPrototype>] public static readonly EntProtoId ActionId = "ActionSelectBorgType";
public const string ActionId = "ActionSelectBorgType";
public override void Initialize() public override void Initialize()
{ {

View File

@@ -69,7 +69,6 @@ public abstract partial class SharedStationAiSystem : EntitySystem
private EntityQuery<BroadphaseComponent> _broadphaseQuery; private EntityQuery<BroadphaseComponent> _broadphaseQuery;
private EntityQuery<MapGridComponent> _gridQuery; private EntityQuery<MapGridComponent> _gridQuery;
[ValidatePrototypeId<EntityPrototype>]
private static readonly EntProtoId DefaultAi = "StationAiBrain"; private static readonly EntProtoId DefaultAi = "StationAiBrain";
private const float MaxVisionMultiplier = 5f; private const float MaxVisionMultiplier = 5f;

View File

@@ -1,11 +1,11 @@
using Content.Shared.StatusEffect; using Content.Shared.StatusEffect;
using Robust.Shared.Prototypes;
namespace Content.Shared.Speech.EntitySystems; namespace Content.Shared.Speech.EntitySystems;
public abstract class SharedStutteringSystem : EntitySystem public abstract class SharedStutteringSystem : EntitySystem
{ {
[ValidatePrototypeId<StatusEffectPrototype>] public static readonly ProtoId<StatusEffectPrototype> StutterKey = "Stutter";
public const string StutterKey = "Stutter";
[Dependency] private readonly StatusEffectsSystem _statusEffectsSystem = default!; [Dependency] private readonly StatusEffectsSystem _statusEffectsSystem = default!;

View File

@@ -28,8 +28,7 @@ public abstract class SharedSprayPainterSystem : EntitySystem
public List<AirlockStyle> Styles { get; private set; } = new(); public List<AirlockStyle> Styles { get; private set; } = new();
public List<AirlockGroupPrototype> Groups { get; private set; } = new(); public List<AirlockGroupPrototype> Groups { get; private set; } = new();
[ValidatePrototypeId<AirlockDepartmentsPrototype>] private static readonly ProtoId<AirlockDepartmentsPrototype> Departments = "Departments";
private const string Departments = "Departments";
public override void Initialize() public override void Initialize()
{ {
@@ -180,7 +179,7 @@ public abstract class SharedSprayPainterSystem : EntitySystem
} }
// get their department ids too for the final style list // get their department ids too for the final style list
var departments = Proto.Index<AirlockDepartmentsPrototype>(Departments); var departments = Proto.Index(Departments);
Styles.Capacity = names.Count; Styles.Capacity = names.Count;
foreach (var name in names) foreach (var name in names)
{ {

View File

@@ -83,8 +83,7 @@ public abstract class SharedStorageSystem : EntitySystem
/// </summary> /// </summary>
public bool NestedStorage = true; public bool NestedStorage = true;
[ValidatePrototypeId<ItemSizePrototype>] public static readonly ProtoId<ItemSizePrototype> DefaultStorageMaxItemSize = "Normal";
public const string DefaultStorageMaxItemSize = "Normal";
public const float AreaInsertDelayPerItem = 0.075f; public const float AreaInsertDelayPerItem = 0.075f;
private static AudioParams _audioParams = AudioParams.Default private static AudioParams _audioParams = AudioParams.Default
@@ -254,7 +253,7 @@ public abstract class SharedStorageSystem : EntitySystem
private void UpdatePrototypeCache() private void UpdatePrototypeCache()
{ {
_defaultStorageMaxItemSize = _prototype.Index<ItemSizePrototype>(DefaultStorageMaxItemSize); _defaultStorageMaxItemSize = _prototype.Index(DefaultStorageMaxItemSize);
_sortedSizes.Clear(); _sortedSizes.Clear();
_sortedSizes.AddRange(_prototype.EnumeratePrototypes<ItemSizePrototype>()); _sortedSizes.AddRange(_prototype.EnumeratePrototypes<ItemSizePrototype>());
_sortedSizes.Sort(); _sortedSizes.Sort();