Extracts magic strings from Tag calls (#36305)

* Extracts magic strings from Tag calls

When #36281 gets merged, the `TagSystem` methods will all give warnings. Let's fix those warnings before they even happen!

* Adds missing libraries

* Remove not yet implemented TagSystem changes

* Fix tag spelling error

Genuinely surprised there was only 1!

* Styling and proper type changes

* Styling

Co-authored-by: Tayrtahn <tayrtahn@gmail.com>

---------

Co-authored-by: Tayrtahn <tayrtahn@gmail.com>
This commit is contained in:
J
2025-04-06 21:35:59 +01:00
committed by deltanedas
co-authored by Tayrtahn
parent 4a203418f8
commit 6571868f3b
36 changed files with 158 additions and 55 deletions
+4 -2
View File
@@ -16,6 +16,8 @@ public sealed class MagicSystem : SharedMagicSystem
[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();
@@ -48,8 +50,8 @@ public sealed class MagicSystem : SharedMagicSystem
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";