From abf69a81d8a523503ba9da76316c70be888e84da Mon Sep 17 00:00:00 2001 From: Qwertytoforty <52090703+Qwertytoforty@users.noreply.github.com> Date: Tue, 2 May 2023 15:28:50 -0400 Subject: [PATCH] Overdosed chemicals no longer do helpful effects when overdosed (generally) (#20906) * Overdosed chemicals no longer do helpful effects when overdosed (generally) * Update code/modules/reagents/chemistry/reagents_holder.dm Co-authored-by: Nathan Winters <100448493+CinnamonSnowball@users.noreply.github.com> * balance request * Update code/modules/reagents/chemistry/reagents_datum.dm Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com> * od to overdose --------- Co-authored-by: Nathan Winters <100448493+CinnamonSnowball@users.noreply.github.com> Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com> --- code/modules/reagents/chemistry/reagents/alcohol.dm | 2 ++ code/modules/reagents/chemistry/reagents/drugs.dm | 2 ++ .../reagents/chemistry/reagents/food_reagents.dm | 2 ++ code/modules/reagents/chemistry/reagents/toxins.dm | 1 + code/modules/reagents/chemistry/reagents_datum.dm | 12 ++++++++++++ code/modules/reagents/chemistry/reagents_holder.dm | 5 ++++- 6 files changed, 23 insertions(+), 1 deletion(-) diff --git a/code/modules/reagents/chemistry/reagents/alcohol.dm b/code/modules/reagents/chemistry/reagents/alcohol.dm index d21ccb5f7ef..2b812904975 100644 --- a/code/modules/reagents/chemistry/reagents/alcohol.dm +++ b/code/modules/reagents/chemistry/reagents/alcohol.dm @@ -102,6 +102,7 @@ drink_name = "Glass of Absinthe" drink_desc = "The green fairy is going to get you now!" taste_description = "fucking pain" + allowed_overdose_process = TRUE //copy paste from LSD... shoot me /datum/reagent/consumable/ethanol/absinthe/on_mob_life(mob/living/M) @@ -143,6 +144,7 @@ drink_name = "Glass of Rum" drink_desc = "Now you want to Pray for a pirate suit, don't you?" taste_description = "rum" + allowed_overdose_process = TRUE /datum/reagent/consumable/ethanol/rum/overdose_process(mob/living/M, severity) var/update_flags = STATUS_UPDATE_NONE diff --git a/code/modules/reagents/chemistry/reagents/drugs.dm b/code/modules/reagents/chemistry/reagents/drugs.dm index 798d474b6ef..2cf79cd7d8a 100644 --- a/code/modules/reagents/chemistry/reagents/drugs.dm +++ b/code/modules/reagents/chemistry/reagents/drugs.dm @@ -283,6 +283,7 @@ addiction_chance = 10 addiction_threshold = 10 taste_description = "very poor life choices" + allowed_overdose_process = TRUE /datum/reagent/krokodil/on_mob_life(mob/living/M) @@ -360,6 +361,7 @@ addiction_decay_rate = 0.1 // very low, to prevent people from abusing the massive speed boost for too long. forces them to take long downtimes to not die from brain damage. heart_rate_increase = 1 taste_description = "speed" + allowed_overdose_process = TRUE //Requested by balance. /// modifier to the stun time of the mob taking the drug var/tenacity = 1.5 diff --git a/code/modules/reagents/chemistry/reagents/food_reagents.dm b/code/modules/reagents/chemistry/reagents/food_reagents.dm index 9443429c56e..1c7440e6434 100644 --- a/code/modules/reagents/chemistry/reagents/food_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/food_reagents.dm @@ -98,6 +98,7 @@ overdose_threshold = 200 // Hyperglycaemic shock taste_description = "sweetness" taste_mult = 1.5 + allowed_overdose_process = TRUE /datum/reagent/consumable/sugar/on_mob_life(mob/living/M) var/update_flags = STATUS_UPDATE_NONE @@ -717,6 +718,7 @@ overdose_threshold = 75 harmless = FALSE taste_description = "oil" + allowed_overdose_process = TRUE /datum/reagent/consumable/hydrogenated_soybeanoil/on_mob_life(mob/living/M) if(prob(15)) diff --git a/code/modules/reagents/chemistry/reagents/toxins.dm b/code/modules/reagents/chemistry/reagents/toxins.dm index 9c041a81986..80bd1f2c164 100644 --- a/code/modules/reagents/chemistry/reagents/toxins.dm +++ b/code/modules/reagents/chemistry/reagents/toxins.dm @@ -494,6 +494,7 @@ metabolization_rate = 0.2 overdose_threshold = 40 taste_mult = 0 + allowed_overdose_process = TRUE /datum/reagent/histamine/reaction_mob(mob/living/M, method=REAGENT_TOUCH, volume) //dumping histamine on someone is VERY mean. if(iscarbon(M)) diff --git a/code/modules/reagents/chemistry/reagents_datum.dm b/code/modules/reagents/chemistry/reagents_datum.dm index cda47f9b9ea..cc61576ee8b 100644 --- a/code/modules/reagents/chemistry/reagents_datum.dm +++ b/code/modules/reagents/chemistry/reagents_datum.dm @@ -28,6 +28,8 @@ var/addiction_stage = 1 var/last_addiction_dose = 0 var/overdosed = FALSE // You fucked up and this is now triggering it's overdose effects, purge that shit quick. + /// If this variable is true, chemicals will continue to process in mobs when overdosed. + var/allowed_overdose_process = FALSE var/current_cycle = 1 var/drink_icon = null var/drink_name = "Glass of ..what?" @@ -107,6 +109,16 @@ holder.remove_reagent(id, total_depletion_rate) //By default it slowly disappears. return STATUS_UPDATE_NONE +/datum/reagent/proc/on_mob_overdose_life(mob/living/M) //We want to drain reagents but not do the entire mob life. + current_cycle++ + var/total_depletion_rate = metabolization_rate * M.metabolism_efficiency // Cache it + + handle_addiction(M, total_depletion_rate) + sate_addiction(M) + + holder.remove_reagent(id, total_depletion_rate) //By default it slowly disappears. + return STATUS_UPDATE_NONE + /datum/reagent/proc/handle_addiction(mob/living/M, consumption_rate) if(addiction_chance && !is_type_in_list(src, M.reagents.addiction_list)) M.reagents.addiction_threshold_accumulated[type] += consumption_rate diff --git a/code/modules/reagents/chemistry/reagents_holder.dm b/code/modules/reagents/chemistry/reagents_holder.dm index 1661ce8de59..9f1de6f7403 100644 --- a/code/modules/reagents/chemistry/reagents_holder.dm +++ b/code/modules/reagents/chemistry/reagents_holder.dm @@ -331,10 +331,13 @@ continue //If you got this far, that means we can process whatever reagent this iteration is for. Handle things normally from here. if(M && R) - update_flags |= R.on_mob_life(M) if(R.volume >= R.overdose_threshold && !R.overdosed && R.overdose_threshold > 0) R.overdosed = TRUE R.overdose_start(M) + if(!R.overdosed || R.allowed_overdose_process) + update_flags |= R.on_mob_life(M) + else + update_flags |= R.on_mob_overdose_life(M) //We want to drain reagents but not do the entire mob life. if(R.volume < R.overdose_threshold && R.overdosed) R.overdosed = FALSE if(R.overdosed)