2024-02-13 01:22:36 +09:00
|
|
|
using Content.Server.Changeling;
|
|
|
|
|
using Content.Shared._White.Cult.Components;
|
2023-12-24 12:58:28 +03:00
|
|
|
using Content.Shared.Roles;
|
2023-08-28 16:53:24 -07:00
|
|
|
|
|
|
|
|
namespace Content.Server.Roles;
|
|
|
|
|
|
2023-08-30 21:46:11 -07:00
|
|
|
public sealed class RoleSystem : SharedRoleSystem
|
2023-08-28 16:53:24 -07:00
|
|
|
{
|
|
|
|
|
public override void Initialize()
|
|
|
|
|
{
|
|
|
|
|
// TODO make roles entities
|
2023-08-30 21:46:11 -07:00
|
|
|
base.Initialize();
|
2023-08-28 16:53:24 -07:00
|
|
|
|
2023-09-30 21:18:01 +01:00
|
|
|
SubscribeAntagEvents<DragonRoleComponent>();
|
2023-09-08 17:29:49 -04:00
|
|
|
SubscribeAntagEvents<InitialInfectedRoleComponent>();
|
2023-09-10 07:20:27 +01:00
|
|
|
SubscribeAntagEvents<NinjaRoleComponent>();
|
2023-08-28 16:53:24 -07:00
|
|
|
SubscribeAntagEvents<NukeopsRoleComponent>();
|
2023-10-04 21:40:52 -07:00
|
|
|
SubscribeAntagEvents<RevolutionaryRoleComponent>();
|
2023-08-28 16:53:24 -07:00
|
|
|
SubscribeAntagEvents<SubvertedSiliconRoleComponent>();
|
2023-12-25 03:16:56 +00:00
|
|
|
SubscribeAntagEvents<TerminatorRoleComponent>();
|
2023-08-28 16:53:24 -07:00
|
|
|
SubscribeAntagEvents<TraitorRoleComponent>();
|
|
|
|
|
SubscribeAntagEvents<ZombieRoleComponent>();
|
2023-12-24 12:58:28 +03:00
|
|
|
SubscribeAntagEvents<ThiefRoleComponent>();
|
2024-02-13 01:22:36 +09:00
|
|
|
SubscribeAntagEvents<ChangelingRoleComponent>(); // WD EDIT
|
|
|
|
|
SubscribeAntagEvents<CultistRoleComponent>(); // WD EDIT
|
2023-08-28 16:53:24 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string? MindGetBriefing(EntityUid? mindId)
|
|
|
|
|
{
|
2023-08-31 22:29:45 +01:00
|
|
|
if (mindId == null)
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
|
|
var ev = new GetBriefingEvent();
|
|
|
|
|
RaiseLocalEvent(mindId.Value, ref ev);
|
|
|
|
|
return ev.Briefing;
|
2023-08-28 16:53:24 -07:00
|
|
|
}
|
|
|
|
|
}
|
2023-08-31 22:29:45 +01:00
|
|
|
|
|
|
|
|
/// <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]
|
2023-10-05 16:05:09 +01:00
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|