diff --git a/Content.Server/Chat/Systems/ChatSystem.cs b/Content.Server/Chat/Systems/ChatSystem.cs index f1fcd17a79..00140301c8 100644 --- a/Content.Server/Chat/Systems/ChatSystem.cs +++ b/Content.Server/Chat/Systems/ChatSystem.cs @@ -159,10 +159,9 @@ public sealed partial class ChatSystem : SharedChatSystem IConsoleShell? shell = null, ICommonSession? player = null, string? nameOverride = null, bool checkRadioPrefix = true, - bool ignoreActionBlocker = false, - bool force = false) + bool ignoreActionBlocker = false) { - TrySendInGameICMessage(source, message, desiredType, hideChat ? ChatTransmitRange.HideChat : ChatTransmitRange.Normal, hideLog, shell, player, nameOverride, checkRadioPrefix, ignoreActionBlocker, force); + TrySendInGameICMessage(source, message, desiredType, hideChat ? ChatTransmitRange.HideChat : ChatTransmitRange.Normal, hideLog, shell, player, nameOverride, checkRadioPrefix, ignoreActionBlocker); } /// @@ -186,8 +185,7 @@ public sealed partial class ChatSystem : SharedChatSystem ICommonSession? player = null, string? nameOverride = null, bool checkRadioPrefix = true, - bool ignoreActionBlocker = false, - bool force = false + bool ignoreActionBlocker = false ) { if (HasComp(source)) @@ -209,7 +207,7 @@ public sealed partial class ChatSystem : SharedChatSystem return; } - if (!force && !CanSendInGame(message, shell, player)) + if (!CanSendInGame(message, shell, player)) return; ignoreActionBlocker = CheckIgnoreSpeechBlocker(source, ignoreActionBlocker); diff --git a/Content.Server/White/Commands/NoticeCommand.cs b/Content.Server/White/Commands/NoticeCommand.cs index 61c4e87e55..5206cef8b6 100644 --- a/Content.Server/White/Commands/NoticeCommand.cs +++ b/Content.Server/White/Commands/NoticeCommand.cs @@ -16,7 +16,7 @@ internal sealed class NoticeCommand : IConsoleCommand public void Execute(IConsoleShell shell, string argStr, string[] args) { - if (shell.Player is not IPlayerSession player) + if (shell.Player is not { } player) { shell.WriteError("This command cannot be run from the server."); return; diff --git a/Content.Server/White/Other/CritMobActionsSystem.cs b/Content.Server/White/Other/CritMobActionsSystem.cs deleted file mode 100644 index 8adc73451c..0000000000 --- a/Content.Server/White/Other/CritMobActionsSystem.cs +++ /dev/null @@ -1,76 +0,0 @@ -using Content.Server.Administration; -using Content.Server.Chat.Systems; -using Content.Shared.Actions; -using Content.Shared.Mobs.Systems; -using Content.Shared.White.Other; -using Robust.Server.Console; -using Robust.Server.GameObjects; - -namespace Content.Server.White.Other; - -/// -/// Handles performing crit-specific actions. -/// -public sealed class CritMobActionsSystem : EntitySystem -{ - [Dependency] private readonly ChatSystem _chat = default!; - [Dependency] private readonly IServerConsoleHost _host = default!; - [Dependency] private readonly MobStateSystem _mobState = default!; - [Dependency] private readonly QuickDialogSystem _quickDialog = default!; - - private const int MaxLastWordsLength = 30; - - public override void Initialize() - { - base.Initialize(); - - SubscribeLocalEvent(OnSuccumb); - SubscribeLocalEvent(OnLastWords); - } - - private void OnSuccumb(EntityUid uid, MobStateActionsComponent component, CritSuccumbEvent args) - { - if (!TryComp(uid, out var actor) || !_mobState.IsCritical(uid)) - return; - - _host.ExecuteCommand(actor.PlayerSession, "ghost"); - args.Handled = true; - } - - private void OnLastWords(EntityUid uid, MobStateActionsComponent component, CritLastWordsEvent args) - { - if (!TryComp(uid, out var actor)) - return; - - _quickDialog.OpenDialog(actor.PlayerSession, Loc.GetString("action-name-crit-last-words"), "", - (string lastWords) => - { - if (actor.PlayerSession.AttachedEntity != uid - || !_mobState.IsCritical(uid)) - return; - if (lastWords.Length > MaxLastWordsLength) - { - lastWords = lastWords.Substring(0, MaxLastWordsLength); - } - lastWords += "..."; - _chat.TrySendInGameICMessage(uid, lastWords, InGameICChatType.Whisper, ChatTransmitRange.Normal, force: true); - _host.ExecuteCommand(actor.PlayerSession, "ghost"); - }); - - args.Handled = true; - } -} - -/// -/// Only applies to mobs in crit capable of ghosting/succumbing -/// -public sealed class CritSuccumbEvent : InstantActionEvent -{ -} - -/// -/// Only applies to mobs capable of speaking, as a last resort in crit -/// -public sealed class CritLastWordsEvent : InstantActionEvent -{ -} diff --git a/Content.Server/White/Other/DeathGasps/OnDeath.cs b/Content.Server/White/Other/DeathGasps/OnDeath.cs index 90d8b5f7b6..3dfbcdf1ca 100644 --- a/Content.Server/White/Other/DeathGasps/OnDeath.cs +++ b/Content.Server/White/Other/DeathGasps/OnDeath.cs @@ -88,7 +88,8 @@ public sealed class OnDeath : EntitySystem private void SendDeathGaspMessage(EntityUid uid, string message) { - _chat.TrySendInGameICMessage(uid, message, InGameICChatType.Emote, ChatTransmitRange.Normal, force: true); + _chat.TrySendInGameICMessage(uid, message, InGameICChatType.Emote, ChatTransmitRange.Normal, + ignoreActionBlocker: true); } private void PlayDeathSound(EntityUid uid) diff --git a/Content.Server/White/Other/ExamineSystem/ExamineSystem.cs b/Content.Server/White/Other/ExamineSystem/ExamineSystem.cs index 87f01993c7..f947d34d0d 100644 --- a/Content.Server/White/Other/ExamineSystem/ExamineSystem.cs +++ b/Content.Server/White/Other/ExamineSystem/ExamineSystem.cs @@ -8,6 +8,7 @@ using Content.Shared.White; using Robust.Server.GameObjects; using Robust.Shared.Configuration; using Robust.Shared.Console; +using Robust.Shared.Player; namespace Content.Server.White.Other.ExamineSystem { diff --git a/Content.Shared/Content.Shared.csproj b/Content.Shared/Content.Shared.csproj index e67223ae3c..b8fc551e75 100644 --- a/Content.Shared/Content.Shared.csproj +++ b/Content.Shared/Content.Shared.csproj @@ -23,6 +23,9 @@ false + + + diff --git a/Content.Shared/White/Other/MobStateActionsComponent.cs b/Content.Shared/White/Other/MobStateActionsComponent.cs deleted file mode 100644 index cfa41a3ce5..0000000000 --- a/Content.Shared/White/Other/MobStateActionsComponent.cs +++ /dev/null @@ -1,27 +0,0 @@ -using Content.Shared.Mobs; - -namespace Content.Shared.White.Other; - -/// -/// Used for specifying actions that should be automatically added/removed on mob state transitions -/// -/// -/// Mostly for crit-specific actions. -/// -/// -[RegisterComponent] -public sealed class MobStateActionsComponent : Component -{ - /// - /// Specifies a list of actions that should be available if a mob is in a given state. - /// - /// - /// actions: - /// Critical: - /// - CritSuccumb - /// Alive: - /// - AnimalLayEgg - /// - [DataField("actions")] - public Dictionary> Actions = new(); -} diff --git a/Content.Shared/White/Other/MobStateActionsSystem.cs b/Content.Shared/White/Other/MobStateActionsSystem.cs deleted file mode 100644 index c37975a947..0000000000 --- a/Content.Shared/White/Other/MobStateActionsSystem.cs +++ /dev/null @@ -1,54 +0,0 @@ -using Content.Shared.Actions; -using Content.Shared.Actions.ActionTypes; -using Content.Shared.Mobs; -using Robust.Shared.Prototypes; - -namespace Content.Shared.White.Other; - -/// -/// Adds and removes defined actions when a mob's changes. -/// -public sealed class MobStateActionsSystem : EntitySystem -{ - [Dependency] private readonly IPrototypeManager _proto = default!; - [Dependency] private readonly SharedActionsSystem _actions = default!; - - /// - public override void Initialize() - { - SubscribeLocalEvent(OnMobStateChanged); - } - - private void OnMobStateChanged(EntityUid uid, MobStateActionsComponent component, MobStateChangedEvent args) - { - if (!TryComp(uid, out var action)) - return; - - foreach (var (state, acts) in component.Actions) - { - if (state != args.NewMobState && state != args.OldMobState) - continue; - - foreach (var item in acts) - { - if (!_proto.TryIndex(item, out var proto)) - continue; - - var instance = new InstantAction(proto); - if (state == args.OldMobState) - { - // Don't remove actions that would be getting readded anyway - if (component.Actions.TryGetValue(args.NewMobState, out var value) - && value.Contains(item)) - continue; - - _actions.RemoveAction(uid, instance, action); - } - else if (state == args.NewMobState) - { - _actions.AddAction(uid, instance, null, action); - } - } - } - } -} diff --git a/Content.Shared/White/WhiteCVars.cs b/Content.Shared/White/WhiteCVars.cs index 73c8e55791..02f7a2e8a4 100644 --- a/Content.Shared/White/WhiteCVars.cs +++ b/Content.Shared/White/WhiteCVars.cs @@ -298,7 +298,7 @@ public sealed class WhiteCVars /// /// Should load a ERT map? /// - public static readonly CVarDef LoadERTMap = CVarDef.Create("white.ert_load", false, CVar.SERVERONLY); + public static readonly CVarDef LoadErtMap = CVarDef.Create("white.ert_load", false, CVar.SERVERONLY); public static readonly CVarDef LogChatActions = CVarDef.Create("white.log_to_chat", true, CVar.CLIENT | CVar.ARCHIVE | CVar.REPLICATED); diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml b/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml index 61da8b3b73..22569dc518 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml @@ -1388,7 +1388,7 @@ actions: Critical: - ActionCritSuccumb - - ActionCritFakeDeath + #- ActionCritFakeDeath - ActionCritLastWords - type: MobThresholds thresholds: @@ -2793,7 +2793,7 @@ actions: Critical: - ActionCritSuccumb - - ActionCritFakeDeath + #- ActionCritFakeDeath - ActionCritLastWords - type: MobThresholds thresholds: diff --git a/Resources/Prototypes/Entities/Mobs/Species/base.yml b/Resources/Prototypes/Entities/Mobs/Species/base.yml index 80b6e96531..9652da27d4 100644 --- a/Resources/Prototypes/Entities/Mobs/Species/base.yml +++ b/Resources/Prototypes/Entities/Mobs/Species/base.yml @@ -234,11 +234,6 @@ - type: ExaminableClothes - type: CharacterInformation - type: Penetrated - - type: MobStateActions - actions: - Critical: - - CritSuccumb - - CritLastWords - type: entity save: false diff --git a/Resources/Prototypes/Entities/Mobs/base.yml b/Resources/Prototypes/Entities/Mobs/base.yml index 788b14f322..e79218a006 100644 --- a/Resources/Prototypes/Entities/Mobs/base.yml +++ b/Resources/Prototypes/Entities/Mobs/base.yml @@ -1,4 +1,4 @@ -# The progenitor. This should only container the most basic components possible. +# The progenitor. This should only container the most basic components possible. # Only put things on here if every mob *must* have it. This includes ghosts. - type: entity save: false @@ -72,7 +72,7 @@ actions: Critical: - ActionCritSuccumb - - ActionCritFakeDeath + #- ActionCritFakeDeath - ActionCritLastWords - type: Deathgasp - type: HealthExaminable diff --git a/Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml b/Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml index 112535afa8..a8bc7142c1 100644 --- a/Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml +++ b/Resources/Prototypes/Entities/Objects/Misc/identification_cards.yml @@ -589,7 +589,7 @@ suffix: Agent components: - type: IdCard - jobTitle: Passenger + jobTitle: ассистент - type: Access tags: - Maintenance