# 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: 1000

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

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

- type: entity
  name: D-K 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
  - BaseC2ContrabandUnredeemable # Need a doctor's note to run this.
  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, RawBananium, Skrungle]
    - type: PowerMonitoringDevice
      sprite: _NF/Structures/Power/Generation/portable_generator.rsi
      state: portgen1
    - type: RadiationSource
      enabled: false
    - type: PowerSupplier
      supplyRampRate: 10000
      supplyRampTolerance: 3000
    - type: FuelGradeAdapter
      conversions:
      - input: Bananium
        output: FuelGradeBananium
        rate: 1
      - input: RawBananium
        output: FuelGradeBananium
        rate: 0.5
      - input: Skrungle
        output: FuelGradeBananium
        rate: 0.25
    - type: Geiger
      showExamine: true
      broadcastAudio: true
      isEnabled: true
      attachedToSuit: true # Prevents the counter from being disabled.
    - type: RadiationReceiver # For the geiger counter

- 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: 1000

- type: entity
  name: D-K Jr. 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:
  - BaseC1Contraband # Mildly illegal. Just enough to add some spice to your life.
  - 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: entity
  parent:
  - BaseGeneratorShuttle
  - PortableGeneratorDKJr
  id: PortableGeneratorDKJrShuttle
  suffix: Bananium, Rad-, 60 kW, Ship
  components:
    - type: MaterialStorage
      storage:
        FuelGradeBananium: 1000
