fish-station/Content.Server/Roles/RoleSystem.cs
Vigers Ray ffd3e3de14
Планетарная тюрьма (#187)
* Тюрьма (#150)

* Prison Init

* Новая карта для планетарных тюрем

* Готовая планетарная тюрьма

* Незначительное изменение тайлов

---------

Co-authored-by: Vigers Ray <60344369+VigersRay@users.noreply.github.com>

* Космическая тюрьма и всё остальное говно

* фиксы

* фикс PrisonlDoctor

* фикс PrisonDoctor

* день длится 20 минут

---------

Co-authored-by: SplikZerys <136282037+SplikZerys@users.noreply.github.com>
2024-07-12 04:21:12 +03:00

69 lines
1.9 KiB
C#

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<TraitorRoleComponent>();
SubscribeAntagEvents<ZombieRoleComponent>();
SubscribeAntagEvents<ThiefRoleComponent>();
// Sunrise-start
SubscribeAntagEvents<FugitiveRoleComponent>();
SubscribeAntagEvents<PlanetPrisonerRoleComponent>();
// 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;
}
}
}