]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Plushies can now have pAIs stuffed into them (v2)! (#30805)
authorbeck-thompson <107373427+beck-thompson@users.noreply.github.com>
Wed, 9 Oct 2024 18:01:32 +0000 (11:01 -0700)
committerGitHub <noreply@github.com>
Wed, 9 Oct 2024 18:01:32 +0000 (20:01 +0200)
* First commit

* I forgot silly me

* Actually added comments

* spellin

* fixes

* more blacklists

* Minor fixes

* Speech Verb also changes now

* Simple name stuff

* Other fixes

* remove one line of whitespace

---------

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
12 files changed:
Content.Server/Kitchen/EntitySystems/ReagentGrinderSystem.cs
Content.Server/Nutrition/EntitySystems/FoodSystem.cs
Content.Shared/ChangeNameInContainer/ChangeNameInContainerComponent.cs [new file with mode: 0644]
Content.Shared/ChangeNameInContainer/ChangeNameInContainerSystem.cs [new file with mode: 0644]
Content.Shared/Storage/Components/SecretStashComponent.cs
Content.Shared/Storage/EntitySystems/SecretStashSystem.cs
Resources/Locale/en-US/storage/components/secret-stash-component.ftl
Resources/Prototypes/Entities/Objects/Fun/pai.yml
Resources/Prototypes/Entities/Objects/Fun/toys.yml
Resources/Prototypes/Entities/Objects/Misc/dat_fukken_disk.yml
Resources/Prototypes/Entities/Structures/Furniture/potted_plants.yml
Resources/Prototypes/tags.yml

index 12c5a30a4b29ec62b8ee2e4dec42a373998b8d8e..de848b34c2c1587d5849d0ea7f5389c53dc10ff3 100644 (file)
@@ -5,6 +5,7 @@ using Content.Server.Stack;
 using Content.Shared.Chemistry.EntitySystems;
 using Content.Shared.Chemistry.Components;
 using Content.Shared.Containers.ItemSlots;
+using Content.Shared.Destructible;
 using Content.Shared.FixedPoint;
 using Content.Shared.Interaction;
 using Content.Shared.Kitchen;
@@ -122,6 +123,9 @@ namespace Content.Server.Kitchen.EntitySystems
                         if (solution.Volume > containerSolution.AvailableVolume)
                             continue;
 
+                        var dev = new DestructionEventArgs();
+                        RaiseLocalEvent(item, dev);
+
                         QueueDel(item);
                     }
 
index 3a7c249c2b30cbf3aadc231ed18da6288d4cd0ac..d7daf632d661c83742d99d746246167acf6fe99a 100644 (file)
@@ -33,6 +33,7 @@ using System.Linq;
 using Content.Shared.Containers.ItemSlots;
 using Robust.Server.GameObjects;
 using Content.Shared.Whitelist;
+using Content.Shared.Destructible;
 
 namespace Content.Server.Nutrition.EntitySystems;
 
@@ -335,6 +336,9 @@ public sealed class FoodSystem : EntitySystem
         if (ev.Cancelled)
             return;
 
+        var dev = new DestructionEventArgs();
+        RaiseLocalEvent(food, dev);
+
         if (component.Trash.Count == 0)
         {
             QueueDel(food);
diff --git a/Content.Shared/ChangeNameInContainer/ChangeNameInContainerComponent.cs b/Content.Shared/ChangeNameInContainer/ChangeNameInContainerComponent.cs
new file mode 100644 (file)
index 0000000..dca8f5b
--- /dev/null
@@ -0,0 +1,18 @@
+using Content.Shared.Whitelist;
+using Robust.Shared.GameStates;
+
+namespace Content.Shared.ChangeNameInContainer;
+
+/// <summary>
+///     An entity with this component will get its name and verb chaned to the container it's inside of. E.g, if your a
+///     pAI that has this component and are inside a lizard plushie, your name when talking will be "lizard plushie".
+/// </summary>
+[RegisterComponent, NetworkedComponent, Access(typeof(ChangeNameInContainerSystem))]
+public sealed partial class ChangeVoiceInContainerComponent : Component
+{
+    /// <summary>
+    ///     A whitelist of containers that will change the name.
+    /// </summary>
+    [DataField]
+    public EntityWhitelist? Whitelist;
+}
diff --git a/Content.Shared/ChangeNameInContainer/ChangeNameInContainerSystem.cs b/Content.Shared/ChangeNameInContainer/ChangeNameInContainerSystem.cs
new file mode 100644 (file)
index 0000000..f9abda3
--- /dev/null
@@ -0,0 +1,30 @@
+using Content.Shared.Chat;
+using Robust.Shared.Containers;
+using Content.Shared.Whitelist;
+using Content.Shared.Speech;
+
+namespace Content.Shared.ChangeNameInContainer;
+
+public sealed partial class ChangeNameInContainerSystem : EntitySystem
+{
+    [Dependency] private readonly SharedContainerSystem _container = default!;
+    [Dependency] private readonly EntityWhitelistSystem _whitelist = default!;
+
+    public override void Initialize()
+    {
+        base.Initialize();
+        SubscribeLocalEvent<ChangeVoiceInContainerComponent, TransformSpeakerNameEvent>(OnTransformSpeakerName);
+    }
+
+    private void OnTransformSpeakerName(Entity<ChangeVoiceInContainerComponent> ent, ref TransformSpeakerNameEvent args)
+    {
+        if (!_container.TryGetContainingContainer((ent, null, null), out var container)
+            || _whitelist.IsWhitelistFail(ent.Comp.Whitelist, container.Owner))
+            return;
+
+        args.VoiceName = Name(container.Owner);
+        if (TryComp<SpeechComponent>(container.Owner, out var speechComp))
+            args.SpeechVerb = speechComp.SpeechVerb;
+    }
+
+}
index 3bf8e2e871ba5c41dcd30a2c96e2cf93b182fbee..f8fff4c19498a8a1b58452e9e5162a3e74b55c66 100644 (file)
@@ -8,6 +8,7 @@ using Robust.Shared.GameStates;
 using Content.Shared.DoAfter;
 using Robust.Shared.Serialization;
 using Robust.Shared.Audio;
+using Content.Shared.Whitelist;
 
 namespace Content.Shared.Storage.Components
 {
@@ -26,6 +27,12 @@ namespace Content.Shared.Storage.Components
         [DataField("maxItemSize")]
         public ProtoId<ItemSizePrototype> MaxItemSize = "Small";
 
+        /// <summary>
+        ///     Entity blacklist for secret stashes.
+        /// </summary>
+        [DataField]
+        public EntityWhitelist? Blacklist;
+
         /// <summary>
         ///     This sound will be played when you try to insert an item in the stash.
         ///     The sound will be played whether or not the item is actually inserted.
index 901d744df5f3863486ad776e9ae342a13c9bc5eb..08a69c345f0919f35464d5c5e622a86c0875883b 100644 (file)
@@ -13,6 +13,7 @@ using Robust.Shared.Audio.Systems;
 using Content.Shared.Verbs;
 using Content.Shared.IdentityManagement;
 using Content.Shared.Tools.EntitySystems;
+using Content.Shared.Whitelist;
 
 namespace Content.Shared.Storage.EntitySystems;
 
@@ -27,7 +28,7 @@ public sealed class SecretStashSystem : EntitySystem
     [Dependency] private readonly SharedItemSystem _item = default!;
     [Dependency] private readonly SharedAudioSystem _audio = default!;
     [Dependency] private readonly ToolOpenableSystem _toolOpenableSystem = default!;
-
+    [Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
 
     public override void Initialize()
     {
@@ -90,8 +91,9 @@ public sealed class SecretStashSystem : EntitySystem
             return false;
         }
 
-        // check if item is too big to fit into secret stash
-        if (_item.GetSizePrototype(itemComp.Size) > _item.GetSizePrototype(entity.Comp.MaxItemSize))
+        // check if item is too big to fit into secret stash or is in the blacklist
+        if (_item.GetSizePrototype(itemComp.Size) > _item.GetSizePrototype(entity.Comp.MaxItemSize) ||
+            _whitelistSystem.IsBlacklistPass(entity.Comp.Blacklist, itemToHideUid))
         {
             var msg = Loc.GetString("comp-secret-stash-action-hide-item-too-big",
                 ("item", itemToHideUid), ("stashname", GetStashName(entity)));
index 36892428070176a08a84e1e1a5ea963d4a73e259..16e575c0f13fcd4620e6a95776691fe2469cdcfc 100644 (file)
@@ -22,3 +22,4 @@ comp-secret-stash-verb-open = Open
 ### Stash names
 secret-stash-plant = plant
 secret-stash-toilet = toilet cistern
+secret-stash-plushie = plushie
index ff662c2186aacfcdd4780cfb142d9aaefbd5251c..b4af7f010e0d24790be3ccede5c10fcf7ee1413a 100644 (file)
           Searching: { state: pai-searching-overlay }
           On: { state: pai-on-overlay }
   - type: StationMap
+  - type: ChangeVoiceInContainer
+    whitelist:
+      components:
+        - SecretStash
 
 - type: entity
   parent: [ PersonalAI, BaseSyndicateContraband]
index ffb1611a71d18704b13b3e195f09eb5982e441d6..a5105fac5ffe58065be2c1129f0c124ae2607ae7 100644 (file)
         reagents:
         - ReagentId: Fiber
           Quantity: 10
+  - type: ContainerContainer
+    containers:
+      stash: !type:ContainerSlot {}
+  - type: Speech
+    speechVerb: Default # for pais (In the secret stash)
+  - type: SecretStash
+    secretStashName: secret-stash-plushie
+    blacklist:
+      components:
+      - SecretStash # Prevents being able to insert plushies inside each other (infinite plush)!
+      - NukeDisk # Could confuse the nukies if they don't know that plushies have a stash.
+      tags:
+      - QuantumSpinInverter # It will cause issues with the grinder...
+      - FakeNukeDisk # So you can't tell if the nuke disk is real or fake depending on if it can be inserted or not.
+  - type: ToolOpenable
+    openToolQualityNeeded: Slicing
+    closeToolQualityNeeded: Slicing # Should probably be stitching or something if that gets added
+    name: secret-stash-plushie
 
 - type: entity
   parent: BasePlushie
     equippedPrefix: lizard
     slots:
     - HEAD
+  - type: Speech
+    speechVerb: Reptilian # for pais (In the secret stash)
 
 - type: entity
   parent: PlushieLizard
index 90e975b93efa17c16a74d3a0238f06ddce4c48ed..e1fc3fa5b6f647588390784b15cec63fbc883afc 100644 (file)
@@ -35,3 +35,6 @@
     state: icon
   - type: StaticPrice
     price: 1 # it's worth even less than normal items. Perfection.
+  - type: Tag
+    tags:
+    - FakeNukeDisk
index 97c845a7862440445f9a42e0a477a425f228a640..9e6d6580b31694865aaea7d07810e74f5dabe03a 100644 (file)
@@ -25,6 +25,8 @@
     offset: "0.0,0.3"
     sprite: Structures/Furniture/potted_plants.rsi
     noRot: true
+  - type: Speech
+    speechVerb: Plant # for pais (In the secret stash)
   - type: SecretStash
     tryInsertItemSound: /Audio/Effects/plant_rustle.ogg
     tryRemoveItemSound: /Audio/Effects/plant_rustle.ogg
index 86ade97d4ea57cb8ad52ee2764b5e6c91da7c398..4f9d0eb3f8cde4e6b64a6173ba22c8071913fc51 100644 (file)
 - type: Tag
   id: Nugget # for chicken nuggets
 
+- type: Tag
+  id: FakeNukeDisk
+
 - type: Tag
   id: NukeOpsUplink
 
 - type: Tag
   id: SecureWindoor
 
-- type: Tag  
+- type: Tag
   id: SecurityHelmet
 
 - type: Tag