using Content.Shared.Ghost;
using Content.Shared.Mind;
using Content.Shared.NameModifier.EntitySystems;
using Content.Shared.Roles.Components;
namespace Content.Server.Roles;
///
/// System responsible for giving a ghost of a paradox clone a name modifier.
///
public sealed class ParadoxCloneRoleSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent>(OnRefreshNameModifiers);
}
private void OnRefreshNameModifiers(Entity ent, ref MindRelayedEvent args)
{
var mindId = Transform(ent).ParentUid; // the mind role entity is in a container in the mind entity
if (!TryComp(mindId, out var mindComp))
return;
// only show for ghosts
if (!HasComp(mindComp.OwnedEntity))
return;
if (ent.Comp.NameModifier != null)
args.Args.AddModifier(ent.Comp.NameModifier.Value, 50);
}
}