Files
wwdpublic/Content.Shared/Mind/Components/MindContainerComponent.cs
sleepyyapril 3a9a0e63bf Change "Kill" To "Teach a Lesson" (#1654)
better for MRP
this code is originally by me anyway, they just made it better

🆑
- tweak: Kill random person objective has been replaced by teaching them
a lesson, removing the need to RR a random person.

---------

Signed-off-by: sleepyyapril <123355664+sleepyyapril@users.noreply.github.com>
Co-authored-by: Lyndomen <49795619+Lyndomen@users.noreply.github.com>
Co-authored-by: Milon <milonpl.git@proton.me>
Co-authored-by: deltanedas <39013340+deltanedas@users.noreply.github.com>
Co-authored-by: VMSolidus <evilexecutive@gmail.com>
(cherry picked from commit f592d4cd890bc14c70153182a400d273ffb113b9)
2025-01-29 20:10:41 +03:00

104 lines
3.6 KiB
C#

using System.Diagnostics.CodeAnalysis;
using Robust.Shared.GameStates;
namespace Content.Shared.Mind.Components
{
/// <summary>
/// This component indicates that this entity may have mind, which is simply an entity with a <see cref="MindComponent"/>.
/// The mind entity is not actually stored in a "container", but is simply stored in nullspace.
/// </summary>
[RegisterComponent, Access(typeof(SharedMindSystem)), NetworkedComponent, AutoGenerateComponentState]
public sealed partial class MindContainerComponent : Component
{
/// <summary>
/// The mind controlling this mob. Can be null.
/// </summary>
[DataField, AutoNetworkedField]
[Access(typeof(SharedMindSystem), Other = AccessPermissions.ReadWriteExecute)] // FIXME Friends
public EntityUid? Mind { get; set; }
/// <summary>
/// True if we have a mind, false otherwise.
/// </summary>
[MemberNotNullWhen(true, nameof(Mind))]
public bool HasMind => Mind != null;
/// <summary>
/// Whether examining should show information about the mind or not.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField("showExamineInfo"), AutoNetworkedField]
public bool ShowExamineInfo { get; set; }
/// <summary>
/// Whether the mind will be put on a ghost after this component is shutdown.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField("ghostOnShutdown")]
[Access(typeof(SharedMindSystem), Other = AccessPermissions.ReadWriteExecute)] // FIXME Friends
public bool GhostOnShutdown { get; set; } = true;
/// <summary>
/// DeltaV: The first mind to control this mob. Will only be null if the mob never had a mind at all.
/// </summary>
[DataField, AutoNetworkedField]
public EntityUid? OriginalMind;
}
public abstract class MindEvent : EntityEventArgs
{
public readonly Entity<MindComponent> Mind;
public readonly Entity<MindContainerComponent> Container;
public MindEvent(Entity<MindComponent> mind, Entity<MindContainerComponent> container)
{
Mind = mind;
Container = container;
}
}
/// <summary>
/// Event raised directed at a mind-container when a mind gets removed.
/// </summary>
public sealed class MindRemovedMessage : MindEvent
{
public MindRemovedMessage(Entity<MindComponent> mind, Entity<MindContainerComponent> container)
: base(mind, container)
{
}
}
/// <summary>
/// Event raised directed at a mind when it gets removed from a mind-container.
/// </summary>
public sealed class MindGotRemovedEvent : MindEvent
{
public MindGotRemovedEvent(Entity<MindComponent> mind, Entity<MindContainerComponent> container)
: base(mind, container)
{
}
}
/// <summary>
/// Event raised directed at a mind-container when a mind gets added.
/// </summary>
public sealed class MindAddedMessage : MindEvent
{
public MindAddedMessage(Entity<MindComponent> mind, Entity<MindContainerComponent> container)
: base(mind, container)
{
}
}
/// <summary>
/// Event raised directed at a mind when it gets added to a mind-container.
/// </summary>
public sealed class MindGotAddedEvent : MindEvent
{
public MindGotAddedEvent(Entity<MindComponent> mind, Entity<MindContainerComponent> container)
: base(mind, container)
{
}
}
}