]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Mannequin (#29004)
authorBombasterDS <115770678+BombasterDS@users.noreply.github.com>
Sat, 15 Jun 2024 17:50:55 +0000 (03:50 +1000)
committerGitHub <noreply@github.com>
Sat, 15 Jun 2024 17:50:55 +0000 (13:50 -0400)
* Mannequin

* rsi license fix

* damage container fix

* container fix

hope this works

* layers fix + appearance comp (mb it help?)

* maybe fixed?

* one day it will work...

* can't even understand why test failing... (maybe fix?)

* last try?

Content.Server/Medical/SuitSensors/SuitSensorSystem.cs
Resources/Prototypes/Entities/Structures/Decoration/mannequin.yml [new file with mode: 0644]
Resources/Prototypes/InventoryTemplates/mannequin_inventory_template.yml [new file with mode: 0644]
Resources/Prototypes/Recipes/Construction/Graphs/furniture/mannequin.yml [new file with mode: 0644]
Resources/Prototypes/Recipes/Construction/furniture.yml
Resources/Textures/Structures/Decoration/mannequin.rsi/mannequin.png [new file with mode: 0644]
Resources/Textures/Structures/Decoration/mannequin.rsi/meta.json [new file with mode: 0644]

index 1acbf292f03a6a77539ed547f3ef570f7c836401..e0917f32a84426a4586525e7bfe59fdae5a685d9 100644 (file)
@@ -308,7 +308,7 @@ public sealed class SuitSensorSystem : EntitySystem
             return null;
 
         // check if sensor is enabled and worn by user
-        if (sensor.Mode == SuitSensorMode.SensorOff || sensor.User == null || transform.GridUid == null)
+        if (sensor.Mode == SuitSensorMode.SensorOff || sensor.User == null || !HasComp<MobStateComponent>(sensor.User) || transform.GridUid == null)
             return null;
 
         // try to get mobs id from ID slot
diff --git a/Resources/Prototypes/Entities/Structures/Decoration/mannequin.yml b/Resources/Prototypes/Entities/Structures/Decoration/mannequin.yml
new file mode 100644 (file)
index 0000000..4a2b0d3
--- /dev/null
@@ -0,0 +1,95 @@
+- type: entity
+  id: Mannequin
+  parent: BaseStructureDynamic
+  name: mannequin
+  description: It can wear any clothing with style.
+  components:
+  - type: Appearance
+  - type: Sprite
+    sprite: Structures/Decoration/mannequin.rsi
+    state: mannequin
+    noRot: true
+    layers:
+    - map: [ "mannequin" ]
+      sprite: Structures/Decoration/mannequin.rsi
+      state: mannequin
+    - map: [ "jumpsuit" ]
+    - map: [ "outerClothing" ]
+    - map: [ "eyes" ]
+    - map: [ "neck" ]
+    - map: [ "back" ]
+    - map: [ "mask" ]
+    - map: [ "head" ] 
+  - type: Rotatable
+  - type: Fixtures
+    fixtures:
+      fix1:
+        shape:
+          !type:PhysShapeCircle
+          radius: 0.2
+        density: 200
+        mask:
+        - MachineMask
+        layer:
+        - MidImpassable
+        - BulletImpassable
+  - type: InteractionOutline
+  - type: Construction
+    graph: Mannequin
+    node: mannequin
+  - type: Damageable
+    damageContainer: Inorganic
+  - type: Destructible
+    thresholds:
+    - trigger:
+        !type:DamageTrigger
+        damage: 200
+      behaviors:
+      - !type:PlaySoundBehavior
+        sound:
+          collection: WoodDestroy
+      - !type:EmptyAllContainersBehaviour
+      - !type:DoActsBehavior
+        acts: [ "Destruction" ]
+  - type: ContainerContainer
+    containers:
+      jumpsuit: !type:ContainerSlot
+        showEnts: False
+        occludes: False
+        ent: null
+      outerClothing: !type:ContainerSlot
+        showEnts: False
+        occludes: False
+        ent: null
+      neck: !type:ContainerSlot
+        showEnts: False
+        occludes: False
+        ent: null
+      mask: !type:ContainerSlot
+        showEnts: False
+        occludes: False
+        ent: null
+      eyes: !type:ContainerSlot
+        showEnts: False
+        occludes: False
+        ent: null
+      head: !type:ContainerSlot
+        showEnts: False
+        occludes: False
+        ent: null
+      suitstorage: !type:ContainerSlot
+        showEnts: False
+        occludes: False
+        ent: null
+      back: !type:ContainerSlot
+        showEnts: False
+        occludes: False
+        ent: null
+  - type: Inventory
+    templateId: mannequin
+  - type: InventorySlots
+  - type: Strippable
+  - type: UserInterface
+    interfaces:
+      enum.StrippingUiKey.Key:
+        type: StrippableBoundUserInterface
\ No newline at end of file
diff --git a/Resources/Prototypes/InventoryTemplates/mannequin_inventory_template.yml b/Resources/Prototypes/InventoryTemplates/mannequin_inventory_template.yml
new file mode 100644 (file)
index 0000000..80b9c6e
--- /dev/null
@@ -0,0 +1,64 @@
+- type: inventoryTemplate
+  id: mannequin
+  slots:
+    - name: jumpsuit
+      slotTexture: uniform
+      slotFlags: INNERCLOTHING
+      stripTime: 3
+      uiWindowPos: 0,1
+      strippingWindowPos: 1,2
+      displayName: Jumpsuit
+    - name: outerClothing
+      slotTexture: suit
+      slotFlags: OUTERCLOTHING
+      stripTime: 3
+      uiWindowPos: 1,1
+      strippingWindowPos: 2,2
+      displayName: Suit
+    - name: neck
+      slotTexture: neck
+      slotFlags: NECK
+      stripTime: 3
+      uiWindowPos: 0,2
+      strippingWindowPos: 0,1
+      displayName: Neck
+    - name: mask
+      stripTime: 3
+      slotTexture: mask
+      slotFlags: MASK
+      uiWindowPos: 1,2
+      strippingWindowPos: 1,1
+      displayName: Mask
+    - name: eyes
+      slotTexture: glasses
+      slotFlags: EYES
+      stripTime: 3
+      uiWindowPos: 0,3
+      strippingWindowPos: 0,0
+      displayName: Eyes
+    - name: head
+      slotTexture: head
+      slotFlags: HEAD
+      stripTime: 3
+      uiWindowPos: 1,3
+      strippingWindowPos: 1,0
+      displayName: Head
+    - name: suitstorage
+      slotTexture: suit_storage
+      slotFlags:   SUITSTORAGE
+      slotGroup: MainHotbar
+      stripTime: 3
+      uiWindowPos: 2,0
+      strippingWindowPos: 1,3
+      dependsOn: outerClothing
+      dependsOnComponents:
+      - type: AllowSuitStorage
+      displayName: Suit Storage
+    - name: back
+      slotTexture: back
+      fullTextureName: template_small
+      slotFlags: BACK
+      stripTime: 3
+      uiWindowPos: 3,0
+      strippingWindowPos: 0,2
+      displayName: Back
diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/furniture/mannequin.yml b/Resources/Prototypes/Recipes/Construction/Graphs/furniture/mannequin.yml
new file mode 100644 (file)
index 0000000..f83a3b1
--- /dev/null
@@ -0,0 +1,31 @@
+- type: constructionGraph
+  id: Mannequin
+  start: start
+  graph:
+    - node: start
+      actions:
+        - !type:DestroyEntity {}
+      edges:
+        - to: mannequin
+          completed:
+            - !type:SnapToGrid { }
+          steps:
+            - material: WoodPlank
+              amount: 5
+            - material: MetalRod
+              amount: 2
+              doAfter: 2
+    - node: mannequin
+      entity: Mannequin
+      edges:
+        - to: start
+          completed:
+            - !type:SpawnPrototype
+              prototype: MaterialWoodPlank
+              amount: 5
+            - !type:SpawnPrototype
+              prototype: PartRodMetal
+              amount: 2
+          steps:
+            - tool: Screwing
+              doAfter: 3
index 5f7ec9c92d815caceba901a17ac2f49f5d36a339..ea11a09b9653514f3f136393caa94e1e43058ab1 100644 (file)
   canBuildInImpassable: false
   conditions:
     - !type:TileNotBlocked
+
+- type: construction
+  id: Mannequin
+  name: mannequin
+  description: Wooden mannequin designed for clothing displaying
+  graph: Mannequin
+  startNode: start
+  targetNode: mannequin
+  category: construction-category-furniture
+  icon:
+    sprite: Structures/Decoration/mannequin.rsi
+    state: mannequin
+  objectType: Structure
+  placementMode: SnapgridCenter
+  canRotate: true
+  canBuildInImpassable: false
+  conditions:
+    - !type:TileNotBlocked
\ No newline at end of file
diff --git a/Resources/Textures/Structures/Decoration/mannequin.rsi/mannequin.png b/Resources/Textures/Structures/Decoration/mannequin.rsi/mannequin.png
new file mode 100644 (file)
index 0000000..3f362c6
Binary files /dev/null and b/Resources/Textures/Structures/Decoration/mannequin.rsi/mannequin.png differ
diff --git a/Resources/Textures/Structures/Decoration/mannequin.rsi/meta.json b/Resources/Textures/Structures/Decoration/mannequin.rsi/meta.json
new file mode 100644 (file)
index 0000000..8edc153
--- /dev/null
@@ -0,0 +1,15 @@
+{
+  "version": 1,
+  "license": "CC-BY-SA-3.0",
+  "copyright": "Made By BombasterDS",
+  "size": {
+    "x": 32,
+    "y": 32
+  },
+  "states": [
+    {
+      "name": "mannequin",
+         "directions": 4
+    }
+  ]
+}