using Robust.Shared.Configuration;
using Robust.Shared.Containers;
using Robust.Shared.Map;
+using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
namespace Content.Client.Verbs
private float _lookupSize;
+ private static readonly ProtoId<TagPrototype> HideContextMenuTag = "HideContextMenu";
+
/// <summary>
/// These flags determine what entities the user can see on the context menu.
/// </summary>
for (var i = entities.Count - 1; i >= 0; i--)
{
- if (_tagSystem.HasTag(entities[i], "HideContextMenu"))
+ if (_tagSystem.HasTag(entities[i], HideContextMenuTag))
entities.RemoveSwap(i);
}
-using System.Linq;
+using System.Linq;
using Content.Shared.Damage;
using Content.Shared.Damage.Prototypes;
using Content.Shared.Execution;
name: test version of the material reclaimer
components:
- type: MaterialReclaimer";
-
+ private static readonly ProtoId<TagPrototype> CannotSuicideTag = "CannotSuicide";
/// <summary>
/// Run the suicide command in the console
/// Should successfully kill the player and ghost them
mobStateComp = entManager.GetComponent<MobStateComponent>(player);
});
- tagSystem.AddTag(player, "CannotSuicide");
+ tagSystem.AddTag(player, CannotSuicideTag);
// Check that running the suicide command kills the player
// and properly ghosts them without them being able to return to their body
public const float HydroponicsSpeedMultiplier = 1f;
public const float HydroponicsConsumptionMultiplier = 2f;
+ private static readonly ProtoId<TagPrototype> HoeTag = "Hoe";
+ private static readonly ProtoId<TagPrototype> PlantSampleTakerTag = "PlantSampleTaker";
+
public override void Initialize()
{
base.Initialize();
return;
}
- if (_tagSystem.HasTag(args.Used, "Hoe"))
+ if (_tagSystem.HasTag(args.Used, HoeTag))
{
args.Handled = true;
if (component.WeedLevel > 0)
return;
}
- if (_tagSystem.HasTag(args.Used, "PlantSampleTaker"))
+ if (_tagSystem.HasTag(args.Used, PlantSampleTakerTag))
{
args.Handled = true;
if (component.Seed == null)
using Content.Shared.Popups;
using Content.Shared.Tag;
using Robust.Shared.Player;
+using Robust.Shared.Prototypes;
namespace Content.Server.Chat;
[Dependency] private readonly GhostSystem _ghostSystem = default!;
[Dependency] private readonly SharedSuicideSystem _suicide = default!;
+ private static readonly ProtoId<TagPrototype> CannotSuicideTag = "CannotSuicide";
+
public override void Initialize()
{
base.Initialize();
// Suicide is considered a fail if the user wasn't able to ghost
// Suiciding with the CannotSuicide tag will ghost the player but not kill the body
- if (!suicideGhostEvent.Handled || _tagSystem.HasTag(victim, "CannotSuicide"))
+ if (!suicideGhostEvent.Handled || _tagSystem.HasTag(victim, CannotSuicideTag))
return false;
var suicideEvent = new SuicideEvent(victim);
// CannotSuicide tag will allow the user to ghost, but also return to their mind
// This is kind of weird, not sure what it applies to?
- if (_tagSystem.HasTag(victim, "CannotSuicide"))
+ if (_tagSystem.HasTag(victim, CannotSuicideTag))
args.CanReturnToBody = true;
if (_ghostSystem.OnGhostAttempt(victim.Comp.Mind.Value, args.CanReturnToBody, mind: mindComponent))
using Content.Shared.Tag;
using Content.Shared.Weapons.Melee.Events;
using Robust.Shared.Collections;
+using Robust.Shared.Prototypes;
namespace Content.Server.Chemistry.EntitySystems;
[Dependency] private readonly SharedSolutionContainerSystem _solutionContainer = default!;
[Dependency] private readonly TagSystem _tag = default!;
+ private static readonly ProtoId<TagPrototype> HardsuitTag = "Hardsuit";
+
public override void Initialize()
{
base.Initialize();
// Yuck, this is way to hardcodey for my tastes
// TODO blocking injection with a hardsuit should probably done with a cancellable event or something
- if (!injector.Comp.PierceArmor && _inventory.TryGetSlotEntity(target, "outerClothing", out var suit) && _tag.HasTag(suit.Value, "Hardsuit"))
+ if (!injector.Comp.PierceArmor && _inventory.TryGetSlotEntity(target, "outerClothing", out var suit) && _tag.HasTag(suit.Value, HardsuitTag))
{
// Only show popup to attacker
if (source != null)
using Content.Shared.Tag;
using Robust.Shared.Console;
using Robust.Shared.Map.Components;
+using Robust.Shared.Prototypes;
namespace Content.Server.Construction.Commands;
{
[Dependency] private readonly IEntityManager _entManager = default!;
+ private static readonly ProtoId<TagPrototype> ForceFixRotationsTag = "ForceFixRotations";
+ private static readonly ProtoId<TagPrototype> ForceNoFixRotationsTag = "ForceNoFixRotations";
+ private static readonly ProtoId<TagPrototype> DiagonalTag = "Diagonal";
+
// ReSharper disable once StringLiteralTypo
public string Command => "fixrotations";
public string Description => "Sets the rotation of all occluders, low walls and windows to south.";
// cables
valid |= _entManager.HasComponent<CableComponent>(child);
// anything else that might need this forced
- valid |= tagSystem.HasTag(child, "ForceFixRotations");
+ valid |= tagSystem.HasTag(child, ForceFixRotationsTag);
// override
- valid &= !tagSystem.HasTag(child, "ForceNoFixRotations");
+ valid &= !tagSystem.HasTag(child, ForceNoFixRotationsTag);
// remove diagonal entities as well
- valid &= !tagSystem.HasTag(child, "Diagonal");
+ valid &= !tagSystem.HasTag(child, DiagonalTag);
if (!valid)
continue;
[ValidatePrototypeId<DamageTypePrototype>]
private const string DamageType = "Shock";
+ private static readonly ProtoId<TagPrototype> WindowTag = "Window";
+
// Multiply and shift the log scale for shock damage.
private const float RecursiveDamageMultiplier = 0.75f;
private const float RecursiveTimeMultiplier = 0.8f;
{
foreach (var entity in _entityLookup.GetLocalEntitiesIntersecting(tileRef.Value, flags: LookupFlags.StaticSundries))
{
- if (_tag.HasTag(entity, "Window"))
+ if (_tag.HasTag(entity, WindowTag))
return false;
}
}
using Robust.Shared.Audio;
using Robust.Shared.Random;
using InventoryComponent = Content.Shared.Inventory.InventoryComponent;
+using Robust.Shared.Prototypes;
namespace Content.Server.Flash
{
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly StatusEffectsSystem _statusEffectsSystem = default!;
+ private static readonly ProtoId<TagPrototype> TrashTag = "Trash";
+
public override void Initialize()
{
base.Initialize();
if (_charges.IsEmpty(uid, charges))
{
_appearance.SetData(uid, FlashVisuals.Burnt, true);
- _tag.AddTag(uid, "Trash");
+ _tag.AddTag(uid, TrashTag);
_popup.PopupEntity(Loc.GetString("flash-component-becomes-empty"), user);
}
using Robust.Shared.Player;
using Robust.Shared.Timing;
using Content.Server.Chemistry.Containers.EntitySystems;
+using Robust.Shared.Prototypes;
// todo: remove this stinky LINQy
namespace Content.Server.Forensics
[Dependency] private readonly ForensicsSystem _forensicsSystem = default!;
[Dependency] private readonly TagSystem _tag = default!;
+ private static readonly ProtoId<TagPrototype> DNASolutionScannableTag = "DNASolutionScannable";
+
public override void Initialize()
{
base.Initialize();
scanner.Residues = forensics.Residues.ToList();
}
- if (_tag.HasTag(args.Args.Target.Value, "DNASolutionScannable"))
+ if (_tag.HasTag(args.Args.Target.Value, DNASolutionScannableTag))
{
scanner.SolutionDNAs = _forensicsSystem.GetSolutionsDNA(args.Args.Target.Value);
} else
using Content.Shared.Survivor.Components;
using Content.Shared.Tag;
using Robust.Server.GameObjects;
+using Robust.Shared.Prototypes;
namespace Content.Server.GameTicking.Rules;
[Dependency] private readonly TagSystem _tag = default!;
[Dependency] private readonly MobStateSystem _mobState = default!;
+ private static readonly ProtoId<TagPrototype> InvalidForSurvivorAntagTag = "InvalidForSurvivorAntag";
+
public override void Initialize()
{
base.Initialize();
var mind = humanMind.Owner;
var ent = humanMind.Comp.OwnedEntity.Value;
- if (HasComp<SurvivorComponent>(mind) || _tag.HasTag(mind, "InvalidForSurvivorAntag"))
+ if (HasComp<SurvivorComponent>(mind) || _tag.HasTag(mind, InvalidForSurvivorAntagTag))
continue;
EnsureComp<SurvivorComponent>(mind);
private EntityQuery<GhostComponent> _ghostQuery;
private EntityQuery<PhysicsComponent> _physicsQuery;
+ private static readonly ProtoId<TagPrototype> AllowGhostShownByEventTag = "AllowGhostShownByEvent";
+
public override void Initialize()
{
base.Initialize();
var entityQuery = EntityQueryEnumerator<GhostComponent, VisibilityComponent>();
while (entityQuery.MoveNext(out var uid, out var _, out var vis))
{
- if (!_tag.HasTag(uid, "AllowGhostShownByEvent"))
+ if (!_tag.HasTag(uid, AllowGhostShownByEventTag))
continue;
if (visible)
[ValidatePrototypeId<EntityPrototype>]
private const string MalfunctionSpark = "Spark";
+ private static readonly ProtoId<TagPrototype> MetalTag = "Metal";
+ private static readonly ProtoId<TagPrototype> PlasticTag = "Plastic";
+
public override void Initialize()
{
base.Initialize();
return;
}
- if (_tag.HasTag(item, "Metal"))
+ if (_tag.HasTag(item, MetalTag))
{
malfunctioning = true;
}
- if (_tag.HasTag(item, "Plastic"))
+ if (_tag.HasTag(item, PlasticTag))
{
var junk = Spawn(component.BadRecipeEntityId, Transform(uid).Coordinates);
_container.Insert(junk, component.Storage);
using JetBrains.Annotations;
using Robust.Server.GameObjects;
using Robust.Shared.Audio.Systems;
+using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
namespace Content.Server.Light.EntitySystems
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
[Dependency] private readonly MetaDataSystem _metaData = default!;
+ private static readonly ProtoId<TagPrototype> TrashTag = "Trash";
+
public override void Initialize()
{
base.Initialize();
_metaData.SetEntityName(ent, Loc.GetString(component.SpentName), meta);
_metaData.SetEntityDescription(ent, Loc.GetString(component.SpentDesc), meta);
- _tagSystem.AddTag(ent, "Trash");
+ _tagSystem.AddTag(ent, TrashTag);
UpdateSounds(ent);
UpdateVisualizer(ent);
[Dependency] private readonly TagSystem _tag = default!;
[Dependency] private readonly SharedMindSystem _mind = default!;
+ private static readonly ProtoId<TagPrototype> InvalidForSurvivorAntagTag = "InvalidForSurvivorAntag";
+
public override void Initialize()
{
base.Initialize();
if (!ev.MakeSurvivorAntagonist)
return;
- if (_mind.TryGetMind(ev.Performer, out var mind, out _) && !_tag.HasTag(mind, "InvalidForSurvivorAntag"))
- _tag.AddTag(mind, "InvalidForSurvivorAntag");
+ if (_mind.TryGetMind(ev.Performer, out var mind, out _) && !_tag.HasTag(mind, InvalidForSurvivorAntagTag))
+ _tag.AddTag(mind, InvalidForSurvivorAntagTag);
EntProtoId survivorRule = "Survivor";
using Content.Shared.Popups;
using Content.Shared.Tag;
using Robust.Shared.Audio.Systems;
+using Robust.Shared.Prototypes;
namespace Content.Server.MagicMirror;
[Dependency] private readonly InventorySystem _inventory = default!;
[Dependency] private readonly TagSystem _tagSystem = default!;
+ private static readonly ProtoId<TagPrototype> HidesHairTag = "HidesHair";
+
public override void Initialize()
{
base.Initialize();
var slots = _inventory.GetSlotEnumerator((target, inventoryComp), SlotFlags.WITHOUT_POCKET);
while (slots.MoveNext(out var slot))
{
- if (slot.ContainedEntity != null && _tagSystem.HasTag(slot.ContainedEntity.Value, "HidesHair"))
+ if (slot.ContainedEntity != null && _tagSystem.HasTag(slot.ContainedEntity.Value, HidesHairTag))
{
return true;
}
using Content.Shared.Chemistry.Components.SolutionManager;
using Content.Shared.Chemistry.EntitySystems;
using Content.Shared.Tag;
+using Robust.Shared.Prototypes;
namespace Content.Server.Nutrition.EntitySystems
{
[Dependency] private readonly SharedSolutionContainerSystem _solutionContainerSystem = default!;
[Dependency] private readonly TagSystem _tagSystem = default!;
+ private static readonly ProtoId<TagPrototype> TrashTag = "Trash";
+
public override void Initialize()
{
base.Initialize();
{
if (solution.Volume <= 0)
{
- _tagSystem.AddTag(entity.Owner, "Trash");
+ _tagSystem.AddTag(entity.Owner, TrashTag);
return;
}
- if (_tagSystem.HasTag(entity.Owner, "Trash"))
- _tagSystem.RemoveTag(entity.Owner, "Trash");
+
+ _tagSystem.RemoveTag(entity.Owner, TrashTag);
}
}
}
using Robust.Shared.Utility;
using System.Linq;
using Robust.Server.GameObjects;
+using Robust.Shared.Prototypes;
namespace Content.Server.Payload.EntitySystems;
[Dependency] private readonly IComponentFactory _componentFactory = default!;
[Dependency] private readonly ISerializationManager _serializationManager = default!;
+ private static readonly ProtoId<TagPrototype> PayloadTag = "Payload";
+
public override void Initialize()
{
base.Initialize();
{
foreach (var entity in container.ContainedEntities)
{
- if (_tagSystem.HasTag(entity, "Payload"))
+ if (_tagSystem.HasTag(entity, PayloadTag))
yield return entity;
}
}
return;
// Ensure we don't enter a trigger-loop
- DebugTools.Assert(!_tagSystem.HasTag(uid, "Payload"));
+ DebugTools.Assert(!_tagSystem.HasTag(uid, PayloadTag));
RaiseLocalEvent(parent, args, false);
}
using System.Numerics;
using Content.Shared.Procedural;
+using Content.Shared.Tag;
using Robust.Shared.Collections;
using Robust.Shared.Map.Components;
using Robust.Shared.Physics.Components;
+using Robust.Shared.Prototypes;
namespace Content.Server.Procedural.DungeonJob;
* Run after the main dungeon generation
*/
+ private static readonly ProtoId<TagPrototype> WallTag = "Wall";
+
private bool HasWall(Vector2i tile)
{
var anchored = _maps.GetAnchoredEntitiesEnumerator(_gridUid, _grid, tile);
while (anchored.MoveNext(out var uid))
{
- if (_tags.HasTag(uid.Value, "Wall"))
+ if (_tags.HasTag(uid.Value, WallTag))
return true;
}
using Robust.Shared.Utility;
using Robust.Shared.Map.Components;
using Content.Shared.Whitelist;
+using Robust.Shared.Prototypes;
namespace Content.Server.Revenant.EntitySystems;
[Dependency] private readonly SharedTransformSystem _transformSystem = default!;
[Dependency] private readonly SharedMapSystem _mapSystem = default!;
+ private static readonly ProtoId<TagPrototype> WindowTag = "Window";
+
private void InitializeAbilities()
{
SubscribeLocalEvent<RevenantComponent, UserActivateInWorldEvent>(OnInteract);
foreach (var ent in lookup)
{
//break windows
- if (tags.HasComponent(ent) && _tag.HasTag(ent, "Window"))
+ if (tags.HasComponent(ent) && _tag.HasTag(ent, WindowTag))
{
//hardcoded damage specifiers til i die.
var dspec = new DamageSpecifier();
using Robust.Shared.Map;
using Robust.Shared.Utility;
using Content.Shared.UserInterface;
+using Robust.Shared.Prototypes;
namespace Content.Server.Shuttles.Systems;
private readonly HashSet<Entity<ShuttleConsoleComponent>> _consoles = new();
+ private static readonly ProtoId<TagPrototype> CanPilotTag = "CanPilot";
+
public override void Initialize()
{
base.Initialize();
private bool TryPilot(EntityUid user, EntityUid uid)
{
- if (!_tags.HasTag(user, "CanPilot") ||
+ if (!_tags.HasTag(user, CanPilotTag) ||
!TryComp<ShuttleConsoleComponent>(uid, out var component) ||
!this.IsPowered(uid, EntityManager) ||
!Transform(uid).Anchored ||
using Robust.Shared.Physics.Components;
using Robust.Shared.Physics.Events;
using Robust.Shared.Physics.Systems;
+using Robust.Shared.Prototypes;
using Robust.Shared.Timing;
namespace Content.Server.Singularity.EntitySystems;
[Dependency] private readonly TagSystem _tagSystem = default!;
#endregion Dependencies
+ private static readonly ProtoId<TagPrototype> HighRiskItemTag = "HighRiskItem";
+
private EntityQuery<PhysicsComponent> _physicsQuery;
public override void Initialize()
return;
if (HasComp<MindContainerComponent>(morsel)
- || _tagSystem.HasTag(morsel, "HighRiskItem")
+ || _tagSystem.HasTag(morsel, HighRiskItemTag)
|| HasComp<ContainmentFieldGeneratorComponent>(morsel))
{
_adminLogger.Add(LogType.EntityDelete, LogImpact.High, $"{ToPrettyString(morsel):player} entered the event horizon of {ToPrettyString(hungry)} and was deleted");
using Content.Shared.Storage;
using Content.Shared.Tag;
using Robust.Shared.Network;
+using Robust.Shared.Prototypes;
using Robust.Shared.Random;
namespace Content.Server.Tools.Innate;
[Dependency] private readonly SharedHandsSystem _sharedHandsSystem = default!;
[Dependency] private readonly TagSystem _tagSystem = default!;
+ private static readonly ProtoId<TagPrototype> InnateDontDeleteTag = "InnateDontDelete";
+
public override void Initialize()
{
base.Initialize();
{
foreach (var tool in component.ToolUids)
{
- if (_tagSystem.HasTag(tool, "InnateDontDelete"))
+ if (_tagSystem.HasTag(tool, InnateDontDeleteTag))
{
RemComp<UnremoveableComponent>(tool);
}
using Robust.Shared.Audio.Systems;
using Content.Shared.Ghost.Roles.Components;
using Content.Shared.Tag;
+using Robust.Shared.Prototypes;
namespace Content.Server.Zombies;
[Dependency] private readonly TagSystem _tag = default!;
[Dependency] private readonly NameModifierSystem _nameMod = default!;
+ private static readonly ProtoId<TagPrototype> InvalidForGlobalSpawnSpellTag = "InvalidForGlobalSpawnSpell";
+
/// <summary>
/// Handles an entity turning into a zombie when they die or go into crit
/// </summary>
//Need to prevent them from getting an item, they have no hands.
// Also prevents them from becoming a Survivor. They're undead.
- _tag.AddTag(target, "InvalidForGlobalSpawnSpell");
+ _tag.AddTag(target, InvalidForGlobalSpawnSpellTag);
}
}
[Dependency] private readonly TagSystem _tag = default!;
[Dependency] protected readonly SharedUserInterfaceSystem UI = default!;
+ private static readonly ProtoId<TagPrototype> WhitelistChameleonTag = "WhitelistChameleon";
+
public override void Initialize()
{
base.Initialize();
return false;
// check if it is marked as valid chameleon target
- if (!proto.TryGetComponent(out TagComponent? tag, _factory) || !_tag.HasTag(tag, "WhitelistChameleon"))
+ if (!proto.TryGetComponent(out TagComponent? tag, _factory) || !_tag.HasTag(tag, WhitelistChameleonTag))
return false;
if (requiredTag != null && !_tag.HasTag(tag, requiredTag))
-using Content.Shared.Maps;
+using Content.Shared.Maps;
using Content.Shared.Tag;
using JetBrains.Annotations;
using Robust.Shared.Map;
+using Robust.Shared.Prototypes;
namespace Content.Shared.Construction.Conditions
{
[DataDefinition]
public sealed partial class NoWindowsInTile : IConstructionCondition
{
+ private static readonly ProtoId<TagPrototype> WindowTag = "Window";
+
public bool Condition(EntityUid user, EntityCoordinates location, Direction direction)
{
var entManager = IoCManager.Resolve<IEntityManager>();
foreach (var entity in location.GetEntitiesInTile(LookupFlags.Static))
{
- if (tagSystem.HasTag(entity, "Window"))
+ if (tagSystem.HasTag(entity, WindowTag))
return false;
}
using Robust.Shared.Map;
using Robust.Shared.Physics;
using Robust.Shared.Physics.Systems;
+using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
namespace Content.Shared.Construction.Conditions
[DataDefinition]
public sealed partial class WallmountCondition : IConstructionCondition
{
+ private static readonly ProtoId<TagPrototype> WallTag = "Wall";
+
public bool Condition(EntityUid user, EntityCoordinates location, Direction direction)
{
var entManager = IoCManager.Resolve<IEntityManager>();
var tagSystem = entManager.System<TagSystem>();
var userToObjRaycastResults = physics.IntersectRayWithPredicate(entManager.GetComponent<TransformComponent>(user).MapID, rUserToObj, maxLength: length,
- predicate: (e) => !tagSystem.HasTag(e, "Wall"));
+ predicate: (e) => !tagSystem.HasTag(e, WallTag));
var targetWall = userToObjRaycastResults.FirstOrNull();
// check that we didn't try to build wallmount that facing another adjacent wall
var rAdjWall = new CollisionRay(objWorldPosition, directionWithOffset.Normalized(), (int) CollisionGroup.Impassable);
var adjWallRaycastResults = physics.IntersectRayWithPredicate(entManager.GetComponent<TransformComponent>(user).MapID, rAdjWall, maxLength: 0.5f,
- predicate: e => e == targetWall.Value.HitEntity || !tagSystem.HasTag(e, "Wall"));
+ predicate: e => e == targetWall.Value.HitEntity || !tagSystem.HasTag(e, WallTag));
return !adjWallRaycastResults.Any();
}
using Content.Shared.Verbs;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Containers;
+using Robust.Shared.Prototypes;
namespace Content.Shared.Delivery;
[Dependency] private readonly SharedHandsSystem _hands = default!;
[Dependency] private readonly NameModifierSystem _nameModifier = default!;
+ private static readonly ProtoId<TagPrototype> TrashTag = "Trash";
+ private static readonly ProtoId<TagPrototype> RecyclableTag = "Recyclable";
+
public override void Initialize()
{
base.Initialize();
ent.Comp.IsOpened = true;
_appearance.SetData(ent, DeliveryVisuals.IsTrash, ent.Comp.IsOpened);
- _tag.AddTags(ent, "Trash", "Recyclable");
+ _tag.AddTags(ent, TrashTag, RecyclableTag);
EnsureComp<SpaceGarbageComponent>(ent);
RemComp<StealTargetComponent>(ent); // opened mail should not count for the objective
using Content.Shared.Hands.Components;
using Content.Shared.Tag;
using Robust.Shared.GameStates;
+using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
using Robust.Shared.Timing;
using Robust.Shared.Utility;
/// </summary>
private static readonly TimeSpan ExcessTime = TimeSpan.FromSeconds(0.5f);
+ private static readonly ProtoId<TagPrototype> InstantDoAftersTag = "InstantDoAfters";
+
public override void Initialize()
{
base.Initialize();
// TODO DO AFTER
// Why does this tag exist? Just make this a bool on the component?
- if (args.Delay <= TimeSpan.Zero || _tag.HasTag(args.User, "InstantDoAfters"))
+ if (args.Delay <= TimeSpan.Zero || _tag.HasTag(args.User, InstantDoAftersTag))
{
RaiseDoAfterEvents(doAfter, comp);
// We don't store instant do-afters. This is just a lazy way of hiding them from client-side visuals.
using Robust.Shared.Physics;
using Robust.Shared.Physics.Systems;
using Robust.Shared.Player;
+using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
namespace Content.Shared.Follower;
[Dependency] private readonly INetManager _netMan = default!;
[Dependency] private readonly ISharedAdminManager _adminManager = default!;
+ private static readonly ProtoId<TagPrototype> ForceableFollowTag = "ForceableFollow";
+
public override void Initialize()
{
base.Initialize();
ev.Verbs.Add(verb);
}
- if (_tagSystem.HasTag(ev.Target, "ForceableFollow"))
+ if (_tagSystem.HasTag(ev.Target, ForceableFollowTag))
{
if (!ev.CanAccess || !ev.CanInteract)
return;
using Content.Shared.Tag;
using Robust.Shared.Containers;
using Robust.Shared.Map;
+using Robust.Shared.Prototypes;
namespace Content.Shared.Hands.EntitySystems;
public abstract partial class SharedHandsSystem
{
[Dependency] private readonly TagSystem _tagSystem = default!;
+
+ private static readonly ProtoId<TagPrototype> BypassDropChecksTag = "BypassDropChecks";
+
private void InitializeDrop()
{
SubscribeLocalEvent<HandsComponent, EntRemovedFromContainerMessage>(HandleEntityRemoved);
private bool ShouldIgnoreRestrictions(EntityUid user)
{
//Checks if the Entity is something that shouldn't care about drop distance or walls ie Aghost
- return !_tagSystem.HasTag(user, "BypassDropChecks");
+ return !_tagSystem.HasTag(user, BypassDropChecksTag);
}
/// <summary>
using JetBrains.Annotations;
using Robust.Shared.Containers;
using Robust.Shared.Network;
+using Robust.Shared.Prototypes;
using System.Linq;
namespace Content.Shared.Implants;
public const string BaseStorageId = "storagebase";
+ private static readonly ProtoId<TagPrototype> MicroBombTag = "MicroBomb";
+ private static readonly ProtoId<TagPrototype> MacroBombTag = "MacroBomb";
+
public override void Initialize()
{
SubscribeLocalEvent<SubdermalImplantComponent, EntGotInsertedIntoContainerMessage>(OnInsert);
}
//replace micro bomb with macro bomb
- if (_container.TryGetContainer(component.ImplantedEntity.Value, ImplanterComponent.ImplantSlotId, out var implantContainer) && _tag.HasTag(uid, "MacroBomb"))
+ if (_container.TryGetContainer(component.ImplantedEntity.Value, ImplanterComponent.ImplantSlotId, out var implantContainer) && _tag.HasTag(uid, MacroBombTag))
{
foreach (var implant in implantContainer.ContainedEntities)
{
- if (_tag.HasTag(implant, "MicroBomb"))
+ if (_tag.HasTag(implant, MicroBombTag))
{
_container.Remove(implant, implantContainer);
QueueDel(implant);
using Robust.Shared.Physics.Components;
using Robust.Shared.Physics.Systems;
using Robust.Shared.Player;
+using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
using Robust.Shared.Timing;
using Robust.Shared.Utility;
public const float MaxRaycastRange = 100f;
public const string RateLimitKey = "Interaction";
+ private static readonly ProtoId<TagPrototype> BypassInteractionRangeChecksTag = "BypassInteractionRangeChecks";
+
public delegate bool Ignored(EntityUid entity);
public override void Initialize()
{
// This is for Admin/mapping convenience. If ever there are other ghosts that can still interact, this check
// might need to be more selective.
- return !_tagSystem.HasTag(user, "BypassInteractionRangeChecks");
+ return !_tagSystem.HasTag(user, BypassInteractionRangeChecksTag);
}
/// <summary>
[Dependency] private readonly SharedMindSystem _mind = default!;
[Dependency] private readonly SharedStunSystem _stun = default!;
+ private static readonly ProtoId<TagPrototype> InvalidForGlobalSpawnSpellTag = "InvalidForGlobalSpawnSpell";
+
public override void Initialize()
{
base.Initialize();
var ent = human.Comp.OwnedEntity.Value;
- if (_tag.HasTag(ent, "InvalidForGlobalSpawnSpell"))
+ if (_tag.HasTag(ent, InvalidForGlobalSpawnSpellTag))
continue;
var mapCoords = _transform.GetMapCoordinates(ent);
using Robust.Shared.Physics.Components;
using Robust.Shared.Physics.Controllers;
using Robust.Shared.Physics.Systems;
+using Robust.Shared.Prototypes;
using Robust.Shared.Timing;
using Robust.Shared.Utility;
using PullableComponent = Content.Shared.Movement.Pulling.Components.PullableComponent;
protected EntityQuery<FootstepModifierComponent> FootstepModifierQuery;
protected EntityQuery<MapGridComponent> MapGridQuery;
+ private static readonly ProtoId<TagPrototype> FootstepSoundTag = "FootstepSound";
+
/// <summary>
/// <see cref="CCVars.StopSpeed"/>
/// </summary>
{
sound = null;
- if (!CanSound() || !_tags.HasTag(uid, "FootstepSound"))
+ if (!CanSound() || !_tags.HasTag(uid, FootstepSoundTag))
return false;
var coordinates = xform.Coordinates;
using Robust.Shared.Player;
using Robust.Shared.Audio.Systems;
using static Content.Shared.Paper.PaperComponent;
+using Robust.Shared.Prototypes;
namespace Content.Shared.Paper;
[Dependency] private readonly MetaDataSystem _metaSystem = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
+ private static readonly ProtoId<TagPrototype> WriteIgnoreStampsTag = "WriteIgnoreStamps";
+ private static readonly ProtoId<TagPrototype> WriteTag = "Write";
+
public override void Initialize()
{
base.Initialize();
private void OnInteractUsing(Entity<PaperComponent> entity, ref InteractUsingEvent args)
{
// only allow editing if there are no stamps or when using a cyberpen
- var editable = entity.Comp.StampedBy.Count == 0 || _tagSystem.HasTag(args.Used, "WriteIgnoreStamps");
- if (_tagSystem.HasTag(args.Used, "Write"))
+ var editable = entity.Comp.StampedBy.Count == 0 || _tagSystem.HasTag(args.Used, WriteIgnoreStampsTag);
+ if (_tagSystem.HasTag(args.Used, WriteTag))
{
if (editable)
{
private readonly EntProtoId _instantConstructionFx = "EffectRCDConstruct0";
private readonly ProtoId<RCDPrototype> _deconstructTileProto = "DeconstructTile";
private readonly ProtoId<RCDPrototype> _deconstructLatticeProto = "DeconstructLattice";
+ private static readonly ProtoId<TagPrototype> CatwalkTag = "Catwalk";
private HashSet<EntityUid> _intersectingEntities = new();
if (isWindow && HasComp<SharedCanBuildWindowOnTopComponent>(ent))
continue;
- if (isCatwalk && _tags.HasTag(ent, "Catwalk"))
+ if (isCatwalk && _tags.HasTag(ent, CatwalkTag))
{
if (popMsgs)
_popup.PopupClient(Loc.GetString("rcd-component-cannot-build-on-occupied-tile-message"), uid, user);