Files
tbd-station-14/Content.Server/Traitor/Systems/AutoTraitorSystem.cs
Errant 23e4f81b30 Traitor activation fix for missing PDA (#30359)
* Implant the uplink if no PDA is found

* comments

* tidy up loose ends

* Whoops usually I start with the namespace, how did I forget it, shame shame

* Consistent data type for starting TC balance, misc changes

* Implant briefing, guidebook

* Update AutoTraitor, add uplink, codeword and briefing parameters to TraitorRuleComponent,  no pda for reinforcements

* engine 5c0ce43

* pass pda to AddUplink

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>

* nicer string handling

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>

* case typo 1

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>

* case typo 2

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>

* case typo 3

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>

* minor layout changes

* removed redundant implant check

* minor cleanup

---------

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
2024-10-18 14:55:43 +02:00

27 lines
835 B
C#

using Content.Server.Antag;
using Content.Server.Traitor.Components;
using Content.Shared.Mind.Components;
using Robust.Shared.Prototypes;
namespace Content.Server.Traitor.Systems;
/// <summary>
/// Makes entities with <see cref="AutoTraitorComponent"/> a traitor either immediately if they have a mind or when a mind is added.
/// </summary>
public sealed class AutoTraitorSystem : EntitySystem
{
[Dependency] private readonly AntagSelectionSystem _antag = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<AutoTraitorComponent, MindAddedMessage>(OnMindAdded);
}
private void OnMindAdded(EntityUid uid, AutoTraitorComponent comp, MindAddedMessage args)
{
_antag.ForceMakeAntag<AutoTraitorComponent>(args.Mind.Comp.Session, comp.Profile);
}
}