Medical Expansion (#6465)

* Starts work on the Medical Expansion.

* Further Work

* Save Everything!

* Large volume of things.

* Log of Change

* I'm an idiot.

* Kidney assisted sprites. They didn't exist, for some reason.

* Fixfix

* Fixfix

* Update encased.dm

* Update glass.dm

* Update Chemistry-Reagents.dm

I am once more an idiot.

* Split augs.

* Fixfix
This commit is contained in:
Mechoid
2019-10-19 20:27:39 -07:00
committed by Atermonera
parent 5c849287c5
commit e2e870f2b4
80 changed files with 2581 additions and 167 deletions
+28 -4
View File
@@ -20,6 +20,7 @@
var/max_dose = 0
var/overdose = 0 //Amount at which overdose starts
var/overdose_mod = 2 //Modifier to overdose damage
var/can_overdose_touch = FALSE // Can the chemical OD when processing on touch?
var/scannable = 0 // Shows up on health analyzers.
var/affects_dead = 0
var/cup_icon_state = null
@@ -60,19 +61,25 @@
var/datum/reagents/metabolism/active_metab = location
var/removed = metabolism
var/ingest_rem_mult = 1
var/ingest_abs_mult = 1
if(!mrate_static == TRUE)
// Modifiers
for(var/datum/modifier/mod in M.modifiers)
if(!isnull(mod.metabolism_percent))
removed *= mod.metabolism_percent
ingest_rem_mult *= mod.metabolism_percent
// Species
removed *= M.species.metabolic_rate
ingest_rem_mult *= M.species.metabolic_rate
// Metabolism
removed *= active_metab.metabolism_speed
ingest_rem_mult *= active_metab.metabolism_speed
if(ishuman(M))
var/mob/living/carbon/human/H = M
if(H.species.has_organ[O_HEART])
if(H.species.has_organ[O_HEART] && (active_metab.metabolism_class == CHEM_BLOOD))
var/obj/item/organ/internal/heart/Pump = H.internal_organs_by_name[O_HEART]
if(!Pump)
removed *= 0.1
@@ -80,14 +87,31 @@
removed *= 0.8
else // Otherwise, chemicals process as per percentage of your current pulse, or, if you have no pulse but are alive, by a miniscule amount.
removed *= max(0.1, H.pulse / Pump.standard_pulse_level)
if(H.species.has_organ[O_STOMACH] && (active_metab.metabolism_class == CHEM_INGEST))
var/obj/item/organ/internal/stomach/Chamber = H.internal_organs_by_name[O_STOMACH]
if(Chamber)
ingest_rem_mult *= max(0.1, 1 - (Chamber.damage / Chamber.max_damage))
else
ingest_rem_mult = 0.1
if(H.species.has_organ[O_INTESTINE] && (active_metab.metabolism_class == CHEM_INGEST))
var/obj/item/organ/internal/intestine/Tube = H.internal_organs_by_name[O_INTESTINE]
if(Tube)
ingest_abs_mult *= max(0.1, 1 - (Tube.damage / Tube.max_damage))
else
ingest_abs_mult = 0.1
if(filtered_organs && filtered_organs.len)
for(var/organ_tag in filtered_organs)
var/obj/item/organ/internal/O = H.internal_organs_by_name[organ_tag]
if(O && !O.is_broken() && prob(max(0, O.max_damage - O.damage)))
removed *= 0.8
if(active_metab.metabolism_class == CHEM_INGEST)
ingest_rem_mult *= 0.8
if(ingest_met && (active_metab.metabolism_class == CHEM_INGEST))
removed = ingest_met
removed = ingest_met * ingest_rem_mult
if(touch_met && (active_metab.metabolism_class == CHEM_TOUCH))
removed = touch_met
removed = min(removed, volume)
@@ -98,10 +122,10 @@
if(CHEM_BLOOD)
affect_blood(M, alien, removed)
if(CHEM_INGEST)
affect_ingest(M, alien, removed)
affect_ingest(M, alien, removed * ingest_abs_mult)
if(CHEM_TOUCH)
affect_touch(M, alien, removed)
if(overdose && (volume > overdose) && (active_metab.metabolism_class != CHEM_TOUCH))
if(overdose && (volume > overdose) && (active_metab.metabolism_class != CHEM_TOUCH && !can_overdose_touch))
overdose(M, alien, removed)
remove_self(removed)
return
@@ -7,6 +7,15 @@
reagent_state = SOLID
color = "#A8A8A8"
/datum/reagent/calcium
name = "Calcium"
id = "calcium"
description = "A chemical element, the building block of bones."
taste_description = "metallic chalk" // Apparently, calcium tastes like calcium.
taste_mult = 1.3
reagent_state = SOLID
color = "#e9e6e4"
/datum/reagent/carbon
name = "Carbon"
id = "carbon"
@@ -27,6 +27,7 @@
metabolism = REM * 0.5
scannable = 1
touch_met = REM * 0.75
can_overdose_touch = TRUE
/datum/reagent/inaprovaline/topical/affect_blood(var/mob/living/carbon/M, var/alien, var/removed)
if(alien != IS_DIONA)
@@ -84,6 +85,7 @@
overdose = REAGENTS_OVERDOSE * 0.75
scannable = 1
touch_met = REM * 0.75
can_overdose_touch = TRUE
/datum/reagent/bicaridine/topical/affect_blood(var/mob/living/carbon/M, var/alien, var/removed)
var/chem_effective = 1
@@ -100,6 +102,25 @@
if(alien != IS_DIONA)
M.heal_organ_damage(6 * removed * chem_effective, 0)
/datum/reagent/calciumcarbonate
name = "calcium carbonate"
id = "calciumcarbonate"
description = "Calcium carbonate is a calcium salt commonly used as an antacid."
taste_description = "chalk"
reagent_state = SOLID
color = "#eae6e3"
overdose = REAGENTS_OVERDOSE * 0.8
metabolism = REM * 0.4
scannable = 1
/datum/reagent/calciumcarbonate/affect_blood(var/mob/living/carbon/M, var/alien, var/removed) // Why would you inject this.
if(alien != IS_DIONA)
M.adjustToxLoss(3 * removed)
/datum/reagent/calciumcarbonate/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed)
if(alien != IS_DIONA)
M.add_chemical_effect(CE_ANTACID, 3)
/datum/reagent/kelotane
name = "Kelotane"
id = "kelotane"
@@ -147,6 +168,7 @@
overdose = REAGENTS_OVERDOSE * 0.4
scannable = 1
touch_met = REM * 0.75
can_overdose_touch = TRUE
/datum/reagent/dermaline/topical/affect_blood(var/mob/living/carbon/M, var/alien, var/removed)
var/chem_effective = 1
@@ -282,6 +304,42 @@
if(alien != IS_DIONA)
affect_blood(M, alien, removed * 0.4)
/datum/reagent/tricorlidaze
name = "Tricorlidaze"
id = "tricorlidaze"
description = "Tricorlidaze is a topical gel produced with tricordrazine and sterilizine."
taste_description = "bitterness"
reagent_state = SOLID
color = "#B060FF"
scannable = 1
can_overdose_touch = TRUE
/datum/reagent/tricorlidaze/affect_touch(var/mob/living/carbon/M, var/alien, var/removed)
if(alien != IS_DIONA)
var/chem_effective = 1
if(alien == IS_SLIME)
chem_effective = 0.5
M.adjustOxyLoss(-2 * removed * chem_effective)
M.heal_organ_damage(1 * removed, 1 * removed * chem_effective)
M.adjustToxLoss(-2 * removed * chem_effective)
/datum/reagent/tricorlidaze/affect_blood(var/mob/living/carbon/M, var/alien, var/removed)
if(alien != IS_DIONA)
M.adjustToxLoss(3 * removed)
affect_blood(M, alien, removed * 0.4)
/datum/reagent/tricorlidaze/touch_obj(var/obj/O)
if(istype(O, /obj/item/stack/medical/bruise_pack) && round(volume) >= 5)
var/obj/item/stack/medical/bruise_pack/C = O
var/packname = C.name
var/to_produce = min(C.amount, round(volume / 5))
var/obj/item/stack/medical/M = C.upgrade_stack(to_produce)
if(M && M.amount)
holder.my_atom.visible_message("<span class='notice'>\The [packname] bubbles.</span>")
remove_self(to_produce * 5)
/datum/reagent/cryoxadone
name = "Cryoxadone"
id = "cryoxadone"
@@ -333,6 +391,40 @@
M.heal_organ_damage(30 * removed, 30 * removed * chem_effective)
M.adjustToxLoss(-30 * removed * chem_effective)
/datum/reagent/necroxadone
name = "Necroxadone"
id = "necroxadone"
description = "A liquid compound based upon that which is used in the cloning process. Utilized primarily in severe cases of toxic shock."
taste_description = "meat"
reagent_state = LIQUID
color = "#94B21C"
metabolism = REM * 0.5
mrate_static = TRUE
scannable = 1
/datum/reagent/necroxadone/on_mob_life(var/mob/living/carbon/M, var/alien, var/datum/reagents/metabolism/location)
if(M.stat == DEAD && M.has_modifier_of_type(/datum/modifier/bloodpump_corpse))
affects_dead = TRUE
else
affects_dead = FALSE
. = ..(M, alien, location)
/datum/reagent/necroxadone/affect_blood(var/mob/living/carbon/M, var/alien, var/removed)
if(M.bodytemperature < 170 || (M.stat == DEAD && M.has_modifier_of_type(/datum/modifier/bloodpump_corpse)))
var/chem_effective = 1
if(alien == IS_SLIME)
if(prob(10))
to_chat(M, "<span class='danger'>It's so cold. Something causes your cellular mass to harden sporadically, resulting in seizure-like twitching.</span>")
chem_effective = 0.5
M.Weaken(20)
M.silent = max(M.silent, 20)
M.make_jittery(4)
if(M.stat != DEAD)
M.adjustCloneLoss(-5 * removed * chem_effective)
M.adjustOxyLoss(-20 * removed * chem_effective)
M.adjustToxLoss(-40 * removed * chem_effective)
/* Painkillers */
/datum/reagent/paracetamol
@@ -636,7 +728,7 @@
if(ishuman(M))
var/mob/living/carbon/human/H = M
for(var/obj/item/organ/I in H.internal_organs)
if(I.robotic >= ORGAN_ROBOT || !(I.organ_tag in list(O_APPENDIX, O_NUTRIENT, O_PLASMA, O_POLYP)))
if(I.robotic >= ORGAN_ROBOT || !(I.organ_tag in list(O_APPENDIX, O_STOMACH, O_INTESTINE, O_NUTRIENT, O_PLASMA, O_POLYP)))
continue
if(I.damage > 0)
I.damage = max(I.damage - 4 * removed * repair_strength, 0)
@@ -700,7 +792,7 @@
if(ishuman(M))
var/mob/living/carbon/human/H = M
for(var/obj/item/organ/I in H.internal_organs)
if(I.robotic >= ORGAN_ROBOT || !(I.organ_tag in list(O_HEART, O_RESPONSE, O_ANCHOR, O_EGG)))
if(I.robotic >= ORGAN_ROBOT || !(I.organ_tag in list(O_HEART, O_SPLEEN, O_RESPONSE, O_ANCHOR, O_EGG)))
continue
if(I.damage > 0)
I.damage = max(I.damage - 4 * removed * repair_strength, 0)
@@ -877,11 +969,11 @@
if(M.ingested)
for(var/datum/reagent/R in M.ingested.reagent_list)
if(istype(R, /datum/reagent/ethanol))
R.remove_self(removed * 5)
R.remove_self(removed * 30)
if(M.bloodstr)
for(var/datum/reagent/R in M.bloodstr.reagent_list)
if(istype(R, /datum/reagent/ethanol))
R.remove_self(removed * 15)
R.remove_self(removed * 20)
/datum/reagent/hyronalin
name = "Hyronalin"
@@ -1014,6 +1106,54 @@
var/obj/item/organ/external/eo = pick(H.organs) //Misleading variable name, 'organs' is only external organs
eo.fracture()
/datum/reagent/spacomycaze
name = "Spacomycaze"
id = "spacomycaze"
description = "An all-purpose painkilling antibiotic gel."
taste_description = "oil"
reagent_state = SOLID
color = "#C1C1C8"
metabolism = REM * 0.4
mrate_static = TRUE
overdose = REAGENTS_OVERDOSE
scannable = 1
data = 0
can_overdose_touch = TRUE
/datum/reagent/spacomycaze/affect_blood(var/mob/living/carbon/M, var/alien, var/removed)
M.add_chemical_effect(CE_PAINKILLER, 10)
M.adjustToxLoss(3 * removed)
/datum/reagent/spacomycaze/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed)
affect_blood(M, alien, removed * 0.8)
/datum/reagent/spacomycaze/affect_touch(var/mob/living/carbon/M, var/alien, var/removed)
..()
if(alien == IS_SLIME)
if(volume <= 0.1 && data != -1)
data = -1
to_chat(M, "<span class='notice'>The itching fades...</span>")
else
var/delay = (2 MINUTES)
if(world.time > data + delay)
data = world.time
to_chat(M, "<span class='warning'>Your skin itches.</span>")
M.add_chemical_effect(CE_ANTIBIOTIC, dose >= overdose ? ANTIBIO_OD : ANTIBIO_NORM)
M.add_chemical_effect(CE_PAINKILLER, 20) // 5 less than paracetamol.
/datum/reagent/spacomycaze/touch_obj(var/obj/O)
if(istype(O, /obj/item/stack/medical/crude_pack) && round(volume) >= 1)
var/obj/item/stack/medical/crude_pack/C = O
var/packname = C.name
var/to_produce = min(C.amount, round(volume))
var/obj/item/stack/medical/M = C.upgrade_stack(to_produce)
if(M && M.amount)
holder.my_atom.visible_message("<span class='notice'>\The [packname] bubbles.</span>")
remove_self(to_produce)
/datum/reagent/sterilizine
name = "Sterilizine"
id = "sterilizine"
@@ -191,6 +191,7 @@
taste_description = "bitterness"
reagent_state = LIQUID
strength = 5
filtered_organs = list(O_SPLEEN)
/datum/reagent/toxin/expired_medicine/affect_blood(var/mob/living/carbon/M, var/alien, var/removed)
..()
@@ -232,6 +233,7 @@
color = "#FFFFFF"
strength = 0
overdose = REAGENTS_OVERDOSE
filtered_organs = list(O_SPLEEN, O_KIDNEYS)
/datum/reagent/toxin/potassium_chloride/affect_blood(var/mob/living/carbon/M, var/alien, var/removed)
..()
@@ -257,6 +259,7 @@
color = "#FFFFFF"
strength = 10
overdose = 20
filtered_organs = list(O_SPLEEN, O_KIDNEYS)
/datum/reagent/toxin/potassium_chlorophoride/affect_blood(var/mob/living/carbon/M, var/alien, var/removed)
..()
@@ -297,6 +300,35 @@
M.status_flags &= ~FAKEDEATH
return ..()
/datum/reagent/toxin/lichpowder
name = "Lich Powder"
id = "lichpowder"
description = "A stablized nerve agent that puts the subject into a strange state of un-death."
reagent_state = SOLID
color = "#666666"
metabolism = REM * 0.75
strength = 2
mrate_static = TRUE
/datum/reagent/toxin/lichpowder/affect_touch(var/mob/living/carbon/M, var/alien, var/removed)
..()
if(alien == IS_DIONA)
return
M.status_flags |= FAKEDEATH
M.adjustOxyLoss(1 * removed)
M.silent = max(M.silent, 10)
M.tod = stationtime2text()
if(prob(1))
M.visible_message("[M] wheezes.", "You wheeze sharply... it's cold.")
M.bodytemperature = max(M.bodytemperature - 10 * TEMPERATURE_DAMAGE_COEFFICIENT, T0C - 10)
/datum/reagent/toxin/lichpowder/Destroy()
if(holder && holder.my_atom && ismob(holder.my_atom))
var/mob/M = holder.my_atom
M.status_flags &= ~FAKEDEATH
return ..()
/datum/reagent/toxin/fertilizer //Reagents used for plant fertilizers.
name = "fertilizer"
id = "fertilizer"
@@ -392,6 +424,16 @@
power = 10
meltdose = 4
/datum/reagent/acid/digestive
name = "Digestive acid"
id = "stomacid"
description = "Some form of digestive slurry."
taste_description = "vomit"
reagent_state = LIQUID
color = "#664330"
power = 2
meltdose = 30
/datum/reagent/thermite/venom
name = "Pyrotoxin"
id = "thermite_v"
@@ -420,6 +462,7 @@
description = "A biological agent that acts similarly to pepperspray. This compound seems to be particularly cruel, however, capable of permeating the barriers of blood vessels."
taste_description = "fire"
color = "#B31008"
filtered_organs = list(O_SPLEEN)
/datum/reagent/condensedcapsaicin/venom/affect_blood(var/mob/living/carbon/M, var/alien, var/removed)
if(alien == IS_DIONA)
@@ -718,6 +761,7 @@
id = "serotrotium_v"
description = "A chemical compound that promotes concentrated production of the serotonin neurotransmitter in humans. This appears to be a biologically produced form, resulting in a specifically toxic nature."
taste_description = "chalky bitterness"
filtered_organs = list(O_SPLEEN)
/datum/reagent/serotrotium/venom/affect_blood(var/mob/living/carbon/M, var/alien, var/removed)
if(alien == IS_DIONA)
@@ -760,6 +804,7 @@
reagent_state = LIQUID
color = "#C8A5DC"
overdose = REAGENTS_OVERDOSE
filtered_organs = list(O_SPLEEN)
/datum/reagent/impedrezene/affect_blood(var/mob/living/carbon/M, var/alien, var/removed)
if(alien == IS_DIONA)
@@ -976,6 +1021,7 @@ datum/reagent/talum_quem/affect_blood(var/mob/living/carbon/M, var/alien, var/re
reagent_state = SOLID
color = "#555555"
metabolism = REM * 4
filtered_organs = list(O_SPLEEN)
/datum/reagent/neurophage_nanites/affect_blood(var/mob/living/carbon/M, var/alien, var/removed)
M.adjustBrainLoss(2 * removed) // Their job is to give you a bad time.
+15 -8
View File
@@ -150,18 +150,18 @@
catalysts = list("phoron" = 1)
result_amount = 2
/datum/chemical_reaction/tramadol
name = "Tramadol"
id = "tramadol"
result = "tramadol"
required_reagents = list("inaprovaline" = 1, "ethanol" = 1, "oxygen" = 1)
result_amount = 3
/datum/chemical_reaction/paracetamol
name = "Paracetamol"
id = "paracetamol"
result = "paracetamol"
required_reagents = list("tramadol" = 1, "sugar" = 1, "water" = 1)
required_reagents = list("inaprovaline" = 1, "nitrogen" = 1, "water" = 1)
result_amount = 2
/datum/chemical_reaction/tramadol
name = "Tramadol"
id = "tramadol"
result = "tramadol"
required_reagents = list("paracetamol" = 1, "ethanol" = 1, "oxygen" = 1)
result_amount = 3
/datum/chemical_reaction/oxycodone
@@ -465,6 +465,13 @@
required_reagents = list("oxygen" = 1, "anti_toxin" = 1, "carbon" = 1)
result_amount = 3
/datum/chemical_reaction/calciumcarbonate
name = "Calcium Carbonate"
id = "calciumcarbonate"
result = "calciumcarbonate"
required_reagents = list("oxygen" = 3, "calcium" = 1, "carbon" = 1)
result_amount = 2
/datum/chemical_reaction/soporific
name = "Soporific"
id = "stoxin"
@@ -30,6 +30,7 @@
ethanol spawn_reagent = "ethanol"
sacid spawn_reagent = "sacid"
tungsten spawn_reagent = "tungsten"
calcium spawn_reagent = "calcium"
// Bar, alcoholic
beer spawn_reagent = "beer"
@@ -21,7 +21,8 @@
/obj/item/weapon/reagent_containers/chem_disp_cartridge/ethanol,
/obj/item/weapon/reagent_containers/chem_disp_cartridge/sugar,
/obj/item/weapon/reagent_containers/chem_disp_cartridge/sacid,
/obj/item/weapon/reagent_containers/chem_disp_cartridge/tungsten
/obj/item/weapon/reagent_containers/chem_disp_cartridge/tungsten,
/obj/item/weapon/reagent_containers/chem_disp_cartridge/calcium
)
/obj/machinery/chemical_dispenser/ert
@@ -111,7 +112,7 @@
/obj/item/weapon/reagent_containers/chem_disp_cartridge/tequila,
/obj/item/weapon/reagent_containers/chem_disp_cartridge/vermouth,
/obj/item/weapon/reagent_containers/chem_disp_cartridge/cognac,
/obj/item/weapon/reagent_containers/chem_disp_cartridge/cider,
/obj/item/weapon/reagent_containers/chem_disp_cartridge/cider,
/obj/item/weapon/reagent_containers/chem_disp_cartridge/ale,
/obj/item/weapon/reagent_containers/chem_disp_cartridge/mead
)
@@ -192,6 +192,7 @@ SEC_PACK(radium, /obj/item/weapon/reagent_containers/chem_disp_cartridge/radi
SEC_PACK(ethanol, /obj/item/weapon/reagent_containers/chem_disp_cartridge/ethanol, "Reagent refill - Ethanol", "ethanol reagent cartridge crate", 15, access_chemistry)
SEC_PACK(sacid, /obj/item/weapon/reagent_containers/chem_disp_cartridge/sacid, "Reagent refill - Sulfuric Acid", "sulfuric acid reagent cartridge crate", 15, access_chemistry)
SEC_PACK(tungsten, /obj/item/weapon/reagent_containers/chem_disp_cartridge/tungsten, "Reagent refill - Tungsten", "tungsten reagent cartridge crate", 15, access_chemistry)
SEC_PACK(calcium, /obj/item/weapon/reagent_containers/chem_disp_cartridge/calcium, "Reagent refill - Calcium", "calcium reagent cartridge crate", 15, access_chemistry)
// Bar-restricted (alcoholic drinks)
// Datum path Contents type Supply pack name Container name Cost Container access
@@ -104,6 +104,28 @@
temp_range = list(T0C + 115, T0C + 130)
/datum/chemical_reaction/distilling/spacomycaze
name = "Distilling Spacomycaze"
id = "distill_spacomycaze"
result = "spacomycaze"
required_reagents = list("paracetamol" = 1, "spaceacillin" = 1, "foaming_agent" = 1)
result_amount = 2
reaction_rate = HALF_LIFE(10)
temp_range = list(T0C + 100, T0C + 120)
/datum/chemical_reaction/distilling/tricorlidaze
name = "Distilling Tricorlidaze"
id = "distill_tricorlidaze"
result = "tricorlidaze"
required_reagents = list("tricordrazine" = 1, "sterilizine" = 1, "foaming_agent" = 1)
result_amount = 2
reaction_rate = HALF_LIFE(10)
temp_range = list(T0C + 100, T0C + 120)
// Alcohol
/datum/chemical_reaction/distilling/beer
name = "Distilling Beer"
@@ -168,3 +190,27 @@
F.set_up(6, 0, T)
F.start()
return
/datum/chemical_reaction/distilling/lichpowder
name = "Distilling Lichpowder"
id = "distill_lichpowder"
result = "lichpowder"
required_reagents = list("zombiepowder" = 2, "leporazine" = 1)
result_amount = 2
reaction_rate = HALF_LIFE(8)
temp_range = list(T0C + 100, T0C + 150)
/datum/chemical_reaction/distilling/necroxadone
name = "Distilling Necroxadone"
id = "distill_necroxadone"
result = "necroxadone"
required_reagents = list("lichpowder" = 1, "cryoxadone" = 1, "carthatoline" = 1)
result_amount = 2
catalysts = list("phoron" = 5)
reaction_rate = HALF_LIFE(20)
temp_range = list(T0C + 90, T0C + 95)
@@ -132,6 +132,9 @@
update_name_label()
if(istype(W,/obj/item/weapon/storage/bag))
..()
if(W && W.w_class <= w_class && (flags & OPENCONTAINER))
to_chat(user, "<span class='notice'>You dip \the [W] into \the [src].</span>")
reagents.touch_obj(W, reagents.total_volume)
/obj/item/weapon/reagent_containers/glass/proc/update_name_label()
if(label_text == "")