+using System.Linq;
using System.Numerics;
using Content.Client.Administration.Systems;
+using Content.Shared.CCVar;
+using Content.Shared.Mind;
using Robust.Client.Graphics;
using Robust.Client.ResourceManagement;
using Robust.Client.UserInterface;
-using Robust.Shared;
-using Robust.Shared.Enums;
using Robust.Shared.Configuration;
+using Robust.Shared.Enums;
+using Robust.Shared.Prototypes;
namespace Content.Client.Administration;
internal sealed class AdminNameOverlay : Overlay
{
+ [Dependency] private readonly IConfigurationManager _config = default!;
+
private readonly AdminSystem _system;
private readonly IEntityManager _entityManager;
private readonly IEyeManager _eyeManager;
private readonly IUserInterfaceManager _userInterfaceManager;
private readonly Font _font;
+ //TODO make this adjustable via GUI
+ private readonly ProtoId<RoleTypePrototype>[] _filter =
+ ["SoloAntagonist", "TeamAntagonist", "SiliconAntagonist", "FreeAgent"];
+ private readonly string _antagLabelClassic = Loc.GetString("admin-overlay-antag-classic");
+ private readonly Color _antagColorClassic = Color.OrangeRed;
+
public AdminNameOverlay(AdminSystem system, IEntityManager entityManager, IEyeManager eyeManager, IResourceCache resourceCache, EntityLookupSystem entityLookup, IUserInterfaceManager userInterfaceManager)
{
+ IoCManager.InjectDependencies(this);
+
_system = system;
_entityManager = entityManager;
_eyeManager = eyeManager;
{
var viewport = args.WorldAABB;
+ //TODO make this adjustable via GUI
+ var classic = _config.GetCVar(CCVars.AdminOverlayClassic);
+
foreach (var playerInfo in _system.PlayerList)
{
var entity = _entityManager.GetEntity(playerInfo.NetEntity);
var screenCoordinates = _eyeManager.WorldToScreen(aabb.Center +
new Angle(-_eyeManager.CurrentEye.Rotation).RotateVec(
aabb.TopRight - aabb.Center)) + new Vector2(1f, 7f);
- if (playerInfo.Antag)
+
+ if (classic && playerInfo.Antag)
{
- args.ScreenHandle.DrawString(_font, screenCoordinates + (lineoffset * 2), "ANTAG", uiScale, Color.OrangeRed);
-;
+ args.ScreenHandle.DrawString(_font, screenCoordinates + (lineoffset * 2), _antagLabelClassic, uiScale, _antagColorClassic);
}
- args.ScreenHandle.DrawString(_font, screenCoordinates+lineoffset, playerInfo.Username, uiScale, playerInfo.Connected ? Color.Yellow : Color.White);
+ else if (!classic && _filter.Contains(playerInfo.RoleProto.ID))
+ {
+ var label = Loc.GetString(playerInfo.RoleProto.Name).ToUpper();
+ var color = playerInfo.RoleProto.Color;
+
+ args.ScreenHandle.DrawString(_font, screenCoordinates + (lineoffset * 2), label, uiScale, color);
+ }
+
+ args.ScreenHandle.DrawString(_font, screenCoordinates + lineoffset, playerInfo.Username, uiScale, playerInfo.Connected ? Color.Yellow : Color.White);
args.ScreenHandle.DrawString(_font, screenCoordinates, playerInfo.CharacterName, uiScale, playerInfo.Connected ? Color.Aquamarine : Color.White);
}
}
Header.Character => Compare(x.CharacterName, y.CharacterName),
Header.Job => Compare(x.StartingJob, y.StartingJob),
Header.Antagonist => x.Antag.CompareTo(y.Antag),
+ Header.RoleType => Compare(x.RoleProto.Name , y.RoleProto.Name),
Header.Playtime => TimeSpan.Compare(x.OverallPlaytime ?? default, y.OverallPlaytime ?? default),
_ => 1
};
HorizontalExpand="True"
ClipText="True"/>
<customControls:VSeparator/>
+ <Label Name="RoleTypeLabel"
+ SizeFlagsStretchRatio="2"
+ HorizontalExpand="True"
+ ClipText="True"/>
+ <customControls:VSeparator/>
<Label Name="OverallPlaytimeLabel"
SizeFlagsStretchRatio="1"
HorizontalExpand="True"
if (player.IdentityName != player.CharacterName)
CharacterLabel.Text += $" [{player.IdentityName}]";
AntagonistLabel.Text = Loc.GetString(player.Antag ? "player-tab-is-antag-yes" : "player-tab-is-antag-no");
+ RoleTypeLabel.Text = Loc.GetString(player.RoleProto.Name);
+ RoleTypeLabel.FontColorOverride = player.RoleProto.Color;
BackgroundColorPanel.PanelOverride = styleBoxFlat;
OverallPlaytimeLabel.Text = player.PlaytimeString;
PlayerEntity = player.NetEntity;
Text="{Loc player-tab-antagonist}"
MouseFilter="Pass"/>
<cc:VSeparator/>
+ <Label Name="RoleTypeLabel"
+ SizeFlagsStretchRatio="2"
+ HorizontalExpand="True"
+ ClipText="True"
+ Text="{Loc player-tab-roletype}"
+ MouseFilter="Pass"/>
+ <cc:VSeparator/>
<Label Name="PlaytimeLabel"
SizeFlagsStretchRatio="1"
HorizontalExpand="True"
CharacterLabel.OnKeyBindDown += CharacterClicked;
JobLabel.OnKeyBindDown += JobClicked;
AntagonistLabel.OnKeyBindDown += AntagonistClicked;
+ RoleTypeLabel.OnKeyBindDown += RoleTypeClicked;
PlaytimeLabel.OnKeyBindDown += PlaytimeClicked;
}
Header.Character => CharacterLabel,
Header.Job => JobLabel,
Header.Antagonist => AntagonistLabel,
+ Header.RoleType => RoleTypeLabel,
Header.Playtime => PlaytimeLabel,
_ => throw new ArgumentOutOfRangeException(nameof(header), header, null)
};
CharacterLabel.Text = Loc.GetString("player-tab-character");
JobLabel.Text = Loc.GetString("player-tab-job");
AntagonistLabel.Text = Loc.GetString("player-tab-antagonist");
+ RoleTypeLabel.Text = Loc.GetString("player-tab-roletype");
PlaytimeLabel.Text = Loc.GetString("player-tab-playtime");
}
HeaderClicked(args, Header.Antagonist);
}
+ private void RoleTypeClicked(GUIBoundKeyEventArgs args)
+ {
+ HeaderClicked(args, Header.RoleType);
+ }
+
private void PlaytimeClicked(GUIBoundKeyEventArgs args)
{
HeaderClicked(args, Header.Playtime);
CharacterLabel.OnKeyBindDown -= CharacterClicked;
JobLabel.OnKeyBindDown -= JobClicked;
AntagonistLabel.OnKeyBindDown -= AntagonistClicked;
+ RoleTypeLabel.OnKeyBindDown -= RoleTypeClicked;
PlaytimeLabel.OnKeyBindDown -= PlaytimeClicked;
}
}
Character,
Job,
Antagonist,
+ RoleType,
Playtime
}
}
using Content.Client.UserInterface.Systems.Character.Windows;
using Content.Client.UserInterface.Systems.Objectives.Controls;
using Content.Shared.Input;
-using Content.Shared.Objectives.Systems;
+using Content.Shared.Mind;
+using Content.Shared.Mind.Components;
+using Content.Shared.Roles;
using JetBrains.Annotations;
using Robust.Client.GameObjects;
using Robust.Client.Player;
using Robust.Client.UserInterface.Controllers;
using Robust.Client.UserInterface.Controls;
using Robust.Shared.Input.Binding;
+using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
using static Content.Client.CharacterInfo.CharacterInfoSystem;
using static Robust.Client.UserInterface.Controls.BaseButton;
[UsedImplicitly]
public sealed class CharacterUIController : UIController, IOnStateEntered<GameplayState>, IOnStateExited<GameplayState>, IOnSystemChanged<CharacterInfoSystem>
{
+ [Dependency] private readonly IEntityManager _ent = default!;
+ [Dependency] private readonly ILogManager _logMan = default!;
[Dependency] private readonly IPlayerManager _player = default!;
+ [Dependency] private readonly IPrototypeManager _prototypeManager = default!;
+
[UISystemDependency] private readonly CharacterInfoSystem _characterInfo = default!;
[UISystemDependency] private readonly SpriteSystem _sprite = default!;
+ private ISawmill _sawmill = default!;
+
+ public override void Initialize()
+ {
+ base.Initialize();
+
+ _sawmill = _logMan.GetSawmill("character");
+
+ SubscribeNetworkEvent<MindRoleTypeChangedEvent>(OnRoleTypeChanged);
+ }
+
private CharacterWindow? _window;
private MenuButton? CharacterButton => UIManager.GetActiveUIWidgetOrNull<MenuBar.Widgets.GameTopMenuBar>()?.CharacterButton;
var (entity, job, objectives, briefing, entityName) = data;
_window.SpriteView.SetEntity(entity);
+
+ UpdateRoleType();
+
_window.NameLabel.Text = entityName;
_window.SubText.Text = job;
_window.Objectives.RemoveAllChildren();
_window.RolePlaceholder.Visible = briefing == null && !controls.Any() && !objectives.Any();
}
+ private void OnRoleTypeChanged(MindRoleTypeChangedEvent ev, EntitySessionEventArgs _)
+ {
+ UpdateRoleType();
+ }
+
+ private void UpdateRoleType()
+ {
+ if (_window == null || !_window.IsOpen)
+ return;
+
+ if (!_ent.TryGetComponent<MindContainerComponent>(_player.LocalEntity, out var container)
+ || container.Mind is null)
+ return;
+
+ if (!_ent.TryGetComponent<MindComponent>(container.Mind.Value, out var mind))
+ return;
+
+ var roleText = Loc.GetString("role-type-crew-aligned-name");
+ var color = Color.White;
+ if (_prototypeManager.TryIndex(mind.RoleType, out var proto))
+ {
+ roleText = Loc.GetString(proto.Name);
+ color = proto.Color;
+ }
+ else
+ _sawmill.Error($"{_player.LocalEntity} has invalid Role Type '{mind.RoleType}'. Displaying '{roleText}' instead");
+
+ _window.RoleType.Text = roleText;
+ _window.RoleType.FontColorOverride = color;
+ }
+
private void CharacterDetached(EntityUid uid)
{
CloseWindow();
MinHeight="545">
<ScrollContainer>
<BoxContainer Orientation="Vertical">
+ <Label Name="RoleType" VerticalAlignment="Top" Margin="0 6 0 10" HorizontalAlignment="Center" StyleClasses="LabelHeading" Access="Public"/>
<BoxContainer Orientation="Horizontal">
<SpriteView OverrideDirection="South" Scale="2 2" Name="SpriteView" Access="Public" SetSize="64 64"/>
<BoxContainer Orientation="Vertical" VerticalAlignment="Top">
using Content.Shared.Inventory;
using Content.Shared.Mind;
using Content.Shared.PDA;
-using Content.Shared.Players;
using Content.Shared.Players.PlayTimeTracking;
using Content.Shared.Popups;
using Content.Shared.Roles;
using Robust.Shared.Enums;
using Robust.Shared.Network;
using Robust.Shared.Player;
+using Robust.Shared.Prototypes;
namespace Content.Server.Administration.Systems;
[Dependency] private readonly PopupSystem _popup = default!;
[Dependency] private readonly PhysicsSystem _physics = default!;
[Dependency] private readonly PlayTimeTrackingManager _playTime = default!;
+ [Dependency] private readonly IPrototypeManager _proto = default!;
[Dependency] private readonly SharedRoleSystem _role = default!;
[Dependency] private readonly GameTicker _gameTicker = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
private void OnRoleEvent(RoleEvent ev)
{
var session = _minds.GetSession(ev.Mind);
- if (!ev.Antagonist || session == null)
+
+ if (!ev.RoleTypeUpdate || session == null)
return;
UpdatePlayerList(session);
}
var antag = false;
+
+ RoleTypePrototype roleType = new();
var startingRole = string.Empty;
- if (_minds.TryGetMind(session, out var mindId, out _))
+ if (_minds.TryGetMind(session, out var mindId, out var mindComp))
{
+ if (_proto.TryIndex(mindComp.RoleType, out var role))
+ roleType = role;
+ else
+ Log.Error($"{ToPrettyString(mindId)} has invalid Role Type '{mindComp.RoleType}'. Displaying '{Loc.GetString(roleType.Name)}' instead");
+
antag = _role.MindIsAntagonist(mindId);
startingRole = _jobs.MindTryGetJobName(mindId);
}
overallPlaytime = playTime;
}
- return new PlayerInfo(name, entityName, identityName, startingRole, antag, GetNetEntity(session?.AttachedEntity), data.UserId,
+ return new PlayerInfo(name, entityName, identityName, startingRole, antag, roleType, GetNetEntity(session?.AttachedEntity), data.UserId,
connected, _roundActivePlayers.Contains(data.UserId), overallPlaytime);
}
/// List of Mind Role Prototypes to be added to the player's mind.
/// </summary>
[DataField]
- public List<ProtoId<EntityPrototype>>? MindRoles;
+ public List<EntProtoId>? MindRoles;
/// <summary>
/// A set of starting gear that's equipped to the player.
_mind.SetUserId(newMind, data.UserId);
var jobPrototype = _prototypeManager.Index<JobPrototype>(jobId);
- _roles.MindAddJobRole(newMind, silent: silent, jobPrototype:jobId);
- var jobName = _jobs.MindTryGetJobName(newMind);
_playTimeTrackings.PlayerRolesChanged(player);
_mind.TransferTo(newMind, mob);
+ _roles.MindAddJobRole(newMind, silent: silent, jobPrototype:jobId);
+ var jobName = _jobs.MindTryGetJobName(newMind);
+
if (lateJoin && !silent)
{
if (jobPrototype.JoinNotifyCrew)
-namespace Content.Server.Ghost;
+using Content.Shared.Roles;
+
+namespace Content.Server.Ghost;
/// <summary>
/// This is used to mark Observers properly, as they get Minds
/// </summary>
[RegisterComponent]
-public sealed partial class ObserverRoleComponent : Component
+public sealed partial class ObserverRoleComponent : BaseMindRoleComponent
{
public string Name => Loc.GetString("observer-role-name");
}
}
}
- [DataField("allowSpeech")]
- [ViewVariables(VVAccess.ReadWrite)]
+ /// <summary>
+ /// The mind roles that will be added to the mob's mind entity
+ /// </summary>
+ [DataField, Access(typeof(GhostRoleSystem), Other = AccessPermissions.ReadWriteExecute)] // Don't make eye contact
+ public List<EntProtoId> MindRoles = new() { "MindRoleGhostRoleNeutral" };
+
+ [DataField]
public bool AllowSpeech { get; set; } = true;
- [DataField("allowMovement")]
- [ViewVariables(VVAccess.ReadWrite)]
+ [DataField]
public bool AllowMovement { get; set; }
[ViewVariables(VVAccess.ReadOnly)]
[Access(typeof(GhostRoleSystem), Other = AccessPermissions.ReadWriteExecute)] // also FIXME Friends
public ProtoId<JobPrototype>? JobProto = null;
}
+
[RegisterComponent, Access(typeof(ToggleableGhostRoleSystem))]
public sealed partial class ToggleableGhostRoleComponent : Component
{
- [DataField("examineTextMindPresent")]
+ /// <summary>
+ /// The text shown on the entity's Examine when it is controlled by a player
+ /// </summary>
+ [DataField]
public string ExamineTextMindPresent = string.Empty;
- [DataField("examineTextMindSearching")]
+ /// <summary>
+ /// The text shown on the entity's Examine when it is waiting for a controlling player
+ /// </summary>
+ [DataField]
public string ExamineTextMindSearching = string.Empty;
- [DataField("examineTextNoMind")]
+ /// <summary>
+ /// The text shown on the entity's Examine when it has no controlling player
+ /// </summary>
+ [DataField]
public string ExamineTextNoMind = string.Empty;
- [DataField("beginSearchingText")]
+ /// <summary>
+ /// The popup text when the entity (PAI/positronic brain) it is activated to seek a controlling player
+ /// </summary>
+ [DataField]
public string BeginSearchingText = string.Empty;
- [DataField("roleName")]
+ /// <summary>
+ /// The name shown on the Ghost Role list
+ /// </summary>
+ [DataField]
public string RoleName = string.Empty;
- [DataField("roleDescription")]
+ /// <summary>
+ /// The description shown on the Ghost Role list
+ /// </summary>
+ [DataField]
public string RoleDescription = string.Empty;
- [DataField("roleRules")]
+ /// <summary>
+ /// The introductory message shown when trying to take the ghost role/join the raffle
+ /// </summary>
+ [DataField]
public string RoleRules = string.Empty;
- [DataField("wipeVerbText")]
+ /// <summary>
+ /// A list of mind roles that will be added to the entity's mind
+ /// </summary>
+ [DataField]
+ public List<EntProtoId> MindRoles;
+
+ /// <summary>
+ /// The displayed name of the verb to wipe the controlling player
+ /// </summary>
+ [DataField]
public string WipeVerbText = string.Empty;
- [DataField("wipeVerbPopup")]
+ /// /// <summary>
+ /// The popup message when wiping the controlling player
+ /// </summary>
+ [DataField]
public string WipeVerbPopup = string.Empty;
- [DataField("stopSearchVerbText")]
+ /// <summary>
+ /// The displayed name of the verb to stop searching for a controlling player
+ /// </summary>
+ [DataField]
public string StopSearchVerbText = string.Empty;
- [DataField("stopSearchVerbPopup")]
+ /// /// <summary>
+ /// The popup message when stopping to search for a controlling player
+ /// </summary>
+ [DataField]
public string StopSearchVerbPopup = string.Empty;
+ /// /// <summary>
+ /// The prototype ID of the job that will be given to the controlling mind
+ /// </summary>
[DataField("job")]
- public ProtoId<JobPrototype>? JobProto = null;
+ public ProtoId<JobPrototype>? JobProto;
}
namespace Content.Server.Ghost.Roles;
/// <summary>
-/// This is used for round end display of ghost roles.
-/// It may also be used to ensure some ghost roles count as antagonists in future.
+/// Added to mind role entities to tag that they are a ghostrole.
+/// It also holds the name for the round end display
/// </summary>
[RegisterComponent]
public sealed partial class GhostRoleMarkerRoleComponent : BaseMindRoleComponent
{
- [DataField("name")] public string? Name;
+ //TODO does anything still use this? It gets populated by GhostRolesystem but I don't see anything ever reading it
+ [DataField] public string? Name;
+
}
using Content.Shared.Verbs;
using Robust.Shared.Collections;
using Content.Shared.Ghost.Roles.Components;
-using Content.Shared.Roles.Jobs;
namespace Content.Server.Ghost.Roles;
var newMind = _mindSystem.CreateMind(player.UserId,
EntityManager.GetComponent<MetaDataComponent>(mob).EntityName);
- _roleSystem.MindAddRole(newMind, "MindRoleGhostMarker");
-
- if(_roleSystem.MindHasRole<GhostRoleMarkerRoleComponent>(newMind!, out var markerRole))
- markerRole.Value.Comp2.Name = role.RoleName;
-
_mindSystem.SetUserId(newMind, player.UserId);
_mindSystem.TransferTo(newMind, mob);
+
+ _roleSystem.MindAddRoles(newMind.Owner, role.MindRoles, newMind.Comp);
+
+ if (_roleSystem.MindHasRole<GhostRoleMarkerRoleComponent>(newMind!, out var markerRole))
+ markerRole.Value.Comp2.Name = role.RoleName;
}
/// <summary>
var ghostRole = EnsureComp<GhostRoleComponent>(uid);
EnsureComp<GhostTakeoverAvailableComponent>(uid);
+
+ //GhostRoleComponent inherits custom settings from the ToggleableGhostRoleComponent
ghostRole.RoleName = Loc.GetString(component.RoleName);
ghostRole.RoleDescription = Loc.GetString(component.RoleDescription);
ghostRole.RoleRules = Loc.GetString(component.RoleRules);
ghostRole.JobProto = component.JobProto;
+ ghostRole.MindRoles = component.MindRoles;
}
private void OnExamined(EntityUid uid, ToggleableGhostRoleComponent component, ExaminedEvent args)
SubscribeLocalEvent<RoundRestartCleanupEvent>(OnRoundEnd);
SubscribeLocalEvent<PlayerAttachedEvent>(OnPlayerAttached);
SubscribeLocalEvent<PlayerDetachedEvent>(OnPlayerDetached);
- SubscribeLocalEvent<RoleAddedEvent>(OnRoleAdd);
- SubscribeLocalEvent<RoleRemovedEvent>(OnRoleRemove);
+ SubscribeLocalEvent<RoleAddedEvent>(OnRoleEvent);
+ SubscribeLocalEvent<RoleRemovedEvent>(OnRoleEvent);
SubscribeLocalEvent<AFKEvent>(OnAFK);
SubscribeLocalEvent<UnAFKEvent>(OnUnAFK);
SubscribeLocalEvent<MobStateChangedEvent>(OnMobStateChanged);
return GetTimedRoles(contentData.Mind.Value);
}
- private void OnRoleRemove(RoleRemovedEvent ev)
- {
- if (_minds.TryGetSession(ev.Mind, out var session))
- _tracking.QueueRefreshTrackers(session);
- }
-
- private void OnRoleAdd(RoleAddedEvent ev)
+ private void OnRoleEvent(RoleEvent ev)
{
if (_minds.TryGetSession(ev.Mind, out var session))
_tracking.QueueRefreshTrackers(session);
public override void Initialize()
{
base.Initialize();
- SubscribeLocalEvent<MindComponent, MindRoleAddedEvent>(MindOnDoGreeting);
+ SubscribeLocalEvent<RoleAddedEvent>(OnRoleAddedEvent);
+ SubscribeLocalEvent<RoleRemovedEvent>(OnRoleRemovedEvent);
}
- private void MindOnDoGreeting(EntityUid mindId, MindComponent component, ref MindRoleAddedEvent args)
+ private void OnRoleAddedEvent(RoleAddedEvent args)
+ {
+ MindOnDoGreeting(args.MindId, args.Mind, args);
+
+ if (args.RoleTypeUpdate)
+ _roles.RoleUpdateMessage(args.Mind);
+ }
+
+ private void OnRoleRemovedEvent(RoleRemovedEvent args)
+ {
+ if (args.RoleTypeUpdate)
+ _roles.RoleUpdateMessage(args.Mind);
+ }
+
+ private void MindOnDoGreeting(EntityUid mindId, MindComponent component, RoleAddedEvent args)
{
if (args.Silent)
return;
-namespace Content.Server.Roles;
+using Content.Shared.Roles;
+
+namespace Content.Server.Roles;
/// <summary>
/// Adds a briefing to the character info menu, does nothing else.
/// </summary>
[RegisterComponent]
-public sealed partial class RoleBriefingComponent : Component
+public sealed partial class RoleBriefingComponent : BaseMindRoleComponent
{
- [DataField("briefing"), ViewVariables(VVAccess.ReadWrite)]
+ [DataField]
public string Briefing;
}
+using Content.Server.Chat.Managers;
+using Content.Shared.Chat;
using Content.Shared.Mind;
using Content.Shared.Roles;
+using Robust.Shared.Prototypes;
namespace Content.Server.Roles;
public sealed class RoleSystem : SharedRoleSystem
{
+ [Dependency] private readonly IChatManager _chat = default!;
+ [Dependency] private readonly IPrototypeManager _proto = default!;
+
public string? MindGetBriefing(EntityUid? mindId)
{
if (mindId == null)
return ev.Briefing;
}
+
+ public void RoleUpdateMessage(MindComponent mind)
+ {
+ if (mind.Session is null)
+ return;
+
+ if (!_proto.TryIndex(mind.RoleType, out var proto))
+ return;
+
+ var roleText = Loc.GetString(proto.Name);
+ var color = proto.Color;
+
+ var session = mind.Session;
+
+ //TODO add audio? Would need to be optional so it does not play on role changes that already come with their own audio
+ // _audio.PlayGlobal(Sound, session);
+
+ var message = Loc.GetString("role-type-update-message", ("color", color), ("role", roleText));
+ var wrappedMessage = Loc.GetString("chat-manager-server-wrap-message", ("message", message));
+ _chat.ChatMessageToOne(ChatChannel.Server,
+ message,
+ wrappedMessage,
+ default,
+ false,
+ session.Channel);
+ }
}
/// <summary>
-using Content.Shared.Containers.ItemSlots;
+using Content.Server.Roles;
+using Content.Shared.Containers.ItemSlots;
using Content.Shared.Mind.Components;
+using Content.Shared.Roles;
using Content.Shared.Silicons.Borgs.Components;
using Robust.Shared.Containers;
/// <inheritdoc/>
public sealed partial class BorgSystem
{
+
+ [Dependency] private readonly SharedRoleSystem _roles = default!;
+
public void InitializeMMI()
{
SubscribeLocalEvent<MMIComponent, ComponentInit>(OnMMIInit);
Dirty(uid, component);
if (_mind.TryGetMind(ent, out var mindId, out var mind))
+ {
_mind.TransferTo(mindId, uid, true, mind: mind);
+ if (!_roles.MindHasRole<SiliconBrainRoleComponent>(mindId))
+ _roles.MindAddRole(mindId, "MindRoleSiliconBrain", silent: true);
+ }
+
_appearance.SetData(uid, MMIVisuals.BrainPresent, true);
}
RemComp(uid, component);
if (_mind.TryGetMind(linked, out var mindId, out var mind))
+ {
+ if (_roles.MindHasRole<SiliconBrainRoleComponent>(mindId))
+ _roles.MindRemoveRole<SiliconBrainRoleComponent>(mindId);
+
_mind.TransferTo(mindId, uid, true, mind: mind);
+ }
_appearance.SetData(linked, MMIVisuals.BrainPresent, false);
}
using Content.Server.Explosion.EntitySystems;
using Content.Server.Hands.Systems;
using Content.Server.PowerCell;
-using Content.Shared.Access.Systems;
using Content.Shared.Alert;
using Content.Shared.Database;
using Content.Shared.IdentityManagement;
private void EnsureSubvertedSiliconRole(EntityUid mindId)
{
if (!_roles.MindHasRole<SubvertedSiliconRoleComponent>(mindId))
- _roles.MindAddRole(mindId, "MindRoleSubvertedSilicon");
+ _roles.MindAddRole(mindId, "MindRoleSubvertedSilicon", silent: true);
}
private void RemoveSubvertedSiliconRole(EntityUid mindId)
+using Content.Shared.Mind;
using Robust.Shared.Network;
using Robust.Shared.Serialization;
string IdentityName,
string StartingJob,
bool Antag,
+ RoleTypePrototype RoleProto,
NetEntity? NetEntity,
NetUserId SessionId,
bool Connected,
public sealed partial class CCVars
{
+ /// <summary>
+ /// The sound played when clicking a UI button
+ /// </summary>
public static readonly CVarDef<string> UIClickSound =
CVarDef.Create("interface.click_sound", "/Audio/UserInterface/click.ogg", CVar.REPLICATED);
+ /// <summary>
+ /// The sound played when the mouse hovers over a clickable UI element
+ /// </summary>
public static readonly CVarDef<string> UIHoverSound =
CVarDef.Create("interface.hover_sound", "/Audio/UserInterface/hover.ogg", CVar.REPLICATED);
+ /// <summary>
+ /// The layout style of the UI
+ /// </summary>
public static readonly CVarDef<string> UILayout =
CVarDef.Create("ui.layout", "Default", CVar.CLIENTONLY | CVar.ARCHIVE);
+ /// <summary>
+ /// The dimensions for the chat window in Default UI mode
+ /// </summary>
public static readonly CVarDef<string> DefaultScreenChatSize =
CVarDef.Create("ui.default_chat_size", "", CVar.CLIENTONLY | CVar.ARCHIVE);
+ /// <summary>
+ /// The width of the chat panel in Separated UI mode
+ /// </summary>
public static readonly CVarDef<string> SeparatedScreenChatSize =
CVarDef.Create("ui.separated_chat_size", "0.6,0", CVar.CLIENTONLY | CVar.ARCHIVE);
public static readonly CVarDef<bool> OutlineEnabled =
CVarDef.Create("outline.enabled", true, CVar.CLIENTONLY);
+
+ /// <summary>
+ /// If true, the admin overlay will be displayed in the old style (showing only "ANTAG")
+ /// </summary>
+ public static readonly CVarDef<bool> AdminOverlayClassic =
+ CVarDef.Create("ui.admin_overlay_classic", false, CVar.CLIENTONLY | CVar.ARCHIVE);
}
using Robust.Shared.GameStates;
using Robust.Shared.Network;
using Robust.Shared.Player;
+using Robust.Shared.Prototypes;
namespace Content.Shared.Mind;
[DataField, AutoNetworkedField]
public List<EntityUid> MindRoles = new List<EntityUid>();
+ /// <summary>
+ /// The mind's current antagonist/special role, or lack thereof;
+ /// </summary>
+ [DataField, AutoNetworkedField]
+ public ProtoId<RoleTypePrototype> RoleType = "Neutral";
+
/// <summary>
/// The session of the player owning this mind.
/// Can be null, in which case the player is currently not logged in.
--- /dev/null
+using Robust.Shared.Prototypes;
+
+namespace Content.Shared.Mind;
+
+/// <summary>
+/// The core properties of Role Types
+/// </summary>
+[Prototype, Serializable]
+public sealed class RoleTypePrototype : IPrototype
+{
+ [IdDataField]
+ public string ID { get; private set; } = default!;
+
+ /// <summary>
+ /// The role's name as displayed on the UI.
+ /// </summary>
+ [DataField]
+ public LocId Name = "role-type-crew-aligned-name";
+
+ /// <summary>
+ /// The role's displayed color.
+ /// </summary>
+ [DataField]
+ public Color Color { get; private set; } = Color.FromHex("#eeeeee");
+}
/// depending on their roles.
/// </summary>
/// <param name="IsAntagonist">Whether or not the player is an antagonist.</param>
-/// <param name="IsExclusiveAntagonist">Whether or not AntagSelectionSystem should exclude this player from other antag roles</param
+/// <param name="IsExclusiveAntagonist">Whether or not AntagSelectionSystem should exclude this player from other antag roles</param>
[ByRefEvent]
public record struct MindIsAntagonistEvent(bool IsAntagonist, bool IsExclusiveAntagonist);
+++ /dev/null
-namespace Content.Shared.Roles;
-
-/// <summary>
-/// Raised on mind entities when a role is added to them.
-/// <see cref="RoleAddedEvent"/> for the one raised on player entities.
-/// </summary>
-[ByRefEvent]
-public readonly record struct MindRoleAddedEvent(bool Silent);
using Content.Shared.Mind;
-using JetBrains.Annotations;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
[DataField]
public bool Antag { get; set; } = false;
+ /// <summary>
+ /// The mind's current antagonist/special role, or lack thereof;
+ /// </summary>
+ [DataField]
+ public ProtoId<RoleTypePrototype>? RoleType;
+
/// <summary>
/// True if this mindrole is an exclusive antagonist. Antag setting is not checked if this is True.
/// </summary>
}
// Why does this base component actually exist? It does make auto-categorization easy, but before that it was useless?
+// I used it for easy organisation/bookkeeping of what components are for mindroles
[EntityCategory("Roles")]
public abstract partial class BaseMindRoleComponent : Component
{
namespace Content.Shared.Roles;
/// <summary>
-/// Raised on player entities when a role is added to them.
-/// <see cref="RoleAddedEvent"/> for the one raised on mind entities.
+/// Raised on mind entities when a mind role is added to them.
/// </summary>
/// <param name="MindId">The mind id associated with the player.</param>
/// <param name="Mind">The mind component associated with the mind id.</param>
-/// <param name="Antagonist">Whether or not the role makes the player an antagonist.</param>
-public sealed record RoleAddedEvent(EntityUid MindId, MindComponent Mind, bool Antagonist, bool Silent = false) : RoleEvent(MindId, Mind, Antagonist);
+/// <param name="RoleTypeUpdate">True if this update has changed the mind's role type</param>
+/// <param name="Silent">If true, Job greeting/intro will not be sent to the player's chat</param>
+public sealed record RoleAddedEvent(EntityUid MindId, MindComponent Mind, bool RoleTypeUpdate, bool Silent = false) : RoleEvent(MindId, Mind, RoleTypeUpdate);
namespace Content.Shared.Roles;
/// <summary>
-/// Base event raised on player entities to indicate that something changed about one of their roles.
+/// Base event raised on mind entities to indicate that a mind role was either added or removed.
/// </summary>
/// <param name="MindId">The mind id associated with the player.</param>
/// <param name="Mind">The mind component associated with the mind id.</param>
-/// <param name="Antagonist">Whether or not the role makes the player an antagonist.</param>
-public abstract record RoleEvent(EntityUid MindId, MindComponent Mind, bool Antagonist);
+/// <param name="RoleTypeUpdate">True if this update has changed the mind's role type</param>
+public abstract record RoleEvent(EntityUid MindId, MindComponent Mind, bool RoleTypeUpdate);
namespace Content.Shared.Roles;
/// <summary>
-/// Event raised on player entities to indicate that a role was removed from their mind.
+/// Raised on mind entities when a mind role is removed from them.
/// </summary>
/// <param name="MindId">The mind id associated with the player.</param>
/// <param name="Mind">The mind component associated with the mind id.</param>
-/// <param name="Antagonist">
-/// Whether or not the role made the player an antagonist.
-/// They may still be one due to one of their other roles.
-/// </param>
-public sealed record RoleRemovedEvent(EntityUid MindId, MindComponent Mind, bool Antagonist) : RoleEvent(MindId, Mind, Antagonist);
+/// <param name="RoleTypeUpdate">True if this update has changed the mind's role type</param>
+public sealed record RoleRemovedEvent(EntityUid MindId, MindComponent Mind, bool RoleTypeUpdate) : RoleEvent(MindId, Mind, RoleTypeUpdate);
using System.Diagnostics.CodeAnalysis;
+using System.Linq;
using Content.Shared.Administration.Logs;
using Content.Shared.CCVar;
using Content.Shared.Database;
+using Content.Shared.GameTicking;
using Content.Shared.Mind;
using Content.Shared.Roles.Jobs;
+using Content.Shared.Silicons.Borgs.Components;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Configuration;
using Robust.Shared.Map;
using Robust.Shared.Prototypes;
+using Robust.Shared.Serialization;
using Robust.Shared.Utility;
namespace Content.Shared.Roles;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly IConfigurationManager _cfg = default!;
[Dependency] private readonly IEntityManager _entityManager = default!;
+ [Dependency] private readonly SharedMindSystem _minds = default!;
[Dependency] private readonly IPrototypeManager _prototypes = default!;
private JobRequirementOverridePrototype? _requirementOverride;
Subs.CVar(_cfg, CCVars.GameRoleTimerOverride, SetRequirementOverride, true);
SubscribeLocalEvent<MindRoleComponent, ComponentShutdown>(OnComponentShutdown);
+ SubscribeLocalEvent<StartingMindRoleComponent, PlayerSpawnCompleteEvent>(OnSpawn);
+ }
+
+ private void OnSpawn(EntityUid uid, StartingMindRoleComponent component, PlayerSpawnCompleteEvent args)
+ {
+ if (!_minds.TryGetMind(uid, out var mindId, out var mindComp))
+ return;
+
+ MindAddRole(mindId, component.MindRole, mind: mindComp, silent: component.Silent);
}
private void SetRequirementOverride(string value)
/// <param name="mind">If the mind component is provided, it will be checked if it belongs to the mind entity</param>
/// <param name="silent">If true, no briefing will be generated upon receiving the mind role</param>
public void MindAddRoles(EntityUid mindId,
- List<ProtoId<EntityPrototype>>? roles,
+ List<EntProtoId>? roles,
MindComponent? mind = null,
bool silent = false)
{
/// <param name="mind">If the mind component is provided, it will be checked if it belongs to the mind entity</param>
/// <param name="silent">If true, no briefing will be generated upon receiving the mind role</param>
public void MindAddRole(EntityUid mindId,
- ProtoId<EntityPrototype> protoId,
+ EntProtoId protoId,
MindComponent? mind = null,
bool silent = false)
{
/// Creates a Mind Role
/// </summary>
private void MindAddRoleDo(EntityUid mindId,
- ProtoId<EntityPrototype> protoId,
+ EntProtoId protoId,
MindComponent? mind = null,
bool silent = false,
string? jobPrototype = null)
{
if (!Resolve(mindId, ref mind))
{
- Log.Error($"Failed to add role {protoId} to mind {mindId} : Mind does not match provided mind component");
+ Log.Error($"Failed to add role {protoId} to {ToPrettyString(mindId)} : Mind does not match provided mind component");
return;
}
- var antagonist = false;
-
if (!_prototypes.TryIndex(protoId, out var protoEnt))
{
- Log.Error($"Failed to add role {protoId} to mind {mindId} : Role prototype does not exist");
+ Log.Error($"Failed to add role {protoId} to {ToPrettyString(mindId)} : Role prototype does not exist");
return;
}
DebugTools.Assert(!mindRoleComp.ExclusiveAntag);
}
- antagonist |= mindRoleComp.Antag;
mind.MindRoles.Add(mindRoleId);
- var mindEv = new MindRoleAddedEvent(silent);
- RaiseLocalEvent(mindId, ref mindEv);
+ var update = MindRolesUpdate((mindId, mind));
- var message = new RoleAddedEvent(mindId, mind, antagonist, silent);
+ // RoleType refresh, Role time tracking, Update Admin playerlist
if (mind.OwnedEntity != null)
{
+ var message = new RoleAddedEvent(mindId, mind, update, silent);
RaiseLocalEvent(mind.OwnedEntity.Value, message, true);
}
{
//TODO: This is not tied to the player on the Admin Log filters.
//Probably only happens when Job Role is added on initial spawn, before the mind entity is put in a mob
+ Log.Error($"{ToPrettyString(mindId)} does not have an OwnedEntity!");
_adminLogger.Add(LogType.Mind,
LogImpact.Low,
$"{name} added to {ToPrettyString(mindId)}");
}
}
+ /// <summary>
+ /// Select the mind's currently "active" mind role entity, and update the mind's role type, if necessary
+ /// </summary>
+ /// <returns>
+ /// True if this changed the mind's role type
+ /// </returns>>
+ private bool MindRolesUpdate(Entity<MindComponent?> ent)
+ {
+ if(!Resolve(ent.Owner, ref ent.Comp))
+ return false;
+
+ //get the most important/latest mind role
+ var roleType = GetRoleTypeByTime(ent.Comp);
+
+ if (ent.Comp.RoleType == roleType)
+ return false;
+
+ SetRoleType(ent.Owner, roleType);
+ return true;
+ }
+
+ private ProtoId<RoleTypePrototype> GetRoleTypeByTime(MindComponent mind)
+ {
+ // If any Mind Roles specify a Role Type, return the most recent. Otherwise return Neutral
+
+ var roles = new List<ProtoId<RoleTypePrototype>>();
+
+ foreach (var role in mind.MindRoles)
+ {
+ var comp = Comp<MindRoleComponent>(role);
+ if (comp.RoleType is not null)
+ roles.Add(comp.RoleType.Value);
+ }
+
+ ProtoId<RoleTypePrototype> result = (roles.Count > 0) ? roles.LastOrDefault() : "Neutral";
+ return (result);
+ }
+
+ private void SetRoleType(EntityUid mind, ProtoId<RoleTypePrototype> roleTypeId)
+ {
+ if (!TryComp<MindComponent>(mind, out var comp))
+ {
+ Log.Error($"Failed to update Role Type of mind entity {ToPrettyString(mind)} to {roleTypeId}. MindComponent not found.");
+ return;
+ }
+
+ if (!_prototypes.HasIndex(roleTypeId))
+ {
+ Log.Error($"Failed to change Role Type of {_minds.MindOwnerLoggingString(comp)} to {roleTypeId}. Invalid role");
+ return;
+ }
+
+ comp.RoleType = roleTypeId;
+ Dirty(mind, comp);
+
+ // Update player character window
+ if (_minds.TryGetSession(mind, out var session))
+ RaiseNetworkEvent(new MindRoleTypeChangedEvent(), session.Channel);
+ else
+ {
+ var error = $"The Character Window of {_minds.MindOwnerLoggingString(comp)} potentially did not update immediately : session error";
+ _adminLogger.Add(LogType.Mind, LogImpact.High, $"{error}");
+ }
+
+ if (comp.OwnedEntity is null)
+ {
+ Log.Error($"{ToPrettyString(mind)} does not have an OwnedEntity!");
+ _adminLogger.Add(LogType.Mind,
+ LogImpact.High,
+ $"Role Type of {ToPrettyString(mind)} changed to {roleTypeId}");
+ return;
+ }
+
+ _adminLogger.Add(LogType.Mind,
+ LogImpact.High,
+ $"Role Type of {ToPrettyString(comp.OwnedEntity)} changed to {roleTypeId}");
+ }
+
/// <summary>
/// Removes all instances of a specific role from this mind.
/// </summary>
return false;
var found = false;
- var antagonist = false;
var delete = new List<EntityUid>();
foreach (var role in mind.Comp.MindRoles)
{
if (!HasComp<T>(role))
continue;
- if (!TryComp(role, out MindRoleComponent? roleComp))
+ if (!HasComp<MindRoleComponent>(role))
{
Log.Error($"Encountered mind role entity {ToPrettyString(role)} without a {nameof(MindRoleComponent)}");
continue;
}
- antagonist |= roleComp.Antag | roleComp.ExclusiveAntag;
delete.Add(role);
found = true;
}
_entityManager.DeleteEntity(role);
}
+ var update = MindRolesUpdate(mind);
+
if (mind.Comp.OwnedEntity != null)
{
- var message = new RoleRemovedEvent(mind.Owner, mind.Comp, antagonist);
+ var message = new RoleRemovedEvent(mind.Owner, mind.Comp, update);
RaiseLocalEvent(mind.Comp.OwnedEntity.Value, message, true);
}
/// Finds the first mind role of a specific T type on a mind entity.
/// Outputs entity components for the mind role's MindRoleComponent and for T
/// </summary>
- /// <param name="mindId">The mind entity</param>
+ /// <param name="mind">The mind entity</param>
/// <typeparam name="T">The type of the role to find.</typeparam>
/// <param name="role">The Mind Role entity component</param>
- /// <param name="roleT">The Mind Role's entity component for T</param>
/// <returns>True if the role is found</returns>
public bool MindHasRole<T>(Entity<MindComponent?> mind,
[NotNullWhen(true)] out Entity<MindRoleComponent, T>? role) where T : IComponent
return CheckAntagonistStatus(mindId.Value).ExclusiveAntag;
}
- public (bool Antag, bool ExclusiveAntag) CheckAntagonistStatus(Entity<MindComponent?> mind)
+ private (bool Antag, bool ExclusiveAntag) CheckAntagonistStatus(Entity<MindComponent?> mind)
{
if (!Resolve(mind.Owner, ref mind.Comp))
return (false, false);
return antag.Requirements;
}
}
+
+/// <summary>
+/// Raised on the client to update Role Type on the character window, in case it happened to be open.
+/// </summary>
+[Serializable, NetSerializable]
+public sealed class MindRoleTypeChangedEvent : EntityEventArgs
+{
+
+}
--- /dev/null
+namespace Content.Shared.Roles;
+
+/// <summary>
+/// Used on Silicon's minds to get the appropriate mind role
+/// </summary>
+[RegisterComponent]
+public sealed partial class SiliconBrainRoleComponent : BaseMindRoleComponent
+{
+}
--- /dev/null
+using Robust.Shared.GameStates;
+using Robust.Shared.Prototypes;
+
+namespace Content.Shared.Roles;
+
+/// <summary>
+/// This is most likely not the component you are looking for, almost nothing should be using this.
+/// Consider using GhostRoleComponent or AntagSelectionComponent instead.
+///
+/// The specified mind role will be added to the mob on spawn.
+///
+/// </summary>
+[RegisterComponent, NetworkedComponent]
+public sealed partial class StartingMindRoleComponent : Component
+{
+ /// <summary>
+ /// The ID of the mind role to add
+ /// </summary>
+ [DataField(required: true)]
+ public EntProtoId MindRole;
+
+ /// <summary>
+ /// Add the mind role silently
+ /// </summary>
+ [DataField]
+ public bool Silent = true;
+}
admin-verb-text-make-pirate = Make Pirate
admin-verb-text-make-head-rev = Make Head Rev
admin-verb-text-make-thief = Make Thief
+
+admin-overlay-antag-classic = ANTAG
player-tab-character = Character
player-tab-job = Job
player-tab-antagonist = Antagonist
+player-tab-roletype = Role Type
player-tab-playtime = Playtime
player-tab-show-disconnected = Show Disconnected
player-tab-overlay = Overlay
--- /dev/null
+role-type-crew-aligned-name = Crew Aligned
+role-type-solo-antagonist-name = Solo Antagonist
+role-type-team-antagonist-name = Team Antagonist
+role-type-free-agent-name = Free Agent
+role-type-familiar-name = Familiar
+role-type-silicon-name = Silicon
+role-type-silicon-antagonist-name = Altered Silicon
+
+role-type-update-message = Your role is [color = {$color}]{$role}[/color]
name: ghost-role-information-rat-king-name
description: ghost-role-information-rat-king-description
rules: ghost-role-information-freeagent-rules
+ mindRoles:
+ - MindRoleGhostRoleFreeAgent
raffle:
settings: default
- type: GhostRoleMobSpawner
name: ghost-role-information-remilia-name
description: ghost-role-information-remilia-description
rules: ghost-role-information-familiar-rules
+ mindRoles:
+ - MindRoleGhostRoleFamiliar
raffle:
settings: short
- type: GhostRoleMobSpawner
name: ghost-role-information-cerberus-name
description: ghost-role-information-cerberus-description
rules: ghost-role-information-familiar-rules
+ mindRoles:
+ - MindRoleGhostRoleFamiliar
raffle:
settings: default
- type: GhostRoleMobSpawner
components:
- type: GhostRole
rules: ghost-role-information-rules-default-team-antagonist
+ mindRoles:
+ - MindRoleGhostRoleTeamAntagonist
raffle:
settings: default
- type: GhostRoleMobSpawner
name: ghost-role-information-loneop-name
description: ghost-role-information-loneop-description
rules: ghost-role-information-loneop-rules
+ mindRoles:
+ - MindRoleGhostRoleSoloAntagonist
- type: Sprite
sprite: Markers/jobs.rsi
layers:
name: roles-antag-nuclear-operative-commander-name
description: roles-antag-nuclear-operative-commander-objective
rules: ghost-role-information-rules-default-team-antagonist
+ mindRoles:
+ - MindRoleGhostRoleTeamAntagonist
- type: entity
categories: [ HideSpawnMenu, Spawner ]
name: roles-antag-nuclear-operative-agent-name
description: roles-antag-nuclear-operative-agent-objective
rules: ghost-role-information-rules-default-team-antagonist
+ mindRoles:
+ - MindRoleGhostRoleTeamAntagonist
- type: entity
categories: [ HideSpawnMenu, Spawner ]
name: roles-antag-nuclear-operative-name
description: roles-antag-nuclear-operative-objective
rules: ghost-role-information-rules-default-team-antagonist
+ mindRoles:
+ - MindRoleGhostRoleTeamAntagonist
- type: entity
categories: [ HideSpawnMenu, Spawner ]
name: ghost-role-information-space-dragon-name
description: ghost-role-information-space-dragon-description
rules: ghost-role-information-space-dragon-rules
+ mindRoles:
+ - MindRoleGhostRoleTeamAntagonist
- type: Sprite
layers:
- state: green
name: ghost-role-information-space-ninja-name
description: ghost-role-information-space-ninja-description
rules: ghost-role-information-antagonist-rules
+ mindRoles:
+ - MindRoleGhostRoleSoloAntagonist
raffle:
settings: default
- type: Sprite
access: [["SyndicateAgent"], ["NuclearOperative"]]
- type: SiliconLawProvider
laws: SyndicateStatic
+ subverted: true
- type: IntrinsicRadioTransmitter
channels:
- Binary
name: ghost-role-information-mothroach-name
description: ghost-role-information-mothroach-description
rules: ghost-role-information-freeagent-rules
+ mindRoles:
+ - MindRoleGhostRoleFreeAgent
- type: Fixtures
fixtures:
fix1:
name: ghost-role-information-monkey-name
description: ghost-role-information-monkey-description
rules: ghost-role-information-syndicate-reinforcement-rules
+ mindRoles:
+ # This is for syndicate monkeys that randomly gain sentience, thus have no summoner to team with
+ - MindRoleGhostRoleSoloAntagonist
raffle:
settings: default
- type: GhostTakeoverAvailable
name: ghost-role-information-mouse-name
description: ghost-role-information-mouse-description
rules: ghost-role-information-freeagent-rules
+ mindRoles:
+ - MindRoleGhostRoleFreeAgent
- type: GhostTakeoverAvailable
- type: Speech
speechSounds: Squeak
name: ghost-role-information-giant-spider-name
description: ghost-role-information-giant-spider-description
rules: ghost-role-information-giant-spider-rules
+ mindRoles:
+ - MindRoleGhostRoleTeamAntagonist
raffle:
settings: short
- type: GhostTakeoverAvailable
allowMovement: true
description: ghost-role-information-SyndiCat-description
rules: ghost-role-information-SyndiCat-rules
+ mindRoles:
+ - MindRoleGhostRoleTeamAntagonist
raffle:
settings: default
- type: GhostTakeoverAvailable
name: ghost-role-information-behonker-name
description: ghost-role-information-behonker-description
rules: ghost-role-information-antagonist-rules
+ mindRoles:
+ - MindRoleGhostRoleSoloAntagonist
raffle:
settings: default
- type: GhostTakeoverAvailable
name: ghost-role-information-sentient-carp-name
description: ghost-role-information-sentient-carp-description
rules: ghost-role-information-space-dragon-summoned-carp-rules
+ mindRoles:
+ - MindRoleGhostRoleTeamAntagonist
raffle:
settings: short
- type: GhostTakeoverAvailable
prob: 0
description: ghost-role-information-angry-slimes-description
rules: ghost-role-information-angry-slimes-rules
+ mindRoles:
+ - MindRoleGhostRoleTeamAntagonist
raffle:
settings: short
- type: NpcFactionMember
name: ghost-role-information-hellspawn-name
description: ghost-role-information-hellspawn-description
rules: ghost-role-information-antagonist-rules
+ mindRoles:
+ - MindRoleGhostRoleSoloAntagonist
raffle:
settings: default
- type: RotationVisuals
name: ghost-role-information-rat-king-name
description: ghost-role-information-rat-king-description
rules: ghost-role-information-freeagent-rules
+ mindRoles:
+ - MindRoleGhostRoleFreeAgent
raffle:
settings: default
- type: GhostTakeoverAvailable
name: ghost-role-information-revenant-name
description: ghost-role-information-revenant-description
rules: ghost-role-information-antagonist-rules
+ mindRoles:
+ - MindRoleGhostRoleSoloAntagonist
raffle:
settings: default
- type: GhostTakeoverAvailable
name: ghost-role-information-honkbot-name
description: ghost-role-information-honkbot-description
rules: ghost-role-information-freeagent-rules
+ mindRoles:
+ - MindRoleGhostRoleFreeAgent
raffle:
settings: default
- type: GhostTakeoverAvailable
name: ghost-role-information-jonkbot-name
description: ghost-role-information-jonkbot-description
rules: ghost-role-information-freeagent-rules
+ mindRoles:
+ - MindRoleGhostRoleFreeAgent
raffle:
settings: default
- type: InteractionPopup
name: ghost-role-information-mimebot-name
description: ghost-role-information-mimebot-description
rules: ghost-role-information-freeagent-rules
+ mindRoles:
+ - MindRoleGhostRoleFreeAgent
raffle:
settings: default
- type: GhostTakeoverAvailable
- type: GhostRole
description: ghost-role-information-angry-slimes-description
rules: ghost-role-information-angry-slimes-rules
+ mindRoles:
+ - MindRoleGhostRoleTeamAntagonist
raffle:
settings: short
- type: GhostRole
description: ghost-role-information-angry-slimes-description
rules: ghost-role-information-angry-slimes-rules
+ mindRoles:
+ - MindRoleGhostRoleTeamAntagonist
raffle:
settings: short
- type: GhostRole
description: ghost-role-information-angry-slimes-description
rules: ghost-role-information-angry-slimes-rules
+ mindRoles:
+ - MindRoleGhostRoleTeamAntagonist
raffle:
settings: short
name: ghost-role-information-snail-name
description: ghost-role-information-snail-description
rules: ghost-role-information-freeagent-rules
+ mindRoles:
+ - MindRoleGhostRoleFreeAgent
- type: GhostTakeoverAvailable
- type: Emoting
- type: Sprite
name: ghost-role-information-space-dragon-name
description: ghost-role-information-space-dragon-description
rules: ghost-role-information-space-dragon-rules
+ mindRoles:
+ - MindRoleGhostRoleTeamAntagonist
raffle:
settings: default
- type: GhostTakeoverAvailable
- DoorBumpOpener
- type: Puller
needsHands: false
-
+
- type: entity
parent: BaseMobDragon
id: MobDragon
name: ghost-role-information-remilia-name
description: ghost-role-information-remilia-description
rules: ghost-role-information-familiar-rules
+ mindRoles:
+ - MindRoleGhostRoleFamiliar
- type: GhostTakeoverAvailable
- type: Grammar
attributes:
name: ghost-role-information-cerberus-name
description: ghost-role-information-cerberus-description
rules: ghost-role-information-familiar-rules
+ mindRoles:
+ - MindRoleGhostRoleFamiliar
raffle:
settings: default
- type: GhostTakeoverAvailable
name: ghost-role-information-guardian-name
description: ghost-role-information-guardian-description
rules: ghost-role-information-familiar-rules
+ mindRoles:
+ - MindRoleGhostRoleFamiliar
raffle:
settings: default
- type: GhostTakeoverAvailable
rules: ghost-role-information-Death-Squad-rules
raffle:
settings: short
+ mindRoles:
+ - MindRoleGhostRoleFamiliar
- type: Loadout
prototypes: [ DeathSquadGear ]
roleLoadout: [ RoleSurvivalEVA ]
unlistedNumber: true
requiresPower: false
- type: Holopad
- - type: StationAiWhitelist
+ - type: StationAiWhitelist
- type: UserInterface
interfaces:
enum.HolopadUiKey.AiRequestWindow:
- HideContextMenu
- StationAi
- NoConsoleSound
+ - type: StartingMindRole
+ mindRole: "MindRoleSiliconBrain"
+ silent: true
# Hologram projection that the AI's eye tracks.
- type: entity
cell_slot:
name: power-cell-slot-component-slot-name-default
startingItem: PowerCellMedium
+ - type: StartingMindRole
+ mindRole: "MindRoleSiliconBrain"
+ silent: true
- type: entity
id: PlayerBorgSyndicateAssaultBattery
name: ghost-role-information-skeleton-pirate-name
description: ghost-role-information-skeleton-pirate-description
rules: ghost-role-information-freeagent-rules
+ mindRoles:
+ - MindRoleGhostRoleFreeAgent
raffle:
settings: default
- type: GhostTakeoverAvailable
name: ghost-role-information-skeleton-biker-name
description: ghost-role-information-skeleton-biker-description
rules: ghost-role-information-freeagent-rules
+ mindRoles:
+ - MindRoleGhostRoleFreeAgent
raffle:
settings: default
- type: GhostTakeoverAvailable
name: ghost-role-information-closet-skeleton-name
description: ghost-role-information-closet-skeleton-description
rules: ghost-role-information-freeagent-rules
+ mindRoles:
+ - MindRoleGhostRoleFreeAgent
raffle:
settings: default
- type: GhostTakeoverAvailable
name: ghost-role-information-syndicate-reinforcement-spy-name
description: ghost-role-information-syndicate-reinforcement-spy-description
rules: ghost-role-information-syndicate-reinforcement-rules
+ mindRoles:
+ - MindRoleGhostRoleTeamAntagonist
raffle:
settings: default
- type: GhostRoleMobSpawner
name: ghost-role-information-nukeop-reinforcement-name
description: ghost-role-information-nukeop-reinforcement-description
rules: ghost-role-information-nukeop-reinforcement-rules
+ mindRoles:
+ - MindRoleGhostRoleTeamAntagonist
raffle:
settings: default
- type: GhostRoleMobSpawner
name: ghost-role-information-syndicate-monkey-reinforcement-name
description: ghost-role-information-syndicate-monkey-reinforcement-description
rules: ghost-role-information-syndicate-reinforcement-rules
+ mindRoles:
+ - MindRoleGhostRoleTeamAntagonist
raffle:
settings: default
- type: GhostRoleMobSpawner
name: ghost-role-information-SyndiCat-name
description: ghost-role-information-SyndiCat-description
rules: ghost-role-information-syndicate-reinforcement-rules
+ mindRoles:
+ - MindRoleGhostRoleTeamAntagonist
raffle:
settings: default
- type: GhostRoleMobSpawner
name: ghost-role-information-syndicate-cyborg-assault-name
description: ghost-role-information-syndicate-cyborg-description
rules: ghost-role-information-silicon-rules
+ mindRoles:
+ - MindRoleGhostRoleSilicon
raffle:
settings: default
- type: GhostRoleMobSpawner
roleName: pai-system-role-name
roleDescription: pai-system-role-description
roleRules: ghost-role-information-familiar-rules
+ mindRoles:
+ - MindRoleGhostRoleFamiliar
wipeVerbText: pai-system-wipe-device-verb-text
wipeVerbPopup: pai-system-wiped-device
stopSearchVerbText: pai-system-stop-searching-verb-text
roleName: pai-system-role-name-syndicate
roleDescription: pai-system-role-description-syndicate
roleRules: ghost-role-information-familiar-rules
+ mindRoles:
+ - MindRoleGhostRoleFamiliar
- type: IntrinsicRadioTransmitter
channels:
- Syndicate
roleName: pai-system-role-name-potato
roleDescription: pai-system-role-description-potato
roleRules: ghost-role-information-familiar-rules
+ mindRoles:
+ - MindRoleGhostRoleFamiliar
- type: Appearance
- type: GenericVisualizer
visuals:
roleName: positronic-brain-role-name
roleDescription: positronic-brain-role-description
roleRules: ghost-role-information-silicon-rules
+ mindRoles:
+ - MindRoleGhostRoleSilicon
wipeVerbText: positronic-brain-wipe-device-verb-text
wipeVerbPopup: positronic-brain-wiped-device
stopSearchVerbText: positronic-brain-stop-searching-verb-text
definitions:
- prefRoles: [ Traitor ]
mindRoles:
- - MindRoleTraitor
+ - MindRoleTraitorReinforcement
- type: entity
id: Revolutionary
components:
- type: ObserverRole
-#Ghostrole Marker
+#Ghost Roles
- type: entity
parent: BaseMindRole
- id: MindRoleGhostMarker
+ id: MindRoleGhostRoleNeutral
name: Ghost Role
components:
- type: GhostRoleMarkerRole
+- type: entity
+ parent: BaseMindRole
+ id: MindRoleGhostRoleFamiliar
+ name: Ghost Role (Familiar)
+ components:
+ - type: MindRole
+ roleType: Familiar
+ - type: GhostRoleMarkerRole
+
+- type: entity
+ parent: BaseMindRole
+ id: MindRoleGhostRoleFreeAgent
+ name: Ghost Role (Free Agent)
+ components:
+ - type: MindRole
+ roleType: FreeAgent
+ - type: GhostRoleMarkerRole
+
+- type: entity
+ parent: BaseMindRole
+ id: MindRoleGhostRoleSilicon
+ name: Ghost Role (Silicon)
+ components:
+ - type: MindRole
+ roleType: Silicon
+ - type: GhostRoleMarkerRole
+
+- type: entity
+ parent: BaseMindRole
+ id: MindRoleGhostRoleSiliconAntagonist
+ name: Ghost Role (Silicon Antagonist)
+ components:
+ - type: MindRole
+ roleType: SiliconAntagonist
+ - type: GhostRoleMarkerRole
+
+- type: entity
+ parent: BaseMindRole
+ id: MindRoleGhostRoleSoloAntagonist
+ name: Ghost Role (Solo Antagonist)
+ components:
+ - type: MindRole
+ roleType: SoloAntagonist
+ - type: GhostRoleMarkerRole
+
+- type: entity
+ parent: BaseMindRole
+ id: MindRoleGhostRoleTeamAntagonist
+ name: Ghost Role (Team Antagonist)
+ components:
+ - type: MindRole
+ roleType: TeamAntagonist
+ - type: GhostRoleMarkerRole
+
+
+
# The Job MindRole holds the mob's Job prototype
- type: entity
parent: BaseMindRole
# description:
# MindRoleComponent.JobPrototype is filled by SharedJobSystem
-# Subverted Silicon
+# Silicon
+- type: entity
+ parent: BaseMindRole
+ id: MindRoleSiliconBrain
+ name: Borg Brain Role
+ components:
+ - type: MindRole
+ roleType: Silicon
+ - type: SiliconBrainRole
+
- type: entity
parent: BaseMindRoleAntag
id: MindRoleSubvertedSilicon
name: Subverted Silicon Role
description:
components:
- - type: SubvertedSiliconRole
- type: MindRole
antagPrototype: SubvertedSilicon
+ roleType: SiliconAntagonist
+ - type: SubvertedSiliconRole
# Dragon
- type: entity
components:
- type: MindRole
antagPrototype: Dragon
+ roleType: TeamAntagonist
exclusiveAntag: true
- type: DragonRole
- type: RoleBriefing
components:
- type: MindRole
antagPrototype: SpaceNinja
+ roleType: SoloAntagonist
exclusiveAntag: true
- type: NinjaRole
# description: mind-role-nukeops-description
components:
- type: MindRole
+ roleType: TeamAntagonist
exclusiveAntag: true
antagPrototype: Nukeops
- type: NukeopsRole
- type: MindRole
antagPrototype: HeadRev
exclusiveAntag: true
+ roleType: TeamAntagonist
- type: RevolutionaryRole
- type: entity
components:
- type: MindRole
antagPrototype: Thief
+ roleType: SoloAntagonist
- type: ThiefRole
# Traitors
- type: MindRole
antagPrototype: Traitor
exclusiveAntag: true
+ roleType: SoloAntagonist
- type: TraitorRole
- type: entity
- type: MindRole
antagPrototype: TraitorSleeper
+- type: entity
+ parent: MindRoleTraitor
+ id: MindRoleTraitorReinforcement
+ name: Syndicate Reinforcement Role
+ # description: mind-role-syndicate-reinforcement-description
+ components:
+ - type: MindRole
+ roleType: TeamAntagonist
+
# Zombie Squad
- type: entity
parent: BaseMindRoleAntag
- type: MindRole
antagPrototype: InitialInfected
exclusiveAntag: true
+ roleType: TeamAntagonist
- type: InitialInfectedRole
- type: entity
- type: MindRole
antagPrototype: Zombie
exclusiveAntag: true
+ roleType: TeamAntagonist
- type: ZombieRole
--- /dev/null
+# For use by Role Types
+# Do not touch these
+
+- type: roleType
+ id: Neutral
+ name: role-type-crew-aligned-name
+ color: '#eeeeee'
+
+- type: roleType
+ id: SoloAntagonist
+ name: role-type-solo-antagonist-name
+ color: '#d82000'
+
+- type: roleType
+ id: TeamAntagonist
+ name: role-type-team-antagonist-name
+ color: '#d82000'
+
+- type: roleType
+ id: FreeAgent
+ name: role-type-free-agent-name
+ color: '#ffff00'
+
+- type: roleType
+ id: Familiar
+ name: role-type-familiar-name
+ color: '#6495ed'
+
+- type: roleType
+ id: Silicon
+ name: role-type-silicon-name
+ color: '#6495ed'
+
+- type: roleType
+ id: SiliconAntagonist
+ name: role-type-silicon-antagonist-name
+ color: '#c832e6'
name: ghost-role-information-artifact-name
description: ghost-role-information-artifact-description
rules: ghost-role-information-freeagent-rules
+ mindRoles:
+ - MindRoleGhostRoleFreeAgent
raffle:
settings: default
- type: GhostTakeoverAvailable