From fa94e54788e6e83858dc88c9684d0db8b487b939 Mon Sep 17 00:00:00 2001 From: naut <55491249+nauticall@users.noreply.github.com> Date: Fri, 4 Aug 2023 22:43:42 +0800 Subject: [PATCH] Adds Cytophenolate, a new immunosuppressant (#16958) * Immunosuppressant * chagnelgo * slows metabolism down to make prescription meds not overly tedious * CL update * Update code/modules/organs/organ.dm --------- Co-authored-by: Matt Atlas --- code/__defines/chemistry.dm | 1 + code/modules/organs/organ.dm | 26 +++++++++-- .../Chemistry-Reagents-Medicine.dm | 22 ++++++++++ code/modules/reagents/Chemistry-Recipes.dm | 8 +++- .../nauticall-immunosuppressant.yml | 43 +++++++++++++++++++ 5 files changed, 95 insertions(+), 5 deletions(-) create mode 100644 html/changelogs/nauticall-immunosuppressant.yml diff --git a/code/__defines/chemistry.dm b/code/__defines/chemistry.dm index 50014e387f6..592c316ee4c 100644 --- a/code/__defines/chemistry.dm +++ b/code/__defines/chemistry.dm @@ -74,6 +74,7 @@ // Apply healing effects #define CE_ANTIBIOTIC "antibiotic" // Thetamycin +#define CE_ANTIIMMUNE "antiimmune" #define CE_ANTITOXIN "antitoxin" // Dylovene and stuff #define CE_BLOODRESTORE "bloodrestore" // Iron/nutriment #define CE_BRAIN_REGEN "brainfix" // Alkysine diff --git a/code/modules/organs/organ.dm b/code/modules/organs/organ.dm index 384334c7390..90cedbbb897 100644 --- a/code/modules/organs/organ.dm +++ b/code/modules/organs/organ.dm @@ -187,6 +187,7 @@ else if(owner.bodytemperature >= 170) //cryo stops germs from moving and doing their bad stuffs //** Handle antibiotics and curing infections handle_antibiotics() + handle_immunosuppressants() handle_rejection() handle_germ_effects() @@ -241,8 +242,7 @@ take_damage(1,silent=prob(30)) /obj/item/organ/proc/handle_rejection() - // Process unsuitable transplants. TODO: consider some kind of - // immunosuppressant that changes transplant data to make it match. + // Process unsuitable transplants. if(dna) if(!rejecting) if(blood_incompatible(dna.b_type, owner.dna.b_type, species, owner.species)) @@ -310,10 +310,14 @@ //Germs /obj/item/organ/proc/handle_antibiotics() + var/antibiotics if(!owner || !(CE_ANTIBIOTIC in owner.chem_effects) || (germ_level <= 0)) return - - var/antibiotics = owner.chem_effects[CE_ANTIBIOTIC] + var/antiimmune = owner.chem_effects[CE_ANTIIMMUNE] + if(antiimmune) + antibiotics = ((owner.chem_effects[CE_ANTIBIOTIC]) * 0.5) //antibiotic effectiveness is severely hampered + else + antibiotics = owner.chem_effects[CE_ANTIBIOTIC] if(germ_level <= INFECTION_LEVEL_ONE) if(antibiotics >= 5) @@ -325,6 +329,20 @@ else germ_level = max(germ_level - min(antibiotics * 0.5, 3), 0) //Big infections, very slow to stop. At max dose and germ_level 1000, should take five to six minutes +//Immunosuppressants +/obj/item/organ/proc/handle_immunosuppressants() + if(!owner || !(CE_ANTIIMMUNE in owner.chem_effects) || !rejecting) + return + + var/antiimmune = owner.chem_effects[CE_ANTIIMMUNE] + + if(rejecting <= 3) + rejecting = 0 //nullifies rejection + if(dna) + dna.b_type = owner.dna.b_type + else + rejecting = max(rejecting - min(antiimmune, 2), 0) //fairly slow to work, don't want it to be trivial after all + //Adds autopsy data for used_weapon. /obj/item/organ/proc/add_autopsy_data(var/used_weapon, var/damage) var/datum/autopsy_data/W = autopsy_data[used_weapon] diff --git a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Medicine.dm b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Medicine.dm index babd5c77135..17580b109d7 100644 --- a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Medicine.dm +++ b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Medicine.dm @@ -768,6 +768,28 @@ M.make_dizzy(5) M.adjustToxLoss(1) //Antibodies start fighting your body +/singleton/reagent/cytophenolate + name = "Cytophenolate" + description = "A general-purpose immunosuppressant capable of treating organ rejections. Calms down the immune system, but also drastically reduces the effectiveness of antibiotics while in the body, making one more susceptible to infection." + reagent_state = LIQUID + color = "#337758" + od_minimum_dose = 1 + overdose = REAGENTS_OVERDOSE + scannable = TRUE + metabolism = REM * 0.25 + taste_description = "bitter vegetables" + +/singleton/reagent/cytophenolate/affect_blood(var/mob/living/carbon/M, var/alien, var/removed, var/datum/reagents/holder) + if(check_min_dose(M, 0.25)) + M.add_chemical_effect(CE_ANTIIMMUNE, M.chem_doses[type]) + +/singleton/reagent/cytophenolate/overdose(var/mob/living/carbon/M, var/alien, var/removed, var/datum/reagents/holder) + to_chat(M, SPAN_WARNING("You feel extremely weak.")) + M.dizziness = max(150, M.dizziness) + M.make_dizzy(5) + M.AdjustWeakened(5) + M.add_chemical_effect(CE_EMETIC, M.chem_doses[type]/8) + /singleton/reagent/asinodryl name = "Asinodryl" description = "Asinodryl is an anti-emetic medication which acts by preventing the two regions in the brain responsible for vomiting from controlling the act of emesis." diff --git a/code/modules/reagents/Chemistry-Recipes.dm b/code/modules/reagents/Chemistry-Recipes.dm index c584d4118ae..6f58ed48fc2 100644 --- a/code/modules/reagents/Chemistry-Recipes.dm +++ b/code/modules/reagents/Chemistry-Recipes.dm @@ -389,6 +389,13 @@ required_reagents = list(/singleton/reagent/thetamycin = 2, /singleton/reagent/sterilizine = 1, /singleton/reagent/radium = 1) result_amount = 2 +/datum/chemical_reaction/cytophenolate + name = "Cytophenolate" + id = "cytophenolate" + result = /singleton/reagent/cytophenolate + required_reagents = list(/singleton/reagent/fluvectionem = 1, /singleton/reagent/alcohol = 1, /singleton/reagent/sugar = 1) + result_amount = 3 + /datum/chemical_reaction/antiparasitic name = "Helmizole" id = "helmizole" @@ -4058,4 +4065,3 @@ result = /singleton/reagent/alcohol/tribunal required_reagents = list(/singleton/reagent/alcohol/threefold = 1, /singleton/reagent/alcohol/godhead = 1, /singleton/reagent/water/holywater = 1) result_amount = 3 - \ No newline at end of file diff --git a/html/changelogs/nauticall-immunosuppressant.yml b/html/changelogs/nauticall-immunosuppressant.yml new file mode 100644 index 00000000000..3ee7805e095 --- /dev/null +++ b/html/changelogs/nauticall-immunosuppressant.yml @@ -0,0 +1,43 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +# balance +# admin +# backend +# security +# refactor +################################# + +# Your name. +author: nauticall + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - rscadd: "Added a new immunosuppressant drug, Cytophenolate. It slowly but surely mitigates the effects of organ damage above 10 units and cures organ rejection after some timestamps." + - balance: "Cytophenolate does not fully cure rejected transplanted organs from other species; it only prevents the effects from worsening as long as the drug is in their system." + - balance: "Cytophenolate is an actual immunosuppressant, and reduces the effectiveness of antibiotics while in a patient's system."