Move mind role components to shared (#39606)

This commit is contained in:
slarticodefast
2025-08-13 12:51:46 +02:00
committed by GitHub
parent 1f4dfcdcf9
commit 2743dcf67f
66 changed files with 227 additions and 276 deletions

View File

@@ -9,7 +9,6 @@ using Content.Server.Mind;
using Content.Server.Roles; using Content.Server.Roles;
using Content.Server.RoundEnd; using Content.Server.RoundEnd;
using Content.Server.Shuttles.Components; using Content.Server.Shuttles.Components;
using Content.Server.Station.Components;
using Content.Shared.CCVar; using Content.Shared.CCVar;
using Content.Shared.Damage; using Content.Shared.Damage;
using Content.Shared.FixedPoint; using Content.Shared.FixedPoint;
@@ -20,6 +19,7 @@ using Content.Shared.NPC.Prototypes;
using Content.Shared.NPC.Systems; using Content.Shared.NPC.Systems;
using Content.Shared.NukeOps; using Content.Shared.NukeOps;
using Content.Shared.Pinpointer; using Content.Shared.Pinpointer;
using Content.Shared.Roles.Components;
using Content.Shared.Station.Components; using Content.Shared.Station.Components;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;

View File

@@ -3,7 +3,6 @@ using System.Linq;
using Content.Server.Ghost.Roles; using Content.Server.Ghost.Roles;
using Content.Server.Ghost.Roles.Components; using Content.Server.Ghost.Roles.Components;
using Content.Server.Mind; using Content.Server.Mind;
using Content.Server.Roles;
using Content.Shared.Damage; using Content.Shared.Damage;
using Content.Shared.Damage.Prototypes; using Content.Shared.Damage.Prototypes;
using Content.Shared.FixedPoint; using Content.Shared.FixedPoint;
@@ -11,7 +10,7 @@ using Content.Shared.Mind;
using Content.Shared.Mind.Components; using Content.Shared.Mind.Components;
using Content.Shared.Players; using Content.Shared.Players;
using Content.Shared.Roles; using Content.Shared.Roles;
using Content.Shared.Roles.Jobs; using Content.Shared.Roles.Components;
using Robust.Server.Console; using Robust.Server.Console;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;
using Robust.Server.Player; using Robust.Server.Player;

View File

@@ -1,7 +1,5 @@
using System.Linq; using System.Linq;
using Content.Server.Roles; using Content.Shared.Roles.Components;
using Content.Shared.Roles;
using Content.Shared.Roles.Jobs;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
using Robust.Shared.Reflection; using Robust.Shared.Reflection;

View File

@@ -1,7 +1,6 @@
using System.Linq; using System.Linq;
using Content.Server.Administration.Managers; using Content.Server.Administration.Managers;
using Content.Server.Chat.Managers; using Content.Server.Chat.Managers;
using Content.Server.Forensics;
using Content.Server.GameTicking; using Content.Server.GameTicking;
using Content.Server.Hands.Systems; using Content.Server.Hands.Systems;
using Content.Server.Mind; using Content.Server.Mind;
@@ -21,6 +20,7 @@ using Content.Shared.PDA;
using Content.Shared.Players.PlayTimeTracking; using Content.Shared.Players.PlayTimeTracking;
using Content.Shared.Popups; using Content.Shared.Popups;
using Content.Shared.Roles; using Content.Shared.Roles;
using Content.Shared.Roles.Components;
using Content.Shared.Roles.Jobs; using Content.Shared.Roles.Jobs;
using Content.Shared.StationRecords; using Content.Shared.StationRecords;
using Content.Shared.Throwing; using Content.Shared.Throwing;

View File

@@ -3,7 +3,6 @@ using System.Numerics;
using Content.Server.Announcements; using Content.Server.Announcements;
using Content.Server.Discord; using Content.Server.Discord;
using Content.Server.GameTicking.Events; using Content.Server.GameTicking.Events;
using Content.Server.Ghost;
using Content.Server.Maps; using Content.Server.Maps;
using Content.Server.Roles; using Content.Server.Roles;
using Content.Shared.CCVar; using Content.Shared.CCVar;
@@ -12,6 +11,7 @@ using Content.Shared.GameTicking;
using Content.Shared.Mind; using Content.Shared.Mind;
using Content.Shared.Players; using Content.Shared.Players;
using Content.Shared.Preferences; using Content.Shared.Preferences;
using Content.Shared.Roles.Components;
using JetBrains.Annotations; using JetBrains.Annotations;
using Prometheus; using Prometheus;
using Robust.Shared.Asynchronous; using Robust.Shared.Asynchronous;
@@ -19,7 +19,6 @@ using Robust.Shared.Audio;
using Robust.Shared.EntitySerialization; using Robust.Shared.EntitySerialization;
using Robust.Shared.EntitySerialization.Systems; using Robust.Shared.EntitySerialization.Systems;
using Robust.Shared.Map; using Robust.Shared.Map;
using Robust.Shared.Map.Components;
using Robust.Shared.Network; using Robust.Shared.Network;
using Robust.Shared.Player; using Robust.Shared.Player;
using Robust.Shared.Random; using Robust.Shared.Random;

View File

@@ -1,23 +0,0 @@
using Content.Server.GameTicking.Rules.Components;
using Content.Server.Roles;
using Content.Shared.Changeling;
namespace Content.Server.GameTicking.Rules;
/// <summary>
/// Game rule system for Changelings
/// </summary>
public sealed class ChangelingRuleSystem : GameRuleSystem<ChangelingRuleComponent>
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<ChangelingRoleComponent, GetBriefingEvent>(OnGetBriefing);
}
private void OnGetBriefing(Entity<ChangelingRoleComponent> ent, ref GetBriefingEvent args)
{
args.Append(Loc.GetString("changeling-briefing"));
}
}

View File

@@ -4,6 +4,7 @@ using Content.Server.Mind;
using Content.Server.Roles; using Content.Server.Roles;
using Content.Server.Station.Systems; using Content.Server.Station.Systems;
using Content.Shared.Localizations; using Content.Shared.Localizations;
using Content.Shared.Roles.Components;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;
namespace Content.Server.GameTicking.Rules; namespace Content.Server.GameTicking.Rules;

View File

@@ -17,6 +17,7 @@ using Content.Shared.NPC.Components;
using Content.Shared.NPC.Systems; using Content.Shared.NPC.Systems;
using Content.Shared.Nuke; using Content.Shared.Nuke;
using Content.Shared.NukeOps; using Content.Shared.NukeOps;
using Content.Shared.Roles.Components;
using Content.Shared.Store; using Content.Shared.Store;
using Content.Shared.Tag; using Content.Shared.Tag;
using Content.Shared.Zombies; using Content.Shared.Zombies;

View File

@@ -23,6 +23,7 @@ using Content.Shared.Mobs.Systems;
using Content.Shared.NPC.Prototypes; using Content.Shared.NPC.Prototypes;
using Content.Shared.NPC.Systems; using Content.Shared.NPC.Systems;
using Content.Shared.Revolutionary.Components; using Content.Shared.Revolutionary.Components;
using Content.Shared.Roles.Components;
using Content.Shared.Stunnable; using Content.Shared.Stunnable;
using Content.Shared.Zombies; using Content.Shared.Zombies;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
@@ -161,7 +162,10 @@ public sealed class RevolutionaryRuleSystem : GameRuleSystem<RevolutionaryRuleCo
if (_mind.TryGetMind(ev.User.Value, out var revMindId, out _)) if (_mind.TryGetMind(ev.User.Value, out var revMindId, out _))
{ {
if (_role.MindHasRole<RevolutionaryRoleComponent>(revMindId, out var role)) if (_role.MindHasRole<RevolutionaryRoleComponent>(revMindId, out var role))
{
role.Value.Comp2.ConvertedCount++; role.Value.Comp2.ConvertedCount++;
Dirty(role.Value.Owner, role.Value.Comp2);
}
} }
} }

View File

@@ -6,6 +6,7 @@ using Content.Server.Shuttles.Systems;
using Content.Shared.GameTicking.Components; using Content.Shared.GameTicking.Components;
using Content.Shared.Mind; using Content.Shared.Mind;
using Content.Shared.Mobs.Systems; using Content.Shared.Mobs.Systems;
using Content.Shared.Roles.Components;
using Content.Shared.Survivor.Components; using Content.Shared.Survivor.Components;
using Content.Shared.Tag; using Content.Shared.Tag;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;

View File

@@ -2,6 +2,7 @@ using Content.Server.Antag;
using Content.Server.GameTicking.Rules.Components; using Content.Server.GameTicking.Rules.Components;
using Content.Server.Roles; using Content.Server.Roles;
using Content.Shared.Humanoid; using Content.Shared.Humanoid;
using Content.Shared.Roles.Components;
namespace Content.Server.GameTicking.Rules; namespace Content.Server.GameTicking.Rules;

View File

@@ -1,19 +1,16 @@
using Content.Server.Administration.Logs;
using Content.Server.Antag; using Content.Server.Antag;
using Content.Server.GameTicking.Rules.Components; using Content.Server.GameTicking.Rules.Components;
using Content.Server.Mind; using Content.Server.Mind;
using Content.Server.Objectives; using Content.Server.Objectives;
using Content.Server.PDA.Ringer; using Content.Server.PDA.Ringer;
using Content.Server.Roles;
using Content.Server.Traitor.Uplink; using Content.Server.Traitor.Uplink;
using Content.Shared.Database;
using Content.Shared.FixedPoint; using Content.Shared.FixedPoint;
using Content.Shared.GameTicking.Components;
using Content.Shared.Mind; using Content.Shared.Mind;
using Content.Shared.NPC.Systems; using Content.Shared.NPC.Systems;
using Content.Shared.PDA; using Content.Shared.PDA;
using Content.Shared.Random.Helpers; using Content.Shared.Random.Helpers;
using Content.Shared.Roles; using Content.Shared.Roles;
using Content.Shared.Roles.Components;
using Content.Shared.Roles.Jobs; using Content.Shared.Roles.Jobs;
using Content.Shared.Roles.RoleCodeword; using Content.Shared.Roles.RoleCodeword;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;

View File

@@ -13,6 +13,7 @@ using Content.Shared.Mobs;
using Content.Shared.Mobs.Components; using Content.Shared.Mobs.Components;
using Content.Shared.Mobs.Systems; using Content.Shared.Mobs.Systems;
using Content.Shared.Roles; using Content.Shared.Roles;
using Content.Shared.Roles.Components;
using Content.Shared.Zombies; using Content.Shared.Zombies;
using Robust.Shared.Player; using Robust.Shared.Player;
using Robust.Shared.Timing; using Robust.Shared.Timing;

View File

@@ -1,12 +0,0 @@
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 : BaseMindRoleComponent
{
public string Name => Loc.GetString("observer-role-name");
}

View File

@@ -1,15 +0,0 @@
using Content.Shared.Roles;
namespace Content.Server.Ghost.Roles;
/// <summary>
/// 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
{
//TODO does anything still use this? It gets populated by GhostRolesystem but I don't see anything ever reading it
[DataField] public string? Name;
}

View File

@@ -521,9 +521,6 @@ public sealed class GhostRoleSystem : EntitySystem
_mindSystem.TransferTo(newMind, mob); _mindSystem.TransferTo(newMind, mob);
_roleSystem.MindAddRoles(newMind.Owner, role.MindRoles, newMind.Comp); _roleSystem.MindAddRoles(newMind.Owner, role.MindRoles, newMind.Comp);
if (_roleSystem.MindHasRole<GhostRoleMarkerRoleComponent>(newMind!, out var markerRole))
markerRole.Value.Comp2.Name = role.RoleName;
} }
/// <summary> /// <summary>

View File

@@ -6,6 +6,7 @@ using Content.Shared.Database;
using Content.Shared.Implants; using Content.Shared.Implants;
using Content.Shared.Mindshield.Components; using Content.Shared.Mindshield.Components;
using Content.Shared.Revolutionary.Components; using Content.Shared.Revolutionary.Components;
using Content.Shared.Roles.Components;
using Robust.Shared.Containers; using Robust.Shared.Containers;
namespace Content.Server.Mindshield; namespace Content.Server.Mindshield;

View File

@@ -1,10 +1,10 @@
using Content.Server.Mind; using Content.Server.Mind;
using Content.Server.Objectives.Components; using Content.Server.Objectives.Components;
using Content.Server.Popups; using Content.Server.Popups;
using Content.Server.Roles;
using Content.Shared.Ninja.Components; using Content.Shared.Ninja.Components;
using Content.Shared.Ninja.Systems; using Content.Shared.Ninja.Systems;
using Content.Shared.Roles; using Content.Shared.Roles;
using Content.Shared.Roles.Components;
using Content.Shared.Sticky; using Content.Shared.Sticky;
using Content.Shared.Trigger; using Content.Shared.Trigger;

View File

@@ -1,8 +1,8 @@
using Content.Server.Objectives.Components; using Content.Server.Objectives.Components;
using Content.Server.Roles;
using Content.Shared.Objectives.Components; using Content.Shared.Objectives.Components;
using Content.Shared.Ninja.Components; using Content.Shared.Ninja.Components;
using Content.Shared.Roles; using Content.Shared.Roles;
using Content.Shared.Roles.Components;
using Content.Shared.Warps; using Content.Shared.Warps;
using Robust.Shared.Random; using Robust.Shared.Random;

View File

@@ -1,12 +0,0 @@
using Content.Server.Dragon;
using Content.Shared.Roles;
namespace Content.Server.Roles;
/// <summary>
/// Added to mind role entities to tag that they are a space dragon.
/// </summary>
[RegisterComponent, Access(typeof(DragonSystem))]
public sealed partial class DragonRoleComponent : BaseMindRoleComponent
{
}

View File

@@ -1,12 +0,0 @@
using Content.Shared.Roles;
namespace Content.Server.Roles;
/// <summary>
/// Added to mind role entities to tag that they are an initial infected.
/// </summary>
[RegisterComponent]
public sealed partial class InitialInfectedRoleComponent : BaseMindRoleComponent
{
}

View File

@@ -1,11 +0,0 @@
using Content.Shared.Roles;
namespace Content.Server.Roles;
/// <summary>
/// Added to mind role entities to tag that they are a space ninja.
/// </summary>
[RegisterComponent]
public sealed partial class NinjaRoleComponent : BaseMindRoleComponent
{
}

View File

@@ -1,11 +0,0 @@
using Content.Shared.Roles;
namespace Content.Server.Roles;
/// <summary>
/// Added to mind role entities to tag that they are a nuke operative.
/// </summary>
[RegisterComponent]
public sealed partial class NukeopsRoleComponent : BaseMindRoleComponent
{
}

View File

@@ -1,17 +0,0 @@
using Content.Shared.Roles;
namespace Content.Server.Roles;
/// <summary>
/// Added to mind role entities to tag that they are a paradox clone.
/// </summary>
[RegisterComponent]
public sealed partial class ParadoxCloneRoleComponent : BaseMindRoleComponent
{
/// <summary>
/// Name modifer applied to the player when they turn into a ghost.
/// Needed to be able to keep the original and the clone apart in dead chat.
/// </summary>
[DataField]
public LocId? NameModifier = "paradox-clone-ghost-name-modifier";
}

View File

@@ -1,7 +1,7 @@
using Content.Shared.Ghost; using Content.Shared.Ghost;
using Content.Shared.Mind; using Content.Shared.Mind;
using Content.Shared.NameModifier.EntitySystems; using Content.Shared.NameModifier.EntitySystems;
using Content.Shared.Roles; using Content.Shared.Roles.Components;
namespace Content.Server.Roles; namespace Content.Server.Roles;

View File

@@ -3,6 +3,7 @@ using Content.Shared.Administration;
using Content.Shared.Players; using Content.Shared.Players;
using Content.Shared.Roles; using Content.Shared.Roles;
using Content.Shared.Roles.Jobs; using Content.Shared.Roles.Jobs;
using Content.Shared.Roles.Components;
using Robust.Server.Player; using Robust.Server.Player;
using Robust.Shared.Console; using Robust.Shared.Console;

View File

@@ -1,16 +0,0 @@
using Content.Shared.Roles;
namespace Content.Server.Roles;
/// <summary>
/// Added to mind role entities to tag that they are a Revolutionary.
/// </summary>
[RegisterComponent]
public sealed partial class RevolutionaryRoleComponent : BaseMindRoleComponent
{
/// <summary>
/// For headrevs, how many people you have converted.
/// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)]
public uint ConvertedCount = 0;
}

View File

@@ -1,13 +0,0 @@
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 : BaseMindRoleComponent
{
[DataField]
public string Briefing;
}

View File

@@ -1,3 +1,5 @@
using Content.Shared.Roles.Components;
namespace Content.Server.Roles; namespace Content.Server.Roles;
public sealed class RoleBriefingSystem : EntitySystem public sealed class RoleBriefingSystem : EntitySystem

View File

@@ -1,11 +0,0 @@
using Content.Shared.Roles;
namespace Content.Server.Roles;
/// <summary>
/// Added to mind role entities to tag that they are a hacked borg.
/// </summary>
[RegisterComponent]
public sealed partial class SubvertedSiliconRoleComponent : BaseMindRoleComponent
{
}

View File

@@ -1,9 +0,0 @@
using Content.Shared.Roles;
namespace Content.Server.Roles;
/// <summary>
/// Adds to a mind role ent to tag they're a Survivor
/// </summary>
[RegisterComponent]
public sealed partial class SurvivorRoleComponent : BaseMindRoleComponent;

View File

@@ -1,11 +0,0 @@
using Content.Shared.Roles;
namespace Content.Server.Roles;
/// <summary>
/// Added to mind role entities to tag that they are a thief.
/// </summary>
[RegisterComponent]
public sealed partial class ThiefRoleComponent : BaseMindRoleComponent
{
}

View File

@@ -1,11 +0,0 @@
using Content.Shared.Roles;
namespace Content.Server.Roles;
/// <summary>
/// Added to mind role entities to tag that they are a syndicate traitor.
/// </summary>
[RegisterComponent]
public sealed partial class TraitorRoleComponent : BaseMindRoleComponent
{
}

View File

@@ -1,7 +0,0 @@
namespace Content.Server.Roles;
/// <summary>
/// Mind role to tag entities that they're a Wizard
/// </summary>
[RegisterComponent]
public sealed partial class WizardRoleComponent : Component;

View File

@@ -1,11 +0,0 @@
using Content.Shared.Roles;
namespace Content.Server.Roles;
/// <summary>
/// Added to mind role entities to tag that they are a zombie.
/// </summary>
[RegisterComponent]
public sealed partial class ZombieRoleComponent : BaseMindRoleComponent
{
}

View File

@@ -1,7 +1,7 @@
using Content.Server.Roles; using Content.Shared.Containers.ItemSlots;
using Content.Shared.Containers.ItemSlots;
using Content.Shared.Mind.Components; using Content.Shared.Mind.Components;
using Content.Shared.Roles; using Content.Shared.Roles;
using Content.Shared.Roles.Components;
using Content.Shared.Silicons.Borgs.Components; using Content.Shared.Silicons.Borgs.Components;
using Robust.Shared.Containers; using Robust.Shared.Containers;

View File

@@ -2,7 +2,6 @@ using System.Linq;
using Content.Server.Administration; using Content.Server.Administration;
using Content.Server.Chat.Managers; using Content.Server.Chat.Managers;
using Content.Server.Radio.Components; using Content.Server.Radio.Components;
using Content.Server.Roles;
using Content.Server.Station.Systems; using Content.Server.Station.Systems;
using Content.Shared.Administration; using Content.Shared.Administration;
using Content.Shared.Chat; using Content.Shared.Chat;
@@ -11,9 +10,9 @@ using Content.Shared.GameTicking;
using Content.Shared.Mind; using Content.Shared.Mind;
using Content.Shared.Mind.Components; using Content.Shared.Mind.Components;
using Content.Shared.Roles; using Content.Shared.Roles;
using Content.Shared.Roles.Components;
using Content.Shared.Silicons.Laws; using Content.Shared.Silicons.Laws;
using Content.Shared.Silicons.Laws.Components; using Content.Shared.Silicons.Laws.Components;
using Content.Shared.Wires;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;
using Robust.Shared.Audio; using Robust.Shared.Audio;
using Robust.Shared.Containers; using Robust.Shared.Containers;

View File

@@ -1,12 +1,12 @@
using Content.Server.Mind; using Content.Server.Mind;
using Content.Server.Objectives.Components; using Content.Server.Objectives.Components;
using Content.Server.Roles;
using Content.Server.Thief.Components; using Content.Server.Thief.Components;
using Content.Shared.Examine; using Content.Shared.Examine;
using Content.Shared.Foldable; using Content.Shared.Foldable;
using Content.Shared.Popups; using Content.Shared.Popups;
using Content.Shared.Verbs; using Content.Shared.Verbs;
using Content.Shared.Roles; using Content.Shared.Roles;
using Content.Shared.Roles.Components;
using Robust.Shared.Audio.Systems; using Robust.Shared.Audio.Systems;
namespace Content.Server.Thief.Systems; namespace Content.Server.Thief.Systems;

View File

@@ -6,7 +6,6 @@ using Content.Server.Chat;
using Content.Server.Chat.Systems; using Content.Server.Chat.Systems;
using Content.Server.Emoting.Systems; using Content.Server.Emoting.Systems;
using Content.Server.Speech.EntitySystems; using Content.Server.Speech.EntitySystems;
using Content.Server.Roles;
using Content.Shared.Anomaly.Components; using Content.Shared.Anomaly.Components;
using Content.Shared.Armor; using Content.Shared.Armor;
using Content.Shared.Bed.Sleep; using Content.Shared.Bed.Sleep;
@@ -21,6 +20,7 @@ using Content.Shared.Mobs.Components;
using Content.Shared.Mobs.Systems; using Content.Shared.Mobs.Systems;
using Content.Shared.Popups; using Content.Shared.Popups;
using Content.Shared.Roles; using Content.Shared.Roles;
using Content.Shared.Roles.Components;
using Content.Shared.Weapons.Melee.Events; using Content.Shared.Weapons.Melee.Events;
using Content.Shared.Zombies; using Content.Shared.Zombies;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;

View File

@@ -1,9 +0,0 @@
using Content.Shared.Roles;
namespace Content.Shared.Changeling;
/// <summary>
/// The Mindrole for Changeling Antags
/// </summary>
[RegisterComponent]
public sealed partial class ChangelingRoleComponent : BaseMindRoleComponent;

View File

@@ -3,7 +3,7 @@ using Content.Shared.Localizations;
using Content.Shared.Mind; using Content.Shared.Mind;
using Content.Shared.Mind.Components; using Content.Shared.Mind.Components;
using Content.Shared.Roles; using Content.Shared.Roles;
using Content.Shared.Roles.Jobs; using Content.Shared.Roles.Components;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
namespace Content.Shared.EntityEffects.EffectConditions; namespace Content.Shared.EntityEffects.EffectConditions;

View File

@@ -0,0 +1,9 @@
using Robust.Shared.GameStates;
namespace Content.Shared.Roles.Components;
/// <summary>
/// Added to mind role entities to tag that they are a changeling.
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed partial class ChangelingRoleComponent : BaseMindRoleComponent;

View File

@@ -0,0 +1,9 @@
using Robust.Shared.GameStates;
namespace Content.Shared.Roles.Components;
/// <summary>
/// Added to mind role entities to tag that they are a space dragon.
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed partial class DragonRoleComponent : BaseMindRoleComponent;

View File

@@ -0,0 +1,9 @@
using Robust.Shared.GameStates;
namespace Content.Shared.Roles.Components;
/// <summary>
/// Added to mind role entities to tag that they are a ghostrole.
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed partial class GhostRoleMarkerRoleComponent : BaseMindRoleComponent;

View File

@@ -0,0 +1,9 @@
using Robust.Shared.GameStates;
namespace Content.Shared.Roles.Components;
/// <summary>
/// Added to mind role entities to tag that they are an initial infected.
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed partial class InitialInfectedRoleComponent : BaseMindRoleComponent;

View File

@@ -1,12 +1,9 @@
using Robust.Shared.GameStates; using Robust.Shared.GameStates;
namespace Content.Shared.Roles.Jobs; namespace Content.Shared.Roles.Components;
/// <summary> /// <summary>
/// Added to mind role entities to mark them as a job role entity. /// Added to mind role entities to mark them as a job role entity.
/// </summary> /// </summary>
[RegisterComponent, NetworkedComponent] [RegisterComponent, NetworkedComponent]
public sealed partial class JobRoleComponent : BaseMindRoleComponent public sealed partial class JobRoleComponent : BaseMindRoleComponent;
{
}

View File

@@ -2,7 +2,7 @@ using Content.Shared.Mind;
using Robust.Shared.GameStates; using Robust.Shared.GameStates;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
namespace Content.Shared.Roles; namespace Content.Shared.Roles.Components;
/// <summary> /// <summary>
/// This holds data for, and indicates, a Mind Role entity /// This holds data for, and indicates, a Mind Role entity
@@ -11,20 +11,20 @@ namespace Content.Shared.Roles;
public sealed partial class MindRoleComponent : BaseMindRoleComponent public sealed partial class MindRoleComponent : BaseMindRoleComponent
{ {
/// <summary> /// <summary>
/// Marks this Mind Role as Antagonist /// Marks this Mind Role as Antagonist.
/// A single antag Mind Role is enough to make the owner mind count as Antagonist. /// A single antag Mind Role is enough to make the owner mind count as Antagonist.
/// </summary> /// </summary>
[DataField] [DataField]
public bool Antag; public bool Antag;
/// <summary> /// <summary>
/// The mind's current antagonist/special role, or lack thereof; /// The mind's current antagonist/special role, or lack thereof.
/// </summary> /// </summary>
[DataField] [DataField]
public ProtoId<RoleTypePrototype>? RoleType; public ProtoId<RoleTypePrototype>? RoleType;
/// <summary> /// <summary>
/// The role's subtype, shown only to admins to help with antag categorization /// The role's subtype, shown only to admins to help with antag categorization.
/// </summary> /// </summary>
[DataField] [DataField]
public LocId? Subtype; public LocId? Subtype;
@@ -36,21 +36,24 @@ public sealed partial class MindRoleComponent : BaseMindRoleComponent
public bool ExclusiveAntag; public bool ExclusiveAntag;
/// <summary> /// <summary>
/// The Mind that this role belongs to /// The Mind that this role belongs to.
/// </summary> /// </summary>
public Entity<MindComponent> Mind { get; set; } /// <remarks>
/// TODO: Make this a datafield. Also components should not store other components.
/// </remarks>
public Entity<MindComponent> Mind;
/// <summary> /// <summary>
/// The Antagonist prototype of this role /// The Antagonist prototype of this role.
/// </summary> /// </summary>
[DataField] [DataField]
public ProtoId<AntagPrototype>? AntagPrototype { get; set; } public ProtoId<AntagPrototype>? AntagPrototype;
/// <summary> /// <summary>
/// The Job prototype of this role /// The Job prototype of this role.
/// </summary> /// </summary>
[DataField] [DataField]
public ProtoId<JobPrototype>? JobPrototype { get; set; } public ProtoId<JobPrototype>? JobPrototype;
/// <summary> /// <summary>
/// Used to order the characters on by role/antag status. Highest numbers are shown first. /// Used to order the characters on by role/antag status. Highest numbers are shown first.
@@ -62,7 +65,4 @@ public sealed partial class MindRoleComponent : BaseMindRoleComponent
// Why does this base component actually exist? It does make auto-categorization easy, but before that it was useless? // 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 // I used it for easy organisation/bookkeeping of what components are for mindroles
[EntityCategory("Roles")] [EntityCategory("Roles")]
public abstract partial class BaseMindRoleComponent : Component public abstract partial class BaseMindRoleComponent : Component;
{
}

View File

@@ -0,0 +1,9 @@
using Robust.Shared.GameStates;
namespace Content.Shared.Roles.Components;
/// <summary>
/// Added to mind role entities to tag that they are a space ninja.
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed partial class NinjaRoleComponent : BaseMindRoleComponent;

View File

@@ -0,0 +1,9 @@
using Robust.Shared.GameStates;
namespace Content.Shared.Roles.Components;
/// <summary>
/// Added to mind role entities to tag that they are a nuke operative.
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed partial class NukeopsRoleComponent : BaseMindRoleComponent;

View File

@@ -0,0 +1,9 @@
using Robust.Shared.GameStates;
namespace Content.Shared.Roles.Components;
/// <summary>
/// This is used to mark Observers properly, as they get Minds.
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed partial class ObserverRoleComponent : BaseMindRoleComponent;

View File

@@ -0,0 +1,17 @@
using Robust.Shared.GameStates;
namespace Content.Shared.Roles.Components;
/// <summary>
/// Added to mind role entities to tag that they are a paradox clone.
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed partial class ParadoxCloneRoleComponent : BaseMindRoleComponent
{
/// <summary>
/// Name modifer applied to the player when they turn into a ghost.
/// Needed to be able to keep the original and the clone apart in dead chat.
/// </summary>
[DataField]
public LocId? NameModifier = "paradox-clone-ghost-name-modifier";
}

View File

@@ -0,0 +1,16 @@
using Robust.Shared.GameStates;
namespace Content.Shared.Roles.Components;
/// <summary>
/// Added to mind role entities to tag that they are a Revolutionary.
/// </summary>
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class RevolutionaryRoleComponent : BaseMindRoleComponent
{
/// <summary>
/// For headrevs, how many people you have converted.
/// </summary>
[DataField, AutoNetworkedField]
public uint ConvertedCount = 0;
}

View File

@@ -0,0 +1,13 @@
using Robust.Shared.GameStates;
namespace Content.Shared.Roles.Components;
/// <summary>
/// Adds a briefing to the character info menu, does nothing else.
/// </summary>
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
public sealed partial class RoleBriefingComponent : BaseMindRoleComponent
{
[DataField(required: true), AutoNetworkedField]
public LocId Briefing;
}

View File

@@ -0,0 +1,9 @@
using Robust.Shared.GameStates;
namespace Content.Shared.Roles.Components;
/// <summary>
/// Used on Silicon's minds to get the appropriate mind role
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed partial class SiliconBrainRoleComponent : BaseMindRoleComponent;

View File

@@ -1,14 +1,13 @@
using Robust.Shared.GameStates; using Robust.Shared.GameStates;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
namespace Content.Shared.Roles; namespace Content.Shared.Roles.Components;
/// <summary> /// <summary>
/// This is most likely not the component you are looking for, almost nothing should be using this. /// This is most likely not the component you are looking for, almost nothing should be using this.
/// Consider using GhostRoleComponent or AntagSelectionComponent instead. /// Consider using GhostRoleComponent or AntagSelectionComponent instead.
/// ///
/// The specified mind role will be added to the mob on spawn. /// The specified mind role will be added to the mob on spawn.
///
/// </summary> /// </summary>
[RegisterComponent, NetworkedComponent] [RegisterComponent, NetworkedComponent]
public sealed partial class StartingMindRoleComponent : Component public sealed partial class StartingMindRoleComponent : Component

View File

@@ -0,0 +1,9 @@
using Robust.Shared.GameStates;
namespace Content.Shared.Roles.Components;
/// <summary>
/// Added to mind role entities to tag that they are a hacked borg.
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed partial class SubvertedSiliconRoleComponent : BaseMindRoleComponent;

View File

@@ -0,0 +1,9 @@
using Robust.Shared.GameStates;
namespace Content.Shared.Roles.Components;
/// <summary>
/// Added to mind role entities to tag that they are survivor.
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed partial class SurvivorRoleComponent : BaseMindRoleComponent;

View File

@@ -0,0 +1,9 @@
using Robust.Shared.GameStates;
namespace Content.Shared.Roles.Components;
/// <summary>
/// Added to mind role entities to tag that they are a thief.
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed partial class ThiefRoleComponent : BaseMindRoleComponent;

View File

@@ -0,0 +1,9 @@
using Robust.Shared.GameStates;
namespace Content.Shared.Roles.Components;
/// <summary>
/// Added to mind role entities to tag that they are a syndicate traitor.
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed partial class TraitorRoleComponent : BaseMindRoleComponent;

View File

@@ -0,0 +1,9 @@
using Robust.Shared.GameStates;
namespace Content.Shared.Roles.Components;
/// <summary>
/// Added to mind role entities to tag that they are a wizard.
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed partial class WizardRoleComponent : Component;

View File

@@ -0,0 +1,9 @@
using Robust.Shared.GameStates;
namespace Content.Shared.Roles.Components;
/// <summary>
/// Added to mind role entities to tag that they are a zombie.
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed partial class ZombieRoleComponent : BaseMindRoleComponent;

View File

@@ -2,6 +2,7 @@
using System.Linq; using System.Linq;
using Content.Shared.Players; using Content.Shared.Players;
using Content.Shared.Players.PlayTimeTracking; using Content.Shared.Players.PlayTimeTracking;
using Content.Shared.Roles.Components;
using Robust.Shared.Player; using Robust.Shared.Player;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using Robust.Shared.Utility; using Robust.Shared.Utility;

View File

@@ -5,7 +5,7 @@ using Content.Shared.CCVar;
using Content.Shared.Database; using Content.Shared.Database;
using Content.Shared.GameTicking; using Content.Shared.GameTicking;
using Content.Shared.Mind; using Content.Shared.Mind;
using Content.Shared.Roles.Jobs; using Content.Shared.Roles.Components;
using Content.Shared.Whitelist; using Content.Shared.Whitelist;
using Robust.Shared.Audio; using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems; using Robust.Shared.Audio.Systems;

View File

@@ -1,9 +0,0 @@
namespace Content.Shared.Roles;
/// <summary>
/// Used on Silicon's minds to get the appropriate mind role
/// </summary>
[RegisterComponent]
public sealed partial class SiliconBrainRoleComponent : BaseMindRoleComponent
{
}

View File

@@ -1,2 +0,0 @@
observer-role-name = Observer

View File

@@ -320,3 +320,5 @@
roleType: SoloAntagonist roleType: SoloAntagonist
subtype: role-subtype-changeling subtype: role-subtype-changeling
- type: ChangelingRole - type: ChangelingRole
- type: RoleBriefing
briefing: changeling-briefing