mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-14 00:23:29 +01:00
fix for medical chems
This commit is contained in:
@@ -75,8 +75,14 @@
|
||||
current_cycle++
|
||||
var/total_depletion_rate = metabolization_rate * M.metabolism_efficiency * M.digestion_ratio // Cache it
|
||||
|
||||
handle_addiction(M, total_depletion_rate)
|
||||
|
||||
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[id] += total_depletion_rate
|
||||
M.reagents.addiction_threshold_accumulated[id] += consumption_rate
|
||||
var/current_threshold_accumulated = M.reagents.addiction_threshold_accumulated[id]
|
||||
|
||||
if(addiction_threshold < current_threshold_accumulated && prob(addiction_chance) && prob(addiction_chance_additional))
|
||||
@@ -85,9 +91,6 @@
|
||||
new_reagent.last_addiction_dose = world.timeofday
|
||||
M.reagents.addiction_list.Add(new_reagent)
|
||||
|
||||
holder.remove_reagent(id, total_depletion_rate) //By default it slowly disappears.
|
||||
return STATUS_UPDATE_NONE
|
||||
|
||||
/datum/reagent/proc/on_mob_death(mob/living/M) //use this to have chems have a "death-triggered" effect
|
||||
return
|
||||
|
||||
|
||||
@@ -6,7 +6,11 @@
|
||||
|
||||
/datum/reagent/medicine/on_mob_life(mob/living/M)
|
||||
current_cycle++
|
||||
holder.remove_reagent(id, (metabolization_rate / M.metabolism_efficiency) * M.digestion_ratio) //medicine reagents stay longer if you have a better metabolism
|
||||
var/total_depletion_rate = (metabolization_rate / M.metabolism_efficiency) * M.digestion_ratio // Cache it
|
||||
|
||||
handle_addiction(M, total_depletion_rate)
|
||||
|
||||
holder.remove_reagent(id, total_depletion_rate) //medicine reagents stay longer if you have a better metabolism
|
||||
return STATUS_UPDATE_NONE
|
||||
|
||||
/datum/reagent/medicine/hydrocodone
|
||||
|
||||
Reference in New Issue
Block a user