/
githubmirror
/
vgstation13
Обзор
Документация
Войти
/
githubmirror
/
vgstation13
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
Bleeding-Edge
code/modules/surgery/other.dm
187 строк
8 KB
jwhitak
Fixes Most Screwdriver/Wrench/Wirecutter Special Tool Interactions (#37207)
02 окт 2024, 15:35
Не верифицирован
02 окт 2024, 15:35
36ca9ab
Код
Авторство
О чём код?
//Procedures in this file: Inernal wound patching, Implant removal. ////////////////////////////////////////////////////////////////// // INTERNAL WOUND PATCHING // ////////////////////////////////////////////////////////////////// //////FIX VEIN/////// /datum/surgery_step/fix_vein priority = 2 allowed_tools = list( /obj/item/tool/FixOVein = 100, /obj/item/stack/cable_coil = 75, ) can_infect = 1 blood_level = 1 duration = 7 SECONDS /datum/surgery_step/fix_vein/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if(!hasorgans(target)) return 0 var/datum/organ/external/affected = target.get_organ(target_zone) var/internal_bleeding = 0 for(var/datum/wound/W in affected.wounds) if(W.internal) internal_bleeding = 1 break return affected.open >= 2 && internal_bleeding /datum/surgery_step/fix_vein/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/datum/organ/external/affected = target.get_organ(target_zone) user.visible_message("[user] starts patching the damaged vein in [target]'s [affected.display_name] with \the [tool]." , \ "You start patching the damaged vein in [target]'s [affected.display_name] with \the [tool].") target.custom_pain("The pain in [affected.display_name] is unbearable!",1, scream=TRUE) ..() /datum/surgery_step/fix_vein/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/datum/organ/external/affected = target.get_organ(target_zone) user.visible_message("<span class='notice'>[user] has patched the damaged vein in [target]'s [affected.display_name] with \the [tool].</span>", \ "<span class='notice'>You have patched the damaged vein in [target]'s [affected.display_name] with \the [tool].</span>") for(var/datum/wound/W in affected.wounds) if(W.internal) affected.wounds -= W affected.update_damages() if (ishuman(user) && prob(40)) user:bloody_hands(target, 2) /datum/surgery_step/fix_vein/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/datum/organ/external/affected = target.get_organ(target_zone) user.visible_message("<span class='warning'>[user]'s hand slips, smearing [tool] in the incision in [target]'s [affected.display_name]!</span>" , \ "<span class='warning'>Your hand slips, smearing \the [tool] in the incision in [target]'s [affected.display_name]!</span>") affected.take_damage(5, 0) //////FIX DEAD TISSUE///// /datum/surgery_step/fix_dead_tissue/tool_quality(obj/item/tool, mob/living/user) . = ..() if(!tool.is_sharp()) return 0 /datum/surgery_step/fix_dead_tissue //Debridement priority = 2 allowed_tools = list( /obj/item/tool/scalpel = 100, /obj/item/weapon/melee/blood_dagger = 90, /obj/item/weapon/kitchen/utensil/knife/large = 75, /obj/item/weapon/shard = 50, /obj/item/soulstone/gem = 0, /obj/item/soulstone = 50, ) can_infect = 1 blood_level = 1 duration = 11 SECONDS /datum/surgery_step/fix_dead_tissue/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if(!hasorgans(target)) return 0 if (target_zone == "mouth" || target_zone == "eyes") return 0 var/datum/organ/external/affected = target.get_organ(target_zone) return affected.open >= 2 && (affected.status & ORGAN_DEAD) /datum/surgery_step/fix_dead_tissue/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/datum/organ/external/affected = target.get_organ(target_zone) user.visible_message("[user] starts cutting away necrotic tissue in [target]'s [affected.display_name] with \the [tool]." , \ "You start cutting away necrotic tissue in [target]'s [affected.display_name] with \the [tool].") target.custom_pain("The pain in [affected.display_name] is unbearable!",1, scream=TRUE) ..() /datum/surgery_step/fix_dead_tissue/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/datum/organ/external/affected = target.get_organ(target_zone) user.visible_message("<span class='notice'>[user] has cut away necrotic tissue in [target]'s [affected.display_name] with \the [tool].</span>", \ "<span class='notice'>You have cut away necrotic tissue in [target]'s [affected.display_name] with \the [tool].</span>") affected.open = 3 /datum/surgery_step/fix_dead_tissue/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/datum/organ/external/affected = target.get_organ(target_zone) user.visible_message("<span class='warning'>[user]'s hand slips, slicing an artery inside [target]'s [affected.display_name] with \the [tool]!</span>", \ "<span class='warning'>Your hand slips, slicing an artery inside [target]'s [affected.display_name] with \the [tool]!</span>") affected.createwound(CUT, 20, 1) ////TREAT NECROSIS////// /datum/surgery_step/treat_necrosis priority = 2 allowed_tools = list( /obj/item/weapon/reagent_containers/dropper = 100, /obj/item/weapon/reagent_containers/glass/bottle = 75, /obj/item/weapon/reagent_containers/glass/beaker = 75, /obj/item/weapon/reagent_containers/spray = 50, /obj/item/weapon/reagent_containers/glass/bucket = 50, ) can_infect = 0 blood_level = 0 duration = 5 SECONDS /datum/surgery_step/treat_necrosis/can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) if (!istype(tool, /obj/item/weapon/reagent_containers)) return 0 var/obj/item/weapon/reagent_containers/container = tool if(!container.reagents.has_reagent(PERIDAXON)) return 0 if(!hasorgans(target)) return 0 if (target_zone == "mouth" || target_zone == "eyes") return 0 var/datum/organ/external/affected = target.get_organ(target_zone) return affected.open == 3 && (affected.status & ORGAN_DEAD) /datum/surgery_step/treat_necrosis/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/datum/organ/external/affected = target.get_organ(target_zone) user.visible_message("[user] starts applying medication to the affected tissue in [target]'s [affected.display_name] with \the [tool]." , \ "You start applying medication to the affected tissue in [target]'s [affected.display_name] with \the [tool].") target.custom_pain("Something in your [affected.display_name] is causing you a lot of pain!",1, scream=TRUE) ..() /datum/surgery_step/treat_necrosis/end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/datum/organ/external/affected = target.get_organ(target_zone) if (!istype(tool, /obj/item/weapon/reagent_containers)) return var/obj/item/weapon/reagent_containers/container = tool var/trans = container.reagents.trans_to(target, container.amount_per_transfer_from_this) if (trans > 0) //technically it's contact, but the reagents are being applied to internal tissue container.reagents.reaction(target, INGEST, amount_override = min(container.reagents.total_volume,container.amount_per_transfer_from_this)/(container.reagents.reagent_list.len)) if(container.reagents.has_reagent(PERIDAXON)) affected.status &= ~ORGAN_DEAD user.visible_message("<span class='notice'>[user] applies [trans] units of the solution to affected tissue in [target]'s [affected.display_name]</span>", \ "<span class='notice'>You apply [trans] units of the solution to affected tissue in [target]'s [affected.display_name] with \the [tool].</span>") /datum/surgery_step/treat_necrosis/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool) var/datum/organ/external/affected = target.get_organ(target_zone) if (!istype(tool, /obj/item/weapon/reagent_containers)) return var/obj/item/weapon/reagent_containers/container = tool var/trans = container.reagents.trans_to(target, container.amount_per_transfer_from_this) //technically it's contact, but the reagents are being applied to internal tissue container.reagents.reaction(target, INGEST, amount_override = min(container.reagents.total_volume,container.amount_per_transfer_from_this)/(container.reagents.reagent_list.len)) user.visible_message("<span class='warning'>[user]'s hand slips, applying [trans] units of the solution to the wrong place in [target]'s [affected.display_name] with the [tool]!</span>" , \ "<span class='warning'>Your hand slips, applying [trans] units of the solution to the wrong place in [target]'s [affected.display_name] with the [tool]!</span>") //no damage or anything, just wastes medicine