]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Pet Carrier (Zookeeper gameplay?) (#21545)
authorEd <96445749+TheShuEd@users.noreply.github.com>
Mon, 13 Nov 2023 23:55:47 +0000 (02:55 +0300)
committerGitHub <noreply@github.com>
Mon, 13 Nov 2023 23:55:47 +0000 (16:55 -0700)
* add visual

* fix item + entityStorage problem, add generation in maints

* make pet carrier two-handed

* added to cargo

* add resistlocker component

13 files changed:
Content.Shared/Storage/Components/SharedEntityStorageComponent.cs
Content.Shared/Storage/EntitySystems/SharedEntityStorageSystem.cs
Resources/Prototypes/Catalog/Cargo/cargo_service.yml
Resources/Prototypes/Entities/Markers/Spawners/Random/maintenance.yml
Resources/Prototypes/Entities/Objects/Misc/pet_carrier.yml [new file with mode: 0644]
Resources/Textures/Objects/Storage/petcarrier.rsi/icon.png [new file with mode: 0644]
Resources/Textures/Objects/Storage/petcarrier.rsi/inhand-left.png [new file with mode: 0644]
Resources/Textures/Objects/Storage/petcarrier.rsi/inhand-right.png [new file with mode: 0644]
Resources/Textures/Objects/Storage/petcarrier.rsi/meta.json [new file with mode: 0644]
Resources/Textures/Objects/Storage/petcarrier.rsi/pet_carrier_base.png [new file with mode: 0644]
Resources/Textures/Objects/Storage/petcarrier.rsi/pet_carrier_door.png [new file with mode: 0644]
Resources/Textures/Objects/Storage/petcarrier.rsi/pet_carrier_open.png [new file with mode: 0644]
Resources/Textures/Objects/Storage/petcarrier.rsi/welded.png [new file with mode: 0644]

index 80f38188ea966147133737653074ee8fb3e7d116..b4cd18f4d5c62c7eba05b48b1c2b623c9ee9b563 100644 (file)
@@ -1,4 +1,4 @@
-using System.Numerics;
+using System.Numerics;
 using Content.Shared.Physics;
 using Content.Shared.Whitelist;
 using Robust.Shared.Audio;
@@ -64,6 +64,12 @@ public abstract partial class SharedEntityStorageComponent : Component
     [DataField, ViewVariables(VVAccess.ReadWrite)]
     public float EnteringRange = 0.18f;
 
+    /// <summary>
+    /// If true, there may be mobs inside the container, even if the container is an Item
+    /// </summary>
+    [DataField]
+    public bool ItemCanStoreMobs = false;
+
     /// <summary>
     /// Whether or not to show the contents when the storage is closed
     /// </summary>
index 31803c394f24c36326379fc18eaef26d9b3aa54d..f84a65398dca36210ce158c5700086c6b8b6daea 100644 (file)
@@ -1,4 +1,4 @@
-using System.Diagnostics.CodeAnalysis;
+using System.Diagnostics.CodeAnalysis;
 using System.Linq;
 using System.Numerics;
 using Content.Shared.Body.Components;
@@ -413,6 +413,9 @@ public abstract class SharedEntityStorageSystem : EntitySystem
                 var storeEv = new StoreMobInItemContainerAttemptEvent();
                 RaiseLocalEvent(container, ref storeEv);
                 allowedToEat = storeEv is { Handled: true, Cancelled: false };
+
+                if (component.ItemCanStoreMobs)
+                    allowedToEat = true;
             }
         }
 
index 0ddf41a464fbfafbcce04e7249adff4c91bb748a..f010f1ef2f81cdac54e93baedccf94388bde146c 100644 (file)
   cost: 2000
   category: Service
   group: market
+
+- type: cargoProduct
+  id: ServiceAnimalCarrier
+  icon: 
+    sprite: Objects/Storage/petcarrier.rsi
+    state: icon
+  product: PetCarrier
+  cost: 500
+  category: Service
+  group: market
\ No newline at end of file
index a2d8f4b38190ce57960433de381fd4e6c2e8f923..9aa1271044d5b407f2b48c69bb66c75a5d860935 100644 (file)
         - CableHVStack10
         - CableMVStack10
         - CableApcStack10
+        - PetCarrier
       chance: 0.6
       offset: 0.0
 
diff --git a/Resources/Prototypes/Entities/Objects/Misc/pet_carrier.yml b/Resources/Prototypes/Entities/Objects/Misc/pet_carrier.yml
new file mode 100644 (file)
index 0000000..2e19d0b
--- /dev/null
@@ -0,0 +1,66 @@
+- type: entity
+  id: PetCarrier
+  name: big pet carrier
+  description: Allows large animals to be carried comfortably.
+  parent: BaseStructureDynamic
+  components:
+  - type: Sprite
+    noRot: true
+    drawdepth: Objects
+    sprite: Objects/Storage/petcarrier.rsi
+    layers:
+    - state: pet_carrier_base
+      map: ["enum.StorageVisualLayers.Base"]
+    - state: pet_carrier_door
+      map: ["enum.StorageVisualLayers.Door"]
+    - state: welded
+      visible: false
+      map: ["enum.WeldableLayers.BaseWelded"]
+  - type: Icon
+    sprite: Objects/Storage/petcarrier.rsi
+    state: icon
+  - type: InteractionOutline
+  - type: Physics
+  - type: MultiHandedItem
+  - type: Fixtures
+    fixtures:
+      fix1:
+        shape:
+          !type:PhysShapeCircle
+          radius: 0.45
+        density: 25
+        mask:
+        - SmallMobMask
+        layer:
+        - MachineLayer
+  - type: EntityStorage
+    capacity: 1
+    airtight: false
+    itemCanStoreMobs: true
+  - type: Weldable
+  - type: ResistLocker
+  - type: PlaceableSurface
+    isPlaceable: false
+  - type: Damageable
+    damageContainer: Inorganic
+    damageModifierSet: Wood
+  - type: Destructible
+    thresholds:
+      - trigger:
+          !type:DamageTrigger
+          damage: 50
+        behaviors:
+          - !type:DoActsBehavior
+            acts: ["Destruction"]
+  - type: Appearance
+  - type: EntityStorageVisuals
+    stateDoorOpen: pet_carrier_open
+    stateDoorClosed: pet_carrier_door
+  - type: ContainerContainer
+    containers:
+      entity_storage: !type:Container
+      paper_label: !type:ContainerSlot
+  - type: ItemSlots
+  - type: Item
+    size: Ginormous
+    sprite: Objects/Storage/petcarrier.rsi
\ No newline at end of file
diff --git a/Resources/Textures/Objects/Storage/petcarrier.rsi/icon.png b/Resources/Textures/Objects/Storage/petcarrier.rsi/icon.png
new file mode 100644 (file)
index 0000000..a4a3b9f
Binary files /dev/null and b/Resources/Textures/Objects/Storage/petcarrier.rsi/icon.png differ
diff --git a/Resources/Textures/Objects/Storage/petcarrier.rsi/inhand-left.png b/Resources/Textures/Objects/Storage/petcarrier.rsi/inhand-left.png
new file mode 100644 (file)
index 0000000..d633c11
Binary files /dev/null and b/Resources/Textures/Objects/Storage/petcarrier.rsi/inhand-left.png differ
diff --git a/Resources/Textures/Objects/Storage/petcarrier.rsi/inhand-right.png b/Resources/Textures/Objects/Storage/petcarrier.rsi/inhand-right.png
new file mode 100644 (file)
index 0000000..d633c11
Binary files /dev/null and b/Resources/Textures/Objects/Storage/petcarrier.rsi/inhand-right.png differ
diff --git a/Resources/Textures/Objects/Storage/petcarrier.rsi/meta.json b/Resources/Textures/Objects/Storage/petcarrier.rsi/meta.json
new file mode 100644 (file)
index 0000000..0843ad2
--- /dev/null
@@ -0,0 +1,34 @@
+{
+    "version": 1,
+    "license": "CC0-1.0",
+    "copyright": "Taken from TGstation at https://github.com/tgstation/tgstation/commit/8b1ffd1e49a2d30a0aab63264106a3ec0e07f415 and edited by TheShuEd",
+    "size": {
+        "x": 32,
+        "y": 32
+    },
+    "states": [
+        {
+            "name": "inhand-left",
+            "directions": 4
+        },
+        {
+            "name": "inhand-right",
+            "directions": 4
+        },
+        {
+            "name": "pet_carrier_base"
+        },
+        {
+            "name": "pet_carrier_door"
+        },
+        {
+            "name": "pet_carrier_open"
+        },
+        {
+            "name": "icon"
+        },
+        {
+            "name": "welded"
+        }
+    ]
+}
diff --git a/Resources/Textures/Objects/Storage/petcarrier.rsi/pet_carrier_base.png b/Resources/Textures/Objects/Storage/petcarrier.rsi/pet_carrier_base.png
new file mode 100644 (file)
index 0000000..1b4e86d
Binary files /dev/null and b/Resources/Textures/Objects/Storage/petcarrier.rsi/pet_carrier_base.png differ
diff --git a/Resources/Textures/Objects/Storage/petcarrier.rsi/pet_carrier_door.png b/Resources/Textures/Objects/Storage/petcarrier.rsi/pet_carrier_door.png
new file mode 100644 (file)
index 0000000..4208bb9
Binary files /dev/null and b/Resources/Textures/Objects/Storage/petcarrier.rsi/pet_carrier_door.png differ
diff --git a/Resources/Textures/Objects/Storage/petcarrier.rsi/pet_carrier_open.png b/Resources/Textures/Objects/Storage/petcarrier.rsi/pet_carrier_open.png
new file mode 100644 (file)
index 0000000..3bc200b
Binary files /dev/null and b/Resources/Textures/Objects/Storage/petcarrier.rsi/pet_carrier_open.png differ
diff --git a/Resources/Textures/Objects/Storage/petcarrier.rsi/welded.png b/Resources/Textures/Objects/Storage/petcarrier.rsi/welded.png
new file mode 100644 (file)
index 0000000..93b9c1d
Binary files /dev/null and b/Resources/Textures/Objects/Storage/petcarrier.rsi/welded.png differ