# SPDX-FileCopyrightText: 2023 Henry <sigma1198@gmail.com>
# SPDX-FileCopyrightText: 2023 Leon Friedrich <60421075+ElectroJr@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Nylux <33198989+Nylux@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Whisper <121047731+QuietlyWhisper@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 lzk <124214523+lzk228@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Aidenkrz <aiden@djkraz.com>
# SPDX-FileCopyrightText: 2024 BombasterDS <115770678+BombasterDS@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 FungiFellow <151778459+FungiFellow@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 LankLTE <135308300+LankLTE@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Piras314 <p1r4s@proton.me>
# SPDX-FileCopyrightText: 2024 Plykiya <58439124+Plykiya@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 deltanedas <39013340+deltanedas@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 deltanedas <@deltanedas:kde.org>
# SPDX-FileCopyrightText: 2024 gluesniffler <159397573+gluesniffler@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 mubururu_ <139181059+muburu@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 plykiya <plykiya@protonmail.com>
# SPDX-FileCopyrightText: 2024 username <113782077+whateverusername0@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 whateverusername0 <whateveremail>
# SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Armok <155400926+ARMOKS@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Arraydeess <arraygitbash@gmail.com>
# SPDX-FileCopyrightText: 2025 GoobBot <uristmchands@proton.me>
# SPDX-FileCopyrightText: 2025 Martynas6ha4 <martynashagriefer@gmail.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

- type: entity
  id: BaseDionaOrganUnGibbable
  parent: BaseItem
  abstract: true
  components:
  - type: Sprite
    sprite: Mobs/Species/Diona/organs.rsi
  - type: Organ
    intCap: 24
    integrity: 24
    integrityThresholds:
      Normal: 24
      Damaged: 15
      Destroyed: 0
  - type: Food
  - type: Extractable
    grindableSolutionName: organ
  - type: SolutionContainerManager
    solutions:
      organ:
        maxVol: 10
        reagents:
        - ReagentId: Nutriment
          Quantity: 10
      food:
        maxVol: 5
        reagents:
        - ReagentId: UncookedAnimalProteins
          Quantity: 5
  - type: FlavorProfile
    flavors:
      - people
  - type: Tag # goob edit
    tags:
    - Meat
    - Organ

- type: entity
  id: BaseDionaOrgan
  parent: BaseDionaOrganUnGibbable
  abstract: true
  components:
  - type: Gibbable
  - type: PhysicalComposition #Goobstation - Recycle update
    materialComposition:
      Biomass: 5

- type: entity
  id: OrganDionaBrain
  parent: BaseDionaOrganUnGibbable
  name: brain
  description: "The central hub of a diona's pseudo-neurological activity, its root-like tendrils search for its former body."
  components:
  - type: MindContainer
    showExamineInfo: true
  - type: Speech
    enabled: false
  - type: TypingIndicator
    proto: empty
  - type: Emoting
    enabled: false
  - type: Item
    size: Small
    heldPrefix: brain
  - type: Sprite
    state: brain
  - type: Organ # Shitmed
    intCap: 28
    integrity: 28
    integrityThresholds:
      Normal: 28
      Damaged: 16
      Destroyed: 0
    slotId: brain
  - type: Brain # Shitmed
  - type: SolutionContainerManager
    solutions:
      organ:
        maxVol: 15 # goob edit
        reagents:
        - ReagentId: Nutriment
          Quantity: 10
        - ReagentId: Cognizine # goob edit
          Quantity: 5 # goob edit
      Lung:
        maxVol: 100
        canReact: False
      food:
        maxVol: 5
        reagents:
        - ReagentId: GreyMatter
          Quantity: 5
  - type: Tag # goob edit
    tags:
    - Meat
    - Organ
    - Brain
  - type: NerveSystem # backmen: wounding
  - type: ConsciousnessRequired
    identifier: "nerveSystem"

- type: entity
  id: OrganDionaEyes
  parent: BaseDionaOrgan
  name: eyes
  description: "I see you!"
  components:
  - type: Sprite
    layers:
      - state: eyeball-l
      - state: eyeball-r
  - type: Organ # Shitmed
    intCap: 17 # dionas will have better eyes. :fort:
    integrity: 17
    integrityThresholds:
      Normal: 17
      Damaged: 8
      Destroyed: 0
    slotId: eyes
  - type: Tag # goob edit
    tags:
    - Meat
    - Organ
    - Eyes

- type: entity
  id: OrganDionaStomach
  parent: BaseDionaOrgan
  name: stomach
  description: "The diona's equivalent of a stomach, it reeks of asparagus and vinegar."
  components:
  - type: Sprite
    state: stomach
  - type: SolutionContainerManager
    solutions:
      stomach:
        maxVol: 50
      food:
        maxVol: 5
        reagents:
        - ReagentId: UncookedAnimalProteins
          Quantity: 5
  - type: Organ # Shitmed
    intCap: 35
    integrity: 35
    integrityThresholds:
      Normal: 35
      Damaged: 19
      Destroyed: 0
    slotId: stomach
  - type: Stomach
  - type: Metabolizer
    maxPoisonsProcessable: 6
    metabolizerTypes: [ Plant ]
    removeEmpty: true
    groups:
      - id: Food
      - id: Drink
      - id: Medicine
      - id: Poison
      - id: Narcotic
      - id: Alcohol
        rateModifier: 0.1
  - type: Tag # goob edit
    tags:
    - Meat
    - Organ
    - Stomach
  - type: Item
    size: Small
    heldPrefix: stomach

- type: entity
  id: OrganDionaLungs
  parent: BaseDionaOrgan
  name: lungs
  description: "A spongy mess of slimy, leaf-like structures. Capable of breathing both carbon dioxide and oxygen."
  components:
  - type: Sprite
    state: lungs
  - type: Organ # Shitmed
    intCap: 21
    integrity: 21
    integrityThresholds:
      Normal: 21
      Damaged: 12
      Destroyed: 0
    slotId: lungs
  - type: Item
    size: Small
    heldPrefix: lungs
  - type: Lung
  - type: Metabolizer
    removeEmpty: true
    solutionOnBody: false
    solution: "Lung"
    metabolizerTypes: [ Plant ]
    groups:
    - id: Gas
      rateModifier: 100.0
  - type: SolutionContainerManager
    solutions:
      organ:
        maxVol: 10
        reagents:
        - ReagentId: Nutriment
          Quantity: 10
      Lung:
        maxVol: 100
        canReact: False
  - type: Tag # goob edit
    tags:
    - Meat
    - Organ
    - Lungs

# Organs that turn into nymphs on removal
- type: entity
  id: OrganDionaBrainNymph
  parent: OrganDionaBrain
  categories: [ HideSpawnMenu ]
  name: brain
  description: "The source of incredible, unending intelligence. Honk."
  components:
  - type: Brain
  - type: Nymph # This will make the organs turn into a nymph when they're removed.
    entityPrototype: OrganDionaNymphBrain
    transferMind: true
  - type: Tag # goob edit
    tags:
    - Meat
    - Organ
    - Brain


- type: entity
  id: OrganDionaStomachNymph
  parent: OrganDionaStomach
  categories: [ HideSpawnMenu ]
  name: stomach
  description: "Gross. This is hard to stomach."
  components:
  - type: Nymph
    entityPrototype: OrganDionaNymphStomach
  - type: Tag # goob edit
    tags:
    - Meat
    - Organ
    - Stomach

- type: entity
  id: OrganDionaLungsNymph
  parent: OrganDionaLungs
  categories: [ HideSpawnMenu ]
  name: lungs
  description: "Filters oxygen from an atmosphere, which is then sent into the bloodstream to be used as an electron carrier."
  components:
  - type: Nymph
    entityPrototype: OrganDionaNymphLungs
  - type: Tag # goob edit
    tags:
    - Meat
    - Organ
    - Lungs

# Nymphs that the organs will turn into
- type: entity
  id: OrganDionaNymphBrain
  parent: MobDionaNymph
  categories: [ HideSpawnMenu ]
  name: diona nymph
  suffix: Brain
  description: Contains the brain of a formerly fully-formed Diona. Killing this would kill the Diona forever. You monster.
  components:
  - type: IsDeadIC
  - type: Body
    prototype: AnimalNymphBrain
  - type: VentCrawler # goob

- type: entity
  id: OrganDionaNymphStomach
  parent: MobDionaNymphAccent
  categories: [ HideSpawnMenu ]
  name: diona nymph
  suffix: Stomach
  description: Contains the stomach of a formerly fully-formed Diona. It doesn't taste any better for it.
  components:
  - type: IsDeadIC
  - type: Body
    prototype: AnimalNymphStomach
  - type: VentCrawler # goob

- type: entity
  id: OrganDionaNymphLungs
  parent: MobDionaNymphAccent
  categories: [ HideSpawnMenu ]
  name: diona nymph
  suffix: Lungs
  description: Contains the lungs of a formerly fully-formed Diona. Breathtaking.
  components:
  - type: IsDeadIC
  - type: Body
    prototype: AnimalNymphLungs
  - type: VentCrawler # goob
