# SPDX-FileCopyrightText: 2024 Aiden <aiden@djkraz.com>
# SPDX-FileCopyrightText: 2024 Aidenkrz <aiden@djkraz.com>
# SPDX-FileCopyrightText: 2024 Alzore <140123969+Blackern5000@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 BombasterDS <115770678+BombasterDS@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Brandon Hu <103440971+Brandon-Huu@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 CaasGit <87243814+CaasGit@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Chief-Engineer <119664036+Chief-Engineer@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Cojoke <83733158+Cojoke-dot@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 DrSmugleaf <10968691+DrSmugleaf@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 DrSmugleaf <DrSmugleaf@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Ed <96445749+TheShuEd@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Emisse <99158783+Emisse@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 EmoGarbage404 <retron404@gmail.com>
# SPDX-FileCopyrightText: 2024 Eoin Mcloughlin <helloworld@eoinrul.es>
# SPDX-FileCopyrightText: 2024 Errant <35878406+Errant-4@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Fishbait <Fishbait@git.ml>
# SPDX-FileCopyrightText: 2024 Flareguy <78941145+Flareguy@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Hrosts <35345601+Hrosts@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 IProduceWidgets <107586145+IProduceWidgets@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Ian <ignaz.k@live.de>
# SPDX-FileCopyrightText: 2024 Ilya246 <57039557+Ilya246@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Joel Zimmerman <JoelZimmerman@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 JustCone <141039037+JustCone14@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Killerqu00 <47712032+Killerqu00@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Ko4ergaPunk <62609550+Ko4ergaPunk@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Kukutis96513 <146854220+Kukutis96513@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Leon Friedrich <60421075+ElectroJr@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Lye <128915833+Lyroth001@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 MerrytheManokit <167581110+MerrytheManokit@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Mervill <mervills.email@gmail.com>
# SPDX-FileCopyrightText: 2024 Mr. 27 <45323883+Dutch-VanDerLinde@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 MureixloI <132683811+MureixloI@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 NakataRin <45946146+NakataRin@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 OrangeMoronage9622 <whyteterry0092@gmail.com>
# SPDX-FileCopyrightText: 2024 PJBot <pieterjan.briers+bot@gmail.com>
# SPDX-FileCopyrightText: 2024 Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
# SPDX-FileCopyrightText: 2024 Piras314 <p1r4s@proton.me>
# SPDX-FileCopyrightText: 2024 Plykiya <58439124+Plykiya@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Preston Smith <92108534+thetolbean@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Psychpsyo <60073468+Psychpsyo@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Repo <47093363+Titian3@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 RiceMar1244 <138547931+RiceMar1244@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 ShadowCommander <10494922+ShadowCommander@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Simon <63975668+Simyon264@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 SlamBamActionman <83650252+SlamBamActionman@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Speebro <100388782+Speebr0@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Speebro <speebro@notreal.com>
# SPDX-FileCopyrightText: 2024 Stalen <33173619+stalengd@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 TakoDragon <69509841+BackeTako@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Thomas <87614336+Aeshus@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 TsjipTsjip <19798667+TsjipTsjip@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Ubaser <134914314+UbaserB@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Unkn0wn_Gh0st <shadowstalkermll@gmail.com>
# SPDX-FileCopyrightText: 2024 Vasilis <vasilis@pikachu.systems>
# SPDX-FileCopyrightText: 2024 Vigers Ray <60344369+VigersRay@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 beck-thompson <107373427+beck-thompson@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 deathride58 <deathride58@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 deltanedas <39013340+deltanedas@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 deltanedas <@deltanedas:kde.org>
# SPDX-FileCopyrightText: 2024 dffdff2423 <dffdff2423@gmail.com>
# SPDX-FileCopyrightText: 2024 eoineoineoin <github@eoinrul.es>
# SPDX-FileCopyrightText: 2024 fishbait <gnesse@gmail.com>
# SPDX-FileCopyrightText: 2024 foboscheshir <156405958+foboscheshir@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 lzk <124214523+lzk228@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 metalgearsloth <comedian_vs_clown@hotmail.com>
# SPDX-FileCopyrightText: 2024 nikthechampiongr <32041239+nikthechampiongr@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 plykiya <plykiya@protonmail.com>
# SPDX-FileCopyrightText: 2024 saintmuntzer <47153094+saintmuntzer@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 shamp <140359015+shampunj@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 slarticodefast <161409025+slarticodefast@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 strO0pwafel <153459934+strO0pwafel@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 stroopwafel <j.o.luijkx@student.tudelft.nl>
# SPDX-FileCopyrightText: 2024 themias <89101928+themias@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 to4no_fix <156101927+chavonadelal@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 unknown <Administrator@DESKTOP-PMRIVVA.kommune.indresogn.no>
# SPDX-FileCopyrightText: 2024 voidnull000 <18663194+voidnull000@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 yglop <95057024+yglop@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Aviu00 <aviu00@protonmail.com>
# SPDX-FileCopyrightText: 2025 GoobBot <uristmchands@proton.me>
# SPDX-FileCopyrightText: 2025 botanySupremist <160211017+botanySupremist@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 botanySupremist <definitelyrealBotSupremist@gmail.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

- type: entity
  parent: BaseHealingItem
  id: BaseMedicalPatch
  name: base patch
  description: A patch for applying medicine over time to patients.
  abstract: true
  components:
  - type: Item
    size: Tiny
  - type: Sprite
    sprite: _Goobstation/Objects/Medical/medical_patch.rsi
    state: GenericPatch
  - type: SolutionContainerManager
    solutions:
      drink:
        maxVol: 20
  - type: ExaminableSolution
    solution: drink
  - type: Sticky
    stickDelay: 3
    unstickDelay: 2
    stickPopupStart: goobstation-medicalpatch-sticy-trystick
    stickPopupSuccess: goobstation-medicalpatch-sticy-trystick-success
    unstickPopupStart: goobstation-medicalpatch-sticy-tryremove
    unstickPopupSuccess: goobstation-medicalpatch-sticy-tryremove-success
    selfStickBreakOnMove: false
    selfUnstickBreakOnMove: false
    selfStickTimeMultiplier: 0.5
    whitelist:
      components:
      - Bloodstream
  - type: StickyVisualizer
  - type: Appearance
  - type: MixableSolution
    solution: drink
  - type: MedicalPatch
  - type: Tag
    tags:
    - MedicalPatch

- type: entity
  parent: BaseMedicalPatch
  id: MedicalPatchBasic
  name: patch
  description: A basic patch for applying medicine over time to patients.
  components:
  - type: Sprite
    sprite: _Goobstation/Objects/Medical/medical_patch.rsi
    scale: 0.9 , 0.9
    layers:
      - state: GenericPatch
      - state: GenericPatch-1
        map: ["enum.SolutionContainerLayers.Fill"]
        visible: false
  - type: SolutionContainerVisuals
    maxFillLevels: 9
    fillBaseName: GenericPatch-
  - type: SolutionContainerManager
    solutions:
      drink:  #drink is the same as Bottle solution, this is to prevent recoding chem master. TODO: recode chem master
        maxVol: 20
  - type: Tag
    tags:
    - MedicalPatch
  - type: Spillable # only way empty the patch is wring it out and spill it on the floor
    solution: drink
  - type: RefillableSolution  # I don't know why this wasn't like this to begin with.
    solution: drink

- type: entity
  parent: BaseHealingItem
  id: UsedMedicalPatch
  name: used patch
  description: ...ew.
  components:
  - type: Sprite
    sprite: _Goobstation/Objects/Medical/medical_patch.rsi
    state: GenericPatchSmallUsed
  - type: Tag
    tags:
    - Trash
  - type: PhysicalComposition #get 1 cloth form recycling a used patch
    materialComposition:
      Cloth: 100
      Plastic: 100

- type: entity
  parent: UsedMedicalPatch
  id: UsedMedicalPatchMakeshift
  name: used patch
  components:
  - type: Sprite
    sprite: _Goobstation/Objects/Medical/medical_patch.rsi
    state: MakeshiftPatchUsed

- type: entity
  parent: MedicalPatchBasic
  id: MedicalPatchRapid
  name: rapid patch
  description: A patch used for more rapid application of medicine. It has race cars drawn on it.
  components:
  - type: Sprite
    sprite: _Goobstation/Objects/Medical/medical_patch.rsi
    layers:
      - state: GenericPatch
      - state: GenericPatchBorder
        color: Red
      - state: GenericPatch-1
        map: ["enum.SolutionContainerLayers.Fill"]
        visible: false
  - type: MedicalPatch
    transferAmount: 2 # Twice the ammound of basic

- type: entity
  parent: MedicalPatchBasic
  id: MedicalPatchTherapeutic
  name: therapeutic patch
  description: A patch that applies a dose over a longer period of time than other patches.
  components:
  - type: Sprite
    sprite: _Goobstation/Objects/Medical/medical_patch.rsi
    layers:
      - state: GenericPatch
      - state: GenericPatchBorder
        color: LightBlue
      - state: GenericPatch-1
        map: ["enum.SolutionContainerLayers.Fill"]
        visible: false
  - type: MedicalPatch
    transferAmount: 0.5 # literally the rapid patch but in reverse

- type: entity
  parent: MedicalPatchBasic
  id: MedicalPatchLarge
  name: large patch
  description: A larger, higher-capacity patch, used for the really big boo-boos. Not recommended with easily-overdosed chemicals.
  components:
  - type: Sprite
    sprite: _Goobstation/Objects/Medical/medical_patch.rsi
    scale: 1 , 1
    layers:
      - state: GenericPatch
      - state: GenericPatchBorder
        color: Violet
      - state: GenericPatch-1
        map: ["enum.SolutionContainerLayers.Fill"]
        visible: false
  - type: SolutionContainerManager
    solutions:
      drink:
        maxVol: 40 # +50% from basic
  - type: MedicalPatch
    injectPercentageOnAttatch: 10 # 4u when full
  - type: Item
    shape:
    - 0,0,0,1

- type: entity
  parent: BaseMedicalPatch
  id: MedicalPatchMakeshift
  name: makeshift patch
  description: This doesn't look hygienic. Hopefully it does the job.
  components:
  - type: Sprite
    state: MakeshiftPatch
  - type: MedicalPatch
    updateTime: 2 # slow
    singleUse: true
    trashObject: UsedMedicalPatchMakeshift
  - type: SolutionContainerManager
    solutions:
      drink:
        maxVol: 20  # lasts for 40 seconds, effectively half as good as a normal patch
  - type: Construction
    graph: MedicalPatchMakeshift
    node: medicalPatchMakeshift

- type: constructionGraph
  id: MedicalPatchMakeshift
  start: start
  graph:
  - node: start
    edges:
    - to: medicalPatchMakeshift
      steps:
      - material: Cloth
        amount: 1
        doAfter: 5
  - node: medicalPatchMakeshift
    entity: MedicalPatchMakeshift

- type: construction
  id: MedicalPatchMakeshift
  graph: MedicalPatchMakeshift
  startNode: start
  targetNode: medicalPatchMakeshift
  category: construction-category-tools
  objectType: Item

- type: constructionGraph
  id: SilkPatchMakeshift
  start: start
  graph:
  - node: start
    edges:
    - to: silkPatchMakeshift
      steps:
      - material: WebSilk
        amount: 4
        doAfter: 5
  - node: silkPatchMakeshift
    entity: MedicalPatchMakeshift

- type: construction
  id: SilkPatchMakeshift
  graph: SilkPatchMakeshift
  startNode: start
  targetNode: silkPatchMakeshift
  category: construction-category-tools
  objectType: Item
  entityWhitelist:
    tags:
    - SpiderCraft
