- type: entity
  parent: [BaseStructureDynamic, ConstructibleMachine, BaseMachinePowered, BaseConstructibleMachineDestructible]
  id: SmartFridge
  name: SmartFridge
  description: A refrigerated storage unit for keeping items cold and fresh.
  components:
  - type: StationAiWhitelist
  - type: Vocalizer
    hideChat: true
  - type: VocalizerRequiresPower
  - type: DatasetVocalizer
    dataset: SmartFridgeAds
  - type: Speech
  - type: Appearance
  - type: Sprite
    sprite: Structures/Machines/smartfridge.rsi
    snapCardinals: true
    layers:
    - state: "off"
    - state: smartfridge
      visible: false
      map: ["powered-base"]
    - state: smartfridge_open
      visible: false
      map: ["powered-open"]
      shader: unshaded
    - state: smartfridge_door # This state should be toggled off while somebody is accessing the UI. Until that's implemented, we'll just always draw it on top of the "open" sprite.
      visible: false
      map: ["powered-closed"]
    - state: panel
      map: ["enum.WiresVisualLayers.MaintenancePanel"]
  - type: PointLight
    radius: 1.2
    energy: 3.0
    color: "#9dc5c9"
  - type: Machine
    board: SmartFridgeCircuitboard
  - type: ContainerContainer
    containers:
      smart_fridge_inventory: !type:Container
      machine_board: !type:Container
      machine_parts: !type:Container
  - type: Construction
    graph: Machine
    node: machine
    containers:
    - machine_parts
    - machine_board
    - smart_fridge_inventory
  - type: LitOnPowered
  - type: ApcPowerReceiver
    powerLoad: 200
  - type: SmartFridge
    whitelist:
      components:
      - Edible
      - FitsInDispenser
      - Pill
      - Produce
      - Seed
      tags:
      - PillCanister
      - Bottle
      - Syringe
      - ChemDispensable
  - type: ActivatableUI
    key: enum.SmartFridgeUiKey.Key
  - type: ActivatableUIRequiresPower
  - type: UserInterface
    interfaces:
      enum.SmartFridgeUiKey.Key:
        type: SmartFridgeBoundUserInterface
  - type: WiresPanel
  - type: WiresVisuals
  - type: AccessReader
  - type: UseDelay
    delay: 1
  - type: AntiRottingContainer
  - type: ResistLocker
  - type: Physics
    bodyType: Static
  - type: Transform
    noRot: true
    anchored: True
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeAabb
          bounds: "-0.45,-0.45,0.45,0.45"
        mask:
        - MachineMask
        layer:
        - MachineLayer
        density: 200
  - type: Anchorable
    delay: 2
  - type: InteractionOutline
  - type: Damageable
    damageModifierSet: GlassMod
  - type: Destructible
    thresholds:
    - trigger: !type:DamageTrigger
        damage: 175
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          collection: MetalGlassBreak
  - type: DamageOnHighSpeedImpact
    damage:
      types:
        Blunt: 5
    soundHit:
      collection: MetalThud
  - type: ExplosionResistance
    damageCoefficient: 0.2
  - type: Airtight
  - type: GenericVisualizer
    visuals:
      enum.PowerDeviceVisuals.Powered:
        powered-base:
          True: { visible: true }
          False: { visible: false }
        powered-open:
          True: { visible: true }
          False: { visible: false }
        powered-closed:
          True: { visible: true }
          False: { visible: false }
  - type: AmbientMusicMarkerMedical

- type: entity
  parent: SmartFridge
  id: SmartFridgeMedical
  suffix: Medical
  components:
  - type: SmartFridge
    flavorText: smart-fridge-request-chemistry
  - type: AccessReader
    access: [["Medical"]]
