Skip to content

Commit

Permalink
Overdosed chemicals no longer do helpful effects when overdosed (gene…
Browse files Browse the repository at this point in the history
…rally) (ParadiseSS13#20906)

* Overdosed chemicals no longer do helpful effects when overdosed (generally)

* Update code/modules/reagents/chemistry/reagents_holder.dm

Co-authored-by: Nathan Winters <[email protected]>

* balance request

* Update code/modules/reagents/chemistry/reagents_datum.dm

Co-authored-by: Ryan <[email protected]>

* od to overdose

---------

Co-authored-by: Nathan Winters <[email protected]>
Co-authored-by: Ryan <[email protected]>
  • Loading branch information
3 people authored May 2, 2023
1 parent 282f1cb commit abf69a8
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 1 deletion.
2 changes: 2 additions & 0 deletions code/modules/reagents/chemistry/reagents/alcohol.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions code/modules/reagents/chemistry/reagents/drugs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions code/modules/reagents/chemistry/reagents/food_reagents.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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))
Expand Down
1 change: 1 addition & 0 deletions code/modules/reagents/chemistry/reagents/toxins.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
12 changes: 12 additions & 0 deletions code/modules/reagents/chemistry/reagents_datum.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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?"
Expand Down Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion code/modules/reagents/chemistry/reagents_holder.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit abf69a8

Please sign in to comment.