- type: entity
  id: AmmoLoader
  parent: BaseMachinePowered
  name: ammo loader
  description: A pneumatic ammunition loading system manufactured by Erebus HI. Link it to ship artillery with a multitool to transfer ammunition. This model supports 8 guns.
  placement:
    mode: SnapgridCenter
  components:
  - type: Sprite
    sprite: _Mono/Objects/AmmoLoader/powdergate_sealed.rsi
    snapCardinals: true
    layers:
    - state: icon
      map: [ "base" ]
  - type: Physics
    bodyType: Static
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeAabb
          bounds: "-0.45,-0.45,0.45,0.45"
        density: 55
        mask:
        - TableMask
        layer:
        - TableLayer
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 5000
      behaviors:
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
    - trigger:
        !type:DamageTrigger
        damage: 2000
      behaviors:
      - !type:DoActsBehavior
        acts: ["Destruction"]
      - !type:PlaySoundBehavior
        sound:
          collection: MetalBreak
      - !type:SpawnEntitiesBehavior
        spawn:
          SheetSteel1:
            min: 1
            max: 1
  - type: ContainerContainer
    containers:
      ammo_loader: !type:Container
  - type: ThrowInsertContainer
    containerId: ammo_loader
  - type: AmmoLoader
    maxConnections: 8
  - type: ApcPowerReceiver
    powerLoad: 200
  - type: DeviceLinkSource
    range: 100
    ports:
    - AmmoLoaderLoad
  # Mono
  - type: ShipRepairable
    repairTime: 6
    repairCost: 16

- type: entity
  id: AmmoLoaderSmall
  parent: AmmoLoader
  name: small ammo loader
  description: A pneumatic ammunition loading system manufactured by Erebus HI. Link it to ship artillery with a multitool to transfer ammunition. This model supports only 2 guns, but is more durable.
  components:
  - type: Sprite
    sprite: _Mono/Objects/AmmoLoader/payloadgate_sealed.rsi
    snapCardinals: true
    layers:
    - state: icon
      map: [ "base" ]
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 5000
      behaviors:
      - !type:DoActsBehavior
        acts: [ "Destruction" ]
    - trigger:
        !type:DamageTrigger
        damage: 4000
      behaviors:
      - !type:DoActsBehavior
        acts: ["Destruction"]
      - !type:PlaySoundBehavior
        sound:
          collection: MetalBreak
      - !type:SpawnEntitiesBehavior
        spawn:
          SheetSteel1:
            min: 1
            max: 1
  - type: AmmoLoader
    maxConnections: 2
    maxCapacity: 8
