- type: entity
  id: Firelock
  parent: BaseConstructible
  name: firelock
  description: Apply crowbar.
  components:
    - type: InteractionOutline
    - type: Damageable
      resistances: metallicResistances
    - type: Destructible
      thresholds:
      - trigger:
          !type:DamageTrigger
          damage: 500
        behaviors:
        - !type:DoActsBehavior
          acts: ["Destruction"]
    - type: Sprite
      netsync: false
      drawdepth: Mobs # They're on the same layer as mobs, perspective.
      sprite: Constructible/Structures/Doors/Standard/firelock.rsi
      layers:
        - state: closed
          map: ["enum.DoorVisualLayers.Base"]
        - state: closed_unlit
          shader: unshaded
          map: ["enum.DoorVisualLayers.BaseUnlit"]
        - state: welded
          map: ["enum.DoorVisualLayers.BaseWelded"]
        - state: bolted_unlit
          shader: unshaded
          map: ["enum.DoorVisualLayers.BaseBolted"]
        - state: panel_open
          map: ["enum.WiresVisualLayers.MaintenancePanel"]
    - type: Physics
      canCollide: false
      fixtures:
      - shape:
          !type:PhysShapeAabb
            bounds: "-0.49,-0.49,0.49,0.49" # don't want this colliding with walls or they won't close
        mask:
          - MobImpassable
        layer:
          - Opaque
          - Impassable
          - MobImpassable
          - VaultImpassable
          - SmallImpassable
    - type: Door
      closeTimeOne: 0.1
      closeTimeTwo: 0.6
      openTimeOne: 0.1
      openTimeTwo: 0.6
      startOpen: true
      bumpOpen: false
      inhibitCrush: false
    - type: Firelock
    - type: Appearance
      visuals:
        - type: AirlockVisualizer
          open_sound: /Audio/Machines/airlock_open.ogg
          close_sound: /Audio/Machines/airlock_close.ogg
          deny_sound: /Audio/Machines/airlock_deny.ogg
          animation_time: 0.6
        - type: WiresVisualizer
    - type: Wires
      BoardName: "Firelock Control"
      LayoutId: Firelock
    - type: UserInterface
      interfaces:
        - key: enum.WiresUiKey.Key
          type: WiresBoundUserInterface
    - type: Airtight
      fixVacuum: true
    - type: Occluder
      enabled: false
    - type: Construction
      graph: Firelock
      node: Firelock

- type: entity
  id: FirelockGlass
  parent: Firelock
  name: glass firelock
  components:
    - type: Door
      occludes: false
      inhibitCrush: false
    - type: Occluder
      enabled: false
    - type: Sprite
      sprite: Constructible/Structures/Doors/Glass/firelock.rsi

- type: entity
  id: FirelockEdge
  parent: Firelock
  name: firelock
  components:
    - type: Door
      occludes: false
      inhibitCrush: false
    - type: Sprite
      sprite: Constructible/Structures/Doors/edge_door_hazard.rsi
    - type: Airtight
      fixVacuum: true
      noAirWhenFullyAirBlocked: false
      airBlockedDirection:
        - South
    - type: Physics
      fixtures:
      - shape:
          !type:PhysShapeRect
          bounds: "0.49,-0.49,-0.49,-0.2" # don't want this colliding with walls or they won't close
        mask:
          - MobImpassable
        layer:
          - Opaque
          - Impassable
          - MobImpassable
          - VaultImpassable
          - SmallImpassable
