item cabinet rework + stuff (#26779)

This commit is contained in:
deltanedas
2024-05-29 20:08:33 +00:00
committed by GitHub
parent a315f90abc
commit 404fe818e8
14 changed files with 379 additions and 454 deletions

View File

@@ -0,0 +1,44 @@
- type: entity
abstract: true
id: BaseItemCabinet
components:
- type: Openable
openOnActivate: true
closeable: true
sound:
path: /Audio/Machines/machine_switch.ogg
closeSound:
path: /Audio/Machines/machine_switch.ogg
- type: ItemCabinet
- type: ItemSlots
- type: ContainerContainer
containers:
ItemCabinet: !type:ContainerSlot
- type: Appearance
# perfect for most things but you can always replace it
- type: GenericVisualizer
visuals:
enum.ItemCabinetVisuals.ContainsItem:
enum.ItemCabinetVisuals.Layer:
True: { visible: true }
False: { visible: false }
enum.OpenableVisuals.Opened:
enum.OpenableVisuals.Layer:
True: { state: open }
False: { state: closed }
- type: entity
abstract: true
parent: BaseItemCabinet
id: BaseItemCabinetGlass
components:
- type: GenericVisualizer
visuals:
enum.ItemCabinetVisuals.ContainsItem:
enum.ItemCabinetVisuals.Layer:
True: { visible: true }
False: { visible: false }
enum.OpenableVisuals.Opened:
enum.OpenableVisuals.Layer:
True: { state: glass-up }
False: { state: glass }

View File

@@ -1,15 +1,12 @@
- type: entity
parent: [BaseStructureDynamic, BaseItemCabinetGlass]
id: BaseGlassBox
parent: BaseStructureDynamic
abstract: true
placement:
mode: SnapgridCenter
components:
- type: Transform
anchored: true
- type: Physics
bodyType: Static
- type: Clickable
- type: InteractionOutline
- type: Fixtures
fixtures:
@@ -23,13 +20,8 @@
layer:
- MidImpassable
- LowImpassable
- type: ItemSlots
- type: ContainerContainer
containers:
ItemCabinet: !type:ContainerSlot
- type: Anchorable
delay: 4
- type: Appearance
- type: entity
id: GlassBox
@@ -44,10 +36,10 @@
layers:
- state: base
- state: caplaser # TODO: Remove it after item scaling in cabinets is implemented.
map: ["enum.ItemCabinetVisualLayers.ContainsItem"]
map: ["enum.ItemCabinetVisuals.Layer"]
visible: true
- state: glass
map: ["enum.ItemCabinetVisualLayers.Door"]
map: ["enum.OpenableVisuals.Layer"]
- state: locked
shader: unshaded
map: ["enum.LockVisualLayers.Lock"]
@@ -118,49 +110,39 @@
- type: Construction
graph: GlassBox
node: glassBox
- type: ItemCabinet
cabinetSlot:
ejectOnInteract: true
whitelist:
tags:
- WeaponAntiqueLaser
doorSound:
path: /Audio/Machines/machine_switch.ogg
openState: glass-up
closedState: glass
- type: ItemSlots
slots:
ItemCabinet:
ejectOnInteract: true
whitelist:
tags:
- WeaponAntiqueLaser
ejectSound: /Audio/Machines/machine_switch.ogg
- type: entity
id: GlassBoxLaserOpen
parent: GlassBoxLaser
suffix: AntiqueLaser, Open
components:
- type: Openable
opened: true
- type: Lock
locked: false
- type: ItemCabinet
opened: true
- type: entity
id: GlassBoxLaserFilled
parent: GlassBoxLaser
suffix: AntiqueLaser, Filled
components:
- type: ItemCabinet
cabinetSlot:
startingItem: WeaponAntiqueLaser
ejectOnInteract: true
whitelist:
tags:
- WeaponAntiqueLaser
- type: ContainerFill
containers:
ItemCabinet:
- WeaponAntiqueLaser
- type: entity
parent: [GlassBoxLaserFilled, GlassBoxLaserOpen]
id: GlassBoxLaserFilledOpen
parent: GlassBoxLaserFilled
suffix: AntiqueLaser, Filled, Open
components:
- type: Lock
locked: false
- type: ItemCabinet
opened: true
- type: entity
id: GlassBoxFrame

View File

@@ -1,100 +1,74 @@
- type: entity
# TODO: same as other wallmount cabinets they should use a base structure prototype
- type: entity
parent: BaseItemCabinet
id: DefibrillatorCabinet
name: defibrillator cabinet
description: A small wall mounted cabinet designed to hold a defibrillator.
placement:
mode: SnapgridCenter
components:
- type: WallMount
arc: 175
- type: Transform
anchored: true
- type: Clickable
- type: InteractionOutline
- type: Sprite
sprite: Structures/Wallmounts/defib_cabinet.rsi
noRot: false
layers:
- state: frame
- state: fill
map: ["enum.ItemCabinetVisualLayers.ContainsItem"]
visible: true
- state: closed
map: ["enum.ItemCabinetVisualLayers.Door"]
- type: ItemCabinet
cabinetSlot:
- type: WallMount
arc: 175
- type: Transform
anchored: true
- type: Clickable
- type: InteractionOutline
- type: Sprite
sprite: Structures/Wallmounts/defib_cabinet.rsi
noRot: false
layers:
- state: frame
- state: fill
map: ["enum.ItemCabinetVisuals.Layer"]
visible: true
- state: closed
map: ["enum.OpenableVisuals.Layer"]
- type: ItemSlots
slots:
ItemCabinet:
ejectOnInteract: true
whitelist:
components:
- Defibrillator
doorSound:
path: /Audio/Machines/machine_switch.ogg
openState: open
closedState: closed
- type: Appearance
- type: ItemSlots
- type: ContainerContainer
containers:
ItemCabinet: !type:ContainerSlot
- type: Damageable
damageContainer: Inorganic
damageModifierSet: Metallic
- type: Destructible
thresholds:
- trigger:
!type:DamageTrigger
damage: 80
behaviors:
- !type:DoActsBehavior
acts: [ "Destruction" ]
- trigger:
!type:DamageTrigger
damage: 40
behaviors:
- !type:EmptyAllContainersBehaviour
- !type:DoActsBehavior
acts: [ "Destruction" ]
- !type:PlaySoundBehavior
sound:
collection: MetalGlassBreak
placement:
mode: SnapgridCenter
- type: Damageable
damageContainer: Inorganic
damageModifierSet: Metallic
- type: Destructible
thresholds:
- trigger: !type:DamageTrigger
damage: 80
behaviors:
- !type:DoActsBehavior
acts: [ "Destruction" ]
- trigger: !type:DamageTrigger
damage: 40
behaviors:
- !type:EmptyAllContainersBehaviour
- !type:DoActsBehavior
acts: [ "Destruction" ]
- !type:PlaySoundBehavior
sound:
collection: MetalGlassBreak
- type: entity
id: DefibrillatorCabinetOpen
parent: DefibrillatorCabinet
id: DefibrillatorCabinetOpen
suffix: Open
components:
- type: ItemCabinet
- type: Openable
opened: true
doorSound:
path: /Audio/Machines/machine_switch.ogg
openState: open
closedState: closed
- type: entity
id: DefibrillatorCabinetFilled
parent: DefibrillatorCabinet
id: DefibrillatorCabinetFilled
suffix: Filled
components:
- type: ItemCabinet
cabinetSlot:
ejectOnInteract: true
startingItem: Defibrillator
whitelist:
components:
- Defibrillator
doorSound:
path: /Audio/Machines/machine_switch.ogg
openState: open
closedState: closed
- type: ContainerFill
containers:
ItemCabinet:
- Defibrillator
- type: entity
parent: [DefibrillatorCabinetFilled, DefibrillatorCabinetOpen]
id: DefibrillatorCabinetFilledOpen
parent: DefibrillatorCabinetFilled
suffix: Filled, Open
components:
- type: ItemCabinet
opened: true
doorSound:
path: /Audio/Machines/machine_switch.ogg
openState: open
closedState: closed

View File

@@ -1,7 +1,12 @@
- type: entity
# TODO: this could probably use some kind of base structure prototype
# every wallmount cabinet copypastes placement and like 8 components
- type: entity
parent: BaseItemCabinet
id: ExtinguisherCabinet
name: extinguisher cabinet
description: A small wall mounted cabinet designed to hold a fire extinguisher.
placement:
mode: SnapgridCenter
components:
- type: WallMount
arc: 360
@@ -15,25 +20,17 @@
layers:
- state: frame
- state: extinguisher
map: ["enum.ItemCabinetVisualLayers.ContainsItem"]
map: ["enum.ItemCabinetVisuals.Layer"]
visible: true
- state: closed
map: ["enum.ItemCabinetVisualLayers.Door"]
- type: ItemCabinet
cabinetSlot:
ejectOnInteract: true
whitelist:
components:
- FireExtinguisher
doorSound:
path: /Audio/Machines/machine_switch.ogg
openState: open
closedState: closed
- type: Appearance
map: ["enum.OpenableVisuals.Layer"]
- type: ItemSlots
- type: ContainerContainer
containers:
ItemCabinet: !type:ContainerSlot
slots:
ItemCabinet:
ejectOnInteract: true
whitelist:
components:
- FireExtinguisher
- type: Damageable
damageContainer: Inorganic
damageModifierSet: Metallic
@@ -57,46 +54,26 @@
collection: MetalGlassBreak
params:
volume: -4
placement:
mode: SnapgridCenter
- type: entity
id: ExtinguisherCabinetOpen
parent: ExtinguisherCabinet
id: ExtinguisherCabinetOpen
suffix: Open
components:
- type: ItemCabinet
- type: Openable
opened: true
doorSound:
path: /Audio/Machines/machine_switch.ogg
openState: open
closedState: closed
- type: entity
id: ExtinguisherCabinetFilled
parent: ExtinguisherCabinet
id: ExtinguisherCabinetFilled
suffix: Filled
components:
- type: ItemCabinet
cabinetSlot:
ejectOnInteract: true
startingItem: FireExtinguisher
whitelist:
components:
- FireExtinguisher
doorSound:
path: /Audio/Machines/machine_switch.ogg
openState: open
closedState: closed
- type: ContainerFill
containers:
ItemCabinet:
- FireExtinguisher
- type: entity
parent: [ExtinguisherCabinetFilled, ExtinguisherCabinetOpen]
id: ExtinguisherCabinetFilledOpen
parent: ExtinguisherCabinetFilled
suffix: Filled, Open
components:
- type: ItemCabinet
opened: true
doorSound:
path: /Audio/Machines/machine_switch.ogg
openState: open
closedState: closed

View File

@@ -1,29 +1,33 @@
# TODO: same as fire extinguisher make it use a base structure theres lots of copy paste
- type: entity
parent: BaseItemCabinetGlass
id: FireAxeCabinet
name: fire axe cabinet
description: There is a small label that reads "For Emergency use only" along with details for safe use of the axe. As if.
placement:
mode: SnapgridCenter
components:
- type: Damageable
damageContainer: Inorganic
damageModifierSet: Glass
- type: Destructible
thresholds:
- trigger:
!type:DamageTrigger
damage: 300
behaviors:
- !type:DoActsBehavior
acts: [ "Destruction" ]
- trigger:
!type:DamageTrigger
damage: 200 #20ish crowbar hits
behaviors:
- !type:EmptyAllContainersBehaviour
- !type:DoActsBehavior
acts: [ "Destruction" ]
- !type:PlaySoundBehavior
sound:
collection: MetalGlassBreak
- trigger:
!type:DamageTrigger
damage: 300
behaviors:
- !type:DoActsBehavior
acts: [ "Destruction" ]
- trigger:
!type:DamageTrigger
damage: 200 #20ish crowbar hits
behaviors:
- !type:EmptyAllContainersBehaviour
- !type:DoActsBehavior
acts: [ "Destruction" ]
- !type:PlaySoundBehavior
sound:
collection: MetalGlassBreak
- type: MeleeSound
soundGroups:
Brute:
@@ -36,68 +40,42 @@
layers:
- state: cabinet
- state: fireaxe
map: ["enum.ItemCabinetVisualLayers.ContainsItem"]
map: ["enum.ItemCabinetVisuals.Layer"]
visible: true
- state: glass
map: ["enum.ItemCabinetVisualLayers.Door"]
- type: ItemCabinet
cabinetSlot:
ejectOnInteract: true
whitelist:
tags:
- FireAxe
doorSound:
path: /Audio/Machines/machine_switch.ogg
openState: glass-up
closedState: glass
- type: Appearance
map: ["enum.OpenableVisuals.Layer"]
- type: ItemSlots
slots:
ItemCabinet:
ejectOnInteract: true
whitelist:
tags:
- FireAxe
- type: Lock
- type: AccessReader
access: [["Atmospherics"], ["Command"]]
- type: ItemSlots
- type: ContainerContainer
containers:
ItemCabinet: !type:ContainerSlot
placement:
mode: SnapgridCenter
- type: entity
id: FireAxeCabinetOpen
parent: FireAxeCabinet
id: FireAxeCabinetOpen
suffix: Open
components:
- type: ItemCabinet
- type: Openable
opened: true
doorSound:
path: /Audio/Machines/machine_switch.ogg
openState: glass-up
closedState: glass
- type: Lock
locked: false
- type: entity
id: FireAxeCabinetFilled
parent: FireAxeCabinet
id: FireAxeCabinetFilled
suffix: Filled
components:
- type: ItemCabinet
cabinetSlot:
startingItem: FireAxe
ejectOnInteract: true
whitelist:
tags:
- FireAxe
doorSound:
path: /Audio/Machines/machine_switch.ogg
openState: glass-up
closedState: glass
- type: ContainerFill
containers:
ItemCabinet:
- FireAxe
- type: entity
parent: [FireAxeCabinetFilled, FireAxeCabinetOpen]
id: FireAxeCabinetFilledOpen
parent: FireAxeCabinetFilled
suffix: Filled, Open
components:
- type: ItemCabinet
opened: true
doorSound:
path: /Audio/Machines/machine_switch.ogg
openState: glass-up
closedState: glass

View File

@@ -9,39 +9,41 @@
layers:
- state: cabinet
- state: shotgun
map: ["enum.ItemCabinetVisualLayers.ContainsItem"]
map: ["enum.ItemCabinetVisuals.Layer"]
visible: true
- state: glass
map: ["enum.ItemCabinetVisualLayers.Door"]
- type: ItemCabinet
cabinetSlot:
ejectOnInteract: true
whitelist:
tags:
- WeaponShotgunKammerer
map: ["enum.OpenableVisuals.Layer"]
- type: ItemSlots
slots:
ItemCabinet:
ejectOnInteract: true
whitelist:
tags:
- WeaponShotgunKammerer
- type: AccessReader
access: [["Security"], ["Command"]]
- type: entity
parent: ShotGunCabinet
id: ShotGunCabinetOpen
parent: [ShotGunCabinet, FireAxeCabinetOpen]
suffix: Open
components:
- type: Openable
opened: true
- type: Lock
locked: false
- type: entity
parent: ShotGunCabinet
id: ShotGunCabinetFilled
parent: [ShotGunCabinet,FireAxeCabinetFilled]
suffix: Filled
components:
- type: ItemCabinet
cabinetSlot:
startingItem: WeaponShotgunKammerer
ejectOnInteract: true
whitelist:
tags:
- WeaponShotgunKammerer
- type: ContainerFill
containers:
ItemCabinet:
- WeaponShotgunKammerer
- type: entity
parent: [ShotGunCabinetFilled, ShotGunCabinetOpen]
id: ShotGunCabinetFilledOpen
parent: [ShotGunCabinetFilled,FireAxeCabinetFilledOpen]
suffix: Filled, Open