# SPDX-FileCopyrightText: 2023 LankLTE <135308300+LankLTE@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Leon Friedrich <60421075+ElectroJr@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Jezithyr <jezithyr@gmail.com>
# SPDX-FileCopyrightText: 2024 metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Aiden <aiden@djkraz.com>
# SPDX-FileCopyrightText: 2025 GoobBot <uristmchands@proton.me>
# SPDX-FileCopyrightText: 2025 deltanedas <39013340+deltanedas@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 deltanedas <@deltanedas:kde.org>
# SPDX-FileCopyrightText: 2025 gluesniffler <159397573+gluesniffler@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 gluesniffler <linebarrelerenthusiast@gmail.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# Shitmed Change: this entire file is reorganized for shitmed:
# Instead of random species parts inheriting BaseItem and copy pasting stuff,
# EVERYTHING inherits either BasePart or BasePartInorganic.
# Then individual part LS just inherits from PartSBase and BaseL where S and L are the species and limb.
# All limbs have the usual state, PartSBase just needs to set the rsi for sprite and icon
- type: entity
  abstract: true
  parent: BaseItem
  id: BasePartInorganic
  name: "body part"
  components:
  - type: Sprite
    sprite: Mobs/Species/Human/parts.rsi
    enableOverrideDir: true
    overrideDir: North
  - type: ThrowingAngle # We add this so that throwing things doesn't make them freak the fuck out by automatically deciding directions.
    angle: 90
  - type: Icon
    sprite: Mobs/Species/Human/parts.rsi
  - type: Damageable
    damageContainer: Inorganic # Shitmed Change
  - type: BodyPart
    partComposition: Inorganic
  - type: SurgeryTool # Shitmed Change
    startSound:
      path: /Audio/_Shitmed/Medical/Surgery/organ1.ogg
    endSound:
      path: /Audio/_Shitmed/Medical/Surgery/organ2.ogg
  - type: Gibbable
  - type: ContainerContainer
    containers:
      bodypart: !type:Container
        ents: []
      Wounds: !type:Container # Shitmed Change
        ents: []
      Bone: !type:Container # Shitmed Change
        ents: []
  - type: Appearance
  - type: StaticPrice
    price: 100

- type: entity
  abstract: true
  id: BaseChestInorganic
  name: "chest"
  components:
  - type: Sprite
    state: "chest_m"
  - type: Icon
    state: "chest_m"
  - type: BodyPart
    partType: Chest
    # Shitmed Change Start
    toolName: "a chest"
    containerName: "chest_slot"
    children:
      groin:
        id: groin
        type: Groin
      right arm:
        id: right arm
        type: Arm
      left arm:
        id: left arm
        type: Arm
      head:
        id: head
        type: Head
    organs:
      heart:
        id: heart
      lungs:
        id: lungs
  - type: Woundable
    damageContainer: Inorganic
    integrity: 200
    integrityCap: 200
    thresholds:
      Minor: 180
      Moderate: 120
      Severe: 60
      Critical: 30
      Mangled: 0
  - type: WoundableVisuals
    thresholds: [ 10, 20, 30, 50, 70, 100 ]
    occupiedLayer: Chest
    damageOverlayGroups:
      Brute:
        sprite: _Shitmed/Mobs/Effects/brute_damage.rsi
        color: "#FF0000"
      Burn:
        sprite: _Shitmed/Mobs/Effects/burn_damage.rsi
    bleedingOverlay: _Shitmed/Mobs/Effects/bleeding_damage.rsi
  - type: ConsciousnessRequired
    identifier: "chest"
    causesDeath: true
  - type: ContainerContainer
    containers:
      chest_slot: !type:ContainerSlot {}
      Wounds: !type:Container # Shitmed Change
        ents: []
      Bone: !type:Container # Shitmed Change
        ents: []

- type: entity
  abstract: true
  id: BaseGroinInorganic
  name: "groin"
  components:
  - type: Sprite
    state: "groin_m"
  - type: Icon
    state: "groin_m"
  - type: BodyPart
    partType: Groin
    # Shitmed Change Start
    toolName: "a groin"
    containerName: "groin_slot"
    children:
      right leg:
        id: right leg
        type: Leg
      left leg:
        id: left leg
        type: Leg
    organs:
      stomach:
        id: stomach
      liver:
        id: liver
      kidneys:
        id: kidneys
  - type: Woundable
    integrity: 100
    integrityCap: 100
    thresholds:
      Minor: 84
      Moderate: 70
      Severe: 55
      Critical: 30
      Mangled: 0
    traumaDeductions:
      Dismemberment: 0.5
  - type: WoundableVisuals
    thresholds: [ 10, 20, 30, 50, 70, 100 ]
    occupiedLayer: Groin
    damageOverlayGroups:
      Brute:
        sprite: _Shitmed/Mobs/Effects/brute_damage.rsi
        color: "#FF0000"
      Burn:
        sprite: _Shitmed/Mobs/Effects/burn_damage.rsi
    bleedingOverlay: _Shitmed/Mobs/Effects/bleeding_damage.rsi
  - type: ConsciousnessRequired
    identifier: "groin"
    causesDeath: false
  - type: ContainerContainer
    containers:
      groin_slot: !type:ContainerSlot {}
      Wounds: !type:Container # Shitmed Change
        ents: []
      Bone: !type:Container # Shitmed Change
        ents: []

- type: entity
  abstract: true
  id: BaseHead
  name: "head"
  components:
  - type: Damageable
    damageContainer: Biological
  - type: Sprite
    state: "head_m"
  - type: Icon
    state: "head_m"
  - type: BodyPart
    partType: Head
    toolName: "a head" # Shitmed Change
    organs: # Shitmed Change
      brain:
        id: brain
      eyes:
        id: eyes
  - type: Input
    context: "ghost"
  - type: Tag
    tags:
      - Head
      - Unedible # Goobstation
  - type: Woundable
    boneEntity: BoneNeck
    integrity: 80
    integrityCap: 80
    thresholds:
      Minor: 70
      Moderate: 50
      Severe: 25
      Critical: 10
      Mangled: 0
    damageOnAmputate: # This seemingly arbitrary spread is the result of the default head health (65) subtracted to 200 (death threshold).
      types:
        Bloodloss: 45
        Asphyxiation: 45
        Slash: 45
    traumaDeductions:
      Dismemberment: 0.5
  - type: WoundableVisuals
    thresholds: [ 10, 20, 30, 50, 70, 100 ]
    occupiedLayer: Head
    damageOverlayGroups:
      Brute:
        sprite: _Shitmed/Mobs/Effects/brute_damage.rsi
        color: "#FF0000"
      Burn:
        sprite: _Shitmed/Mobs/Effects/burn_damage.rsi
    bleedingOverlay: _Shitmed/Mobs/Effects/bleeding_damage.rsi
  - type: ConsciousnessRequired
    identifier: "head"
    causesDeath: true
  - type: ContainerContainer
    containers:
      mouth_slot: !type:ContainerSlot {}
      Wounds: !type:Container # Shitmed Change
        ents: []
      Bone: !type:Container # Shitmed Change
        ents: []

- type: entity
  abstract: true
  id: BaseLeftArm
  name: "left arm"
  components:
  - type: Sprite
    state: "l_arm"
  - type: Icon
    state: "l_arm"
  - type: BodyPart
    partType: Arm
    symmetry: Left
    toolName: "a left arm" # Shitmed Change
    children: # Shitmed Change
      left hand:
        id: left hand
        type: Hand
  - type: WoundableVisuals
    thresholds: [ 10, 20, 30, 50, 70, 100 ]
    occupiedLayer: LArm
    damageOverlayGroups:
      Brute:
        sprite: _Shitmed/Mobs/Effects/brute_damage.rsi
        color: "#FF0000"
      Burn:
        sprite: _Shitmed/Mobs/Effects/burn_damage.rsi
    bleedingOverlay: _Shitmed/Mobs/Effects/bleeding_damage.rsi
  - type: Woundable
    integrity: 80
    integrityCap: 80
    thresholds:
      Minor: 70
      Moderate: 50
      Severe: 25
      Critical: 10
      Mangled: 0

- type: entity
  abstract: true
  id: BaseRightArm
  name: "right arm"
  components:
  - type: Sprite
    state: "r_arm"
  - type: Icon
    state: "r_arm"
  - type: BodyPart
    partType: Arm
    symmetry: Right
    toolName: "a right arm" # Shitmed Change
    children: # Shitmed Change
      right hand:
        id: right hand
        type: Hand
  - type: WoundableVisuals
    thresholds: [ 10, 20, 30, 50, 70, 100 ]
    occupiedLayer: RArm
    damageOverlayGroups:
      Brute:
        sprite: _Shitmed/Mobs/Effects/brute_damage.rsi
        color: "#FF0000"
      Burn:
        sprite: _Shitmed/Mobs/Effects/burn_damage.rsi
    bleedingOverlay: _Shitmed/Mobs/Effects/bleeding_damage.rsi
  - type: Woundable
    integrity: 80
    integrityCap: 80
    thresholds:
      Minor: 70
      Moderate: 50
      Severe: 25
      Critical: 10
      Mangled: 0

- type: entity
  abstract: true
  id: BaseLeftHand
  name: "left hand"
  components:
  - type: Sprite
    state: "l_hand"
  - type: Icon
    state: "l_hand"
  - type: BodyPart
    partType: Hand
    symmetry: Left
    toolName: "a left hand" # Shitmed Change
  - type: WoundableVisuals
    thresholds: [ 10, 20, 30, 50, 70, 100 ]
    occupiedLayer: LHand
    damageOverlayGroups:
      Brute:
        sprite: _Shitmed/Mobs/Effects/brute_damage.rsi
        color: "#FF0000"
      Burn:
        sprite: _Shitmed/Mobs/Effects/burn_damage.rsi
    bleedingOverlay: null
  - type: Woundable
    integrity: 50
    integrityCap: 50
    thresholds:
      Minor: 42
      Moderate: 36
      Severe: 26
      Critical: 15
      Mangled: 0

- type: entity
  abstract: true
  id: BaseRightHand
  name: "right hand"
  components:
  - type: Sprite
    state: "r_hand"
  - type: Icon
    state: "r_hand"
  - type: BodyPart
    partType: Hand
    symmetry: Right
    toolName: "a right hand" # Shitmed Change
  - type: Woundable
    integrity: 60
    integrityCap: 60
    thresholds:
      Minor: 50
      Moderate: 40
      Severe: 30
      Critical: 18
      Mangled: 0
  - type: WoundableVisuals
    thresholds: [ 10, 20, 30, 50, 70, 100 ]
    occupiedLayer: RHand
    damageOverlayGroups:
      Brute:
        sprite: _Shitmed/Mobs/Effects/brute_damage.rsi
        color: "#FF0000"
      Burn:
        sprite: _Shitmed/Mobs/Effects/burn_damage.rsi
    bleedingOverlay: null

- type: entity
  abstract: true
  id: BaseLeftLeg
  name: "left leg"
  components:
  - type: Sprite
    state: "l_leg"
  - type: Icon
    state: "l_leg"
  - type: BodyPart
    partType: Leg
    symmetry: Left
    toolName: "a left leg" # Shitmed Change
    children: # Shitmed Change
      left foot:
        id: left foot
        type: Foot
  - type: MovementBodyPart
  - type: WoundableVisuals
    thresholds: [ 10, 20, 30, 50, 70, 100 ]
    occupiedLayer: LLeg
    damageOverlayGroups:
      Brute:
        sprite: _Shitmed/Mobs/Effects/brute_damage.rsi
        color: "#FF0000"
      Burn:
        sprite: _Shitmed/Mobs/Effects/burn_damage.rsi
    bleedingOverlay: _Shitmed/Mobs/Effects/bleeding_damage.rsi
  - type: Woundable
    integrity: 80
    integrityCap: 80
    thresholds:
      Minor: 70
      Moderate: 50
      Severe: 25
      Critical: 10
      Mangled: 0

- type: entity
  abstract: true
  id: BaseRightLeg
  name: "right leg"
  components:
  - type: Sprite
    state: "r_leg"
  - type: Icon
    state: "r_leg"
  - type: BodyPart
    partType: Leg
    symmetry: Right
    toolName: "a right leg" # Shitmed Change
    children: # Shitmed Change
      right foot:
        id: right foot
        type: Foot
  - type: MovementBodyPart
  - type: WoundableVisuals
    thresholds: [ 10, 20, 30, 50, 70, 100 ]
    occupiedLayer: RLeg
    damageOverlayGroups:
      Brute:
        sprite: _Shitmed/Mobs/Effects/brute_damage.rsi
        color: "#FF0000"
      Burn:
        sprite: _Shitmed/Mobs/Effects/burn_damage.rsi
    bleedingOverlay: _Shitmed/Mobs/Effects/bleeding_damage.rsi
  - type: Woundable
    integrity: 80
    integrityCap: 80
    thresholds:
      Minor: 70
      Moderate: 50
      Severe: 25
      Critical: 10
      Mangled: 0

- type: entity
  abstract: true
  id: BaseLeftFoot
  name: "left foot"
  components:
  - type: Sprite
    state: "l_foot"
  - type: Icon
    state: "l_foot"
  - type: BodyPart
    partType: Foot
    symmetry: Left
    toolName: "a left foot" # Shitmed Change
  - type: WoundableVisuals
    thresholds: [ 10, 20, 30, 50, 70, 100 ]
    occupiedLayer: LFoot
    damageOverlayGroups:
      Brute:
        sprite: _Shitmed/Mobs/Effects/brute_damage.rsi
        color: "#FF0000"
      Burn:
        sprite: _Shitmed/Mobs/Effects/burn_damage.rsi
    bleedingOverlay: null
  - type: Woundable
    integrity: 60
    integrityCap: 60
    thresholds:
      Minor: 50
      Moderate: 40
      Severe: 30
      Critical: 18
      Mangled: 0

- type: entity
  abstract: true
  id: BaseRightFoot
  name: "right foot"
  components:
  - type: Sprite
    state: "r_foot"
  - type: Icon
    state: "r_foot"
  - type: BodyPart
    partType: Foot
    symmetry: Right
    toolName: "a right foot" # Shitmed Change
  - type: WoundableVisuals
    thresholds: [ 10, 20, 30, 50, 70, 100 ]
    occupiedLayer: RFoot
    damageOverlayGroups:
      Brute:
        sprite: _Shitmed/Mobs/Effects/brute_damage.rsi
        color: "#FF0000"
      Burn:
        sprite: _Shitmed/Mobs/Effects/burn_damage.rsi
    bleedingOverlay: null
  - type: Woundable
    integrity: 60
    integrityCap: 60
    thresholds:
      Minor: 50
      Moderate: 40
      Severe: 30
      Critical: 18
      Mangled: 0
