From 05696058ed8e4d7c78c8370c42a603dbbf16f047 Mon Sep 17 00:00:00 2001 From: LT3 <83487515+lessthnthree@users.noreply.github.com> Date: Wed, 16 Apr 2025 18:07:02 -0700 Subject: [PATCH] Fix synthflesh patch unhusking, improved feedback (#90514) ## About The Pull Request - Fixes application of synthflesh patches for unhusking mobs, adjusts purity to allow one medigel to dehusk one corpse. - Improved information on containers about the requirements to unhusk, and added feedback for the player to help guide the proper usage of the synthflesh. - It will give a warning if they are using it in a method that would waste the synthflesh and fail to unhusk. ## Why It's Good For The Game - Fixes patches. - Provide better feedback on why failure to dehusk occurs. Currently the player is provided no information about why it failed (such as purity, quantity, burn damage) nor how to resolve it. ## Changelog :cl: LT3 fix: Synthflesh patches unhusk corpses as expected qol: Better information and feedback about de-husking corpses /:cl: --------- Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com> --- .../reagents/cat2_medicine_reagents.dm | 14 ++++++++++--- code/modules/reagents/reagent_containers.dm | 6 ++++-- .../reagents/reagent_containers/medigel.dm | 19 ++++++++++++++++- .../reagents/reagent_containers/patch.dm | 21 ++++++++++++++++++- 4 files changed, 53 insertions(+), 7 deletions(-) diff --git a/code/modules/reagents/chemistry/reagents/cat2_medicine_reagents.dm b/code/modules/reagents/chemistry/reagents/cat2_medicine_reagents.dm index c067767b5ca..49080d9425f 100644 --- a/code/modules/reagents/chemistry/reagents/cat2_medicine_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/cat2_medicine_reagents.dm @@ -483,7 +483,7 @@ /*Suffix: Combo of healing, prob gonna get wack REAL fast*/ /datum/reagent/medicine/c2/synthflesh name = "Synthflesh" - description = "Heals brute and burn damage at the cost of toxicity (66% of damage healed). 100u or more can restore corpses husked by burns. Touch application only." + description = "Heals brute and burn damage at the cost of toxicity (66% of damage healed). Patch, splash, and spray application only. 60u of pure synthflesh or 100u at lower purities can restore corpses husked by burns." color = "#FFEBEB" ph = 7.2 chemical_flags = REAGENT_CAN_BE_SYNTHESIZED @@ -522,7 +522,11 @@ return //don't try to unhusk mobs above burn damage threshold - if (carbies.getFireLoss() > UNHUSK_DAMAGE_THRESHOLD) + if (carbies.getFireLoss() > UNHUSK_DAMAGE_THRESHOLD * 2.5) + carbies.visible_message(span_minoralert("The liquid fails to properly stick on [carbies]. [carbies]'s burns need to be repaired first!")) + return + else if (carbies.getFireLoss() > UNHUSK_DAMAGE_THRESHOLD) + carbies.visible_message(span_boldnotice("A rubbery liquid partially coats [carbies]'s burns... It seems more is required to fully unhusk!")) return var/datum/reagent/synthflesh = carbies.reagents.has_reagent(/datum/reagent/medicine/c2/synthflesh) @@ -536,7 +540,11 @@ //when purity = 100%, 60u to unhusk, when purity = 60%, 100u to unhusk. if(current_volume >= SYNTHFLESH_UNHUSK_MAX || current_volume * current_purity >= SYNTHFLESH_UNHUSK_AMOUNT) carbies.cure_husk(BURN) - carbies.visible_message(span_nicegreen("A rubbery liquid coats [carbies]'s burns. [carbies] looks a lot healthier!")) //we're avoiding using the phrases "burnt flesh" and "burnt skin" here because carbies could be a skeleton or a golem or something + carbies.reagents.remove_reagent(/datum/reagent/medicine/c2/synthflesh, current_volume) // consume the synthflesh, it won't do anything in their blood + //we're avoiding using the phrases "burnt flesh" and "burnt skin" here because carbies could be a skeleton or a golem or something + carbies.visible_message(span_nicegreen("A rubbery liquid coats [carbies]'s burns. [carbies] looks a lot healthier!")) + else + carbies.visible_message(span_boldnotice("A rubbery liquid partially coats [carbies]'s burns... It seems more is required to fully unhusk!")) /******ORGAN HEALING******/ /*Suffix: -rite*/ diff --git a/code/modules/reagents/reagent_containers.dm b/code/modules/reagents/reagent_containers.dm index 06212c6b055..c93590bb5b9 100644 --- a/code/modules/reagents/reagent_containers.dm +++ b/code/modules/reagents/reagent_containers.dm @@ -16,6 +16,8 @@ var/reagent_flags /// A list of what initial reagents this container should spawn with var/list/list_reagents = null + /// The purity of the spawned reagents in list_reagents. Default purity if `null` + var/list_reagents_purity = null /// If this container should spawn with a disease type inside of it var/spawned_disease = null /// How much of a disease specified in spawned_disease should this container spawn with @@ -67,7 +69,7 @@ . = ..() if(has_variable_transfer_amount) if(possible_transfer_amounts.len > 1) - . += span_notice("Left-click or right-click in-hand to increase or decrease its transfer amount.") + . += span_notice("Left-click or right-click in-hand to increase or decrease its transfer amount. It is currently set to [amount_per_transfer_from_this] units.") else if(possible_transfer_amounts.len) . += span_notice("Left-click or right-click in-hand to view its transfer amount.") if(isliving(user) && HAS_TRAIT(user, TRAIT_REMOTE_TASTING)) @@ -85,7 +87,7 @@ /obj/item/reagent_containers/proc/add_initial_reagents() if(list_reagents) - reagents.add_reagent_list(list_reagents) + reagents.add_reagent_list(list_reagents, added_purity = list_reagents_purity) /obj/item/reagent_containers/attack_self(mob/user) if(has_variable_transfer_amount) diff --git a/code/modules/reagents/reagent_containers/medigel.dm b/code/modules/reagents/reagent_containers/medigel.dm index f6d7b116eff..4f45caebf4a 100644 --- a/code/modules/reagents/reagent_containers/medigel.dm +++ b/code/modules/reagents/reagent_containers/medigel.dm @@ -87,12 +87,29 @@ /obj/item/reagent_containers/medigel/synthflesh name = "medical gel (synthflesh)" - desc = "A medical gel applicator bottle, designed for precision application, with an unscrewable cap. This one contains synthflesh, a slightly toxic medicine capable of healing both bruises and burns." + desc = "A medical gel applicator bottle, designed for precision application, with an unscrewable cap. This one contains synthflesh, a slightly toxic medicine capable of healing bruises, burns, and husks." icon_state = "synthgel" current_skin = "synthgel" list_reagents = list(/datum/reagent/medicine/c2/synthflesh = 60) + list_reagents_purity = 1 + amount_per_transfer_from_this = 60 + possible_transfer_amounts = list(5, 10, 60) custom_price = PAYCHECK_CREW * 5 +/obj/item/reagent_containers/medigel/synthflesh/examine(mob/user) + . = ..() + if(reagents.total_volume >= 60) + . += span_info("One full bottle can restore a corpse husked by burns.") + +/obj/item/reagent_containers/medigel/synthflesh/attack(mob/M, mob/user, def_zone) + if(iscarbon(M)) + var/mob/living/carbon/carbies = M + if(HAS_TRAIT_FROM(carbies, TRAIT_HUSK, BURN) && carbies.getFireLoss() > UNHUSK_DAMAGE_THRESHOLD * 2.5) + // give them a warning if the mob is a husk but synthflesh won't unhusk yet + carbies.visible_message(span_boldwarning("[carbies]'s burns need to be repaired first before synthflesh will unhusk it!")) + + return ..() + /obj/item/reagent_containers/medigel/sterilizine name = "sterilizer gel" desc = "gel bottle loaded with non-toxic sterilizer. Useful in preparation for surgery." diff --git a/code/modules/reagents/reagent_containers/patch.dm b/code/modules/reagents/reagent_containers/patch.dm index 39987179411..8694499586e 100644 --- a/code/modules/reagents/reagent_containers/patch.dm +++ b/code/modules/reagents/reagent_containers/patch.dm @@ -170,6 +170,10 @@ parent.reagents.trans_to(owner, transfer_per_second, methods = PATCH, show_message = show_message) +// delivers all of the patch's contents at once +/datum/embedding/med_patch/instant + transfer_per_second = /obj/item/reagent_containers/applicator/patch::volume + /obj/item/reagent_containers/applicator/patch/libital name = "libital patch (brute)" desc = "A pain reliever. Does minor liver damage. Diluted with Granibitaluri." @@ -184,9 +188,24 @@ /obj/item/reagent_containers/applicator/patch/synthflesh name = "synthflesh patch" - desc = "Helps with brute and burn injuries. Slightly toxic." + desc = "Helps with brute and burn injuries. Slightly toxic. Three patches applied can restore a corpse husked by burns." list_reagents = list(/datum/reagent/medicine/c2/synthflesh = 20) + list_reagents_purity = 1 icon_state = "bandaid_both" + embed_type = /datum/embedding/med_patch/instant //synthflesh effects occur on the initial apply only, so we need to apply it all at once + +/obj/item/reagent_containers/applicator/patch/canconsume(mob/eater, mob/user) + . = ..() + if(!iscarbon(eater)) + return + var/datum/reagent/medicine/c2/synthflesh/synthflesh_patch = reagents.has_reagent(/datum/reagent/medicine/c2/synthflesh) + if(!synthflesh_patch) + return + // Check mob damage for synthflesh unhusking + var/mob/living/carbon/carbies = eater + if(HAS_TRAIT_FROM(carbies, TRAIT_HUSK, BURN) && carbies.getFireLoss() > UNHUSK_DAMAGE_THRESHOLD * 2.5) + // give them a warning if the mob is a husk but synthflesh won't unhusk yet + carbies.visible_message(span_boldwarning("[carbies]'s burns need to be repaired first before synthflesh will unhusk it!")) /obj/item/reagent_containers/applicator/patch/ondansetron name = "ondansetron patch"