using Content.Shared.Alert; using Robust.Shared.GameStates; using Robust.Shared.Prototypes; namespace Content.Shared.CombatMode.Pacification; /// /// Status effect that disallows harming living things and restricts aggressive actions. /// /// There is a caveat with pacifism. It's not intended to be wholly encompassing: there are ways of harming people /// while pacified--plenty of them, even! The goal is to restrict the obvious ones to make gameplay more interesting /// while not overly limiting. /// /// If you want full-pacifism (no combat mode at all), you can simply set before adding. /// [RegisterComponent, NetworkedComponent, AutoGenerateComponentPause] [Access(typeof(PacificationSystem))] public sealed partial class PacifiedComponent : Component { /// /// If true, this will prevent you from disarming opponents in combat. /// [DataField] public bool DisallowDisarm = false; /// /// If true, this will disable combat entirely instead of only disallowing attacking living creatures and harmful things. /// [DataField] public bool DisallowAllCombat = false; /// /// When attempting attack against the same entity multiple times, /// don't spam popups every frame and instead have a cooldown. /// [DataField] public TimeSpan PopupCooldown = TimeSpan.FromSeconds(3.0); /// /// Time at which the next popup can be shown. /// [DataField] [AutoPausedField] public TimeSpan? NextPopupTime = null; /// /// The last entity attacked, used for popup purposes (avoid spam) /// [DataField] public EntityUid? LastAttackedEntity = null; /// /// The alert to show to owners of this component. /// [DataField] public ProtoId PacifiedAlert = "Pacified"; // Prevent cheat clients from using this to identify thieves and players that cannot fight back. // This should not matter for prediction reasons since it only blocks user input. public override bool SendOnlyToOwner => true; }