Fix/Addition - Wizard Survivor Antag Status (#35226)
This commit is contained in:
@@ -1,12 +1,20 @@
|
||||
using Content.Server.Chat.Systems;
|
||||
using Content.Server.GameTicking;
|
||||
using Content.Server.GameTicking.Rules.Components;
|
||||
using Content.Shared.Magic;
|
||||
using Content.Shared.Magic.Events;
|
||||
using Content.Shared.Mind;
|
||||
using Content.Shared.Tag;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Server.Magic;
|
||||
|
||||
public sealed class MagicSystem : SharedMagicSystem
|
||||
{
|
||||
[Dependency] private readonly ChatSystem _chat = default!;
|
||||
[Dependency] private readonly GameTicker _gameTicker = default!;
|
||||
[Dependency] private readonly TagSystem _tag = default!;
|
||||
[Dependency] private readonly SharedMindSystem _mind = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -32,4 +40,20 @@ public sealed class MagicSystem : SharedMagicSystem
|
||||
Spawn(ev.Effect, perfXForm.Coordinates);
|
||||
Spawn(ev.Effect, targetXForm.Coordinates);
|
||||
}
|
||||
|
||||
protected override void OnRandomGlobalSpawnSpell(RandomGlobalSpawnSpellEvent ev)
|
||||
{
|
||||
base.OnRandomGlobalSpawnSpell(ev);
|
||||
|
||||
if (!ev.MakeSurvivorAntagonist)
|
||||
return;
|
||||
|
||||
if (_mind.TryGetMind(ev.Performer, out var mind, out _) && !_tag.HasTag(mind, "InvalidForSurvivorAntag"))
|
||||
_tag.AddTag(mind, "InvalidForSurvivorAntag");
|
||||
|
||||
EntProtoId survivorRule = "Survivor";
|
||||
|
||||
if (!_gameTicker.IsGameRuleActive<SurvivorRuleComponent>())
|
||||
_gameTicker.StartGameRule(survivorRule);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user