]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Mime can no longer write on paper without breaking their vow (#35043)
authorSpeltIncorrectyl <66873282+SpeltIncorrectyl@users.noreply.github.com>
Wed, 26 Feb 2025 09:11:59 +0000 (09:11 +0000)
committerGitHub <noreply@github.com>
Wed, 26 Feb 2025 09:11:59 +0000 (10:11 +0100)
Co-authored-by: Simon <63975668+Simyon264@users.noreply.github.com>
Content.Server/Abilities/Mime/MimePowersComponent.cs
Content.Server/Abilities/Mime/MimePowersSystem.cs
Content.Shared/Paper/BlockWritingComponent.cs [new file with mode: 0644]
Content.Shared/Paper/BlockWritingSystem.cs [new file with mode: 0644]
Content.Shared/Paper/PaperSystem.cs
Resources/Locale/en-US/alerts/alerts.ftl
Resources/Locale/en-US/job/job-description.ftl
Resources/Locale/en-US/paper/paper-component.ftl
Resources/Locale/en-US/tips.ftl
Resources/Prototypes/Roles/Jobs/Civilian/mime.yml

index d56644ed1914c4c08348df09e6d75c6c9b8f1a0a..24ffe5d02341eefe2dc83c8bca33ac40a08778a1 100644 (file)
@@ -55,5 +55,16 @@ namespace Content.Server.Abilities.Mime
         [DataField]
         public ProtoId<AlertPrototype> VowBrokenAlert = "VowBroken";
 
+        /// <summary>
+        /// Does this component prevent the mime from writing on paper while their vow is active?
+        /// </summary>
+        [DataField]
+        public bool PreventWriting = false;
+
+        /// <summary>
+        /// What message is displayed when the mime fails to write?
+        /// </summary>
+        [DataField]
+        public LocId FailWriteMessage = "paper-component-illiterate-mime";
     }
 }
index bd8cf7c176618be7012c8316144c446533125121..3de356f608202c14d56b63d67a08ec16d274dd1b 100644 (file)
@@ -5,6 +5,7 @@ using Content.Shared.Actions.Events;
 using Content.Shared.Alert;
 using Content.Shared.Coordinates.Helpers;
 using Content.Shared.Maps;
+using Content.Shared.Paper;
 using Content.Shared.Physics;
 using Robust.Shared.Containers;
 using Robust.Shared.Map;
@@ -55,6 +56,13 @@ namespace Content.Server.Abilities.Mime
         private void OnComponentInit(EntityUid uid, MimePowersComponent component, ComponentInit args)
         {
             EnsureComp<MutedComponent>(uid);
+            if (component.PreventWriting)
+            {
+                EnsureComp<BlockWritingComponent>(uid, out var illiterateComponent);
+                illiterateComponent.FailWriteMessage = component.FailWriteMessage;
+                Dirty(uid, illiterateComponent);
+            }
+
             _alertsSystem.ShowAlert(uid, component.VowAlert);
             _actionsSystem.AddAction(uid, ref component.InvisibleWallActionEntity, component.InvisibleWallAction, uid);
         }
@@ -123,6 +131,8 @@ namespace Content.Server.Abilities.Mime
             mimePowers.VowBroken = true;
             mimePowers.VowRepentTime = _timing.CurTime + mimePowers.VowCooldown;
             RemComp<MutedComponent>(uid);
+            if (mimePowers.PreventWriting)
+                RemComp<BlockWritingComponent>(uid);
             _alertsSystem.ClearAlert(uid, mimePowers.VowAlert);
             _alertsSystem.ShowAlert(uid, mimePowers.VowBrokenAlert);
             _actionsSystem.RemoveAction(uid, mimePowers.InvisibleWallActionEntity);
@@ -146,6 +156,13 @@ namespace Content.Server.Abilities.Mime
             mimePowers.ReadyToRepent = false;
             mimePowers.VowBroken = false;
             AddComp<MutedComponent>(uid);
+            if (mimePowers.PreventWriting)
+            {
+                EnsureComp<BlockWritingComponent>(uid, out var illiterateComponent);
+                illiterateComponent.FailWriteMessage = mimePowers.FailWriteMessage;
+                Dirty(uid, illiterateComponent);
+            }
+
             _alertsSystem.ClearAlert(uid, mimePowers.VowBrokenAlert);
             _alertsSystem.ShowAlert(uid, mimePowers.VowAlert);
             _actionsSystem.AddAction(uid, ref mimePowers.InvisibleWallActionEntity, mimePowers.InvisibleWallAction, uid);
diff --git a/Content.Shared/Paper/BlockWritingComponent.cs b/Content.Shared/Paper/BlockWritingComponent.cs
new file mode 100644 (file)
index 0000000..ae30e95
--- /dev/null
@@ -0,0 +1,17 @@
+using Robust.Shared.GameStates;
+
+namespace Content.Shared.Paper;
+
+/// <summary>
+/// An entity with this component cannot write on paper.
+/// </summary>
+[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
+public sealed partial class BlockWritingComponent : Component
+{
+    /// <summary>
+    /// What message is displayed when the entity fails to write?
+    /// </summary>
+    [DataField]
+    [AutoNetworkedField]
+    public LocId FailWriteMessage = "paper-component-illiterate";
+}
diff --git a/Content.Shared/Paper/BlockWritingSystem.cs b/Content.Shared/Paper/BlockWritingSystem.cs
new file mode 100644 (file)
index 0000000..476e3a2
--- /dev/null
@@ -0,0 +1,20 @@
+namespace Content.Shared.Paper;
+
+/// <summary>
+/// A system that prevents those with the IlliterateComponent from writing on paper.
+/// Has no effect on reading ability.
+/// </summary>
+public sealed class BlockWritingSystem : EntitySystem
+{
+    public override void Initialize()
+    {
+        base.Initialize();
+        SubscribeLocalEvent<BlockWritingComponent, PaperWriteAttemptEvent>(OnPaperWriteAttempt);
+    }
+
+    private void OnPaperWriteAttempt(Entity<BlockWritingComponent> entity, ref PaperWriteAttemptEvent args)
+    {
+        args.FailReason = entity.Comp.FailWriteMessage;
+        args.Cancelled = true;
+    }
+}
index 3c10ff2aaac93b59769334bc3c981ea83e00881c..07fe8150e1d82d264a0f25459dc9fdd8ce33338f 100644 (file)
@@ -113,6 +113,21 @@ public sealed class PaperSystem : EntitySystem
                     args.Handled = true;
                     return;
                 }
+
+                var ev = new PaperWriteAttemptEvent(entity.Owner);
+                RaiseLocalEvent(args.User, ref ev);
+                if (ev.Cancelled)
+                {
+                    if (ev.FailReason is not null)
+                    {
+                        var fileWriteMessage = Loc.GetString(ev.FailReason);
+                        _popupSystem.PopupClient(fileWriteMessage, entity.Owner, args.User);
+                    }
+
+                    args.Handled = true;
+                    return;
+                }
+
                 var writeEvent = new PaperWriteEvent(entity, args.User);
                 RaiseLocalEvent(args.Used, ref writeEvent);
 
@@ -156,6 +171,11 @@ public sealed class PaperSystem : EntitySystem
 
     private void OnInputTextMessage(Entity<PaperComponent> entity, ref PaperInputTextMessage args)
     {
+        var ev = new PaperWriteAttemptEvent(entity.Owner);
+        RaiseLocalEvent(args.Actor, ref ev);
+        if (ev.Cancelled)
+            return;
+
         if (args.Text.Length <= entity.Comp.ContentSize)
         {
             SetContent(entity, args.Text);
@@ -229,3 +249,10 @@ public sealed class PaperSystem : EntitySystem
 /// </summary>
 [ByRefEvent]
 public record struct PaperWriteEvent(EntityUid User, EntityUid Paper);
+
+/// <summary>
+/// Cancellable event for attempting to write on a piece of paper.
+/// </summary>
+/// <param name="paper">The paper that the writing will take place on.</param>
+[ByRefEvent]
+public record struct PaperWriteAttemptEvent(EntityUid Paper, string? FailReason = null, bool Cancelled = false);
index 1748798beaef34bb43d16848408cb676e43c790f..800e8950a50e62779bf97987659228577641eb87 100644 (file)
@@ -82,10 +82,10 @@ alerts-muted-name = Muted
 alerts-muted-desc = You have lost the ability to speak.
 
 alerts-vow-silence-name = Vow of Silence
-alerts-vow-silence-desc = You have taken a vow of silence as part of initiation into the Mystiko Tagma Mimon. Click to break your vow.
+alerts-vow-silence-desc = You have taken a vow forbidding verbal or written communication as part of initiation into the Mystiko Tagma Mimon. Click to break your vow.
 
 alerts-vow-broken-name = Vow Broken
-alerts-vow-broken-desc = You've broken your vows to Mimes everywhere. You can speak, but you've lost your powers for at least 5 entire minutes!!! Click to try and retake your vow.
+alerts-vow-broken-desc = You've broken your vows to Mimes everywhere. You can speak and write, but you've lost your powers for at least 5 entire minutes!!! Click to try and retake your vow.
 
 alerts-pulled-name = Pulled
 alerts-pulled-desc = You're being pulled. Move to break free.
index d91bb8bd215ff1d0bd78dbccfd223199e9132276..fea5928ad202f776d98b2f85f287884607ad854e 100644 (file)
@@ -31,7 +31,7 @@ job-description-intern = Learn the basics of administering medicine, basic chemi
 job-description-janitor = Keep the station clean of any trash or slipping hazards, and help deal with rat infestations.
 job-description-lawyer = Ensure that every prisoner or criminal receives a fair judgment and trial if necessary.
 job-description-librarian = Manage the library, give out knowledge to any who seek it, and report on activities aboard the station.
-job-description-mime = Entertain the crew through non-vocal means, and engage with light rivalry with the clown.
+job-description-mime = Entertain the crew without speaking or writing, and engage with light rivalry with the clown.
 job-description-musician = Entertain the crew with your unique musical talent, and acquire new instruments to mess around with.
 job-description-passenger = Enjoy your stay aboard the station with no obligations!
 job-description-psychologist = Provide emotional support to traumatized crew. Currently available on Box, Marathon and Oasis.
index 7425ea2da1647897984928caa69c65fad786d64c..b4bf222e0386652cdcba1d93b9dfe5f5c5939269 100644 (file)
@@ -7,6 +7,8 @@ paper-ui-blank-page-message = This page intentionally left blank
 paper-component-examine-detail-has-words = {CAPITALIZE(THE($paper))} has something written on it.
 # Shown when paper with stamps examined
 paper-component-examine-detail-stamped-by = {CAPITALIZE(THE($paper))} {CONJUGATE-HAVE($paper)} been stamped by: {$stamps}.
+paper-component-illiterate = You are unable to write.
+paper-component-illiterate-mime = Your vow forbids you from writing.
 
 paper-component-action-stamp-paper-other = {CAPITALIZE(THE($user))} stamps {THE($target)} with {THE($stamp)}.
 paper-component-action-stamp-paper-self = You stamp {THE($target)} with {THE($stamp)}.
index dcadd15b1b06b0cc832f26a9c0bd6c408d8888c4..e0e71d66da1760bd95d420b2f3de50776285426f 100644 (file)
@@ -61,7 +61,7 @@ tips-dataset-60 = As the Clown, spice your gimmicks up! Nobody likes a one-trick
 tips-dataset-61 = As the Clown, if you lose your banana peels and soap, you can still slip people with your PDA! Honk!
 tips-dataset-62 = As the Chef, your knife can act as a weapon in an emergency.
 tips-dataset-63 = As the Chef, you can sneak liquids into your foods. As a traitor, putting a little bit of amatoxin or other poison can greatly annoy the crew!
-tips-dataset-64 = As the Mime, your oath of silence is your source of power. Breaking it robs you of your powers and of your honor.
+tips-dataset-64 = As the Mime, your vow to not speak or write is your source of power. Breaking it robs you of your powers and of your honor.
 tips-dataset-65 = As the Lawyer, try to negotiate with the Warden if sentences seem too high for the crime.
 tips-dataset-66 = As a Security Officer, communicate and coordinate with your fellow officers using the security radio channel to avoid confusion.
 tips-dataset-67 = As a Security Officer, remember that correlation does not equal causation. Someone may have just been at the wrong place at the wrong time!
index de8a900f8e908b9755c97a2c275c23eb07a6bf9a..243dafabf2f834e7ad213148d6620670831a167c 100644 (file)
@@ -16,6 +16,7 @@
   - !type:AddComponentSpecial
     components:
     - type: MimePowers
+      preventWriting: true
     - type: FrenchAccent
 
 - type: startingGear
@@ -23,9 +24,8 @@
   equipment:
     gloves: ClothingHandsGlovesColorWhite
     shoes: ClothingShoesColorWhite
-    pocket1: CrayonMime
-    pocket2: Paper
     id: MimePDA
+    pocket1: CrayonMime
     ears: ClothingHeadsetService
   storage:
     back: