Skip to content

Commit

Permalink
[READY] Adjusting/porting chemical toxins to fermichem (+Seiver fix) (t…
Browse files Browse the repository at this point in the history
  • Loading branch information
LordVollkorn authored Mar 31, 2021
1 parent 831a9bd commit 86293fb
Show file tree
Hide file tree
Showing 9 changed files with 410 additions and 26 deletions.
2 changes: 1 addition & 1 deletion code/__DEFINES/reagents.dm
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
#define CHEMICAL_MAXIMUM_TEMPERATURE 99999

///The default purity of all non reacted reagents
#define REAGENT_STANDARD_PUIRTY 0.75
#define REAGENT_STANDARD_PURITY 0.75

//reagent bitflags, used for altering how they works
///allows on_mob_dead() if present in a dead body
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
metabolization_rate = 0.5 * REAGENTS_METABOLISM
impure_chem = null //Very few of these have impure effects, they're all baked in by creation_purity
inverse_chem = null //Some of these use inverse chems - we're just defining them all to null here to avoid repetition, eventually this will be moved up to parent
creation_purity = REAGENT_STANDARD_PUIRTY//All sources by default are 0.75 - reactions are primed to resolve to roughly the same with no intervention for these.
purity = REAGENT_STANDARD_PUIRTY
creation_purity = REAGENT_STANDARD_PURITY//All sources by default are 0.75 - reactions are primed to resolve to roughly the same with no intervention for these.
purity = REAGENT_STANDARD_PURITY
inverse_chem_val = 0
inverse_chem = null
failed_chem = /datum/reagent/impurity/healing/medicine_failure
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -566,3 +566,4 @@ Basically, we fill the time between now and 2s from now with hands based off the
REMOVE_TRAIT(owner, TRAIT_NODEATH, type)
owner.remove_movespeed_modifier(/datum/movespeed_modifier/reagent/nooartrium)
owner.remove_actionspeed_modifier(/datum/actionspeed_modifier/nooartrium)

Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
//Reagents produced by metabolising/reacting fermichems inoptimally these specifically are for toxins
//Inverse = Splitting
//Invert = Whole conversion
//Failed = End reaction below purity_min

////////////////////TOXINS///////////////////////////

//Lipolicide - Impure Version
/datum/reagent/impurity/ipecacide
name = "Ipecacide"
description = "An extremely gross substance that induces vomiting. It is produced when Lipolicide reactions are impure."
ph = 7
liver_damage = 0

/datum/reagent/impurity/ipecacide/on_mob_add(mob/living/carbon/owner)
if(owner.disgust >= DISGUST_LEVEL_GROSS)
return ..()
owner.adjust_disgust(50)
..()


//Formaldehyde - Impure Version
/datum/reagent/impurity/methanol
name = "Methanol"
description = "A light, colourless liquid with a distinct smell. Ingestion can lead to blindness. It is a byproduct of organisms processing impure Formaldehyde."
reagent_state = LIQUID
color = "#aae7e4"
ph = 7
liver_damage = 0

/datum/reagent/impurity/methanol/on_mob_life(mob/living/carbon/owner, delta_time)
var/obj/item/organ/eyes/eyes = owner.getorganslot(ORGAN_SLOT_EYES)
if(!eyes)
return ..()
eyes.applyOrganDamage(0.5 * REM * delta_time)
..()


//Chloral Hydrate - Impure Version
/datum/reagent/impurity/chloralax
name = "Chloralax"
description = "An oily, colorless and slightly toxic liquid. It is produced when impure choral hydrate is broken down inside an organism."
reagent_state = LIQUID
color = "#387774"
ph = 7
liver_damage = 0

/datum/reagent/impurity/chloralax/on_mob_life(mob/living/carbon/owner, delta_time)
owner.adjustToxLoss(1 * REM * delta_time, 0)
..()


//Mindbreaker Toxin - Impure Version
/datum/reagent/impurity/rosenol
name = "Rosenol"
description = "A strange, blue liquid that is produced during impure mindbreaker toxin reactions. Historically it has been abused to write poetry."
reagent_state = LIQUID
color = "#0963ad"
ph = 7
liver_damage = 0
metabolization_rate = 0.5 * REAGENTS_METABOLISM

/datum/reagent/impurity/rosenol/on_mob_life(mob/living/carbon/owner, delta_time)
var/obj/item/organ/tongue/tongue = owner.getorganslot(ORGAN_SLOT_TONGUE)
if(!tongue)
return ..()
if(DT_PROB(4.0, delta_time))
owner.manual_emote("clicks with [owner.p_their()] tongue.")
owner.say("Noice.")
if(DT_PROB(2.0, delta_time))
owner.say(pick("Ah! That was a mistake!", "Horrible.", "Watch out everybody, the potato is really hot.", "When I was six I ate a bag of plums.", "And if there is one thing I can't stand it's tomatoes.", "And if there is one thing I love it's tomatoes.", "We had a captain who was so strict, you weren't allowed to breathe in their station.", "The unrobust ones just used to keel over and die, you'd hear them going down behind you."), forced = /datum/reagent/impurity/rosenol)
..()
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@
ph = 8.6
metabolization_rate = 0.05 * REAGENTS_METABOLISM
taste_description = "icey bitterness"
purity = REAGENT_STANDARD_PUIRTY
purity = REAGENT_STANDARD_PURITY
self_consuming = TRUE
impure_chem = /datum/reagent/consumable/ice
inverse_chem_val = 0.5
Expand Down
58 changes: 38 additions & 20 deletions code/modules/reagents/chemistry/reagents/toxin_reagents.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
taste_mult = 1.2
harmful = TRUE
var/toxpwr = 1.5
creation_purity = REAGENT_STANDARD_PURITY
purity = REAGENT_STANDARD_PURITY
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
var/silent_toxin = FALSE //won't produce a pain message when processed by liver/life() if there isn't another non-silent toxin present.

Expand All @@ -20,7 +22,7 @@

/datum/reagent/toxin/on_mob_life(mob/living/carbon/M, delta_time, times_fired)
if(toxpwr)
M.adjustToxLoss(toxpwr * REM * delta_time, 0)
M.adjustToxLoss(toxpwr * REM * normalise_creation_purity() * delta_time, 0)
. = TRUE
..()

Expand Down Expand Up @@ -159,8 +161,8 @@
. = FALSE

if(.)
C.adjustOxyLoss(5 * REM * delta_time, 0)
C.losebreath += 2 * REM * delta_time
C.adjustOxyLoss(5 * REM * normalise_creation_purity() * delta_time, 0)
C.losebreath += 2 * REM * normalise_creation_purity() * delta_time
if(DT_PROB(10, delta_time))
C.emote("gasp")
..()
Expand Down Expand Up @@ -290,6 +292,8 @@
toxpwr = 0
taste_description = "sourness"
ph = 11
impure_chem = /datum/reagent/impurity/rosenol
inverse_chem = null
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
addiction_types = list(/datum/addiction/hallucinogens = 18) //7.2 per 2 seconds

Expand Down Expand Up @@ -426,19 +430,20 @@
toxpwr = 0
metabolization_rate = 1.5 * REAGENTS_METABOLISM
ph = 11
impure_chem = /datum/reagent/impurity/chloralax
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED

/datum/reagent/toxin/chloralhydrate/on_mob_life(mob/living/carbon/M, delta_time, times_fired)
switch(current_cycle)
if(1 to 10)
M.add_confusion(2 * REM * delta_time)
M.drowsyness += 2 * REM * delta_time
M.add_confusion(2 * REM * normalise_creation_purity() * delta_time)
M.drowsyness += 2 * REM * normalise_creation_purity() * delta_time
if(10 to 50)
M.Sleeping(40 * REM * delta_time)
M.Sleeping(40 * REM * normalise_creation_purity() * delta_time)
. = TRUE
if(51 to INFINITY)
M.Sleeping(40 * REM * delta_time)
M.adjustToxLoss(1 * (current_cycle - 50) * REM * delta_time, 0)
M.Sleeping(40 * REM * normalise_creation_purity() * delta_time)
M.adjustToxLoss(1 * (current_cycle - 50) * REM * normalise_creation_purity() * delta_time, 0)
. = TRUE
..()

Expand Down Expand Up @@ -493,7 +498,7 @@
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED

/datum/reagent/toxin/mutetoxin/on_mob_life(mob/living/carbon/M, delta_time, times_fired)
M.silent = max(M.silent, 3 * REM * delta_time)
M.silent = max(M.silent, 3 * REM * normalise_creation_purity() * delta_time)
..()

/datum/reagent/toxin/staminatoxin
Expand Down Expand Up @@ -567,6 +572,8 @@
color = "#B4004B"
metabolization_rate = 0.5 * REAGENTS_METABOLISM
toxpwr = 1
ph = 2.0
impure_chem = /datum/reagent/impurity/methanol
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED

/datum/reagent/toxin/formaldehyde/on_mob_life(mob/living/carbon/M, delta_time, times_fired)
Expand Down Expand Up @@ -602,17 +609,18 @@
color = "#64916E"
metabolization_rate = 0.5 * REAGENTS_METABOLISM
toxpwr = 0
ph = 9
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
addiction_types = list(/datum/addiction/opiods = 25)

/datum/reagent/toxin/fentanyl/on_mob_life(mob/living/carbon/M, delta_time, times_fired)
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 3 * REM * delta_time, 150)
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 3 * REM * normalise_creation_purity() * delta_time, 150)
if(M.toxloss <= 60)
M.adjustToxLoss(1 * REM * delta_time, 0)
M.adjustToxLoss(1 * REM * normalise_creation_purity() * delta_time, 0)
if(current_cycle >= 4)
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "smacked out", /datum/mood_event/narcotic_heavy, name)
if(current_cycle >= 18)
M.Sleeping(40 * REM * delta_time)
M.Sleeping(40 * REM * normalise_creation_purity() * delta_time)
..()
return TRUE

Expand All @@ -623,6 +631,7 @@
color = "#00B4FF"
metabolization_rate = 0.125 * REAGENTS_METABOLISM
toxpwr = 1.25
ph = 9.3
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED

/datum/reagent/toxin/cyanide/on_mob_life(mob/living/carbon/M, delta_time, times_fired)
Expand All @@ -631,7 +640,7 @@
if(DT_PROB(4, delta_time))
to_chat(M, "<span class='danger'>You feel horrendously weak!</span>")
M.Stun(40)
M.adjustToxLoss(2*REM, 0)
M.adjustToxLoss(2*REM * normalise_creation_purity(), 0)
return ..()

/datum/reagent/toxin/bad_food
Expand All @@ -652,6 +661,7 @@
color = "#C8C8C8"
metabolization_rate = 0.4 * REAGENTS_METABOLISM
toxpwr = 0
ph = 7
penetrates_skin = TOUCH|VAPOR
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED

Expand Down Expand Up @@ -758,11 +768,12 @@
color = "#7DC3A0"
metabolization_rate = 0.125 * REAGENTS_METABOLISM
toxpwr = 0.5
ph = 6
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED

/datum/reagent/toxin/sulfonal/on_mob_life(mob/living/carbon/M, delta_time, times_fired)
if(current_cycle >= 22)
M.Sleeping(40 * REM * delta_time)
M.Sleeping(40 * REM * normalise_creation_purity() * delta_time)
return ..()

/datum/reagent/toxin/amanitin
Expand Down Expand Up @@ -790,12 +801,14 @@
color = "#F0FFF0"
metabolization_rate = 0.5 * REAGENTS_METABOLISM
toxpwr = 0
ph = 6
impure_chem = /datum/reagent/impurity/ipecacide
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED

/datum/reagent/toxin/lipolicide/on_mob_life(mob/living/carbon/M, delta_time, times_fired)
if(M.nutrition <= NUTRITION_LEVEL_STARVING)
M.adjustToxLoss(1 * REM * delta_time, 0)
M.adjust_nutrition(-3 * REM * delta_time) // making the chef more valuable, one meme trap at a time
M.adjust_nutrition(-3 * REM * normalise_creation_purity() * delta_time) // making the chef more valuable, one meme trap at a time
M.overeatduration = 0
return ..()

Expand Down Expand Up @@ -862,6 +875,7 @@
color = "#C8C8C8" //RGB: 200, 200, 200
metabolization_rate = 0.2 * REAGENTS_METABOLISM
toxpwr = 0
ph = 11.6
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED

/datum/reagent/toxin/heparin/on_mob_metabolize(mob/living/M)
Expand All @@ -880,6 +894,7 @@
color = "#AC88CA" //RGB: 172, 136, 202
metabolization_rate = 0.6 * REAGENTS_METABOLISM
toxpwr = 0.5
ph = 6.2
taste_description = "spinning"
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED

Expand Down Expand Up @@ -908,14 +923,15 @@
color = "#3C5133"
metabolization_rate = 0.08 * REAGENTS_METABOLISM
toxpwr = 0.15
ph = 8
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED

/datum/reagent/toxin/anacea/on_mob_life(mob/living/carbon/M, delta_time, times_fired)
var/remove_amt = 5
if(holder.has_reagent(/datum/reagent/medicine/calomel) || holder.has_reagent(/datum/reagent/medicine/pen_acid))
remove_amt = 0.5
for(var/datum/reagent/medicine/R in M.reagents.reagent_list)
M.reagents.remove_reagent(R.type, remove_amt * REM * delta_time)
M.reagents.remove_reagent(R.type, remove_amt * REM * normalise_creation_purity() * delta_time)
return ..()

//ACID
Expand Down Expand Up @@ -973,7 +989,7 @@
color = "#5050FF"
toxpwr = 2
acidpwr = 42.0
ph = 1.3
ph = 0.0
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED

// SERIOUSLY
Expand All @@ -985,7 +1001,7 @@
mytray.adjustWeeds(-rand(1,4))

/datum/reagent/toxin/acid/fluacid/on_mob_life(mob/living/carbon/M, delta_time, times_fired)
M.adjustFireLoss((current_cycle/15) * REM * delta_time, 0)
M.adjustFireLoss((current_cycle/15) * REM * normalise_creation_purity() * delta_time, 0)
. = TRUE
..()

Expand All @@ -995,11 +1011,11 @@
color = "#5050FF"
toxpwr = 3
acidpwr = 5.0
ph = 3.3
ph = 1.3
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED

/datum/reagent/toxin/acid/nitracid/on_mob_life(mob/living/carbon/M, delta_time, times_fired)
M.adjustFireLoss((volume/10) * REM * delta_time, FALSE) //here you go nervar
M.adjustFireLoss((volume/10) * REM * normalise_creation_purity() * delta_time, FALSE) //here you go nervar
. = TRUE
..()

Expand Down Expand Up @@ -1029,6 +1045,7 @@
silent_toxin = TRUE
color = "#F0F8FF" // rgb: 240, 248, 255
toxpwr = 0
ph = 1.7
taste_description = "stillness"
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED

Expand All @@ -1044,6 +1061,7 @@
silent_toxin = TRUE //no point spamming them even more.
color = "#AAAAAA77" //RGBA: 170, 170, 170, 77
toxpwr = 0
ph = 3.1
taste_description = "bone hurting"
overdose_threshold = 50
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
Expand Down
4 changes: 2 additions & 2 deletions code/modules/reagents/chemistry/recipes/cat2_medicines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,11 @@
overheat_temp = NO_OVERHEAT
optimal_ph_min = 5
optimal_ph_max = 8
determin_ph_range = 6
determin_ph_range = 2
temp_exponent_factor = 1
ph_exponent_factor = 0.5
thermic_constant = -500
H_ion_release = -6
H_ion_release = -2
rate_up_lim = 15
purity_min = 0.2
reaction_flags = REACTION_PH_VOL_CONSTANT | REACTION_CLEAR_INVERSE
Expand Down
Loading

0 comments on commit 86293fb

Please sign in to comment.