diff --git a/baystation12.dme b/baystation12.dme index 4b2f3f8b5eb..ad8f570a557 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -2904,6 +2904,7 @@ #include "code\modules\reagents\addiction\alcohol.dm" #include "code\modules\reagents\addiction\gottheit.dm" #include "code\modules\reagents\addiction\hallucinogens.dm" +#include "code\modules\reagents\addiction\nicotine.dm" #include "code\modules\reagents\addiction\opiate.dm" #include "code\modules\reagents\addiction\psionics.dm" #include "code\modules\reagents\Chemistry-Reagents\Chemistry-Reagents-Core.dm" diff --git a/code/__defines/chemistry.dm b/code/__defines/chemistry.dm index 0f527f54345..461385fd6c4 100644 --- a/code/__defines/chemistry.dm +++ b/code/__defines/chemistry.dm @@ -59,13 +59,16 @@ #define HANDLE_REACTIONS(_reagents) SSchemistry.active_holders[_reagents] = TRUE #define UNQUEUE_REACTIONS(_reagents) SSchemistry.active_holders -= _reagents +#define ANTIDEPRESSANT_MESSAGE_DELAY 5 MINUTES + /// Minimum requirement for addiction buzz to be met #define MIN_ADDICTION_REAGENT_AMOUNT 2 -#define MAX_ADDICTION_POINTS 1000 +/// Maximum amount of addiction points for any addiction type +#define MAX_ADDICTION_POINTS 2000 /// Addiction start/ends -#define WITHDRAWAL_STAGE1_START_CYCLE 20 -#define WITHDRAWAL_STAGE1_END_CYCLE 80 -#define WITHDRAWAL_STAGE2_START_CYCLE 81 -#define WITHDRAWAL_STAGE2_END_CYCLE 140 -#define WITHDRAWAL_STAGE3_START_CYCLE 141 +#define WITHDRAWAL_STAGE1_START_CYCLE 50 +#define WITHDRAWAL_STAGE1_END_CYCLE 120 +#define WITHDRAWAL_STAGE2_START_CYCLE 121 +#define WITHDRAWAL_STAGE2_END_CYCLE 200 +#define WITHDRAWAL_STAGE3_START_CYCLE 201 diff --git a/code/_global_vars/lists/objects.dm b/code/_global_vars/lists/objects.dm index 3dc9111d99d..11012780417 100644 --- a/code/_global_vars/lists/objects.dm +++ b/code/_global_vars/lists/objects.dm @@ -21,3 +21,6 @@ GLOBAL_DATUM_INIT(universe, /datum/universal_state, new) GLOBAL_LIST_INIT(full_alphabet, list("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z")) GLOBAL_LIST_EMPTY(meteor_list) + +/// List of all /datum/reagent datums indexed by reagent path. Used by chemistry stuff +GLOBAL_LIST(chemical_reagents_list) diff --git a/code/modules/clothing/masks/chewable.dm b/code/modules/clothing/masks/chewable.dm index 8b598417b89..62e6d8df912 100644 --- a/code/modules/clothing/masks/chewable.dm +++ b/code/modules/clothing/masks/chewable.dm @@ -97,7 +97,7 @@ obj/item/clothing/mask/chewable/Destroy() type_butt = /obj/item/trash/cigbutt/spitgum /obj/item/clothing/mask/chewable/tobacco/nico/New() ..() - reagents.add_reagent(/datum/reagent/medicine/fluff/nicotine, 2) + reagents.add_reagent(/datum/reagent/nicotine, 2) color = reagents.get_color() /obj/item/clothing/mask/chewable/candy diff --git a/code/modules/hydroponics/seed_datums.dm b/code/modules/hydroponics/seed_datums.dm index 65c80629f5f..2cfb6e97b7c 100644 --- a/code/modules/hydroponics/seed_datums.dm +++ b/code/modules/hydroponics/seed_datums.dm @@ -1211,7 +1211,7 @@ name = "puretobacco" seed_name = "succulent tobacco" display_name = "succulent tobacco leaves" - chems = list(/datum/reagent/medicine/fluff/nicotine = list(1,10)) + chems = list(/datum/reagent/nicotine = list(1,10)) /datum/seed/tobacco/puretobacco/New() ..() diff --git a/code/modules/reagents/Chemistry-Holder.dm b/code/modules/reagents/Chemistry-Holder.dm index 6c5d1e0d07f..24344a2b45b 100644 --- a/code/modules/reagents/Chemistry-Holder.dm +++ b/code/modules/reagents/Chemistry-Holder.dm @@ -10,6 +10,8 @@ GLOBAL_DATUM_INIT(temp_reagents_holder, /obj, new) if(!istype(my_atom)) CRASH("Invalid reagents holder: [log_info_line(my_atom)]") ..() + if(!GLOB.chemical_reagents_list) + build_chemical_reagent_list() src.my_atom = my_atom src.maximum_volume = maximum_volume @@ -488,3 +490,27 @@ GLOBAL_DATUM_INIT(temp_reagents_holder, /obj, new) else reagents = new/datum/reagents(max_vol, src) return reagents + +// Helper procs +//Chemical Reagents - Initialises all /datum/reagent into a list indexed by reagent id +/proc/build_chemical_reagent_list() + if(GLOB.chemical_reagents_list) + return + + var/paths = subtypesof(/datum/reagent) + GLOB.chemical_reagents_list = list() + + var/datum/reagents/anti_runtime = new(20000, GLOB.temp_reagents_holder) // Self-explanatory name + for(var/path in paths) + var/datum/reagent/D = new path(anti_runtime) + if(!D.name) // Those are usually master/parent types of other stuff + qdel(D) + continue + GLOB.chemical_reagents_list[path] = D + qdel(anti_runtime) + +/proc/get_chem_id(chem_name) + for(var/X in GLOB.chemical_reagents_list) + var/datum/reagent/R = GLOB.chemical_reagents_list[X] + if(ckey(chem_name) == ckey(lowertext(R.name))) + return X diff --git a/code/modules/reagents/Chemistry-Reagents.dm b/code/modules/reagents/Chemistry-Reagents.dm index 4d9c601e8cf..a2710715029 100644 --- a/code/modules/reagents/Chemistry-Reagents.dm +++ b/code/modules/reagents/Chemistry-Reagents.dm @@ -62,7 +62,7 @@ var/should_admin_log = FALSE - /// Assoc list with key type of addiction this reagent feeds, and value amount of addiction points added per unit of reagent metabolzied (which means * REM every life()) + /// Assoc list with key type of addiction this reagent feeds, and value amount of addiction points added per unit of reagent metabolzied (which means * removed every life()) var/list/addiction_types = null /datum/reagent/New(var/datum/reagents/holder) @@ -101,9 +101,6 @@ if(volume > overdose_threshold) overdose(M, alien) - for(var/addiction in addiction_types) - M.AddAddictionPoints(addiction, addiction_types[addiction] * REM) - //determine the metabolism rate var/removed = metabolism if(ingest_met && (location == CHEM_INGEST)) @@ -112,6 +109,9 @@ removed = touch_met removed = M.get_adjusted_metabolism(removed) + for(var/addiction in addiction_types) + M.AddAddictionPoints(addiction, addiction_types[addiction] * removed) + //adjust effective amounts - removed, dose, and max_dose - for mob size var/effective = removed if(!(flags & IGNORE_MOB_SIZE) && location != CHEM_TOUCH) diff --git a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Dispenser.dm b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Dispenser.dm index 809836d9fca..6d5b5e7babe 100644 --- a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Dispenser.dm +++ b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Dispenser.dm @@ -122,7 +122,7 @@ value = DISPENSER_REAGENT_VALUE /datum/reagent/ethanol/New() - addiction_types = list(/datum/addiction/alcohol = max(0.5, 15 / strength)) // Higher strength is somehow weaker, go figure + addiction_types = list(/datum/addiction/alcohol = max(0.5, 50 / strength)) // Higher strength is somehow weaker, go figure return ..() /datum/reagent/ethanol/touch_mob(var/mob/living/L, var/amount) diff --git a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Other.dm b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Other.dm index d1dbefa288e..1c028b70d13 100644 --- a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Other.dm +++ b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Other.dm @@ -728,20 +728,24 @@ reagent_state = LIQUID color = COLOR_YELLOW value = 50 - addiction_types = list(/datum/addiction/gottheit = 200) // Near instant addiction + metabolism = 0.1 + addiction_types = list(/datum/addiction/gottheit = 600) // Near instant addiction -/datum/reagent/gottheit/affect_blood(mob/living/carbon/M, alien, removed) +/datum/reagent/gottheit/affect_blood(mob/living/carbon/human/M, alien, removed) if(alien == IS_DIONA) return // Heal all conventional damage types M.adjustCloneLoss(-40 * removed) - M.adjustOxyLoss(-10 * removed) - M.heal_organ_damage(40 * removed, 40 * removed) - M.adjustToxLoss(-40 * removed) + M.adjustOxyLoss(-40 * removed) + M.heal_organ_damage(80 * removed, 80 * removed) + M.adjustToxLoss(-80 * removed) + + // Restore blood + M.regenerate_blood(8 * removed) // Some useful chem effects, including painkilling - M.add_chemical_effect(CE_PAINKILLER, 200) + M.add_chemical_effect(CE_PAINKILLER, 400) M.add_chemical_effect(CE_SPEEDBOOST, 1) // Reduce bad effects @@ -760,6 +764,8 @@ if(ishuman(M)) var/mob/living/carbon/human/H = M for(var/obj/item/organ/internal/I in H.internal_organs) + if((I.status & ORGAN_DEAD) && prob(25)) + I.revive() if(!BP_IS_ROBOTIC(I)) I.heal_damage(20 * removed) for(var/obj/item/organ/external/E in H.organs) @@ -772,7 +778,7 @@ if(E.status & ORGAN_BROKEN) E.status &= ~ORGAN_BROKEN if(E.status & ORGAN_DEAD) - E.status &= ~ORGAN_DEAD + E.revive() // Remove all diseases for(var/datum/disease/D in M.diseases) diff --git a/code/modules/reagents/Chemistry-Reagents/medicines/medicines_fluff.dm b/code/modules/reagents/Chemistry-Reagents/medicines/medicines_fluff.dm index 5c444611e51..6bf6106d4b9 100644 --- a/code/modules/reagents/Chemistry-Reagents/medicines/medicines_fluff.dm +++ b/code/modules/reagents/Chemistry-Reagents/medicines/medicines_fluff.dm @@ -1,5 +1,3 @@ -#define ANTIDEPRESSANT_MESSAGE_DELAY 5 MINUTES - // Reagents in this file should have little to no mechanical effect, and instead be focused on roleplay! /datum/reagent/medicine/fluff @@ -86,34 +84,6 @@ M.add_chemical_effect(CE_ANTIVIRAL, 1) - -// We classify nicotine and tobacco as a medicine for ease of coding, and because we can't simulate lung cancer after several years of use. -/datum/reagent/medicine/fluff/nicotine - name = "Nicotine" - description = "A sickly yellow liquid sourced from tobacco leaves. Stimulates and relaxes the mind and body." - taste_description = "peppery bitterness" - color = "#efebaa" - overdose = REAGENTS_OVERDOSE / 6 - data = 0 - value = 2 - -/datum/reagent/medicine/fluff/nicotine/affect_blood(mob/living/carbon/M, alien, removed) - if (alien == IS_DIONA) - return - if (prob(volume * 20)) - M.add_chemical_effect(CE_PULSE, 1) - if (volume <= 0.02 && M.chem_doses[type] >= 0.05 && world.time > data + ANTIDEPRESSANT_MESSAGE_DELAY * 0.3) - data = world.time - to_chat(M, SPAN_WARNING("You feel antsy, your concentration wavers...")) - else - if (world.time > data + ANTIDEPRESSANT_MESSAGE_DELAY * 0.3) - data = world.time - to_chat(M, SPAN_NOTICE("You feel invigorated and calm.")) - -/datum/reagent/medicine/fluff/nicotine/overdose(mob/living/carbon/M, alien) - ..() - M.add_chemical_effect(CE_PULSE, 2) - /datum/reagent/medicine/fluff/tobacco name = "Tobacco" description = "Cut and processed tobacco leaves." @@ -130,7 +100,7 @@ /datum/reagent/medicine/fluff/tobacco/affect_blood(mob/living/carbon/M, alien, removed) ..() - M.reagents.add_reagent(/datum/reagent/medicine/fluff/nicotine, nicotine_ratio) + M.reagents.add_reagent(/datum/reagent/nicotine, nicotine_ratio) /datum/reagent/medicine/fluff/tobacco/fine name = "Fine Tobacco" @@ -171,5 +141,3 @@ if (world.time > data + ANTIDEPRESSANT_MESSAGE_DELAY * 0.35) data = world.time to_chat(M, SPAN_NOTICE("You feel faintly sore in the throat.")) - -#undef ANTIDEPRESSANT_MESSAGE_DELAY diff --git a/code/modules/reagents/Chemistry-Reagents/medicines/medicines_misc.dm b/code/modules/reagents/Chemistry-Reagents/medicines/medicines_misc.dm index ac936df7951..d0af5f918fb 100644 --- a/code/modules/reagents/Chemistry-Reagents/medicines/medicines_misc.dm +++ b/code/modules/reagents/Chemistry-Reagents/medicines/medicines_misc.dm @@ -34,8 +34,65 @@ if(istype(R, /datum/reagent/ethanol)) M.chem_doses[R.type] = max(M.chem_doses[R.type] - removed * 5, 0) // Helps with alcohol addiction slightly - M.RemoveAddictionPoints(/datum/addiction/alcohol, removed * 3) + M.RemoveAddictionPoints(/datum/addiction/alcohol, removed * 5) +/datum/reagent/medicine/naltrexone + name = "Naltrexone" + description = "A medication primarily used to manage alcohol, opioid and other minor drug addictions. Should not be taken in cases of liver damage." + reagent_state = LIQUID + color = "#f0e962" + value = 3.1 + /// List of addiction type paths and amount of points it will remove from them per unit + var/list/affected_addictions = list( + /datum/addiction/alcohol = 3, + /datum/addiction/opiate = 3, + /datum/addiction/hallucinogens = 3, + ) + +/datum/reagent/medicine/naltrexone/affect_blood(mob/living/carbon/M, alien, removed) + if(alien == IS_DIONA) + return + + // Side effects + if(prob(15)) + M.dizziness = clamp(M.dizziness + 15, M.dizziness, 50) + if(prob(15)) + M.confused = clamp(M.confused + 15, M.confused, 50) + // With liver damage, it will worsen it + var/obj/item/organ/internal/liver/L = M.internal_organs_by_name[BP_LIVER] + if(istype(L) && L.damage >= 5) + L.take_general_damage(min(2, L.damage * 0.1)) + // At small doses, acts as minor painkiller + if(volume <= 5) + M.add_chemical_effect(CE_PAINKILLER, 10) + // Helps with various addictions + for(var/addiction_type in affected_addictions) + M.RemoveAddictionPoints(addiction_type, removed * affected_addictions[addiction_type]) + +/datum/reagent/medicine/varenicline + name = "Varenicline" + description = "A medication used for smoking cessation and for the treatment of blurry vision." + reagent_state = LIQUID + color = "#c0e1ed" + value = 3.1 + +/datum/reagent/medicine/varenicline/affect_blood(mob/living/carbon/M, alien, removed) + if(alien == IS_DIONA) + return + + // Side effects + if(prob(15)) + M.druggy = clamp(M.druggy + 15, M.druggy, 50) + if(prob(1) && ishuman(M)) + var/mob/living/carbon/human/H = M + H.vomit() + // Fluff messages + if(prob(3)) + to_chat(M, SPAN_WARNING("Your head hurts!")) + // Slightly helps fix blurry vision + M.eye_blurry = max(M.eye_blurry - 2, 0) + // Helps with nicotine addiction + M.RemoveAddictionPoints(/datum/addiction/nicotine, removed * 5) /datum/reagent/medicine/imidazoline name = "Imidazoline" diff --git a/code/modules/reagents/Chemistry-Reagents/medicines/medicines_painkillers.dm b/code/modules/reagents/Chemistry-Reagents/medicines/medicines_painkillers.dm index e955a6ab683..bb87b27585e 100644 --- a/code/modules/reagents/Chemistry-Reagents/medicines/medicines_painkillers.dm +++ b/code/modules/reagents/Chemistry-Reagents/medicines/medicines_painkillers.dm @@ -16,7 +16,7 @@ /datum/reagent/medicine/painkiller/New() if(is_opiate) - addiction_types = list(/datum/addiction/opiate = max(0.5, 0.025 * target_painkiller_strength)) + addiction_types = list(/datum/addiction/opiate = max(0.5, 0.15 * target_painkiller_strength)) return ..() /datum/reagent/medicine/painkiller/affect_blood(mob/living/carbon/M, alien, removed) diff --git a/code/modules/reagents/Chemistry-Reagents/toxins/toxins_drugs.dm b/code/modules/reagents/Chemistry-Reagents/toxins/toxins_drugs.dm index f9ae0879d22..e3359453261 100644 --- a/code/modules/reagents/Chemistry-Reagents/toxins/toxins_drugs.dm +++ b/code/modules/reagents/Chemistry-Reagents/toxins/toxins_drugs.dm @@ -13,7 +13,7 @@ overdose = REAGENTS_OVERDOSE value = 2.8 should_admin_log = TRUE - addiction_types = list(/datum/addiction/hallucinogens = 2) + addiction_types = list(/datum/addiction/hallucinogens = 4) /datum/reagent/space_drugs/affect_blood(mob/living/carbon/M, alien, removed) if (alien == IS_DIONA) @@ -31,7 +31,36 @@ M.emote(pick("twitch", "drool", "moan", "giggle")) M.add_chemical_effect(CE_PULSE, -1) +/datum/reagent/nicotine + name = "Nicotine" + description = "A sickly yellow liquid sourced from tobacco leaves. Stimulates and relaxes the mind and body." + taste_description = "peppery bitterness" + color = "#efebaa" + overdose = REAGENTS_OVERDOSE / 6 + data = 0 + value = 2 + addiction_types = list(/datum/addiction/nicotine = 10) + +/datum/reagent/nicotine/affect_blood(mob/living/carbon/M, alien, removed) + if (alien == IS_DIONA) + return + if (prob(volume * 20)) + M.add_chemical_effect(CE_PULSE, 1) + if (volume <= 0.02 && M.chem_doses[type] >= 0.05 && world.time > data + ANTIDEPRESSANT_MESSAGE_DELAY * 0.3) + data = world.time + to_chat(M, SPAN_WARNING("You feel antsy, your concentration wavers...")) + else + if (world.time > data + ANTIDEPRESSANT_MESSAGE_DELAY * 0.3) + data = world.time + to_chat(M, SPAN_NOTICE("You feel invigorated and calm.")) +/datum/reagent/nicotine/overdose(mob/living/carbon/M, alien) + ..() + M.add_chemical_effect(CE_PULSE, 2) + var/obj/item/organ/internal/lungs/L = M.internal_organs_by_name[BP_LUNGS] + if(istype(L) && !L.is_bruised(L)) + var/lung_damage = min(0.2, L.min_broken_damage - L.damage) + L.take_general_damage(lung_damage) /datum/reagent/serotrotium name = "Serotrotium" @@ -42,7 +71,7 @@ metabolism = REM * 0.25 overdose = REAGENTS_OVERDOSE value = 2.5 - addiction_types = list(/datum/addiction/hallucinogens = 2) + addiction_types = list(/datum/addiction/hallucinogens = 4) /datum/reagent/serotrotium/affect_blood(mob/living/carbon/M, alien, removed) if(alien == IS_DIONA) @@ -66,7 +95,7 @@ overdose = REAGENTS_OVERDOSE value = 0.6 should_admin_log = TRUE - addiction_types = list(/datum/addiction/hallucinogens = 5) + addiction_types = list(/datum/addiction/hallucinogens = 10) /datum/reagent/mindbreaker_toxin/affect_blood(mob/living/carbon/M, alien, removed) if (alien == IS_DIONA) @@ -136,7 +165,7 @@ metabolism = REM overdose = 25 should_admin_log = TRUE - addiction_types = list(/datum/addiction/psionics = 5) + addiction_types = list(/datum/addiction/psionics = 40) // M A X I M U M C H E E S E var/global/list/dose_messages = list( @@ -206,7 +235,7 @@ color = "#d0ff00" metabolism = 1 overdose = 5 - addiction_types = list(/datum/addiction/psionics = 20) // You usually only take small amount + addiction_types = list(/datum/addiction/psionics = 100) // You usually only take small amount var/global/list/dose_messages = list( "Your name is called. It is your time.", @@ -252,7 +281,7 @@ description = "A somewhat expensive hallucinogenic drug used by psionic users to either get high or keep addictions in check. Has several benefits, but it is still addictive." reagent_state = LIQUID color = "#d5f29d" - addiction_types = list(/datum/addiction/psionics = 2, /datum/addiction/hallucinogens = 1) + addiction_types = list(/datum/addiction/psionics = 4, /datum/addiction/hallucinogens = 2) /datum/reagent/mensvir/affect_blood(mob/living/carbon/M, alien, removed) if(!M.psi) // Sorry, elitist drug diff --git a/code/modules/reagents/Chemistry-Recipes.dm b/code/modules/reagents/Chemistry-Recipes.dm index 1113d34482b..52b9167b972 100644 --- a/code/modules/reagents/Chemistry-Recipes.dm +++ b/code/modules/reagents/Chemistry-Recipes.dm @@ -333,6 +333,18 @@ required_reagents = list(/datum/reagent/acetone = 1, /datum/reagent/medicine/dylovene = 1, /datum/reagent/carbon = 1) result_amount = 3 +/datum/chemical_reaction/naltrexone + name = "Naltrexone" + result = /datum/reagent/medicine/naltrexone + required_reagents = list(/datum/reagent/medicine/fluff/methylphenidate = 1, /datum/reagent/sugar = 1, /datum/reagent/carbon = 1) + result_amount = 3 + +/datum/chemical_reaction/varenicline + name = "Varenicline" + result = /datum/reagent/medicine/varenicline + required_reagents = list(/datum/reagent/acetone = 1, /datum/reagent/phosphorus = 1, /datum/reagent/sodium = 1) + result_amount = 3 + /datum/chemical_reaction/soporific name = "Soporific" result = /datum/reagent/soporific diff --git a/code/modules/reagents/addiction/_addiction.dm b/code/modules/reagents/addiction/_addiction.dm index 7d9eeaafff0..cf02022c590 100644 --- a/code/modules/reagents/addiction/_addiction.dm +++ b/code/modules/reagents/addiction/_addiction.dm @@ -10,6 +10,8 @@ var/list/withdrawal_stage_messages = list() /// Rates at which you lose addiction (in units/second) if you are not on the drug at that time per stage var/addiction_loss_per_stage = list(0.5, 0.5, 1, 1.5) + /// Amount of drugs you need in your system to be satisfied + var/addiction_relief_treshold = MIN_ADDICTION_REAGENT_AMOUNT /// Called when you gain addiction points somehow. Takes a carbon mob as argument and sees if you gained the addiction /datum/addiction/proc/OnGainAddictionPoints(mob/living/carbon/victim) @@ -42,9 +44,10 @@ /datum/addiction/proc/ProcessAddiction(mob/living/carbon/victim, delta_time = 2) var/current_addiction_cycle = LAZYACCESS(victim.active_addictions, type) // If this is null, we're not addicted - for(var/datum/reagent/possible_drug as anything in victim.reagents.reagent_list) // Go through the drugs in our system - for(var/addiction in possible_drug.addiction_types) // And check all of their addiction types - if(addiction == type && possible_drug.volume >= MIN_ADDICTION_REAGENT_AMOUNT) // If one of them matches, and we have enough of it in our system, we're not losing addiction + for(var/drug_type in victim.chem_doses) // Go through the drugs in our system + var/datum/reagent/R = GLOB.chemical_reagents_list[drug_type] + for(var/addiction in R.addiction_types) // And check all of their addiction types + if(addiction == type && victim.chem_doses[drug_type] >= addiction_relief_treshold) // If one of them matches, and we have enough of it in our system, we're not losing addiction if(current_addiction_cycle) LAZYSET(victim.active_addictions, type, 1) // Keeps withdrawal inactive for a while return diff --git a/code/modules/reagents/addiction/alcohol.dm b/code/modules/reagents/addiction/alcohol.dm index 55400718694..42d08203639 100644 --- a/code/modules/reagents/addiction/alcohol.dm +++ b/code/modules/reagents/addiction/alcohol.dm @@ -1,6 +1,6 @@ /// Alcohol /datum/addiction/alcohol - name = "alcohol" + name = "Alcohol" withdrawal_stage_messages = list("I could use a drink...", "Maybe the bar is still open?..", "God I need a drink!") /datum/addiction/alcohol/WithdrawalStage1Process(mob/living/carbon/victim, delta_time) diff --git a/code/modules/reagents/addiction/gottheit.dm b/code/modules/reagents/addiction/gottheit.dm index 45762f51f45..b551c880ad2 100644 --- a/code/modules/reagents/addiction/gottheit.dm +++ b/code/modules/reagents/addiction/gottheit.dm @@ -1,8 +1,12 @@ // Gottheit // Essentially makes you fall apart if you got addicted to it. /datum/addiction/gottheit - name = "gottheit" + name = "Gottheit" withdrawal_stage_messages = list("I need to feel it again...", "The gottheit... The divine essense... I NEED IT NOW!!", "I AM ABOUT TO DIE, I NEED GOTTHEIT!!!") + // Might as well make sure you don't die if you have enough of it + addiction_relief_treshold = 0.1 + // You are in for a long ride, until you reach the final withdrawal stage, that is + addiction_loss_per_stage = list(0, 0.25, 0.5, 3) /datum/addiction/gottheit/WithdrawalStage1Process(mob/living/carbon/victim, delta_time) . = ..() diff --git a/code/modules/reagents/addiction/nicotine.dm b/code/modules/reagents/addiction/nicotine.dm new file mode 100644 index 00000000000..17495050f59 --- /dev/null +++ b/code/modules/reagents/addiction/nicotine.dm @@ -0,0 +1,23 @@ +/// Nicotine +/datum/addiction/nicotine + name = "Nicotine" + withdrawal_stage_messages = list("Feel like having a smoke...", "Getting antsy. Really need a smoke now.", "I can't take it! Need a smoke NOW!") + // Since we get it from cigarettes, which inject it very slowly + addiction_relief_treshold = 0.02 + +/datum/addiction/nicotine/WithdrawalStage1Process(mob/living/carbon/victim, delta_time) + . = ..() + if(prob(20)) + victim.jitteriness = clamp(victim.jitteriness + 5 * delta_time, victim.jitteriness, 10) + +/datum/addiction/nicotine/WithdrawalStage2Process(mob/living/carbon/victim, delta_time) + . = ..() + victim.jitteriness = clamp(victim.jitteriness + 5 * delta_time, victim.jitteriness, 20) + if(prob(7)) + victim.emote("cough") + +/datum/addiction/nicotine/WithdrawalStage3Process(mob/living/carbon/victim, delta_time) + . = ..() + victim.jitteriness = clamp(victim.jitteriness + 10 * delta_time, victim.jitteriness, 100) + if(prob(15)) + victim.emote("cough") diff --git a/code/modules/reagents/addiction/opiate.dm b/code/modules/reagents/addiction/opiate.dm index 4c452169011..025c052572c 100644 --- a/code/modules/reagents/addiction/opiate.dm +++ b/code/modules/reagents/addiction/opiate.dm @@ -1,6 +1,6 @@ /// Opiates /datum/addiction/opiate - name = "opiate" + name = "Opiates" withdrawal_stage_messages = list("I feel aches in my bodies..", "I need some pain relief...", "It aches all over...I need some opiates!") /datum/addiction/opiate/WithdrawalStage1Process(mob/living/carbon/victim, delta_time) diff --git a/code/modules/reagents/addiction/psionics.dm b/code/modules/reagents/addiction/psionics.dm index 8854ffcdcb2..06df4eb6588 100644 --- a/code/modules/reagents/addiction/psionics.dm +++ b/code/modules/reagents/addiction/psionics.dm @@ -1,6 +1,6 @@ // Psionics /datum/addiction/psionics - name = "psionics" + name = "Psionics" withdrawal_stage_messages = list("My mind aches.", "My mind wants more power...", "My head will explode! I need more power!") /datum/addiction/psionics/WithdrawalStage1Process(mob/living/carbon/victim, delta_time) @@ -12,19 +12,22 @@ /datum/addiction/psionics/WithdrawalStage2Process(mob/living/carbon/victim, delta_time) . = ..() if(victim.psi && victim.psi.stamina > 5) - victim.psi.spend_power(1 * delta_time) - victim.adjustBrainLoss(1 * delta_time) + victim.psi.stamina -= 1 * delta_time + if(victim.getBrainLoss() < 120) + victim.adjustBrainLoss(1 * delta_time) victim.hallucination(10, 50) /datum/addiction/psionics/WithdrawalStage3Process(mob/living/carbon/victim, delta_time) . = ..() if(victim.psi && victim.psi.stamina > 5) - victim.psi.spend_power(2 * delta_time) - victim.adjustBrainLoss(2 * delta_time) + victim.psi.stamina -= 2 * delta_time + if(victim.getBrainLoss() < 180) // This alone won't kill you, hopefuly + victim.adjustBrainLoss(2 * delta_time) victim.hallucination(30, 100) /datum/addiction/psionics/LoseAddiction(mob/living/carbon/victim) // BLAST THEM!!! if(victim.psi) + victim.psi.suppressed = FALSE // Have to make it unsupressed for this victim.psi.spend_power(victim.psi.stamina) return ..()