diff --git a/Content.Server/Traits/Assorted/PacifistComponent.cs b/Content.Server/Traits/Assorted/PacifistComponent.cs
deleted file mode 100644
index 095dc651fc..0000000000
--- a/Content.Server/Traits/Assorted/PacifistComponent.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-namespace Content.Server.Traits.Assorted;
-
-///
-/// This is used for enforcing pacifism.
-///
-[RegisterComponent]
-public sealed class PacifistComponent : Component
-{
-
-}
diff --git a/Content.Server/Traits/Assorted/PacifistSystem.cs b/Content.Server/Traits/Assorted/PacifistSystem.cs
deleted file mode 100644
index 5d8b1f44db..0000000000
--- a/Content.Server/Traits/Assorted/PacifistSystem.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using Content.Shared.CombatMode.Pacification;
-
-namespace Content.Server.Traits.Assorted;
-
-///
-/// This handles enforced pacifism.
-///
-public sealed class PacifistSystem : EntitySystem
-{
- public override void Update(float frameTime)
- {
- foreach (var comp in EntityQuery())
- {
- EnsureComp(comp.Owner); // It's a status effect so just enforce it.
- }
- }
-}
diff --git a/Content.Shared/Alert/AlertType.cs b/Content.Shared/Alert/AlertType.cs
index 75447e90d7..64fd5943eb 100644
--- a/Content.Shared/Alert/AlertType.cs
+++ b/Content.Shared/Alert/AlertType.cs
@@ -39,6 +39,7 @@ namespace Content.Shared.Alert
Essence,
Corporeal,
Bleed,
+ Pacified,
Debug1,
Debug2,
Debug3,
diff --git a/Content.Shared/CombatMode/Pacification/PacificationSystem.cs b/Content.Shared/CombatMode/Pacification/PacificationSystem.cs
index a223c61053..670d3976ea 100644
--- a/Content.Shared/CombatMode/Pacification/PacificationSystem.cs
+++ b/Content.Shared/CombatMode/Pacification/PacificationSystem.cs
@@ -1,52 +1,57 @@
using Content.Shared.Actions;
+using Content.Shared.Alert;
using Content.Shared.Interaction.Events;
+using Content.Shared.Popups;
-namespace Content.Shared.CombatMode.Pacification
+namespace Content.Shared.CombatMode.Pacification;
+
+public sealed class PacificationSystem : EntitySystem
{
- public sealed class PacificationSystem : EntitySystem
+ [Dependency] private readonly AlertsSystem _alertsSystem = default!;
+ [Dependency] private readonly SharedActionsSystem _actionsSystem = default!;
+ [Dependency] private readonly SharedCombatModeSystem _combatSystem = default!;
+ [Dependency] private readonly SharedPopupSystem _popupSystem = default!;
+
+ public override void Initialize()
{
- [Dependency] private readonly SharedActionsSystem _actionsSystem = default!;
- [Dependency] private readonly SharedCombatModeSystem _combatSystem = default!;
+ base.Initialize();
+ SubscribeLocalEvent(OnStartup);
+ SubscribeLocalEvent(OnShutdown);
+ SubscribeLocalEvent(OnAttackAttempt);
+ }
- public override void Initialize()
- {
- base.Initialize();
- SubscribeLocalEvent(OnStartup);
- SubscribeLocalEvent(OnShutdown);
- SubscribeLocalEvent(OnAttackAttempt);
- }
+ private void OnAttackAttempt(EntityUid uid, PacifiedComponent component, AttackAttemptEvent args)
+ {
+ args.Cancel();
+ }
- private void OnAttackAttempt(EntityUid uid, PacifiedComponent component, AttackAttemptEvent args)
- {
- args.Cancel();
- }
+ private void OnStartup(EntityUid uid, PacifiedComponent component, ComponentStartup args)
+ {
+ if (!TryComp(uid, out var combatMode))
+ return;
- private void OnStartup(EntityUid uid, PacifiedComponent component, ComponentStartup args)
- {
- if (!TryComp(uid, out var combatMode))
- return;
+ if (combatMode.CanDisarm != null)
+ _combatSystem.SetCanDisarm(uid, false, combatMode);
- if (combatMode.CanDisarm != null)
- _combatSystem.SetCanDisarm(uid, false, combatMode);
+ _combatSystem.SetInCombatMode(uid, false, combatMode);
- _combatSystem.SetInCombatMode(uid, false, combatMode);
+ if (combatMode.CombatToggleAction != null)
+ _actionsSystem.SetEnabled(combatMode.CombatToggleAction, false);
- if (combatMode.CombatToggleAction != null)
- {
- _actionsSystem.SetEnabled(combatMode.CombatToggleAction, false);
- }
- }
+ _alertsSystem.ShowAlert(uid, AlertType.Pacified);
+ }
- private void OnShutdown(EntityUid uid, PacifiedComponent component, ComponentShutdown args)
- {
- if (!TryComp(uid, out var combatMode))
- return;
+ private void OnShutdown(EntityUid uid, PacifiedComponent component, ComponentShutdown args)
+ {
+ if (!TryComp(uid, out var combatMode))
+ return;
- if (combatMode.CanDisarm != null)
- _combatSystem.SetCanDisarm(uid, true, combatMode);
+ if (combatMode.CanDisarm != null)
+ _combatSystem.SetCanDisarm(uid, true, combatMode);
- if (combatMode.CombatToggleAction != null)
- _actionsSystem.SetEnabled(combatMode.CombatToggleAction, true);
- }
+ if (combatMode.CombatToggleAction != null)
+ _actionsSystem.SetEnabled(combatMode.CombatToggleAction, true);
+
+ _alertsSystem.ClearAlert(uid, AlertType.Pacified);
}
}
diff --git a/Content.Shared/CombatMode/Pacification/PacifiedComponent.cs b/Content.Shared/CombatMode/Pacification/PacifiedComponent.cs
index aee298a9d5..ad50b4bf1f 100644
--- a/Content.Shared/CombatMode/Pacification/PacifiedComponent.cs
+++ b/Content.Shared/CombatMode/Pacification/PacifiedComponent.cs
@@ -1,13 +1,13 @@
using Robust.Shared.GameStates;
-namespace Content.Shared.CombatMode.Pacification
-{
- ///
- /// Status effect that disables combat mode.
- ///
- [RegisterComponent, NetworkedComponent]
- public sealed class PacifiedComponent : Component
- {
+namespace Content.Shared.CombatMode.Pacification;
+
+///
+/// Status effect that disables combat mode.
+///
+[RegisterComponent, NetworkedComponent]
+[Access(typeof(PacificationSystem))]
+public sealed class PacifiedComponent : Component
+{
- }
}
diff --git a/Resources/Locale/en-US/alerts/alerts.ftl b/Resources/Locale/en-US/alerts/alerts.ftl
index 1469543c33..a0af1a7953 100644
--- a/Resources/Locale/en-US/alerts/alerts.ftl
+++ b/Resources/Locale/en-US/alerts/alerts.ftl
@@ -86,3 +86,6 @@ alerts-pulling-desc = You're pulling something. Click the alert to stop.
alerts-bleed-name = [color=red]Bleed[/color]
alerts-bleed-desc = You're [color=red]bleeding[/color].
+
+alerts-pacified-name = [color=green]Pacified[/color]
+alerts-pacified-desc = You're pacified; you won't be able to attack anyone directly.
diff --git a/Resources/Prototypes/Alerts/alerts.yml b/Resources/Prototypes/Alerts/alerts.yml
index 7c7c75b8f8..b1c39e3663 100644
--- a/Resources/Prototypes/Alerts/alerts.yml
+++ b/Resources/Prototypes/Alerts/alerts.yml
@@ -1,4 +1,4 @@
-- type: alertOrder
+- type: alertOrder
# Defines ordering in alert tab, higher up = higher in tab.
# List below can contain alert type or category, if both are present the id will take precedence.
# If item is not in list it will go at the bottom (ties broken by alert type enum value)
@@ -22,6 +22,7 @@
- category: Hunger
- category: Thirst
- alertType: Magboots
+ - alertType: Pacified
- type: alert
id: LowOxygen
@@ -323,6 +324,14 @@
minSeverity: 0
maxSeverity: 10
+- type: alert
+ id: Pacified
+ icons:
+ - sprite: /Textures/Interface/Alerts/pacified.rsi
+ state: icon
+ name: alerts-pacified-name
+ description: alerts-pacified-desc
+
- type: alert
id: Debug1
icons:
diff --git a/Resources/Prototypes/Traits/disabilities.yml b/Resources/Prototypes/Traits/disabilities.yml
index d820f0ded0..fd845aa8d2 100644
--- a/Resources/Prototypes/Traits/disabilities.yml
+++ b/Resources/Prototypes/Traits/disabilities.yml
@@ -1,4 +1,4 @@
-- type: trait
+- type: trait
id: Blindness
name: trait-blindness-name
description: trait-blindness-desc
@@ -22,7 +22,7 @@
id: Pacifist
name: trait-pacifist-name
components:
- - type: Pacifist
+ - type: Pacified
- type: trait
id: Paracusia
diff --git a/Resources/Textures/Interface/Alerts/pacified.rsi/icon.png b/Resources/Textures/Interface/Alerts/pacified.rsi/icon.png
new file mode 100644
index 0000000000..3fc61bdabe
Binary files /dev/null and b/Resources/Textures/Interface/Alerts/pacified.rsi/icon.png differ
diff --git a/Resources/Textures/Interface/Alerts/pacified.rsi/meta.json b/Resources/Textures/Interface/Alerts/pacified.rsi/meta.json
new file mode 100644
index 0000000000..cb848b0c03
--- /dev/null
+++ b/Resources/Textures/Interface/Alerts/pacified.rsi/meta.json
@@ -0,0 +1,14 @@
+{
+ "version": 1,
+ "license": "CC-BY-SA-4.0",
+ "copyright": "@Vordenburg",
+ "size": {
+ "x": 32,
+ "y": 32
+ },
+ "states": [
+ {
+ "name": "icon"
+ }
+ ]
+}