From b4c52d70da769ee1f852409d6171810b6fe6e668 Mon Sep 17 00:00:00 2001
From: HMBGERDO <61080616+HMBGERDO@users.noreply.github.com>
Date: Sun, 21 Jan 2024 22:12:33 +0100
Subject: [PATCH] i ded pls nerf: Combat Beakers (#23708)
* reagent splash now different from touch
* arghhghghg
* hghg
* FUCK THE BOTANY OORAH
* only botany smoke affected
* Update code/modules/reagents/chemistry/reagents/drugs.dm
Co-authored-by: Nathan Winters <100448493+CinnamonSnowball@users.noreply.github.com>
* Update code/modules/reagents/chemistry/reagents/toxins.dm
Co-authored-by: Nathan Winters <100448493+CinnamonSnowball@users.noreply.github.com>
* Update code/modules/reagents/chemistry/reagents/medicine.dm
Co-authored-by: Nathan Winters <100448493+CinnamonSnowball@users.noreply.github.com>
* Update code/modules/reagents/chemistry/reagents/pyrotechnic.dm
Co-authored-by: Nathan Winters <100448493+CinnamonSnowball@users.noreply.github.com>
* removing REAGENT_SPLASH, cleaning up
* Update code/modules/reagents/chemistry/reagents/medicine.dm
Co-authored-by: Nathan Winters <100448493+CinnamonSnowball@users.noreply.github.com>
* Update code/modules/reagents/chemistry/reagents/medicine.dm
Co-authored-by: Nathan Winters <100448493+CinnamonSnowball@users.noreply.github.com>
* Update code/modules/reagents/chemistry/reagents/medicine.dm
Co-authored-by: Nathan Winters <100448493+CinnamonSnowball@users.noreply.github.com>
* Update code/modules/reagents/chemistry/reagents/medicine.dm
Co-authored-by: Nathan Winters <100448493+CinnamonSnowball@users.noreply.github.com>
* Update code/modules/reagents/chemistry/reagents/medicine.dm
Co-authored-by: Nathan Winters <100448493+CinnamonSnowball@users.noreply.github.com>
* Update code/modules/reagents/chemistry/reagents/medicine.dm
Co-authored-by: Nathan Winters <100448493+CinnamonSnowball@users.noreply.github.com>
* Update code/modules/reagents/chemistry/reagents/medicine.dm
Co-authored-by: Nathan Winters <100448493+CinnamonSnowball@users.noreply.github.com>
* Update code/modules/reagents/chemistry/reagents/medicine.dm
Co-authored-by: Nathan Winters <100448493+CinnamonSnowball@users.noreply.github.com>
* Update code/modules/reagents/chemistry/reagents/medicine.dm
Co-authored-by: Nathan Winters <100448493+CinnamonSnowball@users.noreply.github.com>
* Update code/modules/reagents/chemistry/reagents/medicine.dm
Co-authored-by: Nathan Winters <100448493+CinnamonSnowball@users.noreply.github.com>
* Apply suggestions from code review
Co-authored-by: Nathan Winters <100448493+CinnamonSnowball@users.noreply.github.com>
---------
Co-authored-by: Nathan Winters <100448493+CinnamonSnowball@users.noreply.github.com>
Co-authored-by: S34N <12197162+S34NW@users.noreply.github.com>
---
code/modules/crafting/recipes.dm | 4 +-
.../reagents/chemistry/reagents/drugs.dm | 3 +-
.../reagents/chemistry/reagents/medicine.dm | 198 +++++++++++-------
.../chemistry/reagents/pyrotechnic.dm | 5 +-
.../reagents/chemistry/reagents/toxins.dm | 7 +-
5 files changed, 135 insertions(+), 82 deletions(-)
diff --git a/code/modules/crafting/recipes.dm b/code/modules/crafting/recipes.dm
index 4e9df5d3961..27a767271d6 100644
--- a/code/modules/crafting/recipes.dm
+++ b/code/modules/crafting/recipes.dm
@@ -1346,7 +1346,7 @@
time = 3 SECONDS
result = list(/obj/item/stack/medical/bruise_pack)
reqs = list(/obj/item/stack/medical/bruise_pack/improvised = 6,
- /datum/reagent/medicine/styptic_powder = 30,
+ /datum/reagent/medicine/heal_on_apply/styptic_powder = 30,
/datum/reagent/medicine/sterilizine = 10)
category = CAT_MISC
@@ -1356,6 +1356,6 @@
result = list(/obj/item/stack/medical/ointment)
reqs = list(/obj/item/stack/sheet/plastic = 2,
/datum/reagent/water = 10,
- /datum/reagent/medicine/silver_sulfadiazine = 30,
+ /datum/reagent/medicine/heal_on_apply/silver_sulfadiazine = 30,
/datum/reagent/medicine/sterilizine = 10)
category = CAT_MISC
diff --git a/code/modules/reagents/chemistry/reagents/drugs.dm b/code/modules/reagents/chemistry/reagents/drugs.dm
index eab7d288c5b..51f8ec28f33 100644
--- a/code/modules/reagents/chemistry/reagents/drugs.dm
+++ b/code/modules/reagents/chemistry/reagents/drugs.dm
@@ -741,8 +741,7 @@
return ..() | update_flags
/datum/reagent/fliptonium/reaction_mob(mob/living/M, method=REAGENT_TOUCH, volume)
- if(method == REAGENT_INGEST || method == REAGENT_TOUCH)
- M.SpinAnimation(speed = 12, loops = -1, parallel = FALSE)
+ M.SpinAnimation(speed = 12, loops = -1, parallel = FALSE)
..()
/datum/reagent/fliptonium/on_mob_delete(mob/living/M)
diff --git a/code/modules/reagents/chemistry/reagents/medicine.dm b/code/modules/reagents/chemistry/reagents/medicine.dm
index dd1ef9b10c0..e9934c85720 100644
--- a/code/modules/reagents/chemistry/reagents/medicine.dm
+++ b/code/modules/reagents/chemistry/reagents/medicine.dm
@@ -211,61 +211,6 @@
M.germ_level = max(M.germ_level - 20, 0) // Reduces the mobs germ level, too
return ..()
-/datum/reagent/medicine/silver_sulfadiazine
- name = "Silver Sulfadiazine"
- id = "silver_sulfadiazine"
- description = "This antibacterial compound is used to treat burn victims."
- reagent_state = LIQUID
- color = "#F0DC00"
- metabolization_rate = 3
- harmless = FALSE //toxic if ingested, and I am NOT going to account for the difference
- taste_description = "burn cream"
-
-/datum/reagent/medicine/silver_sulfadiazine/on_mob_life(mob/living/M)
- var/update_flags = STATUS_UPDATE_NONE
- update_flags |= M.adjustFireLoss(-2*REAGENTS_EFFECT_MULTIPLIER, FALSE)
- return ..() | update_flags
-
-/datum/reagent/medicine/silver_sulfadiazine/reaction_mob(mob/living/M, method=REAGENT_TOUCH, volume, show_message = 1)
- if(iscarbon(M))
- if(method == REAGENT_TOUCH)
- M.adjustFireLoss(-volume)
- if(show_message)
- to_chat(M, "The silver sulfadiazine soothes your burns.")
- if(method == REAGENT_INGEST)
- M.adjustToxLoss(0.5*volume)
- if(show_message)
- to_chat(M, "You feel sick...")
- ..()
-
-/datum/reagent/medicine/styptic_powder
- name = "Styptic Powder"
- id = "styptic_powder"
- description = "Styptic (aluminum sulfate) powder helps control bleeding and heal physical wounds."
- reagent_state = LIQUID
- color = "#FF9696"
- metabolization_rate = 3
- harmless = FALSE
- taste_description = "wound cream"
-
-/datum/reagent/medicine/styptic_powder/on_mob_life(mob/living/M)
- var/update_flags = STATUS_UPDATE_NONE
- update_flags |= M.adjustBruteLoss(-2*REAGENTS_EFFECT_MULTIPLIER, FALSE)
- return ..() | update_flags
-
-/datum/reagent/medicine/styptic_powder/reaction_mob(mob/living/M, method=REAGENT_TOUCH, volume, show_message = 1)
- if(iscarbon(M))
- if(method == REAGENT_TOUCH)
- M.adjustBruteLoss(-volume)
- if(show_message)
- to_chat(M, "The styptic powder stings like hell as it closes some of your wounds!")
- M.emote("scream")
- if(method == REAGENT_INGEST)
- M.adjustToxLoss(0.5*volume)
- if(show_message)
- to_chat(M, "You feel gross!")
- ..()
-
/datum/reagent/medicine/salglu_solution
name = "Saline-Glucose Solution"
id = "salglu_solution"
@@ -288,7 +233,49 @@
H.blood_volume += 1
return ..() | update_flags
-/datum/reagent/medicine/synthflesh
+/datum/reagent/medicine/heal_on_apply
+
+/datum/reagent/medicine/heal_on_apply/proc/heal_external_limb(obj/item/organ/external/organ, volume)
+ return
+
+/datum/reagent/medicine/heal_on_apply/proc/heal_overall_damage(mob/living/M, volume)
+ return
+
+/datum/reagent/medicine/heal_on_apply/proc/splash_human(mob/living/carbon/human/H, volume)
+ var/turf_volume = max(0, (volume - 100) / 3)
+ volume = volume - turf_volume
+
+ var/volume_per_bodypart = volume / length(H.bodyparts)
+
+ for(var/obj/item/organ/external/organ in H.bodyparts)
+ if(!get_location_accessible(H, organ.limb_name))
+ turf_volume += volume_per_bodypart
+ continue
+
+ heal_external_limb(organ, volume_per_bodypart)
+
+ H.updatehealth(reason = "[id] splashed")
+ H.UpdateDamageIcon()
+
+ if(turf_volume > 0)
+ reaction_turf(get_turf(H), turf_volume)
+
+ return volume
+
+/datum/reagent/medicine/heal_on_apply/reaction_mob(mob/living/M, method = REAGENT_TOUCH, volume, show_message = 1)
+ if(!iscarbon(M))
+ return ..()
+
+ if(ishuman(M) && volume >= 20 && method == REAGENT_TOUCH)
+ var/applied_volume = splash_human(M, volume)
+ return ..(M, method, applied_volume, show_message)
+
+ if(method == REAGENT_TOUCH)
+ heal_overall_damage(M, volume)
+
+ return ..()
+
+/datum/reagent/medicine/heal_on_apply/synthflesh
name = "Synthflesh"
id = "synthflesh"
description = "A resorbable microfibrillar collagen and protein mixture that can rapidly heal injuries when applied topically."
@@ -297,26 +284,95 @@
penetrates_skin = TRUE
taste_description = "blood"
-/datum/reagent/medicine/synthflesh/reaction_mob(mob/living/M, method=REAGENT_TOUCH, volume, show_message = 1)
- if(iscarbon(M))
- if(method == REAGENT_TOUCH)
- M.adjustBruteLoss(-1.5 * volume)
- M.adjustFireLoss(-1.5 * volume)
- if(show_message)
- to_chat(M, "The synthetic flesh integrates itself into your wounds, healing you.")
- if(ishuman(M))
- var/mob/living/carbon/human/H = M
- if(HAS_TRAIT_FROM(H, TRAIT_HUSK, BURN) && H.getFireLoss() <= UNHUSK_DAMAGE_THRESHOLD && (H.reagents.get_reagent_amount("synthflesh") + volume >= SYNTHFLESH_UNHUSK_AMOUNT))
- H.cure_husk(BURN)
- // Could be a skeleton or a golem or sth, avoid phrases like "burnt flesh" and "burnt skin"
- H.visible_message("The squishy liquid coats [H]'s burns. [H] looks a lot healthier!")
- ..()
+/datum/reagent/medicine/heal_on_apply/synthflesh/reaction_mob(mob/living/M, method = REAGENT_TOUCH, volume, show_message = 1)
+ var/mob/living/carbon/human/H = M
+ if(ishuman(H) && HAS_TRAIT_FROM(H, TRAIT_HUSK, BURN) && H.getFireLoss() <= UNHUSK_DAMAGE_THRESHOLD && H.reagents.get_reagent_amount("synthflesh") + volume >= SYNTHFLESH_UNHUSK_AMOUNT)
+ H.cure_husk(BURN)
+ // Could be a skeleton or a golem or sth, avoid phrases like "burnt flesh" and "burnt skin"
+ H.visible_message("The squishy liquid coats [H]'s burns. [H] looks a lot healthier!")
-/datum/reagent/medicine/synthflesh/reaction_turf(turf/T, volume) //let's make a mess!
+ if(show_message)
+ to_chat(M, "The synthetic flesh integrates itself into your wounds, healing you.")
+
+ return ..()
+
+/datum/reagent/medicine/heal_on_apply/synthflesh/heal_external_limb(obj/item/organ/external/organ, volume)
+ organ.heal_damage(1.5 * volume, 1.5 * volume, updating_health = FALSE)
+
+/datum/reagent/medicine/heal_on_apply/synthflesh/heal_overall_damage(mob/living/M, volume)
+ M.adjustBruteLoss(-1.5 * volume)
+ M.adjustFireLoss(-1.5 * volume)
+
+/datum/reagent/medicine/heal_on_apply/synthflesh/reaction_turf(turf/T, volume) //let's make a mess!
if(volume >= 5 && !isspaceturf(T))
new /obj/effect/decal/cleanable/blood/gibs/cleangibs(T)
playsound(T, 'sound/effects/splat.ogg', 50, 1, -3)
+/datum/reagent/medicine/heal_on_apply/styptic_powder
+ name = "Styptic Powder"
+ id = "styptic_powder"
+ description = "Styptic (aluminum sulfate) powder helps control bleeding and heal physical wounds."
+ reagent_state = LIQUID
+ color = "#FF9696"
+ metabolization_rate = 3
+ harmless = FALSE
+ taste_description = "wound cream"
+
+/datum/reagent/medicine/heal_on_apply/styptic_powder/on_mob_life(mob/living/M)
+ var/update_flags = STATUS_UPDATE_NONE
+ update_flags |= M.adjustBruteLoss(-2 * REAGENTS_EFFECT_MULTIPLIER, FALSE)
+ return ..() | update_flags
+
+/datum/reagent/medicine/heal_on_apply/styptic_powder/heal_external_limb(obj/item/organ/external/organ, volume)
+ organ.heal_damage(volume, 0, updating_health = FALSE)
+
+/datum/reagent/medicine/heal_on_apply/styptic_powder/heal_overall_damage(mob/living/M, volume)
+ M.adjustBruteLoss(-volume)
+
+/datum/reagent/medicine/heal_on_apply/styptic_powder/reaction_mob(mob/living/M, method = REAGENT_TOUCH, volume, show_message = 1)
+ if(show_message)
+ to_chat(M, "The styptic powder stings like hell as it closes some of your wounds!")
+ M.emote("scream")
+
+ if(method == REAGENT_INGEST)
+ M.adjustToxLoss(0.5 * volume)
+ if(show_message)
+ to_chat(M, "You feel gross!")
+
+ return ..()
+
+/datum/reagent/medicine/heal_on_apply/silver_sulfadiazine
+ name = "Silver Sulfadiazine"
+ id = "silver_sulfadiazine"
+ description = "This antibacterial compound is used to treat burn victims."
+ reagent_state = LIQUID
+ color = "#F0DC00"
+ metabolization_rate = 3
+ harmless = FALSE //toxic if ingested, and I am NOT going to account for the difference
+ taste_description = "burn cream"
+
+/datum/reagent/medicine/heal_on_apply/silver_sulfadiazine/on_mob_life(mob/living/M)
+ var/update_flags = STATUS_UPDATE_NONE
+ update_flags |= M.adjustFireLoss(-2 * REAGENTS_EFFECT_MULTIPLIER, FALSE)
+ return ..() | update_flags
+
+/datum/reagent/medicine/heal_on_apply/silver_sulfadiazine/heal_external_limb(obj/item/organ/external/organ, volume)
+ organ.heal_damage(0, volume, updating_health = FALSE)
+
+/datum/reagent/medicine/heal_on_apply/silver_sulfadiazine/heal_overall_damage(mob/living/M, volume)
+ M.adjustFireLoss(-volume)
+
+/datum/reagent/medicine/heal_on_apply/silver_sulfadiazine/reaction_mob(mob/living/M, method = REAGENT_TOUCH, volume, show_message = 1)
+ if(show_message)
+ to_chat(M, "The silver sulfadiazine soothes your burns.")
+
+ if(method == REAGENT_INGEST)
+ M.adjustToxLoss(0.5 * volume)
+ if(show_message)
+ to_chat(M, "You feel sick...")
+
+ return ..()
+
/datum/reagent/medicine/charcoal
name = "Charcoal"
id = "charcoal"
diff --git a/code/modules/reagents/chemistry/reagents/pyrotechnic.dm b/code/modules/reagents/chemistry/reagents/pyrotechnic.dm
index a1e6795070b..fdfd4e3b9c9 100644
--- a/code/modules/reagents/chemistry/reagents/pyrotechnic.dm
+++ b/code/modules/reagents/chemistry/reagents/pyrotechnic.dm
@@ -251,9 +251,8 @@
fireflash_sm(T, radius, 4500 + volume * 500, 350)
/datum/reagent/clf3/reaction_mob(mob/living/M, method = REAGENT_TOUCH, volume)
- if(method == REAGENT_TOUCH || method == REAGENT_INGEST)
- M.adjust_fire_stacks(10)
- M.IgniteMob()
+ M.adjust_fire_stacks(10)
+ M.IgniteMob()
if(method == REAGENT_INGEST)
M.adjustFireLoss(min(max(15, volume * 2.5), 90))
to_chat(M, "It burns!")
diff --git a/code/modules/reagents/chemistry/reagents/toxins.dm b/code/modules/reagents/chemistry/reagents/toxins.dm
index 7ec1006150e..c104e21bd9e 100644
--- a/code/modules/reagents/chemistry/reagents/toxins.dm
+++ b/code/modules/reagents/chemistry/reagents/toxins.dm
@@ -1233,10 +1233,9 @@
/datum/reagent/ants/reaction_mob(mob/living/M, method=REAGENT_TOUCH, volume) //NOT THE ANTS
if(iscarbon(M))
- if(method == REAGENT_TOUCH || method==REAGENT_INGEST)
- to_chat(M, "OH SHIT ANTS!!!!")
- M.emote("scream")
- M.adjustBruteLoss(4)
+ to_chat(M, "OH SHIT ANTS!!!!")
+ M.emote("scream")
+ M.adjustBruteLoss(4)
/datum/reagent/teslium //Teslium. Causes periodic shocks, and makes shocks against the target much more effective.
name = "Teslium"