mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 18:31:17 +03:00
* Make every EntitySystem partial * Oobs thats for a diff PR * Also oops on that one * Test systems * git are we fr * Update file templates * cleanup empty classes while we are here * forgor --------- Co-authored-by: AJCM-git <ajcm_mail@disroot.org>
34 lines
1.1 KiB
C#
34 lines
1.1 KiB
C#
using Content.Shared.Ghost.Components;
|
|
using Content.Shared.Mind;
|
|
using Content.Shared.NameModifier.EntitySystems;
|
|
using Content.Shared.Roles.Components;
|
|
|
|
namespace Content.Server.Roles;
|
|
|
|
/// <summary>
|
|
/// System responsible for giving a ghost of a paradox clone a name modifier.
|
|
/// </summary>
|
|
public sealed partial class ParadoxCloneRoleSystem : EntitySystem
|
|
{
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeLocalEvent<ParadoxCloneRoleComponent, MindRelayedEvent<RefreshNameModifiersEvent>>(OnRefreshNameModifiers);
|
|
}
|
|
|
|
private void OnRefreshNameModifiers(Entity<ParadoxCloneRoleComponent> ent, ref MindRelayedEvent<RefreshNameModifiersEvent> args)
|
|
{
|
|
var mindId = Transform(ent).ParentUid; // the mind role entity is in a container in the mind entity
|
|
|
|
if (!TryComp<MindComponent>(mindId, out var mindComp))
|
|
return;
|
|
|
|
// only show for ghosts
|
|
if (!HasComp<GhostComponent>(mindComp.OwnedEntity))
|
|
return;
|
|
|
|
if (ent.Comp.NameModifier != null)
|
|
args.Args.AddModifier(ent.Comp.NameModifier.Value, 50);
|
|
}
|
|
}
|