* 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>
27 lines
835 B
C#
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);
|
|
}
|
|
}
|