]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Glass box fixes + Construction & Stealthy deconstruction (#25365)
authorMilenVolf <63782763+MilenVolf@users.noreply.github.com>
Sat, 27 Apr 2024 13:53:16 +0000 (16:53 +0300)
committerGitHub <noreply@github.com>
Sat, 27 Apr 2024 13:53:16 +0000 (23:53 +1000)
* Showcase update

* Fix craft prototype. Add glass box deconstruction for stealth gameplay

* Remove duplicated tag

* Forgor

* Some cleanup

---------

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
17 files changed:
Resources/Audio/Machines/warning_buzzer.ogg
Resources/Prototypes/Entities/Objects/Devices/Electronics/triggers.yml
Resources/Prototypes/Entities/Structures/Storage/glass_box.yml
Resources/Prototypes/Recipes/Construction/Graphs/structures/glassbox.yml [new file with mode: 0644]
Resources/Prototypes/Recipes/Construction/storage.yml
Resources/Prototypes/tags.yml
Resources/Textures/Structures/Storage/glassbox.rsi/DamageOverlay_12.png
Resources/Textures/Structures/Storage/glassbox.rsi/DamageOverlay_4.png
Resources/Textures/Structures/Storage/glassbox.rsi/DamageOverlay_8.png
Resources/Textures/Structures/Storage/glassbox.rsi/base.png [moved from Resources/Textures/Structures/Storage/glassbox.rsi/glassbox-empty-open.png with 100% similarity]
Resources/Textures/Structures/Storage/glassbox.rsi/glass-broken.png [moved from Resources/Textures/Structures/Storage/glassbox.rsi/glass-4.png with 100% similarity]
Resources/Textures/Structures/Storage/glassbox.rsi/glassbox-filled-closed.png [deleted file]
Resources/Textures/Structures/Storage/glassbox.rsi/glassbox-filled-open.png [deleted file]
Resources/Textures/Structures/Storage/glassbox.rsi/glassbox.png [deleted file]
Resources/Textures/Structures/Storage/glassbox.rsi/icon.png [new file with mode: 0644]
Resources/Textures/Structures/Storage/glassbox.rsi/meta.json
Resources/migration.yml

index 55bb179f57d479b1ef3b2bd06d33b6bd76a87666..bef16f46fb9f4b8ee64a11236b2fe4af7241d1a7 100644 (file)
Binary files a/Resources/Audio/Machines/warning_buzzer.ogg and b/Resources/Audio/Machines/warning_buzzer.ogg differ
index 43ed20c694c4359c67600c325814f95a0a95429b..2cb9b5233d0f2a8b82b750cec950ac68f97b2267 100644 (file)
@@ -18,6 +18,8 @@
     state: timer
   - type: Item
     size: Small
+  - type: StaticPrice
+    price: 40
   - type: PayloadTrigger
     components:
     - type: OnUseTimerTrigger
@@ -28,8 +30,6 @@
         path: /Audio/Machines/Nuke/general_beep.ogg
         params:
           volume: -2
-    - type: StaticPrice
-      price: 40
 
 - type: entity
   parent: TimerTrigger
   - type: Sprite
     sprite: Objects/Devices/signaltrigger.rsi
     state: signaltrigger
+  - type: StaticPrice
+    price: 40
+  - type: Tag
+    tags:
+    - SignalTrigger
   - type: PayloadTrigger
     components:
     - type: TriggerOnSignal
@@ -49,8 +54,6 @@
     - type: WirelessNetworkConnection
       range: 200
     - type: DeviceLinkSink
-    - type: StaticPrice
-      price: 40
 
 - type: entity
   parent: BaseItem
   - type: Sprite
     sprite: Objects/Devices/voice.rsi
     state: voice
-  - type: PayloadTrigger
-    components:
-  - type: TriggerOnVoice
   - type: StaticPrice
     price: 40
   - type: Tag
     tags:
     - VoiceTrigger
+  - type: PayloadTrigger
+    components:
+    - type: TriggerOnVoice
index bdb02d2bc35c8c5a46ce93d388d1a3f66a1261c3..8177b6b6f0d340ccdc930c69d03f2902533b7160 100644 (file)
 - type: entity
-  id: GlassBoxLaser
-  name: glass box
-  description: A sturdy showcase for an expensive exhibit.
+  id: BaseGlassBox
   parent: BaseStructureDynamic
+  abstract: true
   placement:
     mode: SnapgridCenter
   components:
-  - type: Anchorable
-    delay: 4
   - type: Transform
     anchored: true
-  - type: Damageable
-    damageContainer: Inorganic
-    damageModifierSet: Glass
-  - type: MeleeSound
-    soundGroups:
-      Brute:
-        collection: GlassSmash
   - type: Physics
     bodyType: Static
   - type: Clickable
   - type: InteractionOutline
+  - type: Fixtures
+    fixtures:
+      fix1:
+        shape:
+          !type:PhysShapeAabb
+          bounds: "-0.45,-0.45,0.45,0.45"
+        density: 1000
+        mask:
+        - MachineMask
+        layer:
+        - MidImpassable
+        - LowImpassable
+  - type: ItemSlots
+  - type: ContainerContainer
+    containers:
+      ItemCabinet: !type:ContainerSlot
+  - type: Anchorable
+    delay: 4
+  - type: Appearance
+
+- type: entity
+  id: GlassBox
+  name: glass box
+  description: A sturdy showcase for an expensive exhibit.
+  parent: BaseGlassBox
+  abstract: true # TODO: Temporarily abstract. Remove it after item scaling in cabinets is implemented.
+  components:
   - type: Sprite
+    noRot: true
     sprite: Structures/Storage/glassbox.rsi
     layers:
-    - state: glassbox
-    - state: caplaser
+    - state: base
+    - state: caplaser # TODO: Remove it after item scaling in cabinets is implemented.
       map: ["enum.ItemCabinetVisualLayers.ContainsItem"]
       visible: true
     - state: glass
       map: ["enum.ItemCabinetVisualLayers.Door"]
-  - type: ItemCabinet
-    cabinetSlot:
-      ejectOnInteract: true
-      whitelist:
-        tags:
-        - WeaponAntiqueLaser
-    doorSound:
-      path: /Audio/Machines/machine_switch.ogg
-    openState: glass-up
-    closedState: glass
-  - type: Lock
+    - state: locked
+      shader: unshaded
+      map: ["enum.LockVisualLayers.Lock"]
+  - type: Fixtures
+    fixtures:
+      fix1:
+        shape:
+          !type:PhysShapeAabb
+          bounds: "-0.45,-0.45,0.45,0.45"
+        density: 1000
+        mask:
+        - MachineMask
+        layer:
+        - LowImpassable
+        - MidImpassable
+        - BulletImpassable
   - type: AccessReader
-    access: [["Captain"]]
-  - type: ItemSlots
-  - type: ContainerContainer
-    containers:
-      ItemCabinet: !type:ContainerSlot
   - type: Repairable
-  - type: Appearance
+    fuelCost: 15
+    doAfterDelay: 5
+  - type: Lock
+  - type: LockVisuals
   - type: DamageVisuals
-    thresholds: [4, 8, 12]
+    thresholds: [4, 8, 12] # TODO: Fix damage visuals on open state.
     damageDivisor: 7.555
     trackAllDamage: true
     damageOverlay:
       sprite: Structures/Storage/glassbox.rsi
+  - type: Damageable
+    damageContainer: Inorganic
+    damageModifierSet: Glass
+  - type: MeleeSound
+    soundGroups:
+      Brute:
+        collection: GlassSmash
   - type: Destructible
     thresholds:
     - trigger:
         !type:DamageTrigger
         damage: 150
       behaviors:
-        - !type:EmptyAllContainersBehaviour
-        - !type:PlaySoundBehavior
-          sound:
-            collection: WindowShatter
-        - !type:SpawnEntitiesBehavior
-          spawn:
-            ShardGlassReinforced:
-              min: 1
-              max: 1
-            GlassBoxLaserBroken:
-              min: 1
-              max: 1
-        - !type:DoActsBehavior
-          acts: [ "Destruction" ]
+      - !type:EmptyAllContainersBehaviour
+      - !type:PlaySoundBehavior
+        sound:
+          collection: WindowShatter
+      - !type:PlaySoundBehavior
+        sound:
+          path: /Audio/Machines/warning_buzzer.ogg
+          params:
+            volume: 10
+      - !type:SpawnEntitiesBehavior
+        spawn:
+          ShardGlassReinforced:
+            min: 1
+            max: 2
+      - !type:ChangeConstructionNodeBehavior
+        node: brokenGlassBox
+      - !type:DoActsBehavior
+        acts: [ "Destruction" ]
 
 - type: entity
-  id: GlassBoxLaserOpen
-  parent: GlassBoxLaser
-  suffix: Open
+  id: GlassBoxLaser
+  parent: GlassBox
+  suffix: AntiqueLaser
   components:
+  - type: AccessReader
+    access: [["Captain"]]
+  - type: Construction
+    graph: GlassBox
+    node: glassBox
   - type: ItemCabinet
-    opened: true
+    cabinetSlot:
+      ejectOnInteract: true
+      whitelist:
+        tags:
+        - WeaponAntiqueLaser
     doorSound:
       path: /Audio/Machines/machine_switch.ogg
     openState: glass-up
     closedState: glass
 
+- type: entity
+  id: GlassBoxLaserOpen
+  parent: GlassBoxLaser
+  suffix: AntiqueLaser, Open
+  components:
+  - type: Lock
+    locked: false
+  - type: ItemCabinet
+    opened: true
+
 - type: entity
   id: GlassBoxLaserFilled
   parent: GlassBoxLaser
-  suffix: Filled
+  suffix: AntiqueLaser, Filled
   components:
   - type: ItemCabinet
     cabinetSlot:
       whitelist:
         tags:
         - WeaponAntiqueLaser
-    doorSound:
-      path: /Audio/Machines/machine_switch.ogg
-    openState: glass-up
-    closedState: glass
 
 - type: entity
   id: GlassBoxLaserFilledOpen
   parent: GlassBoxLaserFilled
-  suffix: Filled, Open
+  suffix: AntiqueLaser, Filled, Open
   components:
+  - type: Lock
+    locked: false
   - type: ItemCabinet
     opened: true
-    doorSound:
-      path: /Audio/Machines/machine_switch.ogg
-    openState: glass-up
-    closedState: glass
 
 - type: entity
-  id: GlassBoxLaserBroken
+  id: GlassBoxFrame
+  name: glass box frame
+  description: A glassless sturdy showcase for an expensive exhibit.
+  parent: BaseGlassBox
+  suffix: Frame
+  components:
+  - type: Sprite
+    noRot: true
+    sprite: Structures/Storage/glassbox.rsi
+    layers:
+    - state: base
+  - type: Construction
+    graph: GlassBox
+    node: boxMissingWires
+  - type: Climbable
+  - type: Damageable
+    damageModifierSet: Wood
+  - type: Destructible
+    thresholds:
+    - trigger:
+        !type:DamageTrigger
+        damage: 100
+      behaviors:
+      - !type:PlaySoundBehavior
+        sound:
+          collection: WoodDestroy
+      - !type:SpawnEntitiesBehavior
+        spawn:
+          MaterialWoodPlank1:
+            min: 2
+            max: 5
+      - !type:DoActsBehavior
+        acts: ["Destruction"]
+
+- type: entity
+  id: GlassBoxBroken
   name: broken glass box
   description: A broken showcase for a stolen expensive exhibit.
-  parent: BaseStructureDynamic
+  parent: GlassBoxFrame
   suffix: Broken
-  placement:
-    mode: SnapgridCenter
   components:
-  - type: Transform
-    anchored: true
-  - type: Physics
-    bodyType: Static
   - type: Sprite
     sprite: Structures/Storage/glassbox.rsi
     layers:
-    - state: glassbox
-    - state: glass-4
-  - type: Clickable
-  - type: InteractionOutline
+    - state: base
+    - state: glass-broken
+  - type: Construction
+    graph: GlassBox
+    node: brokenGlassBox
+  - type: Destructible
+    thresholds:
+    - trigger:
+        !type:DamageTrigger
+        damage: 100
+      behaviors:
+      - !type:PlaySoundBehavior
+        sound:
+          collection: WoodDestroy
+      - !type:SpawnEntitiesBehavior
+        spawn:
+          ShardGlassReinforced:
+            min: 1
+            max: 1
+          MaterialWoodPlank1:
+            min: 2
+            max: 5
+      - !type:DoActsBehavior
+        acts: ["Destruction"]
diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/structures/glassbox.yml b/Resources/Prototypes/Recipes/Construction/Graphs/structures/glassbox.yml
new file mode 100644 (file)
index 0000000..081f22e
--- /dev/null
@@ -0,0 +1,160 @@
+- type: constructionGraph
+  id: GlassBox
+  start: start
+  graph:
+    - node: start
+      actions:
+        - !type:DeleteEntity
+      edges:
+        - to: boxMissingWires
+          completed:
+            - !type:SetAnchor
+              value: false
+          steps:
+            - material: WoodPlank
+              amount: 10
+              doAfter: 5
+
+    - node: boxMissingWires
+      entity: GlassBoxFrame
+      edges:
+        - to: boxMissingTrigger
+          conditions:
+            - !type:EntityAnchored
+          steps:
+            - material: Cable
+              amount: 2
+              doAfter: 0.5
+
+        - to: start
+          steps:
+            - tool: Prying
+              doAfter: 5
+          completed:
+            - !type:SpawnPrototype
+              prototype: MaterialWoodPlank1
+              amount: 10
+
+    - node: boxMissingTrigger
+      edges:
+        - to: boxTriggerUnsecured
+          conditions:
+            - !type:EntityAnchored
+          steps:
+            - tag: SignalTrigger
+              name: a Signal Trigger
+              icon:
+                sprite: Objects/Devices/signaltrigger.rsi
+                state: signaltrigger
+              doAfter: 0.5
+
+        - to: boxMissingWires
+          conditions:
+            - !type:EntityAnchored
+          steps:
+            - tool: Cutting
+              doAfter: 0.25
+          completed:
+            - !type:SpawnPrototype
+              prototype: CableApcStack1
+              amount: 2
+
+    - node: boxTriggerUnsecured
+      edges:
+        - to: boxMissingRGlass
+          conditions:
+            - !type:EntityAnchored
+          steps:
+            - tool: Screwing
+              doAfter: 0.5
+
+        - to: boxMissingTrigger
+          conditions:
+            - !type:EntityAnchored
+          steps:
+            - tool: Prying
+              doAfter: 0.5
+          completed:
+            - !type:SpawnPrototype
+              prototype: SignalTrigger
+              amount: 1
+
+    - node: boxMissingRGlass
+      edges:
+        - to: boxRGlassUnsecured
+          conditions:
+            - !type:EntityAnchored
+          steps:
+            - material: ReinforcedGlass
+              amount: 5
+              doAfter: 2.5
+
+        - to: boxTriggerUnsecured
+          conditions:
+            - !type:EntityAnchored
+          steps:
+            - tool: Screwing
+              doAfter: 0.5
+
+    - node: boxRGlassUnsecured
+      edges:
+        - to: glassBox
+          conditions:
+            - !type:EntityAnchored
+          steps:
+            - tool: Screwing
+              doAfter: 0.5
+
+        - to: boxMissingRGlass
+          conditions:
+            - !type:EntityAnchored
+          steps:
+            - tool: Prying
+              doAfter: 2
+          completed:
+            - !type:SpawnPrototype
+              prototype: SheetRGlass1
+              amount: 5
+
+    - node: brokenGlassBox
+      entity: GlassBoxBroken
+      edges:
+        - to: boxMissingWires
+          steps:
+            - tool: Prying
+              doAfter: 2
+          completed:
+            - !type:SpawnPrototype
+              prototype: ShardGlassReinforced
+              amount: 1
+
+    - node: glassBox
+      entity: GlassBoxLaser
+      edges:
+        - to: boxMissingWires
+          steps:
+            - tool: Screwing
+              doAfter: 4
+            - tool: Pulsing
+              doAfter: 2
+            - tool: Cutting
+              doAfter: 2
+            - tool: Screwing
+              doAfter: 2
+            - tool: Welding
+              doAfter: 10
+            - tool: Anchoring
+              doAfter: 2
+            - tool: Prying
+              doAfter: 2
+          completed:
+            - !type:EmptyAllContainers
+            - !type:SpawnPrototype
+              prototype: CableApcStack1
+              amount: 2
+            - !type:SpawnPrototype
+              prototype: SignalTrigger
+              amount: 1
+            - !type:SpawnPrototype
+              prototype: SheetRGlass1
+              amount: 5
index 41abf881b656cf18cf490d1d5079adbc70433ec7..c8edebc5096ca5bc059352642abf033cda2e43c9 100644 (file)
   canBuildInImpassable: false
   conditions:
     - !type:TileNotBlocked
+
+# ItemCabinets
+- type: construction
+  id: ShowCase
+  name: showcase
+  description: A sturdy showcase for an expensive exhibit.
+  graph: GlassBox
+  startNode: start
+  targetNode: glassBox
+  category: construction-category-storage
+  icon:
+    sprite: Structures/Storage/glassbox.rsi
+    state: icon
+  objectType: Structure
+  placementMode: SnapgridCenter
+  canBuildInImpassable: false
+  conditions:
+    - !type:TileNotBlocked
index 5545e21ee71e3099edc859e40667a846e3641484..f544cd95ef0fdf5d2bab6efd915f44cde9d18a0b 100644 (file)
 - type: Tag
   id: Sidearm
 
+- type: Tag
+  id: SignalTrigger
+
 - type: Tag
   id: SkeletonMotorcycleKeys
 
index cce6fe0ba3c8c14ff0b5f6f6661a18be74d56f8e..a82bb8b2338f154497c6ffa65c3def8ab4e5a8e3 100644 (file)
Binary files a/Resources/Textures/Structures/Storage/glassbox.rsi/DamageOverlay_12.png and b/Resources/Textures/Structures/Storage/glassbox.rsi/DamageOverlay_12.png differ
index 08b6f6644903c83b695fbfa63833a4bfd48771ed..054f1f520c9cc2cf097761cc5c31ca66a664e187 100644 (file)
Binary files a/Resources/Textures/Structures/Storage/glassbox.rsi/DamageOverlay_4.png and b/Resources/Textures/Structures/Storage/glassbox.rsi/DamageOverlay_4.png differ
index 6d980d1c67cb876ae0e623575b3459408fe8229f..e1c22974684c6c233f263e7d82568ad09f8c38f6 100644 (file)
Binary files a/Resources/Textures/Structures/Storage/glassbox.rsi/DamageOverlay_8.png and b/Resources/Textures/Structures/Storage/glassbox.rsi/DamageOverlay_8.png differ
diff --git a/Resources/Textures/Structures/Storage/glassbox.rsi/glassbox-filled-closed.png b/Resources/Textures/Structures/Storage/glassbox.rsi/glassbox-filled-closed.png
deleted file mode 100644 (file)
index b558cf5..0000000
Binary files a/Resources/Textures/Structures/Storage/glassbox.rsi/glassbox-filled-closed.png and /dev/null differ
diff --git a/Resources/Textures/Structures/Storage/glassbox.rsi/glassbox-filled-open.png b/Resources/Textures/Structures/Storage/glassbox.rsi/glassbox-filled-open.png
deleted file mode 100644 (file)
index 48db8e8..0000000
Binary files a/Resources/Textures/Structures/Storage/glassbox.rsi/glassbox-filled-open.png and /dev/null differ
diff --git a/Resources/Textures/Structures/Storage/glassbox.rsi/glassbox.png b/Resources/Textures/Structures/Storage/glassbox.rsi/glassbox.png
deleted file mode 100644 (file)
index 3a3bf59..0000000
Binary files a/Resources/Textures/Structures/Storage/glassbox.rsi/glassbox.png and /dev/null differ
diff --git a/Resources/Textures/Structures/Storage/glassbox.rsi/icon.png b/Resources/Textures/Structures/Storage/glassbox.rsi/icon.png
new file mode 100644 (file)
index 0000000..9d1c8c8
Binary files /dev/null and b/Resources/Textures/Structures/Storage/glassbox.rsi/icon.png differ
index 5ce653f37b14fc844ccbc4bc779883d257c29631..33decc40092a405be55bf23c25a3bf86c44b65de 100644 (file)
@@ -1,50 +1,44 @@
 {
   "version": 1,
   "license": "CC-BY-SA-3.0",
-  "copyright": "Taken from tgstation https://github.com/tgstation/tgstation/commit/0129a094635aac51e00fdc7aa3b4248affc1f49d Sprite modified and updated by Nimfar11 (Github), Shatter resprite by KREKS",
+  "copyright": "Taken from tgstation https://github.com/tgstation/tgstation/commit/0129a094635aac51e00fdc7aa3b4248affc1f49d Sprite modified and updated by Nimfar11 (Github), Shatter resprite by KREKS and modified by MilenVolf (GitHub)",
   "size": {
     "x": 32,
     "y": 32
   },
   "states": [
     {
-      "name": "glass"
-    },
-    {
-      "name": "DamageOverlay_4"
+      "name": "base"
     },
     {
-      "name": "DamageOverlay_8"
+      "name": "glass"
     },
     {
-      "name": "DamageOverlay_12"
+      "name": "glass-up"
     },
     {
-      "name": "glass-4"
+      "name": "glass-broken"
     },
     {
-      "name": "glass-up"
+      "name": "caplaser"
     },
     {
       "name": "locked"
     },
-    {
-      "name": "caplaser"
-    },
     {
       "name": "unlocked"
     },
     {
-      "name": "glassbox"
+      "name": "icon"
     },
     {
-      "name": "glassbox-empty-open"
+      "name": "DamageOverlay_4"
     },
     {
-      "name": "glassbox-filled-closed"
+      "name": "DamageOverlay_8"
     },
     {
-      "name": "glassbox-filled-open"
+      "name": "DamageOverlay_12"
     }
   ]
 }
\ No newline at end of file
index bf18cfe555b5e6e1ae3e1558f514acf7fca97426..84203370e9a83ccb998e21b622bd54d06cde2729 100644 (file)
@@ -327,5 +327,8 @@ WeaponPistolN1984Nonlethal: WeaponPistolN1984
 WeaponSubMachineGunVectorRubber: WeaponSubMachineGunVector
 WeaponSubMachineGunDrozdRubber: WeaponSubMachineGunDrozd
 WeaponRifleLecterRubber: WeaponRifleLecter
+
+# 2024-04-26
+GlassBoxLaserBroken: GlassBoxBroken
 ReinforcementRadioSyndicateMonkey: ReinforcementRadioSyndicateAncestor
 ReinforcementRadioSyndicateMonkeyNukeops: ReinforcementRadioSyndicateAncestorNukeops