fix for medical chems

This commit is contained in:
Fox McCloud
2020-03-01 23:33:38 -05:00
parent 47926f3e35
commit 24a56ae4fe
2 changed files with 12 additions and 5 deletions
+7 -4
View File
@@ -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