- type: entity
  id: CrateGenericSteel
  name: crate
  parent: CrateGeneric
  components:
  - type: Sprite
    sprite: Structures/Storage/Crates/generic.rsi
    layers:
    - state: crate
    - state: crate_door
      map: ["enum.StorageVisualLayers.Door"]
    - state: welded
      visible: false
      map: ["enum.StorageVisualLayers.Welded"]
  - type: Icon
    sprite: Structures/Storage/Crates/generic.rsi
    state: crate_icon
  - type: Appearance
    visuals:
    - type: StorageVisualizer
      state_open: crate_open
      state_closed: crate_door
  - type: Construction
    graph: CrateGenericSteel
    node: crategenericsteel


- type: entity
  id: CratePlastic
  name: plastic crate
  parent: CrateGeneric
  components:
  - type: Sprite
    sprite: Structures/Storage/Crates/plastic.rsi
    layers:
    - state: plasticcrate
    - state: plasticcrate_door
      map: ["enum.StorageVisualLayers.Door"]
    - state: welded
      visible: false
      map: ["enum.StorageVisualLayers.Welded"]
  - type: Icon
    sprite: Structures/Storage/Crates/plastic.rsi
    state: plasticcrate_icon
  - type: Appearance
    visuals:
    - type: StorageVisualizer
      state_open: plasticcrate_open
      state_closed: plasticcrate_door
  - type: Construction
    graph: CratePlastic
    node: crateplastic

- type: entity
  id: CrateFreezer
  name: freezer
  parent: CrateGeneric
  components:
  - type: Sprite
    sprite: Structures/Storage/Crates/freezer.rsi
    layers:
    - state: freezer
    - state: freezer_door
      map: ["enum.StorageVisualLayers.Door"]
    - state: welded
      visible: false
      map: ["enum.StorageVisualLayers.Welded"]
  - type: Icon
    sprite: Structures/Storage/Crates/freezer.rsi
    state: freezer_icon
  - type: Appearance
    visuals:
    - type: StorageVisualizer
      state_open: freezer_open
      state_closed: freezer_door
  - type: Construction
    graph: CrateGenericSteel
    node: crategenericsteel

- type: entity
  id: CrateHydroponics
  name: hydroponics crate
  parent: CrateGeneric
  components:
  - type: Sprite
    sprite: Structures/Storage/Crates/hydro.rsi
    layers:
    - state: hydrocrate
    - state: hydrocrate_door
      map: ["enum.StorageVisualLayers.Door"]
    - state: welded
      visible: false
      map: ["enum.StorageVisualLayers.Welded"]
  - type: Icon
    sprite: Structures/Storage/Crates/hydro.rsi
    state: hydrocrate_icon
  - type: Appearance
    visuals:
    - type: StorageVisualizer
      state_open: hydrocrate_open
      state_closed: hydrocrate_door
  - type: Construction
    graph: CrateGenericSteel
    node: crategenericsteel

- type: entity
  id: CrateMedical
  name: medical crate
  parent: CrateGeneric
  components:
  - type: Sprite
    sprite: Structures/Storage/Crates/medical.rsi
    layers:
    - state: medicalcrate
    - state: medicalcrate_door
      map: ["enum.StorageVisualLayers.Door"]
    - state: welded
      visible: false
      map: ["enum.StorageVisualLayers.Welded"]
  - type: Icon
    sprite: Structures/Storage/Crates/medical.rsi
    state: medicalcrate_icon
  - type: Appearance
    visuals:
    - type: StorageVisualizer
      state_open: medicalcrate_open
      state_closed: medicalcrate_door
  - type: Construction
    graph: CrateGenericSteel
    node: crategenericsteel

- type: entity
  id: CrateRadiation
  name: radiation gear crate
  description: Is not actually lead lined. Do not store your plutonium in this.
  parent: CrateGeneric
  components:
  - type: Sprite
    sprite: Structures/Storage/Crates/radiation.rsi
    layers:
    - state: radiationcrate
    - state: radiationcrate_door
      map: ["enum.StorageVisualLayers.Door"]
    - state: welded
      visible: false
      map: ["enum.StorageVisualLayers.Welded"]
  - type: Icon
    sprite: Structures/Storage/Crates/radiation.rsi
    state: radiationcrate_icon
  - type: Appearance
    visuals:
    - type: StorageVisualizer
      state_open: radiationcrate_open
      state_closed: radiationcrate_door
  - type: Construction
    graph: CrateGenericSteel
    node: crategenericsteel

- type: entity
  id: CrateInternals
  name: oxygen crate
  parent: CrateGeneric
  components:
  - type: Sprite
    sprite: Structures/Storage/Crates/o2.rsi
    layers:
    - state: o2crate
    - state: o2crate_door
      map: ["enum.StorageVisualLayers.Door"]
    - state: welded
      visible: false
      map: ["enum.StorageVisualLayers.Welded"]
  - type: Icon
    sprite: Structures/Storage/Crates/o2.rsi
    state: o2crate_icon
  - type: Appearance
    visuals:
    - type: StorageVisualizer
      state_open: o2crate_open
      state_closed: o2crate_door
  - type: Construction
    graph: CrateGenericSteel
    node: crategenericsteel

- type: entity
  id: CrateElectrical
  name: electrical crate
  parent: CrateGeneric
  components:
  - type: Sprite
    sprite: Structures/Storage/Crates/electricalcrate.rsi
    layers:
    - state: electricalcrate
    - state: electricalcrate_door
      map: ["enum.StorageVisualLayers.Door"]
    - state: welded
      visible: false
      map: ["enum.StorageVisualLayers.Welded"]
  - type: Icon
    sprite: Structures/Storage/Crates/electricalcrate.rsi
    state: electricalcrate_icon
  - type: Appearance
    visuals:
    - type: StorageVisualizer
      state_open: electricalcrate_open
      state_closed: electricalcrate_door
  - type: Construction
    graph: CrateGenericSteel
    node: crategenericsteel

- type: entity
  id: CrateEngineering
  name: engineering crate
  parent: CrateGeneric
  components:
  - type: Sprite
    sprite: Structures/Storage/Crates/engicrate.rsi
    layers:
    - state: engicrate
    - state: engicrate_door
      map: ["enum.StorageVisualLayers.Door"]
    - state: welded
      visible: false
      map: ["enum.StorageVisualLayers.Welded"]
  - type: Icon
    sprite: Structures/Storage/Crates/engicrate.rsi
    state: engicrate_icon
  - type: Appearance
    visuals:
    - type: StorageVisualizer
      state_open: engicrate_open
      state_closed: engicrate_door
  - type: Construction
    graph: CrateGenericSteel
    node: crategenericsteel

- type: entity
  id: CrateScience
  name: science crate
  parent: CrateGeneric
  components:
  - type: Sprite
    sprite: Structures/Storage/Crates/scicrate.rsi
    layers:
    - state: scicrate
    - state: scicrate_door
      map: ["enum.StorageVisualLayers.Door"]
    - state: welded
      visible: false
      map: ["enum.StorageVisualLayers.Welded"]
  - type: Icon
    sprite: Structures/Storage/Crates/scicrate.rsi
    state: scicrate_icon
  - type: Appearance
    visuals:
    - type: StorageVisualizer
      state_open: scicrate_open
      state_closed: scicrate_door
  - type: Construction
    graph: CrateGenericSteel
    node: crategenericsteel

- type: entity
  id: CrateSurgery
  name: surgery crate
  parent: CrateGeneric
  components:
  - type: Sprite
    sprite: Structures/Storage/Crates/surgerycrate.rsi
    layers:
    - state: surgerycrate
    - state: surgerycrate_door
      map: ["enum.StorageVisualLayers.Door"]
    - state: welded
      visible: false
      map: ["enum.StorageVisualLayers.Welded"]
  - type: Icon
    sprite: Structures/Storage/Crates/surgerycrate.rsi
    state: surgerycrate_icon
  - type: Appearance
    visuals:
    - type: StorageVisualizer
      state_open: surgerycrate_open
      state_closed: surgerycrate_door
  - type: Construction
    graph: CrateGenericSteel
    node: crategenericsteel

# Secure Crates

- type: entity
  id: CrateSecgear
  name: secgear crate
  parent: CrateBaseSecure
  components:
  - type: AccessReader
    access: [["Security"]]
  - type: Lock
  - type: Sprite
    sprite: Structures/Storage/Crates/sec_gear.rsi
    layers:
    - state: secgearcrate
    - state: secgearcrate_door
      map: ["enum.StorageVisualLayers.Door"]
    - state: welded
      visible: false
      map: ["enum.StorageVisualLayers.Welded"]
    - state: locked
      map: ["enum.StorageVisualLayers.Lock"]
      shader: unshaded
  - type: Icon
    sprite: Structures/Storage/Crates/sec_gear.rsi
    state: secgearcrate_icon
  - type: Appearance
    visuals:
    - type: StorageVisualizer
      state_open: secgearcrate_open
      state_closed: secgearcrate_door

- type: entity
  id: CrateEngineeringSecure
  name: secure engineering crate
  parent: CrateBaseSecure
  components:
  - type: AccessReader
    access: [["Engineering"]]
  - type: Lock
  - type: Sprite
    sprite: Structures/Storage/Crates/engicrate_secure.rsi
    layers:
    - state: engicratesecure
    - state: engicratesecure_door
      map: ["enum.StorageVisualLayers.Door"]
    - state: welded
      visible: false
      map: ["enum.StorageVisualLayers.Welded"]
    - state: locked
      map: ["enum.StorageVisualLayers.Lock"]
      shader: unshaded
  - type: Icon
    sprite: Structures/Storage/Crates/engicrate_secure.rsi
    state: engicratesecure_icon
  - type: Appearance
    visuals:
    - type: StorageVisualizer
      state_open: engicratesecure_open
      state_closed: engicratesecure_door

- type: entity
  id: CrateMedicalSecure
  name: secure medical crate
  parent: CrateBaseSecure
  components:
  - type: AccessReader
    access: [["Medical"]]
  - type: Lock
  - type: Sprite
    sprite: Structures/Storage/Crates/medicalcrate_secure.rsi
    layers:
    - state: medicalcratesecure
    - state: medicalcratesecure_door
      map: ["enum.StorageVisualLayers.Door"]
    - state: welded
      visible: false
      map: ["enum.StorageVisualLayers.Welded"]
    - state: locked
      map: ["enum.StorageVisualLayers.Lock"]
      shader: unshaded
  - type: Icon
    sprite: Structures/Storage/Crates/medicalcrate_secure.rsi
    state: medicalcratesecure_icon
  - type: Appearance
    visuals:
    - type: StorageVisualizer
      state_open: medicalcratesecure_open
      state_closed: medicalcratesecure_door

- type: entity
  id: CratePrivateSecure
  name: private crate
  parent: CrateBaseSecure
  components:
  - type: AccessReader
  - type: Lock
  - type: Sprite
    sprite: Structures/Storage/Crates/privatecrate_secure.rsi
    layers:
    - state: privatecrate
    - state: privatecrate_door
      map: ["enum.StorageVisualLayers.Door"]
    - state: welded
      visible: false
      map: ["enum.StorageVisualLayers.Welded"]
    - state: locked
      map: ["enum.StorageVisualLayers.Lock"]
      shader: unshaded
  - type: Icon
    sprite: Structures/Storage/Crates/privatecrate_secure.rsi
    state: privatecrate_icon
  - type: Appearance
    visuals:
    - type: StorageVisualizer
      state_open: privatecrate_open
      state_closed: privatecrate_door

- type: entity
  id: CrateScienceSecure
  name: secure science crate
  parent: CrateBaseSecure
  components:
  - type: AccessReader
    access: [["Research"]]
  - type: Lock
  - type: Sprite
    sprite: Structures/Storage/Crates/scicrate_secure.rsi
    layers:
    - state: scicratesecure
    - state: scicratesecure_door
      map: ["enum.StorageVisualLayers.Door"]
    - state: welded
      visible: false
      map: ["enum.StorageVisualLayers.Welded"]
    - state: locked
      map: ["enum.StorageVisualLayers.Lock"]
      shader: unshaded
  - type: Icon
    sprite: Structures/Storage/Crates/scicrate_secure.rsi
    state: scicratesecure_icon
  - type: Appearance
    visuals:
    - type: StorageVisualizer
      state_open: scicratesecure_open
      state_closed: scicratesecure_door

- type: entity
  id: CratePlasma
  name: plasma crate
  parent: CrateBaseSecure
  components:
  - type: AccessReader
    access: [["Engineering"]]
  - type: Lock
  - type: Sprite
    sprite: Structures/Storage/Crates/plasma.rsi
    layers:
    - state: plasmacrate
    - state: plasmacrate_door
      map: ["enum.StorageVisualLayers.Door"]
    - state: welded
      visible: false
      map: ["enum.StorageVisualLayers.Welded"]
    - state: locked
      map: ["enum.StorageVisualLayers.Lock"]
      shader: unshaded
  - type: Icon
    sprite: Structures/Storage/Crates/plasma.rsi
    state: plasmacrate_icon
  - type: Appearance
    visuals:
    - type: StorageVisualizer
      state_open: plasmacrate_open
      state_closed: plasmacrate_door

- type: entity
  id: CrateSecure
  name: secure crate
  parent: CrateBaseSecure
  components:
  - type: AccessReader
  - type: Lock
  - type: Sprite
    sprite: Structures/Storage/Crates/secure.rsi
    layers:
    - state: securecrate
    - state: securecrate_door
      map: ["enum.StorageVisualLayers.Door"]
    - state: welded
      visible: false
      map: ["enum.StorageVisualLayers.Welded"]
    - state: locked
      map: ["enum.StorageVisualLayers.Lock"]
      shader: unshaded
  - type: Icon
    sprite: Structures/Storage/Crates/secure.rsi
    state: securecrate_icon
  - type: Appearance
    visuals:
    - type: StorageVisualizer
      state_open: securecrate_open
      state_closed: securecrate_door

- type: entity
  id: CrateHydroSecure
  name: secure hydroponics crate
  parent: CrateBaseSecure
  components:
  - type: AccessReader
    access: [["Hydroponics"]]
  - type: Lock
  - type: Sprite
    sprite: Structures/Storage/Crates/hydro_secure.rsi
    layers:
    - state: hydrocratesecure
    - state: hydrocratesecure_door
      map: ["enum.StorageVisualLayers.Door"]
    - state: welded
      visible: false
      map: ["enum.StorageVisualLayers.Welded"]
    - state: locked
      map: ["enum.StorageVisualLayers.Lock"]
      shader: unshaded
  - type: Icon
    sprite: Structures/Storage/Crates/hydro_secure.rsi
    state: hydrocratesecure_icon
  - type: Appearance
    visuals:
    - type: StorageVisualizer
      state_open: hydrocratesecure_open
      state_closed: hydrocratesecure_door

- type: entity
  id: CrateWeaponSecure
  name: secure weapon crate
  parent: CrateBaseSecure
  components:
  - type: AccessReader
    access: [["Armory"]]
  - type: Lock
  - type: Sprite
    sprite: Structures/Storage/Crates/weapon.rsi
    layers:
    - state: weaponcrate
    - state: weaponcrate_door
      map: ["enum.StorageVisualLayers.Door"]
    - state: locked
      map: ["enum.StorageVisualLayers.Lock"]
      shader: unshaded
  - type: Icon
    sprite: Structures/Storage/Crates/weapon.rsi
    state: weaponcrate_icon
  - type: Appearance
    visuals:
    - type: StorageVisualizer
      state_open: weaponcrate_open
      state_closed: weaponcrate_door

- type: entity
  id: CrateCommandSecure
  name: command crate
  parent: CrateBaseSecure
  components:
  - type: AccessReader
    access: [["Command"]]
  - type: Lock
  - type: Sprite
    sprite: Structures/Storage/Crates/secure.rsi
    layers:
    - state: securecrate
    - state: securecrate_door
      map: ["enum.StorageVisualLayers.Door"]
    - state: welded
      visible: false
      map: ["enum.StorageVisualLayers.Welded"]
    - state: locked
      map: ["enum.StorageVisualLayers.Lock"]
      shader: unshaded
  - type: Icon
    sprite: Structures/Storage/Crates/secure.rsi
    state: securecrate_icon
  - type: Appearance
    visuals:
    - type: StorageVisualizer
      state_open: securecrate_open
      state_closed: securecrate_door

- type: entity
  id: CrateLivestock
  name: livestock crate
  parent: CrateGeneric
  components:
  - type: EntityStorage
    Capacity: 500
    CanWeldShut: false
  - type: Sprite
    sprite: Structures/Storage/Crates/livestock.rsi
    layers:
    - state: livestockcrate
    - state: livestockcrate_door
      map: ["enum.StorageVisualLayers.Door"]
  - type: Icon
    sprite: Structures/Storage/Crates/livestock.rsi
    state: livestockcrate
  - type: Appearance
    visuals:
    - type: StorageVisualizer
      state_open: livestockcrate_open
      state_closed: livestockcrate_door
  - type: Damageable
    damageContainer: Inorganic
    damageModifierSet: Metallic
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 15
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          path: /Audio/Effects/woodhit.ogg
      - !type:SpawnEntitiesBehavior
        spawn:
          MaterialWoodPlank1:
            min: 1
            max: 4
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
  - type: Physics
    bodyType: Dynamic
  - type: Fixtures
    fixtures:
    - shape:
        !type:PhysShapeAabb
          bounds: "-0.4,-0.4,0.4,0.29"
      mass: 75
      mask:
      - Impassable
      - SmallImpassable
      layer:
      - Opaque
      - MobImpassable
      - SmallImpassable
  - type: Construction
    graph: CrateLivestock
    node: cratelivestock

