From 083b74ec85516b714aae7a50c84f77333bcfe39c Mon Sep 17 00:00:00 2001
From: JimKil3 <47290811+JimKil3@users.noreply.github.com>
Date: Tue, 11 Jul 2023 08:46:48 -0500
Subject: [PATCH] Adds Sanguine and Osseous Reagent (#21148)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* SR (not strange reagent)
* Osseous Reagent
* i forgor the recipe
* typecasting tweak
* SR tweaks
* bone tumor tweaks
* SR overdose buff
* Update code/modules/surgery/organs/bone_tumor.dm
Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
* Update code/modules/surgery/organs/bone_tumor.dm
Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
* Apply suggestions from code review
Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>
* makes SR actually work
oops 🤪
* guard clause
---------
Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>
---
.../reagents/chemistry/reagents/medicine.dm | 80 +++++++++++++++++++
.../chemistry/recipes/medicine_reactions.dm | 16 ++++
code/modules/surgery/organs/bone_tumor.dm | 29 +++++++
paradise.dme | 1 +
4 files changed, 126 insertions(+)
create mode 100644 code/modules/surgery/organs/bone_tumor.dm
diff --git a/code/modules/reagents/chemistry/reagents/medicine.dm b/code/modules/reagents/chemistry/reagents/medicine.dm
index c641200b983..8ae055aa399 100644
--- a/code/modules/reagents/chemistry/reagents/medicine.dm
+++ b/code/modules/reagents/chemistry/reagents/medicine.dm
@@ -818,6 +818,86 @@
SSblackbox.record_feedback("tally", "players_revived", 1, "lazarus_reagent")
..()
+/datum/reagent/medicine/sanguine_reagent
+ name = "Sanguine Reagent"
+ id = "sanguine_reagent"
+ description = "A deeply crimson almost-gel that can mimic blood, regardless of type."
+ color = "#770101"
+ taste_description = "coppery fuel"
+ harmless = FALSE
+ overdose_threshold = 15
+
+/datum/reagent/medicine/sanguine_reagent/on_mob_life(mob/living/M)
+ if(!ishuman(M))
+ return
+
+ var/mob/living/carbon/human/H = M
+
+ if(NO_BLOOD in H.dna.species.species_traits)
+ return ..()
+
+ if(H.blood_volume < BLOOD_VOLUME_NORMAL)
+ switch(current_cycle)
+ if(1)
+ H.blood_volume += 1
+ if(2 to 25)
+ H.blood_volume += 3
+ else
+ H.blood_volume += 5
+
+ return ..()
+
+/datum/reagent/medicine/sanguine_reagent/overdose_process(mob/living/M, severity)
+ var/update_flags = STATUS_UPDATE_NONE
+ if(!ishuman(M))
+ return
+ var/mob/living/carbon/human/H = M
+ if(volume < 20)
+ if(prob(10))
+ to_chat(H, "[overdose_message]")
+ else
+ if(prob(10))
+ to_chat(H, "You choke on congealed blood!")
+ H.AdjustLoseBreath(2 SECONDS)
+ H.vomit(blood = TRUE, stun = FALSE)
+ else if(prob(10))
+ var/overdose_message = pick("You're seeing red!", "Your heartbeat thunders in your ears!", "Your veins writhe under your skin!")
+ to_chat(H, "[overdose_message]")
+ H.adjustBruteLoss(6)
+ if(H.client?.prefs.colourblind_mode == COLOURBLIND_MODE_NONE)
+ H.client.color = "red"
+ addtimer(VARSET_CALLBACK(H.client, color, ""), 6 SECONDS)
+ return list(0, update_flags)
+
+/datum/reagent/medicine/osseous_reagent
+ name = "Osseous Reagent"
+ id = "osseous_reagent"
+ description = "A solution of pinkish gel with white shards floating in it, which is supposedly able to be processed into bone gel."
+ color = "#c9abab"
+ taste_description = "chunky marrow"
+ harmless = FALSE
+ overdose_threshold = 30 //so a single shotgun dart can't cause the tumor effect
+
+/datum/reagent/medicine/osseous_reagent/on_mob_life(mob/living/M)
+ var/update_flags = STATUS_UPDATE_NONE
+ update_flags |= M.adjustToxLoss(1, FALSE)
+ return ..() | update_flags
+
+/datum/reagent/medicine/osseous_reagent/overdose_process(mob/living/M, severity)
+ var/update_flags = STATUS_UPDATE_NONE
+ update_flags |= M.adjustToxLoss(1, FALSE)
+
+ if(ishuman(M) && prob(5))
+ var/mob/living/carbon/human/H = M
+ if(!H.get_int_organ(/obj/item/organ/internal/bone_tumor))
+ new/obj/item/organ/internal/bone_tumor(H)
+
+ return ..()
+
/datum/reagent/medicine/mannitol
name = "Mannitol"
id = "mannitol"
diff --git a/code/modules/reagents/chemistry/recipes/medicine_reactions.dm b/code/modules/reagents/chemistry/recipes/medicine_reactions.dm
index 554e340c967..97bc4fc6e05 100644
--- a/code/modules/reagents/chemistry/recipes/medicine_reactions.dm
+++ b/code/modules/reagents/chemistry/recipes/medicine_reactions.dm
@@ -215,6 +215,22 @@
/datum/chemical_reaction/life/friendly/on_reaction(datum/reagents/holder, created_volume)
chemical_mob_spawn(holder, rand(1, round(created_volume, 1)), "Life (friendly)", FRIENDLY_SPAWN)
+/datum/chemical_reaction/sanguine_reagent
+ name = "Sanguine Reagent"
+ id = "sanguine_reagent"
+ result = "sanguine_reagent"
+ required_reagents = list("omnizine" = 1, "synthflesh" = 2, "iron" = 2)
+ result_amount = 5
+ mix_message = "The mixture bubbles furiously for a moment, then condenses into a sanguine gel."
+
+/datum/chemical_reaction/osseous_reagent
+ name = "Osseous Reagent"
+ id = "osseous_reagent"
+ result = "osseous_reagent"
+ required_reagents = list("milk" = 1, "potassium" = 1, "oxygen" = 4, "phenol" = 3, "formaldehyde" = 3)
+ result_amount = 12
+ mix_message = "Shards of a bone-like substance start to form in the liquid."
+
/datum/chemical_reaction/mannitol
name = "Mannitol"
id = "mannitol"
diff --git a/code/modules/surgery/organs/bone_tumor.dm b/code/modules/surgery/organs/bone_tumor.dm
new file mode 100644
index 00000000000..98d070f39bd
--- /dev/null
+++ b/code/modules/surgery/organs/bone_tumor.dm
@@ -0,0 +1,29 @@
+/obj/item/organ/internal/bone_tumor
+ name = "bone tumor"
+ parent_organ = "groin"
+ slot = "groin_tumor"
+ destroy_on_removal = TRUE
+ var/tumor_size = 0 //Changed in New to be dependent on amount of osseous reagent in the system when formed, determines damage done
+
+/obj/item/organ/internal/bone_tumor/New(mob/living/carbon/holder)
+ ..()
+ tumor_size = owner.reagents.get_reagent_amount("osseous_reagent")
+ owner.reagents.remove_all_type(/datum/reagent/medicine/osseous_reagent, tumor_size)
+
+/obj/item/organ/internal/bone_tumor/on_life()
+
+ var/obj/item/organ/external/groin/G = owner.get_limb_by_name("groin")
+ var/tumor_damage_modifier = sqrt(tumor_size - 30) //diminishing returns, tumor size can't be lower than 30
+
+ if(prob(5))
+ G.receive_damage(10 + tumor_damage_modifier, 0, FALSE)
+ to_chat(owner, "Something sharp is moving around in your lower body!")
+
+ if(prob(1))
+ to_chat(owner, "Something just tore in your lower body!")
+
+ var/list/other_groin_organs = G.internal_organs
+ other_groin_organs -= src
+
+ for(var/obj/item/organ/internal/I in other_groin_organs)
+ I.receive_damage(rand(5, 15) + tumor_damage_modifier)
diff --git a/paradise.dme b/paradise.dme
index 95bf8675307..28ae45ef6e6 100644
--- a/paradise.dme
+++ b/paradise.dme
@@ -2571,6 +2571,7 @@
#include "code\modules\surgery\organs\autosurgeon.dm"
#include "code\modules\surgery\organs\blood.dm"
#include "code\modules\surgery\organs\body_egg.dm"
+#include "code\modules\surgery\organs\bone_tumor.dm"
#include "code\modules\surgery\organs\brain.dm"
#include "code\modules\surgery\organs\ears.dm"
#include "code\modules\surgery\organs\eyes.dm"