fish-station/Content.Server/Roles/RoleSystem.cs
pacable 556d234b0a
Терминатор (#333)
* Revert Revert Exterminator pending newmed/redesign (#26978)

This reverts commit f544c912

Signed-off-by: pacable <igor.mamaev1@gmail.com>

* Revert "remove GenericAntag completely (#28218)"

This reverts commit 489efeb717.

* Revert "remove TerminatorRoleComponent (#30733)"

This reverts commit 0a4b220854.

* fix broken tag

Signed-off-by: pacable <igor.mamaev1@gmail.com>

* delete invisible symbol

Signed-off-by: pacable <igor.mamaev1@gmail.com>

* ru locale

Signed-off-by: pacable <igor.mamaev1@gmail.com>

---------

Signed-off-by: pacable <igor.mamaev1@gmail.com>
2024-08-29 16:07:25 +03:00

73 lines
2.1 KiB
C#

using Content.Server._Sunrise.EvilTwin;
using Content.Server._Sunrise.Fugitive;
using Content.Server._Sunrise.PlanetPrison;
using Content.Shared.Roles;
namespace Content.Server.Roles;
public sealed class RoleSystem : SharedRoleSystem
{
public override void Initialize()
{
// TODO make roles entities
base.Initialize();
SubscribeAntagEvents<DragonRoleComponent>();
SubscribeAntagEvents<InitialInfectedRoleComponent>();
SubscribeAntagEvents<NinjaRoleComponent>();
SubscribeAntagEvents<NukeopsRoleComponent>();
SubscribeAntagEvents<RevolutionaryRoleComponent>();
SubscribeAntagEvents<SubvertedSiliconRoleComponent>();
SubscribeAntagEvents<TerminatorRoleComponent>();
SubscribeAntagEvents<TraitorRoleComponent>();
SubscribeAntagEvents<ZombieRoleComponent>();
SubscribeAntagEvents<ThiefRoleComponent>();
SubscribeAntagEvents<ChangelingRoleComponent>();
// Sunrise-start
SubscribeAntagEvents<FugitiveRoleComponent>();
SubscribeAntagEvents<PlanetPrisonerRoleComponent>();
SubscribeAntagEvents<EvilTwinRoleComponent>();
// Sunrise-end
}
public string? MindGetBriefing(EntityUid? mindId)
{
if (mindId == null)
return null;
var ev = new GetBriefingEvent();
RaiseLocalEvent(mindId.Value, ref ev);
return ev.Briefing;
}
}
/// <summary>
/// Event raised on the mind to get its briefing.
/// Handlers can either replace or append to the briefing, whichever is more appropriate.
/// </summary>
[ByRefEvent]
public sealed class GetBriefingEvent
{
public string? Briefing;
public GetBriefingEvent(string? briefing = null)
{
Briefing = briefing;
}
/// <summary>
/// If there is no briefing, sets it to the string.
/// If there is a briefing, adds a new line to separate it from the appended string.
/// </summary>
public void Append(string text)
{
if (Briefing == null)
{
Briefing = text;
}
else
{
Briefing += "\n" + text;
}
}
}