diff --git a/code/modules/reagents/chemistry/reagents.dm b/code/modules/reagents/chemistry/reagents.dm index d0933e01690..a9350961357 100644 --- a/code/modules/reagents/chemistry/reagents.dm +++ b/code/modules/reagents/chemistry/reagents.dm @@ -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 diff --git a/code/modules/reagents/chemistry/reagents/medicine.dm b/code/modules/reagents/chemistry/reagents/medicine.dm index 0e2fe0de584..8014238d9b3 100644 --- a/code/modules/reagents/chemistry/reagents/medicine.dm +++ b/code/modules/reagents/chemistry/reagents/medicine.dm @@ -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