- type: markingsGroup
  id: None
  onlyGroupWhitelisted: true

- type: markingsGroup
  id: Undergarments
  limits:
    enum.HumanoidVisualLayers.UndergarmentTop:
      limit: 1
      required: false
      nudityDefault: [ UndergarmentTopTanktop ]
    enum.HumanoidVisualLayers.UndergarmentBottom:
      limit: 1
      required: false
      nudityDefault: [ UndergarmentBottomBoxers ]

- type: entity
  id: OrganBase
  name: organ
  abstract: true
  parent: BaseItem
  components:
  - type: Organ

- type: entity
  id: OrganBaseOrganic
  name: organ
  abstract: true
  parent: [ OrganBase, SolutionFood, SolutionTiny ]
  components:
  - type: FlavorProfile
    flavors:
    - chicken # INTRODUCING OUR NEW EVERY-MEAT BURRITO, IT'S GOT EVERY MEAT!
  - type: Edible
  - type: Solution
    solution:
      reagents:
      - ReagentId: UncookedAnimalProteins
        Quantity: 20
  - type: Tag # I am nearing my limit of tolerance for TagComponent.
    tags:
    - Raw
    - Meat

- type: entity
  parent:
  - OrganBase
  - OrganBaseParent
  - OrganBaseChildExternal
  id: OrganBaseTorso
  name: torso
  abstract: true
  components:
  - type: Organ
    category: Torso
  - type: Sprite
    state: torso
  - type: VisualOrgan
    layer: enum.HumanoidVisualLayers.Chest
    data:
      state: torso
  - type: VisualOrganMarkings
    markingData:
      layers:
      - Chest
      - Tail
      - Overlay
      - TailOverlay
      - UndergarmentTop
      - UndergarmentBottom
      - Special

- type: entity
  parent:
  - OrganBase
  - OrganBaseParent
  - OrganBaseChildExternal
  id: OrganBaseHead
  name: head
  abstract: true
  components:
  - type: Organ
    category: Head
  - type: Sprite
    state: head
  - type: VisualOrgan
    layer: enum.HumanoidVisualLayers.Head
    data:
      state: head
  - type: VisualOrganMarkings
    hideableLayers:
    - enum.HumanoidVisualLayers.Hair
    markingData:
      layers:
      - Head
      - Hair
      - FacialHair
      - Snout
      - SnoutCover
      - HeadSide
      - HeadTop

- type: entity
  parent:
  - OrganBase
  - OrganBaseParent
  - OrganBaseChildExternal
  id: OrganBaseArmLeft
  name: left arm
  abstract: true
  components:
  - type: Organ
    category: ArmLeft
  - type: Sprite
    state: l_arm
  - type: VisualOrgan
    layer: enum.HumanoidVisualLayers.LArm
    data:
      state: l_arm
  - type: VisualOrganMarkings
    markingData:
      layers:
      - LArm

- type: entity
  parent:
  - OrganBase
  - OrganBaseParent
  - OrganBaseChildExternal
  id: OrganBaseArmRight
  name: right arm
  abstract: true
  components:
  - type: Organ
    category: ArmRight
  - type: Sprite
    state: r_arm
  - type: VisualOrgan
    layer: enum.HumanoidVisualLayers.RArm
    data:
      state: r_arm
  - type: VisualOrganMarkings
    markingData:
      layers:
      - RArm

- type: entity
  parent:
  - OrganBase
  - OrganBaseChildExternal
  id: OrganBaseHandLeft
  name: left hand
  abstract: true
  components:
  - type: Organ
    category: HandLeft
  - type: HandOrgan
    handID: left
    data:
      location: Left
  - type: Sprite
    state: l_hand
  - type: VisualOrgan
    layer: enum.HumanoidVisualLayers.LHand
    data:
      state: l_hand
  - type: VisualOrganMarkings
    markingData:
      layers:
      - LHand

- type: entity
  parent:
  - OrganBase
  - OrganBaseChildExternal
  id: OrganBaseHandRight
  name: right hand
  abstract: true
  components:
  - type: Organ
    category: HandRight
  - type: HandOrgan
    handID: right
    data:
      location: Right
  - type: Sprite
    state: r_hand
  - type: VisualOrgan
    layer: enum.HumanoidVisualLayers.RHand
    data:
      state: r_hand
  - type: VisualOrganMarkings
    markingData:
      layers:
      - RHand

- type: entity
  parent:
  - OrganBase
  - OrganBaseParent
  - OrganBaseChildExternal
  id: OrganBaseLegLeft
  name: left leg
  abstract: true
  components:
  - type: Organ
    category: LegLeft
  - type: Sprite
    state: l_leg
  - type: VisualOrgan
    layer: enum.HumanoidVisualLayers.LLeg
    data:
      state: l_leg
  - type: VisualOrganMarkings
    markingData:
      layers:
      - LLeg

- type: entity
  parent:
  - OrganBase
  - OrganBaseParent
  - OrganBaseChildExternal
  id: OrganBaseLegRight
  name: right leg
  abstract: true
  components:
  - type: Organ
    category: LegRight
  - type: Sprite
    state: r_leg
  - type: VisualOrgan
    layer: enum.HumanoidVisualLayers.RLeg
    data:
      state: r_leg
  - type: VisualOrganMarkings
    markingData:
      layers:
      - RLeg

- type: entity
  parent:
  - OrganBase
  - OrganBaseChildExternal
  id: OrganBaseFootLeft
  name: left foot
  abstract: true
  components:
  - type: Organ
    category: FootLeft
  - type: Sprite
    state: l_foot
  - type: VisualOrgan
    layer: enum.HumanoidVisualLayers.LFoot
    data:
      state: l_foot
  - type: VisualOrganMarkings
    markingData:
      layers:
      - LFoot

- type: entity
  parent:
  - OrganBase
  - OrganBaseChildExternal
  id: OrganBaseFootRight
  name: right foot
  abstract: true
  components:
  - type: Organ
    category: FootRight
  - type: Sprite
    state: r_foot
  - type: VisualOrgan
    layer: enum.HumanoidVisualLayers.RFoot
    data:
      state: r_foot
  - type: VisualOrganMarkings
    markingData:
      layers:
      - RFoot

- type: entity
  parent:
  - OrganBase
  - OrganBaseChildInternal
  id: OrganBaseBrain
  name: brain
  abstract: true
  components:
  - type: GibbableOrgan
  - type: Organ
    category: Brain
  - type: Sprite
    layers:
    - state: brain
  - type: Item
    heldPrefix: brain
  - type: Input
    context: "ghost"
  - type: Brain
  - type: InputMover
  - type: Examiner
  - type: BlockMovement
  - type: BadFood
  - type: Solution
    solution:
      reagents:
      - ReagentId: UncookedAnimalProteins
        Quantity: 15
      - ReagentId: GreyMatter
        Quantity: 10
  - type: FoodSequenceElement
    entries:
      Burger: Brain
      Taco: Brain

- type: entity
  parent:
  - OrganBase
  - OrganBaseChildInternal
  id: OrganBaseEyes
  name: eyes
  abstract: true
  components:
  - type: GibbableOrgan
  - type: Organ
    category: Eyes
  - type: Sprite
    layers:
    - state: eyeball-l
    - state: eyeball-r
  - type: VisualOrgan
    layer: enum.HumanoidVisualLayers.Eyes
    data:
      sprite: Mobs/Customization/eyes.rsi
      state: eyes
  - type: VisualOrganMarkings
    markingData:
      layers:
      - Eyes

- type: entity
  parent:
  - OrganBase
  - OrganBaseChildInternal
  id: OrganBaseTongue
  name: tongue
  abstract: true
  components:
  - type: GibbableOrgan
  - type: Organ
    category: Tongue
  - type: Sprite
    layers:
    - state: tongue

- type: entity
  parent:
  - OrganBase
  - OrganBaseChildInternal
  id: OrganBaseAppendix
  name: appendix
  abstract: true
  components:
  - type: GibbableOrgan
  - type: Organ
    category: Appendix
  - type: Sprite
    layers:
    - state: appendix

- type: entity
  parent:
  - OrganBase
  - OrganBaseChildInternal
  id: OrganBaseEars
  name: ears
  abstract: true
  components:
  - type: GibbableOrgan
  - type: Organ
    category: Ears
  - type: Sprite
    layers:
    - state: ears

- type: entity
  parent:
  - OrganBase
  - OrganBaseChildInternal
  id: OrganBaseLungs
  name: lungs
  abstract: true
  components:
  - type: GibbableOrgan
  - type: Organ
    category: Lungs
  - type: Lung
  - type: Metabolizer
    stages: [ Respiration ]
  - type: SolutionManager
    solutions:
    - SolutionLungGas
  - type: Sprite
    layers:
    - state: lung-l
    - state: lung-r
  - type: Item
    heldPrefix: lungs

- type: entity
  parent: Solution
  id: SolutionLungGas # TODO: Metabolize directly from gasses :(
  categories: [ HideSpawnMenu ]
  components:
  - type: Solution
    id: Lung
    solution:
      maxVol: 100.0
      canReact: false

- type: entity
  parent:
  - OrganBase
  - OrganBaseChildInternal
  id: OrganBaseHeart
  name: heart
  abstract: true
  components:
  - type: GibbableOrgan
  - type: Organ
    category: Heart
  - type: Sprite
    layers:
    - state: heart-on
  - type: Metabolizer
    maxReagents: 2
    stages: [ Bloodstream ]

- type: entity
  parent:
  - OrganBase
  - OrganBaseChildInternal
  id: OrganBaseStomach
  name: stomach
  abstract: true
  components:
  - type: GibbableOrgan
  - type: Organ
    category: Stomach
  - type: Stomach
  - type: SolutionManager
    solutions:
    - SolutionStomach
  - type: Metabolizer
    maxReagents: 3
    stages: [ Digestion ]
  - type: Sprite
    layers:
    - state: stomach
  - type: Item
    heldPrefix: stomach

- type: entity
  parent: Solution
  id: SolutionStomach
  categories: [ HideSpawnMenu ]
  components:
  - type: Solution
    id: stomach
    solution:
      maxVol: 150 # 1.25 liters which is average for a human

- type: entity
  parent:
  - OrganBase
  - OrganBaseChildInternal
  id: OrganBaseLiver
  name: liver
  abstract: true
  components:
  - type: GibbableOrgan
  - type: Organ
    category: Liver
  - type: Sprite
    layers:
    - state: liver
  - type: Item
    heldPrefix: liver
  - type: Metabolizer
    maxReagents: 1
    stages: [ Metabolites ]

- type: entity
  parent:
  - OrganBase
  - OrganBaseChildInternal
  id: OrganBaseKidneys
  name: kidneys
  abstract: true
  components:
  - type: GibbableOrgan
  - type: Organ
    category: Kidneys
  - type: Sprite
    layers:
      - state: kidney-l
      - state: kidney-r
  - type: Item
    heldPrefix: kidneys
  - type: Metabolizer
    maxReagents: 5

- type: entity
  id: OrganSpriteHumanInternal
  abstract: true
  components:
  - type: Sprite
    sprite: Mobs/Species/Human/organs.rsi

- type: entity
  id: OrganBaseHeadSexed
  abstract: true
  components:
  - type: Sprite
    state: head_m
  - type: VisualOrgan
    data:
      state: head_m
    sexStateOverrides:
      Male: head_m
      Female: head_f

- type: entity
  id: OrganBaseTorsoSexed
  abstract: true
  components:
  - type: Sprite
    state: torso_m
  - type: VisualOrgan
    data:
      state: torso_m
    sexStateOverrides:
      Male: torso_m
      Female: torso_f

- type: entity
  abstract: true
  id: OrganBaseParent
  components:
  - type: ParentOrgan
  - type: DetachableOrgan
    detachedBody: DetachedBody

- type: entity
  abstract: true
  id: OrganBaseChildExternal
  components:
  - type: ChildOrgan
  - type: DetachableOrgan
    detachedBody: DetachedBody

- type: entity
  abstract: true
  id: OrganBaseChildInternal
  components:
  - type: ChildOrgan
  - type: InternalChildOrgan
