- type: entity
  parent: BaseMachinePowered
  id: GravityGenerator
  name: gravity generator
  description: It's what keeps you to the floor.
  placement:
    mode: AlignTileAny
  components:
  - type: StationAiWhitelist
  - type: AmbientSound
    enabled: false
    volume: -6
    range: 7
    sound:
      path: /Audio/Ambience/Objects/gravity_gen_hum.ogg
  - type: Sprite
    sprite: Structures/Machines/gravity_generator.rsi
    layers:
      - state: on
        map: ["enum.GravityGeneratorVisualLayers.Base"]
      - sprite: Structures/Machines/gravity_generator_core.rsi
        state: activated
        shader: unshaded
        map: ["enum.GravityGeneratorVisualLayers.Core"]
  - type: Transform
    anchored: true
  - type: ApcPowerReceiver
    powerLoad: 2500
  - type: ExtensionCableReceiver
  - type: Physics
    bodyType: Static
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeAabb
          bounds: "-1.5,-1.5,1.5,1.5"
        density: 50
        mask:
        - LargeMobMask
        layer:
        - WallLayer
  - type: Repairable
    fuelCost: 10
    doAfterDelay: 5
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 150
      behaviors:
      - !type:DoActsBehavior
        acts: ["Breakage"]
  - type: PowerCharge
    windowTitle: gravity-generator-window-title
    idlePower: 50
    activePower: 2500
  - type: GravityGenerator
    lightRadiusMin: 0.75
    lightRadiusMax: 2.5
    spriteMap:
      broken: "broken"
      unpowered: "off"
      off: "off"
      on: "on"
  - type: ActivatableUI
    key: enum.PowerChargeUiKey.Key
  - type: ActivatableUIRequiresPower
  - type: UserInterface
    interfaces:
      enum.PowerChargeUiKey.Key:
        type: PowerChargeBoundUserInterface
  - type: Appearance
  - type: PointLight
    radius: 2.5
    energy: 0.5
    # Gravity generator is a large machine, not casting shadows is fine within the radius set above.
    castShadows: false
    color: "#a8ffd9"
  - type: StaticPrice
    price: 5000

- type: entity
  parent: [ GravityGenerator, ConstructibleMachine, BaseConstructibleMachineDestructible ]
  id: GravityGeneratorMini
  name: mini gravity generator
  suffix: Charged
  description: It's what keeps you to the floor, now in fun size.
  components:
  - type: StationAiWhitelist
  - type: Sprite
    sprite: Structures/Machines/gravity_generator_mini.rsi
    snapCardinals: true
    layers:
      - state: on
        map: ["enum.GravityGeneratorVisualLayers.Base"]
      - sprite: Structures/Machines/gravity_generator_core.rsi
        state: activated
        shader: unshaded
        map: ["enum.GravityGeneratorVisualLayers.Core"]
        scale: "0.4,0.4"
        offset: "0,0.2"
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeAabb
          bounds: "-0.4,-0.4,0.4,0.4"
        density: 3125
        mask:
        - LargeMobMask
        layer:
        - WallLayer
  - type: Destructible
    thresholds:
    - trigger:
        !type:DamageTrigger
        damage: 175
      behaviors:
      - !type:PlaySoundBehavior
        sound:
          collection: MetalGlassBreak
  - type: WiresPanel
  - type: Machine
    board: MiniGravityGeneratorCircuitboard
  - type: ApcPowerReceiver
    powerLoad: 500
  - type: PowerCharge
    idlePower: 15
    activePower: 500
  - type: GravityGenerator
    lightRadiusMin: 0.75
    lightRadiusMax: 2.5
  - type: StaticPrice
    price: 2000

- type: entity
  id: GravityGeneratorMiniUncharged
  parent: GravityGeneratorMini
  suffix: Uncharged
  components:
  - type: PowerCharge
    charge: 0
