# Base generator for powered on, anchored versions for shuttles
- type: entity
  id: BaseGeneratorShuttle
  abstract: true
  components:
  - type: Transform
    anchored: true
  - type: Physics
    bodyType: Static
  - type: PortableGenerator
    startOnMapInit: true

- type: entity
  parent:
  - BaseGeneratorShuttle
  - PortableGeneratorPacman
  id: PortableGeneratorPacmanShuttle
  suffix: Plasma, 15 kW, Ship
  components:
  - type: MaterialStorage
    storage:
      FuelGradePlasma: 2000 # mono

- type: entity
  parent:
  - BaseGeneratorShuttle
  - PortableGeneratorSuperPacman
  id: PortableGeneratorSuperPacmanShuttle
  suffix: Uranium, 30 kW, Ship
  components:
  - type: MaterialStorage
    storage:
      FuelGradeUranium: 2000 # mono

- type: entity
  parent:
  - BaseGeneratorShuttle
  - PortableGeneratorJrPacman
  id: PortableGeneratorJrPacmanShuttle
  suffix: Welding Fuel, 6 kW, Ship
  components:
    - type: SolutionContainerManager
      solutions:
        tank:
          maxVol: 500 # mono
          reagents:
          - ReagentId: WeldingFuel
            Quantity: 70 # Frontier - 35<70

- type: entity
  name: D-K-type portable generator
  description: |-
    A prototype Dunn-Kikko fission reactor. Use with caution.
    Runs off bananium and is rated for up to 120 kW.
    Highly radioactive without protection.
  parent:
  - PortableGeneratorSuperPacman
  # Mono - Not contraband
  id: PortableGeneratorDK
  suffix: Bananium, Rad+, 60 kW
  components:
    - type: Sprite
      sprite: _NF/Structures/Power/Generation/portable_generator.rsi
      layers:
        - state: portgen1
          map: [ "enum.GeneratorVisualLayers.Body" ]
        - state: portgen_on_unlit
          map: [ "enum.GeneratorVisualLayers.Unlit" ]
          shader: unshaded
          visible: false
    - type: GenericVisualizer
      visuals:
        enum.GeneratorVisuals.Running:
          enum.GeneratorVisualLayers.Body:
            True: { state: portgen1on }
            False: { state: portgen1 }
          enum.GeneratorVisualLayers.Unlit:
            True: { visible: true }
            False: { visible: false }
    - type: Machine
      board: PortableGeneratorDKMachineCircuitboard
    - type: FuelGenerator
      minTargetPower: 10000
      maxTargetPower: 120000 # 12 rad/s at full output, _just_ safe directly behind a reinforced wall
      targetPower: 60000
      optimalPower: 60000
      # ~22 minutes per stack at full power - 80 kJ per stack, 240 kJ per 30 units
      optimalBurnRate: 0.0075
      # leaky, worse power curve
      fuelEfficiencyConstant: 0.5
      radiationColor: "#00bfff"
    - type: SolidFuelGeneratorAdapter
      fuelMaterial: FuelGradeBananium
    - type: MaterialStorage
      materialWhiteList: [Bananium, FuelGradeBananium]
    - type: PowerMonitoringDevice
      sprite: _NF/Structures/Power/Generation/portable_generator.rsi
      state: portgen1
    - type: RadiationSource
      enabled: false
    - type: AmbientSound
      volume: 1
      enabled: false
      sound:
        path: /Audio/Ambience/Objects/engine_hum.ogg # Mono
    - type: PowerSupplier
      supplyRampRate: 10000
      supplyRampTolerance: 3000
    - type: FuelGradeAdapter
      inputMaterial: Bananium
      outputMaterial: FuelGradeBananium

- type: entity
  parent:
  - BaseGeneratorShuttle
  - PortableGeneratorDK
  id: PortableGeneratorDKShuttle
  suffix: Bananium, Rad+, 60 kW, Ship
  categories: [ HideSpawnMenu ] # Mm, start-on rad source
  components:
    - type: MaterialStorage
      storage:
        FuelGradeBananium: 2500 # mono

- type: entity
  name: D-K Jr.-type portable generator
  description: |-
    A miniaturized Dunn-Kikko fission reactor. Use with caution.
    Runs off bananium and is rated for up to 100 kW.
    Quite radioactive without protection.
  parent:
  # Mono - Not contraband
  - PortableGeneratorDK
  id: PortableGeneratorDKJr
  suffix: Bananium, Rad-, 60 kW
  components:
    - type: Sprite
      sprite: Structures/Power/Generation/portable_generator.rsi
      layers:
        - state: portgen2
          map: [ "enum.GeneratorVisualLayers.Body" ]
        - state: portgen_on_unlit
          map: [ "enum.GeneratorVisualLayers.Unlit" ]
          shader: unshaded
          visible: false
    - type: GenericVisualizer
      visuals:
        enum.GeneratorVisuals.Running:
          enum.GeneratorVisualLayers.Body:
            True: { state: portgen2on }
            False: { state: portgen2 }
          enum.GeneratorVisualLayers.Unlit:
            True: { visible: true }
            False: { visible: false }
    - type: Machine
      board: PortableGeneratorDKJrMachineCircuitboard
    - type: FuelGenerator
      maxTargetPower: 100000
      # still decent power curve
      fuelEfficiencyConstant: 0.75
      radiationIntensity: 0.00004 # 4 rad/s at full output, 2.4 at optimal settings
    - type: PowerMonitoringDevice
      sprite: Structures/Power/Generation/portable_generator.rsi
      state: portgen2
    - type: AmbientSound
      sound:
        path: /Audio/Ambience/Objects/engine_hum.ogg

- type: entity
  parent:
  - BaseGeneratorShuttle
  - PortableGeneratorDKJr
  id: PortableGeneratorDKJrShuttle
  suffix: Bananium, Rad-, 60 kW, Ship
  components:
    - type: MaterialStorage
      storage:
        FuelGradeBananium: 1250 # mono
