From efe1871595760829101925d8ed24fb801f16f0a9 Mon Sep 17 00:00:00 2001 From: Fox-McCloud Date: Tue, 15 Mar 2016 18:36:29 -0400 Subject: [PATCH] Addiction Rework --- code/game/objects/items/devices/scanners.dm | 2 +- code/game/objects/items/weapons/cigs.dm | 2 - code/modules/reagents/newchem/drugs.dm | 193 +----------------- code/modules/reagents/newchem/food.dm | 2 + code/modules/reagents/newchem/medicine.dm | 73 +------ .../modules/reagents/newchem/newchem_procs.dm | 123 ++++++----- .../oldchem/reagents/_reagent_base.dm | 26 +-- .../reagents/drink/reagents_alcohol.dm | 1 + .../oldchem/reagents/drink/reagents_drink.dm | 1 + .../oldchem/reagents/reagents_drugs.dm | 1 + 10 files changed, 104 insertions(+), 320 deletions(-) diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index 4b0e945722c..7ae1700d57d 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -105,7 +105,7 @@ REAGENT SCANNER if(H.reagents.addiction_list.len) user.show_message("Subject is addicted to the following reagents:") for(var/datum/reagent/R in H.reagents.addiction_list) - user.show_message("[R.name]") + user.show_message("[R.name] Stage: [R.addiction_stage]/5") else user.show_message("Subject is not addicted to any reagents.") diff --git a/code/game/objects/items/weapons/cigs.dm b/code/game/objects/items/weapons/cigs.dm index e1c441eea90..2688496651e 100644 --- a/code/game/objects/items/weapons/cigs.dm +++ b/code/game/objects/items/weapons/cigs.dm @@ -174,8 +174,6 @@ LIGHTERS ARE IN LIGHTERS.DM if(reagents && reagents.total_volume) // check if it has any reagents at all if(is_being_smoked) // if it's being smoked, transfer reagents to the mob var/mob/living/carbon/C = loc - if(prob(15)) // so it's not an instarape in case of acid - reagents.reaction(C, INGEST) reagents.trans_to(C, REAGENTS_METABOLISM) if(!reagents.total_volume) // There were reagents, but now they're gone C << "Your [name] loses its flavor." diff --git a/code/modules/reagents/newchem/drugs.dm b/code/modules/reagents/newchem/drugs.dm index 1f35706787d..3fe8af013c7 100644 --- a/code/modules/reagents/newchem/drugs.dm +++ b/code/modules/reagents/newchem/drugs.dm @@ -11,7 +11,7 @@ reagent_state = LIQUID color = "#60A584" // rgb: 96, 165, 132 overdose_threshold = 35 - addiction_threshold = 30 + addiction_chance = 70 /datum/reagent/nicotine/on_mob_life(var/mob/living/M as mob) if(!M) M = holder.my_atom @@ -39,7 +39,7 @@ reagent_state = LIQUID color = "#60A584" // rgb: 96, 165, 132 overdose_threshold = 20 - addiction_threshold = 10 + addiction_chance = 50 /datum/reagent/crank/on_mob_life(var/mob/living/M as mob) if(!M) M = holder.my_atom @@ -69,24 +69,6 @@ ..() return -/datum/reagent/crank/addiction_act_stage1(var/mob/living/M as mob) - M.adjustBrainLoss(rand(1,10)*REM) - ..() - return -/datum/reagent/crank/addiction_act_stage2(var/mob/living/M as mob) - M.adjustToxLoss(rand(1,10)*REM) - ..() - return -/datum/reagent/crank/addiction_act_stage3(var/mob/living/M as mob) - M.adjustBruteLoss(rand(1,10)*REM) - ..() - return -/datum/reagent/crank/addiction_act_stage4(var/mob/living/M as mob) - M.adjustBrainLoss(rand(1,10)*REM) - M.adjustToxLoss(rand(1,10)*REM) - M.adjustBruteLoss(rand(1,10)*REM) - ..() - return /datum/chemical_reaction/crank name = "Crank" id = "crank" @@ -111,7 +93,7 @@ reagent_state = LIQUID color = "#0264B4" overdose_threshold = 20 - addiction_threshold = 15 + addiction_chance = 50 /datum/reagent/krokodil/on_mob_life(var/mob/living/M as mob) @@ -145,30 +127,6 @@ ..() return - -/datum/reagent/krokodil/addiction_act_stage1(var/mob/living/M as mob) - M.adjustBrainLoss(rand(1,5)*REM) - M.adjustToxLoss(rand(1,5)*REM) - ..() - return -/datum/reagent/krokodil/addiction_act_stage2(var/mob/living/M as mob) - if(prob(25)) - M << "Your skin feels loose..." - ..() - return -/datum/reagent/krokodil/addiction_act_stage3(var/mob/living/M as mob) - if(prob(25)) - M << "Your skin starts to peel away..." - M.adjustBruteLoss(3*REM) - ..() - return - -/datum/reagent/krokodil/addiction_act_stage4(var/mob/living/carbon/human/M as mob) - if(prob(25)) - M << "Your skin falls off easily!" - M.adjustBruteLoss(5*REM) - ..() - return /datum/chemical_reaction/krokodil name = "Krokodil" id = "krokodil" @@ -186,12 +144,12 @@ reagent_state = LIQUID color = "#60A584" // rgb: 96, 165, 132 overdose_threshold = 20 - addiction_threshold = 10 + addiction_chance = 60 metabolization_rate = 0.6 /datum/reagent/methamphetamine/meth2 //for donk pockets id = "methamphetamine2" - addiction_threshold = 20 + addiction_chance = 0 /datum/reagent/methamphetamine/on_mob_life(var/mob/living/M as mob) if(!M) M = holder.my_atom @@ -225,35 +183,6 @@ M.adjustBrainLoss(pick(0.5, 0.6, 0.7, 0.8, 0.9, 1)) return -/datum/reagent/methamphetamine/addiction_act_stage1(var/mob/living/M as mob) - M.Jitter(5) - if(prob(20)) - M.emote(pick("twitch","drool","moan")) - ..() - return -/datum/reagent/methamphetamine/addiction_act_stage2(var/mob/living/M as mob) - M.Jitter(10) - M.Dizzy(10) - if(prob(30)) - M.emote(pick("twitch","drool","moan")) - ..() - return -/datum/reagent/methamphetamine/addiction_act_stage3(var/mob/living/M as mob) - M.Jitter(15) - M.Dizzy(15) - if(prob(40)) - M.emote(pick("twitch","drool","moan")) - ..() - return -/datum/reagent/methamphetamine/addiction_act_stage4(var/mob/living/carbon/human/M as mob) - M.Jitter(20) - M.Dizzy(20) - M.adjustToxLoss(5) - if(prob(50)) - M.emote(pick("twitch","drool","moan")) - ..() - return - /datum/chemical_reaction/methamphetamine name = "methamphetamine" id = "methamphetamine" @@ -294,7 +223,7 @@ reagent_state = LIQUID color = "#60A584" // rgb: 96, 165, 132 overdose_threshold = 20 - addiction_threshold = 10 + addiction_chance = 80 metabolization_rate = 0.6 @@ -340,55 +269,6 @@ ..() return -/datum/reagent/bath_salts/addiction_act_stage1(var/mob/living/M as mob) - M.hallucination += 10 - if(M.canmove && !istype(M.loc, /turf/space)) - for(var/i = 0, i < 8, i++) - step(M, pick(cardinal)) - M.Jitter(5) - M.adjustBrainLoss(10) - if(prob(20)) - M.emote(pick("twitch","drool","moan")) - ..() - return -/datum/reagent/bath_salts/addiction_act_stage2(var/mob/living/M as mob) - M.hallucination += 20 - if(M.canmove && !istype(M.loc, /turf/space)) - for(var/i = 0, i < 8, i++) - step(M, pick(cardinal)) - M.Jitter(10) - M.Dizzy(10) - M.adjustBrainLoss(10) - if(prob(30)) - M.emote(pick("twitch","drool","moan")) - ..() - return -/datum/reagent/bath_salts/addiction_act_stage3(var/mob/living/M as mob) - M.hallucination += 30 - if(M.canmove && !istype(M.loc, /turf/space)) - for(var/i = 0, i < 12, i++) - step(M, pick(cardinal)) - M.Jitter(15) - M.Dizzy(15) - M.adjustBrainLoss(10) - if(prob(40)) - M.emote(pick("twitch","drool","moan")) - ..() - return -/datum/reagent/bath_salts/addiction_act_stage4(var/mob/living/carbon/human/M as mob) - M.hallucination += 40 - if(M.canmove && !istype(M.loc, /turf/space)) - for(var/i = 0, i < 16, i++) - step(M, pick(cardinal)) - M.Jitter(50) - M.Dizzy(50) - M.adjustToxLoss(5) - M.adjustBrainLoss(10) - if(prob(50)) - M.emote(pick("twitch","drool","moan")) - ..() - return - /datum/chemical_reaction/aranesp name = "Aranesp" id = "aranesp" @@ -453,6 +333,7 @@ metabolization_rate = 0.2 overdose_threshold = 15 process_flags = ORGANIC | SYNTHETIC //Flipping for everyone! + addiction_chance = 10 /datum/chemical_reaction/fliptonium name = "fliptonium" @@ -532,7 +413,7 @@ process_flags = SYNTHETIC overdose_threshold = 20 - addiction_threshold = 10 + addiction_chance = 60 metabolization_rate = 0.6 /datum/chemical_reaction/lube/ultra @@ -577,38 +458,6 @@ M.adjustBrainLoss(pick(0.5, 0.6, 0.7, 0.8, 0.9, 1)) return -/datum/reagent/lube/ultra/addiction_act_stage1(var/mob/living/M as mob) - M.Jitter(5) - if(prob(20)) - M.emote(pick("twitch","buzz","moan")) - ..() - return - -/datum/reagent/lube/ultra/addiction_act_stage2(var/mob/living/M as mob) - M.Jitter(10) - M.Dizzy(10) - if(prob(30)) - M.emote(pick("twitch","buzz","moan")) - ..() - return - -/datum/reagent/lube/ultra/addiction_act_stage3(var/mob/living/M as mob) - M.Jitter(15) - M.Dizzy(15) - if(prob(40)) - M.emote(pick("twitch","buzz","moan")) - ..() - return - -/datum/reagent/lube/ultra/addiction_act_stage4(var/mob/living/carbon/human/M as mob) - M.Jitter(20) - M.Dizzy(20) - M.adjustBrainLoss(2) - if(prob(50)) - M.emote(pick("twitch","buzz","moan")) - ..() - return - //Surge: Krokodil /datum/reagent/surge name = "Surge" @@ -619,7 +468,7 @@ process_flags = SYNTHETIC overdose_threshold = 20 - addiction_threshold = 15 + addiction_chance = 50 /datum/reagent/surge/on_mob_life(var/mob/living/M as mob) @@ -655,30 +504,6 @@ ..() return -/datum/reagent/surge/addiction_act_stage1(var/mob/living/M as mob) - M.adjustBrainLoss(rand(1,5)*REM) - M.hallucination += rand(1,5) - ..() - return -/datum/reagent/surge/addiction_act_stage2(var/mob/living/M as mob) - if(prob(25)) - M << "Your casing feels loose..." - ..() - return -/datum/reagent/surge/addiction_act_stage3(var/mob/living/M as mob) - if(prob(25)) - M << "Your casing starts to come apart..." - M.adjustBruteLoss(3*REM) - ..() - return - -/datum/reagent/surge/addiction_act_stage4(var/mob/living/carbon/human/M as mob) - if(prob(25)) - M << "Your exposed wiring begins corroding!" - M.adjustFireLoss(5*REM) - ..() - return - /datum/chemical_reaction/surge name = "Surge" id = "surge" diff --git a/code/modules/reagents/newchem/food.dm b/code/modules/reagents/newchem/food.dm index fa11df2df08..4f83e21bc6b 100644 --- a/code/modules/reagents/newchem/food.dm +++ b/code/modules/reagents/newchem/food.dm @@ -284,6 +284,7 @@ datum/reagent/cheese/reaction_turf(var/turf/T, var/volume) reagent_state = LIQUID color = "#B2B139" overdose_threshold = 50 + addiction_chance = 10 /datum/reagent/fake_cheese/overdose_process(var/mob/living/M as mob) if(prob(8)) @@ -298,6 +299,7 @@ datum/reagent/cheese/reaction_turf(var/turf/T, var/volume) reagent_state = SOLID color = "#50FF00" metabolization_rate = 0 //heheheh + addiction_chance = 5 /datum/reagent/weird_cheese/on_mob_life(var/mob/living/M as mob) if(prob(5)) diff --git a/code/modules/reagents/newchem/medicine.dm b/code/modules/reagents/newchem/medicine.dm index b85f73edf27..3e934f49a79 100644 --- a/code/modules/reagents/newchem/medicine.dm +++ b/code/modules/reagents/newchem/medicine.dm @@ -168,6 +168,7 @@ datum/reagent/omnizine color = "#C8A5DC" metabolization_rate = 0.2 overdose_threshold = 30 + addiction_chance = 5 datum/reagent/omnizine/on_mob_life(var/mob/living/M as mob) if(!M) M = holder.my_atom @@ -336,6 +337,7 @@ datum/reagent/perfluorodecalin reagent_state = LIQUID color = "#C8A5DC" metabolization_rate = 0.2 + addiction_chance = 20 datum/reagent/perfluorodecalin/on_mob_life(var/mob/living/carbon/human/M as mob) if(!M) M = holder.my_atom @@ -367,7 +369,7 @@ datum/reagent/ephedrine color = "#C8A5DC" metabolization_rate = 0.3 overdose_threshold = 45 - addiction_threshold = 30 + addiction_chance = 25 datum/reagent/ephedrine/on_mob_life(var/mob/living/M as mob) if(!M) M = holder.my_atom @@ -393,31 +395,6 @@ datum/reagent/ephedrine/overdose_process(var/mob/living/M as mob) ..() return -datum/reagent/ephedrine/addiction_act_stage1(var/mob/living/M as mob) - if(prob(33)) - M.adjustToxLoss(2*REM) - M.losebreath += 2 - ..() - return -datum/reagent/ephedrine/addiction_act_stage2(var/mob/living/M as mob) - if(prob(33)) - M.adjustToxLoss(3*REM) - M.losebreath += 3 - ..() - return -datum/reagent/ephedrine/addiction_act_stage3(var/mob/living/M as mob) - if(prob(33)) - M.adjustToxLoss(4*REM) - M.losebreath += 4 - ..() - return -datum/reagent/ephedrine/addiction_act_stage4(var/mob/living/M as mob) - if(prob(33)) - M.adjustToxLoss(5*REM) - M.losebreath += 5 - ..() - return - /datum/chemical_reaction/ephedrine name = "Ephedrine" id = "ephedrine" @@ -432,6 +409,7 @@ datum/reagent/diphenhydramine description = "Anti-allergy medication. May cause drowsiness, do not operate heavy machinery while using this." reagent_state = LIQUID color = "#5BCBE1" + addiction_chance = 10 datum/reagent/diphenhydramine/on_mob_life(var/mob/living/M as mob) if(!M) M = holder.my_atom @@ -463,7 +441,7 @@ datum/reagent/morphine reagent_state = LIQUID color = "#C8A5DC" overdose_threshold = 30 - addiction_threshold = 25 + addiction_chance = 50 shock_reduction = 50 datum/reagent/morphine/on_mob_life(var/mob/living/M as mob) @@ -495,46 +473,6 @@ datum/reagent/morphine/overdose_process(var/mob/living/M as mob) ..() return -datum/reagent/morphine/addiction_act_stage1(var/mob/living/M as mob) - if(prob(33)) - var/obj/item/I = M.get_active_hand() - if(I) - M.drop_item() - M.Dizzy(2) - M.Jitter(2) - ..() - return -datum/reagent/morphine/addiction_act_stage2(var/mob/living/M as mob) - if(prob(33)) - var/obj/item/I = M.get_active_hand() - if(I) - M.drop_item() - M.adjustToxLoss(1*REM) - M.Dizzy(3) - M.Jitter(3) - ..() - return -datum/reagent/morphine/addiction_act_stage3(var/mob/living/M as mob) - if(prob(33)) - var/obj/item/I = M.get_active_hand() - if(I) - M.drop_item() - M.adjustToxLoss(2*REM) - M.Dizzy(4) - M.Jitter(4) - ..() - return -datum/reagent/morphine/addiction_act_stage4(var/mob/living/M as mob) - if(prob(33)) - var/obj/item/I = M.get_active_hand() - if(I) - M.drop_item() - M.adjustToxLoss(3*REM) - M.Dizzy(5) - M.Jitter(5) - ..() - return - datum/reagent/oculine/on_mob_life(var/mob/living/M as mob) if(!M) M = holder.my_atom if(prob(80)) @@ -943,6 +881,7 @@ datum/reagent/teporone description = "This experimental plasma-based compound seems to regulate body temperature." reagent_state = LIQUID color = "#D782E6" + addiction_chance = 20 datum/reagent/teporone/on_mob_life(var/mob/living/M as mob) if(!M) M = holder.my_atom diff --git a/code/modules/reagents/newchem/newchem_procs.dm b/code/modules/reagents/newchem/newchem_procs.dm index fd29db191f4..4a6ec32366e 100644 --- a/code/modules/reagents/newchem/newchem_procs.dm +++ b/code/modules/reagents/newchem/newchem_procs.dm @@ -1,15 +1,18 @@ -datum/reagent +#define ADDICTION_TIME 4800 //8 minutes + +/datum/reagent var/overdose_threshold = 0 - var/addiction_threshold = 0 - var/addiction_stage = 0 + var/addiction_chance = 0 + var/addiction_stage = 1 + var/last_addiction_dose = 0 var/overdosed = 0 // You fucked up and this is now triggering it's overdose effects, purge that shit quick. var/current_cycle = 1 -datum/reagents + +/datum/reagents var/chem_temp = 300 - var/addiction_tick = 1 var/list/datum/reagent/addiction_list = new/list() -datum/reagents/proc/metabolize(var/mob/M) +/datum/reagents/proc/metabolize(var/mob/M) if(M) if(!istype(M, /mob/living)) //Non-living mobs can't metabolize reagents, so don't bother trying (runtime safety check) return @@ -53,39 +56,29 @@ datum/reagents/proc/metabolize(var/mob/M) R.overdose_start(M) if(R.volume < R.overdose_threshold && R.overdosed) R.overdosed = 0 - if(R.volume >= R.addiction_threshold && !is_type_in_list(R, addiction_list) && R.addiction_threshold > 0) - var/datum/reagent/new_reagent = new R.type() - addiction_list.Add(new_reagent) if(R.overdosed) R.overdose_process(M) - if(is_type_in_list(R,addiction_list)) - for(var/datum/reagent/addicted_reagent in addiction_list) - if(istype(R, addicted_reagent)) - addicted_reagent.addiction_stage = -15 // you're satisfied for a good while. R.on_mob_life(M) - if(addiction_tick == 6) - addiction_tick = 1 - for(var/A in addiction_list) - var/datum/reagent/R = A - if(M && R) - if(R.addiction_stage <= 0) + for(var/A in addiction_list) + var/datum/reagent/R = A + if(M && R) + if(R.addiction_stage < 5) + if(prob(5)) R.addiction_stage++ - if(R.addiction_stage > 0 && R.addiction_stage <= 10) + switch(R.addiction_stage) + if(1) R.addiction_act_stage1(M) - R.addiction_stage++ - if(R.addiction_stage > 10 && R.addiction_stage <= 20) + if(2) R.addiction_act_stage2(M) - R.addiction_stage++ - if(R.addiction_stage > 20 && R.addiction_stage <= 30) + if(3) R.addiction_act_stage3(M) - R.addiction_stage++ - if(R.addiction_stage > 30 && R.addiction_stage <= 40) + if(4) R.addiction_act_stage4(M) - R.addiction_stage++ - if(R.addiction_stage > 40) - M << "You feel like you've gotten over your need for [R.name]." - addiction_list.Remove(R) - addiction_tick++ + if(5) + R.addiction_act_stage5(M) + if(prob(20) && (world.timeofday > (R.last_addiction_dose + ADDICTION_TIME))) //Each addiction lasts 8 minutes before it can end + M << "You no longer feel reliant on [R.name]!" + addiction_list.Remove(R) update_total() /datum/reagents/proc/overdose_list() @@ -96,19 +89,19 @@ datum/reagents/proc/metabolize(var/mob/M) return od_chems -datum/reagents/proc/reagent_on_tick() +/datum/reagents/proc/reagent_on_tick() for(var/datum/reagent/R in reagent_list) R.on_tick() return -datum/reagents/proc/check_gofast(var/mob/M) +/datum/reagents/proc/check_gofast(var/mob/M) if(istype(M, /mob)) if(M.reagents.has_reagent("unholywater")||M.reagents.has_reagent("nuka_cola")||M.reagents.has_reagent("stimulative_agent")) return 1 else M.status_flags &= ~GOTTAGOFAST -datum/reagents/proc/check_goreallyfast(var/mob/M) +/datum/reagents/proc/check_goreallyfast(var/mob/M) if(istype(M, /mob)) if(M.reagents.has_reagent("methamphetamine")) return 1 @@ -116,39 +109,61 @@ datum/reagents/proc/check_goreallyfast(var/mob/M) M.status_flags &= ~GOTTAGOREALLYFAST // Called every time reagent containers process. -datum/reagent/proc/on_tick(var/data) +/datum/reagent/proc/on_tick(var/data) return // Called when the reagent container is hit by an explosion -datum/reagent/proc/on_ex_act(var/severity) +/datum/reagent/proc/on_ex_act(var/severity) return // Called if the reagent has passed the overdose threshold and is set to be triggering overdose effects -datum/reagent/proc/overdose_process(var/mob/living/M as mob) +/datum/reagent/proc/overdose_process(var/mob/living/M as mob) return -datum/reagent/proc/overdose_start(var/mob/living/M as mob) +/datum/reagent/proc/overdose_start(var/mob/living/M as mob) return -datum/reagent/proc/addiction_act_stage1(var/mob/living/M as mob) - if(prob(30)) - M << "You feel like some [name] right about now." +/datum/reagent/proc/addiction_act_stage1(var/mob/living/M as mob) return -datum/reagent/proc/addiction_act_stage2(var/mob/living/M as mob) - if(prob(30)) - M << "You feel like you need [name]. You just can't get enough." - return +/datum/reagent/proc/addiction_act_stage2(var/mob/living/M as mob) + if(prob(8)) + M.emote("shiver") + if(prob(8)) + M.emote("sneeze") + if(prob(4)) + M << "You feel a dull headache." -datum/reagent/proc/addiction_act_stage3(var/mob/living/M as mob) - if(prob(30)) - M << "You have an intense craving for [name]." - return +/datum/reagent/proc/addiction_act_stage3(var/mob/living/M as mob) + if(prob(8)) + M.emote("twitch_s") + if(prob(8)) + M.emote("shiver") + if(prob(4)) + M << "You begin craving [name]!" -datum/reagent/proc/addiction_act_stage4(var/mob/living/M as mob) - if(prob(30)) - M << "You're not feeling good at all! You really need some [name]." - return +/datum/reagent/proc/addiction_act_stage4(var/mob/living/M as mob) + if(prob(8)) + M.emote("twitch") + if(prob(4)) + M << "You have the strong urge for some [name]!" + if(prob(4)) + M << "You REALLY crave some [name]!" + +/datum/reagent/proc/addiction_act_stage5(var/mob/living/M as mob) + if(prob(8)) + M.emote("twitch") + if(prob(6)) + M << "Your stomach lurches painfully!" + M.visible_message("[M] gags and retches!") + M.Stun(rand(2,4)) + M.Weaken(rand(2,4)) + if(prob(5)) + M << "You feel like you can't live without [name]!" + if(prob(5)) + M << "You would DIE for some [name] right now!" /datum/reagent/proc/reagent_deleted() - return \ No newline at end of file + return + +#undef ADDICTION_TIME \ No newline at end of file diff --git a/code/modules/reagents/oldchem/reagents/_reagent_base.dm b/code/modules/reagents/oldchem/reagents/_reagent_base.dm index eab338f2882..93194a16f49 100644 --- a/code/modules/reagents/oldchem/reagents/_reagent_base.dm +++ b/code/modules/reagents/oldchem/reagents/_reagent_base.dm @@ -33,18 +33,20 @@ if(amount >= 1) L.reagents.add_reagent(self.id,amount) -/* - if(method == INGEST && istype(M, /mob/living/carbon)) - if(prob(self.addictiveness)) - var/datum/disease/addiction/A = new /datum/disease/addiction - A.addicted_to = self - A.name = "[self.name] Addiction" - A.addiction ="[self.name]" - A.cure = self.id - M.viruses += A - A.affected_mob = M - A.holder = M -*/ + + if(method == INGEST) //Yes, even Xenos can get addicted to drugs. + if(prob(self.addiction_chance) && !is_type_in_list(self, M.reagents.addiction_list)) + M << "You suddenly feel invigorated and guilty..." + var/datum/reagent/new_reagent = new self.type() + new_reagent.last_addiction_dose = world.timeofday + M.reagents.addiction_list.Add(new_reagent) + else if(is_type_in_list(self, M.reagents.addiction_list)) + M << "You feel slightly better, but for how long?" + for(var/A in M.reagents.addiction_list) + var/datum/reagent/AD = A + if(AD && istype(AD, self)) + AD.last_addiction_dose = world.timeofday + AD.addiction_stage = 1 return 1 /datum/reagent/proc/reaction_obj(var/obj/O, var/volume) //By default we transfer a small part of the reagent to the object diff --git a/code/modules/reagents/oldchem/reagents/drink/reagents_alcohol.dm b/code/modules/reagents/oldchem/reagents/drink/reagents_alcohol.dm index d633bb020ad..1b970f3014a 100644 --- a/code/modules/reagents/oldchem/reagents/drink/reagents_alcohol.dm +++ b/code/modules/reagents/oldchem/reagents/drink/reagents_alcohol.dm @@ -17,6 +17,7 @@ var/vomit_start = 180 //amount absorbed after which mob starts vomitting var/blur_start = 260 //amount absorbed after which mob starts getting blurred vision var/pass_out = 325 //amount absorbed after which mob starts passing out + addiction_chance = 4 //chance to become alcoholic /datum/reagent/ethanol/on_mob_life(var/mob/living/M as mob, var/alien) // Sobering multiplier. diff --git a/code/modules/reagents/oldchem/reagents/drink/reagents_drink.dm b/code/modules/reagents/oldchem/reagents/drink/reagents_drink.dm index dc43ffb54b4..4f79fbac781 100644 --- a/code/modules/reagents/oldchem/reagents/drink/reagents_drink.dm +++ b/code/modules/reagents/oldchem/reagents/drink/reagents_drink.dm @@ -187,6 +187,7 @@ adj_sleepy = -2 adj_temp = 25 overdose_threshold = 45 + addiction_chance = 5 // It's true. /datum/reagent/drink/coffee/on_mob_life(var/mob/living/M as mob) if(holder.has_reagent("frostoil")) diff --git a/code/modules/reagents/oldchem/reagents/reagents_drugs.dm b/code/modules/reagents/oldchem/reagents/reagents_drugs.dm index c44cfe3715e..0529a1ed4b0 100644 --- a/code/modules/reagents/oldchem/reagents/reagents_drugs.dm +++ b/code/modules/reagents/oldchem/reagents/reagents_drugs.dm @@ -87,6 +87,7 @@ reagent_state = LIQUID color = "#9087A2" metabolization_rate = 0.2 + addiction_chance = 65 /datum/reagent/space_drugs/on_mob_life(var/mob/living/M as mob) if(!M) M = holder.my_atom