mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 20:48:56 +01:00
[MIRROR] Addiction rework (#3445)
* Addiction rework * a Co-authored-by: Qustinnus <Floydje123@hotmail.com> Co-authored-by: Gandalf2k15 <jzo123@hotmail.com>
This commit is contained in:
co-authored by
Qustinnus
Gandalf2k15
parent
43febe3145
commit
3b85cf1430
@@ -60,10 +60,6 @@
|
||||
var/ph = CHEMICAL_NORMAL_PH
|
||||
/// unused
|
||||
var/last_tick = 1
|
||||
/// see [/datum/reagents/proc/metabolize] for usage
|
||||
var/addiction_tick = 1
|
||||
/// currently addicted reagents
|
||||
var/list/datum/reagent/addiction_list
|
||||
/// various flags, see code\__DEFINES\reagents.dm
|
||||
var/flags
|
||||
///list of reactions currently on going, this is a lazylist for optimisation
|
||||
@@ -81,7 +77,6 @@
|
||||
|
||||
/datum/reagents/Destroy()
|
||||
//We're about to delete all reagents, so lets cleanup
|
||||
addiction_list = null
|
||||
for(var/reagent in reagent_list)
|
||||
var/datum/reagent/R = reagent
|
||||
qdel(R)
|
||||
@@ -311,8 +306,6 @@
|
||||
R.on_mob_end_metabolize(my_atom)
|
||||
R.on_mob_delete(my_atom)
|
||||
|
||||
//Clear from relevant lists
|
||||
LAZYREMOVE(addiction_list, R)
|
||||
reagent_list -= R
|
||||
LAZYREMOVE(previous_reagent_list, R.type)
|
||||
qdel(R)
|
||||
@@ -664,45 +657,13 @@
|
||||
R.overdosed = TRUE
|
||||
need_mob_update += R.overdose_start(C)
|
||||
log_game("[key_name(C)] has started overdosing on [R.name] at [R.volume] units.")
|
||||
var/is_addicted_to = addiction_list && is_type_in_list(R, addiction_list)
|
||||
if(R.addiction_threshold)
|
||||
if(R.volume >= R.addiction_threshold && !is_addicted_to)
|
||||
var/datum/reagent/new_reagent = new R.addiction_type()
|
||||
LAZYADD(addiction_list, new_reagent)
|
||||
is_addicted_to = TRUE
|
||||
log_game("[key_name(C)] has become addicted to [R.name] at [R.volume] units.")
|
||||
for(var/addiction in R.addiction_types)
|
||||
C.mind?.add_addiction_points(addiction, R.addiction_types[addiction] * REAGENTS_METABOLISM)
|
||||
|
||||
if(R.overdosed)
|
||||
need_mob_update += R.overdose_process(C)
|
||||
var/datum/reagent/addiction_type = new R.addiction_type()
|
||||
if(is_addicted_to)
|
||||
for(var/addiction in addiction_list)
|
||||
var/datum/reagent/A = addiction
|
||||
if(istype(addiction_type, A))
|
||||
A.addiction_stage = -15 // you're satisfied for a good while.
|
||||
need_mob_update += R.on_mob_life(C)
|
||||
|
||||
if(can_overdose)
|
||||
if(addiction_tick == 6)
|
||||
addiction_tick = 1
|
||||
for(var/addiction in addiction_list)
|
||||
var/datum/reagent/R = addiction
|
||||
if(!C)
|
||||
break
|
||||
R.addiction_stage++
|
||||
switch(R.addiction_stage)
|
||||
if(1 to 10)
|
||||
need_mob_update += R.addiction_act_stage1(C)
|
||||
if(10 to 20)
|
||||
need_mob_update += R.addiction_act_stage2(C)
|
||||
if(20 to 30)
|
||||
need_mob_update += R.addiction_act_stage3(C)
|
||||
if(30 to 40)
|
||||
need_mob_update += R.addiction_act_stage4(C)
|
||||
if(40 to INFINITY)
|
||||
remove_addiction(R)
|
||||
else
|
||||
SEND_SIGNAL(C, COMSIG_CLEAR_MOOD_EVENT, "[R.type]_overdose")
|
||||
addiction_tick++
|
||||
need_mob_update += R.on_mob_life(C)
|
||||
if(C && need_mob_update) //some of the metabolized reagents had effects on the mob that requires some updates.
|
||||
C.updatehealth()
|
||||
C.update_stamina()
|
||||
@@ -723,14 +684,6 @@
|
||||
R.metabolizing = FALSE
|
||||
R.on_mob_end_metabolize(C)
|
||||
|
||||
/// Removes addiction to a specific reagent on [/datum/reagents/var/my_atom]
|
||||
/datum/reagents/proc/remove_addiction(datum/reagent/R)
|
||||
to_chat(my_atom, "<span class='notice'>You feel like you've gotten over your need for [R.name].</span>")
|
||||
SEND_SIGNAL(my_atom, COMSIG_CLEAR_MOOD_EVENT, "[R.type]_overdose")
|
||||
LAZYREMOVE(addiction_list, R)
|
||||
qdel(R)
|
||||
|
||||
|
||||
/**
|
||||
* Calls [/datum/reagent/proc/on_move] on every reagent in this holder
|
||||
*
|
||||
|
||||
@@ -157,7 +157,7 @@
|
||||
if(cont.reagents.is_reacting)
|
||||
out_message += "<span class='warning'>A reaction appears to be occuring currently.<span class='notice'>\n"
|
||||
for(var/datum/reagent/R in cont.reagents.reagent_list)
|
||||
out_message += "<b>[round(R.volume, 0.01)]u of [R.name]</b>, <b>Purity:</b> [round(R.purity, 0.01)], [(scanmode?"[(R.overdose_threshold?"<b>Overdose:</b> [R.overdose_threshold]u, ":"")][(R.addiction_threshold?"<b>Addiction:</b> [R.addiction_threshold]u, ":"")]<b>Base pH:</b> [initial(R.ph)], <b>Current pH:</b> [R.ph].":"<b>Current pH:</b> [R.ph].")]\n"
|
||||
out_message += "<b>[round(R.volume, 0.01)]u of [R.name]</b>, <b>Purity:</b> [round(R.purity, 0.01)], [(scanmode?"[(R.overdose_threshold?"<b>Overdose:</b> [R.overdose_threshold]u, ":"")]<b>Base pH:</b> [initial(R.ph)], <b>Current pH:</b> [R.ph].":"<b>Current pH:</b> [R.ph].")]\n"
|
||||
if(scanmode)
|
||||
out_message += "<b>Analysis:</b> [R.description]\n"
|
||||
to_chat(user, "[out_message.Join()]</span>")
|
||||
|
||||
@@ -426,7 +426,7 @@
|
||||
state = "Gas"
|
||||
var/const/P = 3 //The number of seconds between life ticks
|
||||
var/T = initial(R.metabolization_rate) * (60 / P)
|
||||
analyze_vars = list("name" = initial(R.name), "state" = state, "color" = initial(R.color), "description" = initial(R.description), "metaRate" = T, "overD" = initial(R.overdose_threshold), "addicD" = initial(R.addiction_threshold), "pH" = initial(R.ph))
|
||||
analyze_vars = list("name" = initial(R.name), "state" = state, "color" = initial(R.color), "description" = initial(R.description), "metaRate" = T, "overD" = initial(R.overdose_threshold), "pH" = initial(R.ph))
|
||||
screen = "analyze"
|
||||
return TRUE
|
||||
|
||||
@@ -585,7 +585,7 @@
|
||||
for(var/e in holder.reaction_list)
|
||||
var/datum/equilibrium/E = e
|
||||
if(E.reaction.reaction_flags & REACTION_COMPETITIVE)
|
||||
continue
|
||||
continue
|
||||
for(var/result in E.reaction.required_reagents)
|
||||
var/datum/reagent/R = result
|
||||
if(R == reagent.type)
|
||||
|
||||
@@ -58,12 +58,6 @@ GLOBAL_LIST_INIT(name2reagent, build_name2reagent())
|
||||
var/overrides_metab = 0
|
||||
/// above this overdoses happen
|
||||
var/overdose_threshold = 0
|
||||
///Overrides what addiction this chemicals feeds into, allowing you to have multiple chems that treat a single addiction.
|
||||
var/addiction_type
|
||||
/// above this amount addictions start
|
||||
var/addiction_threshold = 0
|
||||
/// increases as addiction gets worse
|
||||
var/addiction_stage = 0
|
||||
/// You fucked up and this is now triggering its overdose effects, purge that shit quick.
|
||||
var/overdosed = FALSE
|
||||
///if false stops metab in liverless mobs
|
||||
@@ -91,14 +85,13 @@ GLOBAL_LIST_INIT(name2reagent, build_name2reagent())
|
||||
var/inverse_chem = /datum/reagent/impurity/toxic
|
||||
///what chem is made at the end of a reaction IF the purity is below the recipies purity_min at the END of a reaction only
|
||||
var/failed_chem = /datum/reagent/consumable/failed_reaction
|
||||
///Assoc list with key type of addiction this reagent feeds, and value amount of addiction points added per unit of reagent metabolzied (which means * REAGENTS_METABOLISM every life())
|
||||
var/list/addiction_types = null
|
||||
|
||||
/datum/reagent/New()
|
||||
SHOULD_CALL_PARENT(TRUE)
|
||||
. = ..()
|
||||
|
||||
if(!addiction_type)
|
||||
addiction_type = type
|
||||
|
||||
if(material)
|
||||
material = GET_MATERIAL_REF(material)
|
||||
|
||||
@@ -160,6 +153,7 @@ Primarily used in reagents/reaction_agents
|
||||
|
||||
/// Called when this reagent is removed while inside a mob
|
||||
/datum/reagent/proc/on_mob_delete(mob/living/L)
|
||||
SEND_SIGNAL(L, COMSIG_CLEAR_MOOD_EVENT, "[type]_overdose")
|
||||
return
|
||||
|
||||
/// Called when this reagent first starts being metabolized by a liver
|
||||
@@ -209,34 +203,6 @@ Primarily used in reagents/reaction_agents
|
||||
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "[type]_overdose", /datum/mood_event/overdose, name)
|
||||
return
|
||||
|
||||
/// Called when addiction hits stage1, see [/datum/reagents/proc/metabolize]
|
||||
/datum/reagent/proc/addiction_act_stage1(mob/living/M)
|
||||
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "[type]_overdose", /datum/mood_event/withdrawal_light, name)
|
||||
if(prob(30))
|
||||
to_chat(M, "<span class='notice'>You feel like having some [name] right about now.</span>")
|
||||
return
|
||||
|
||||
/// Called when addiction hits stage2, see [/datum/reagents/proc/metabolize]
|
||||
/datum/reagent/proc/addiction_act_stage2(mob/living/M)
|
||||
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "[type]_overdose", /datum/mood_event/withdrawal_medium, name)
|
||||
if(prob(30))
|
||||
to_chat(M, "<span class='notice'>You feel like you need [name]. You just can't get enough.</span>")
|
||||
return
|
||||
|
||||
/// Called when addiction hits stage3, see [/datum/reagents/proc/metabolize]
|
||||
/datum/reagent/proc/addiction_act_stage3(mob/living/M)
|
||||
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "[type]_overdose", /datum/mood_event/withdrawal_severe, name)
|
||||
if(prob(30))
|
||||
to_chat(M, "<span class='danger'>You have an intense craving for [name].</span>")
|
||||
return
|
||||
|
||||
/// Called when addiction hits stage4, see [/datum/reagents/proc/metabolize]
|
||||
/datum/reagent/proc/addiction_act_stage4(mob/living/M)
|
||||
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "[type]_overdose", /datum/mood_event/withdrawal_critical, name)
|
||||
if(prob(30))
|
||||
to_chat(M, "<span class='boldannounce'>You're not feeling good at all! You really need some [name].</span>")
|
||||
return
|
||||
|
||||
/**
|
||||
* New, standardized method for chemicals to affect hydroponics trays.
|
||||
* Defined on a per-chem level as opposed to by the tray.
|
||||
|
||||
@@ -36,6 +36,10 @@ All effects don't start immediately, but rather get worse over time; the rate is
|
||||
91-100: Dangerously toxic - swift death
|
||||
*/
|
||||
|
||||
/datum/reagent/consumable/ethanol/New()
|
||||
addiction_types = list(/datum/addiction/alcohol = 0.05 * boozepwr)
|
||||
return ..()
|
||||
|
||||
/datum/reagent/consumable/ethanol/on_mob_life(mob/living/carbon/C)
|
||||
if(C.drunkenness < volume * boozepwr * ALCOHOL_THRESHOLD_MODIFIER || boozepwr < 0)
|
||||
var/booze_power = boozepwr
|
||||
@@ -179,38 +183,11 @@ All effects don't start immediately, but rather get worse over time; the rate is
|
||||
name = "Kong"
|
||||
description = "Makes You Go Ape!®"
|
||||
color = "#332100" // rgb: 51, 33, 0
|
||||
addiction_threshold = 15
|
||||
taste_description = "the grip of a giant ape"
|
||||
glass_name = "glass of Kong"
|
||||
glass_desc = "Makes You Go Ape!®"
|
||||
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
|
||||
|
||||
/datum/reagent/consumable/ethanol/whiskey/kong/addiction_act_stage1(mob/living/M)
|
||||
if(prob(5))
|
||||
to_chat(M, "<span class='notice'>You've made so many mistakes.</span>")
|
||||
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "depression_minimal", /datum/mood_event/depression_minimal)
|
||||
..()
|
||||
|
||||
/datum/reagent/consumable/ethanol/whiskey/kong/addiction_act_stage2(mob/living/M)
|
||||
if(prob(5))
|
||||
to_chat(M, "<span class='notice'>No matter what you do, people will always get hurt.</span>")
|
||||
SEND_SIGNAL(M, COMSIG_CLEAR_MOOD_EVENT, "depression_minimal", /datum/mood_event/depression_minimal)
|
||||
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "depression_mild", /datum/mood_event/depression_mild)
|
||||
..()
|
||||
|
||||
/datum/reagent/consumable/ethanol/whiskey/kong/addiction_act_stage3(mob/living/M)
|
||||
if(prob(5))
|
||||
to_chat(M, "<span class='notice'>You've lost so many people.</span>")
|
||||
SEND_SIGNAL(M, COMSIG_CLEAR_MOOD_EVENT, "depression_mild", /datum/mood_event/depression_mild)
|
||||
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "depression_moderate", /datum/mood_event/depression_moderate)
|
||||
..()
|
||||
|
||||
/datum/reagent/consumable/ethanol/whiskey/kong/addiction_act_stage4(mob/living/M)
|
||||
if(prob(5))
|
||||
to_chat(M, "<span class='notice'>Just lie down and die.</span>")
|
||||
SEND_SIGNAL(M, COMSIG_CLEAR_MOOD_EVENT, "depression_moderate", /datum/mood_event/depression_moderate)
|
||||
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "depression_severe", /datum/mood_event/depression_severe)
|
||||
..()
|
||||
|
||||
/datum/reagent/consumable/ethanol/whiskey/candycorn
|
||||
name = "candy corn liquor"
|
||||
@@ -235,7 +212,6 @@ All effects don't start immediately, but rather get worse over time; the rate is
|
||||
boozepwr = 80
|
||||
quality = DRINK_GOOD
|
||||
overdose_threshold = 60
|
||||
addiction_threshold = 30
|
||||
taste_description = "jitters and death"
|
||||
glass_icon_state = "thirteen_loko_glass"
|
||||
glass_name = "glass of Thirteen Loko"
|
||||
@@ -492,6 +468,7 @@ All effects don't start immediately, but rather get worse over time; the rate is
|
||||
glass_icon_state = "glass_brown2"
|
||||
glass_name = "Hooch"
|
||||
glass_desc = "You've really hit rock bottom now... your liver packed its bags and left last night."
|
||||
addiction_types = list(/datum/addiction/alcohol = 5, /datum/addiction/maintenance_drugs = 2)
|
||||
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
|
||||
|
||||
/datum/reagent/consumable/ethanol/hooch/on_mob_life(mob/living/carbon/M)
|
||||
|
||||
@@ -1007,6 +1007,7 @@
|
||||
glass_icon_state = "lean"
|
||||
glass_name = "Lean"
|
||||
glass_desc = "A drink that makes your life less miserable."
|
||||
addiction_types = list(/datum/addiction/opiods = 6)
|
||||
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
|
||||
|
||||
/datum/reagent/consumable/lean/on_mob_life(mob/living/carbon/M)
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
overdose_threshold = 30
|
||||
ph = 9
|
||||
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
|
||||
addiction_types = list(/datum/addiction/hallucinogens = 10) //4 per 2 seconds
|
||||
|
||||
/datum/reagent/drug/space_drugs/on_mob_life(mob/living/carbon/M)
|
||||
M.set_drugginess(15)
|
||||
@@ -40,7 +41,6 @@
|
||||
description = "Slightly reduces stun times. If overdosed it will deal toxin and oxygen damage."
|
||||
reagent_state = LIQUID
|
||||
color = "#60A584" // rgb: 96, 165, 132
|
||||
addiction_threshold = 10
|
||||
taste_description = "smoke"
|
||||
trippy = FALSE
|
||||
overdose_threshold=15
|
||||
@@ -76,13 +76,13 @@
|
||||
|
||||
/datum/reagent/drug/crank
|
||||
name = "Crank"
|
||||
description = "Reduces stun times by about 200%. If overdosed or addicted it will deal significant Toxin, Brute and Brain damage."
|
||||
description = "Reduces stun times by about 200%. If overdosed it will deal significant Toxin, Brute and Brain damage."
|
||||
reagent_state = LIQUID
|
||||
color = "#FA00C8"
|
||||
overdose_threshold = 20
|
||||
addiction_threshold = 10
|
||||
ph = 10
|
||||
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
|
||||
addiction_types = list(/datum/addiction/stimulants = 14) //5.6 per 2 seconds
|
||||
|
||||
/datum/reagent/drug/crank/on_mob_life(mob/living/carbon/M)
|
||||
if(prob(5))
|
||||
@@ -96,44 +96,15 @@
|
||||
M.AdjustParalyzed(-20)
|
||||
..()
|
||||
. = 1
|
||||
|
||||
/datum/reagent/drug/crank/overdose_process(mob/living/M)
|
||||
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 2*REM)
|
||||
M.adjustToxLoss(2*REM, 0)
|
||||
M.adjustBruteLoss(2*REM, FALSE, FALSE, BODYPART_ORGANIC)
|
||||
..()
|
||||
. = 1
|
||||
|
||||
/datum/reagent/drug/crank/addiction_act_stage1(mob/living/M)
|
||||
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 5*REM)
|
||||
..()
|
||||
|
||||
/datum/reagent/drug/crank/addiction_act_stage2(mob/living/M)
|
||||
M.adjustToxLoss(5*REM, 0)
|
||||
..()
|
||||
. = 1
|
||||
|
||||
/datum/reagent/drug/crank/addiction_act_stage3(mob/living/M)
|
||||
M.adjustBruteLoss(5*REM, 0)
|
||||
..()
|
||||
. = 1
|
||||
|
||||
/datum/reagent/drug/crank/addiction_act_stage4(mob/living/M)
|
||||
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 3*REM)
|
||||
M.adjustToxLoss(5*REM, 0)
|
||||
M.adjustBruteLoss(5*REM, 0)
|
||||
..()
|
||||
. = 1
|
||||
|
||||
/datum/reagent/drug/krokodil
|
||||
name = "Krokodil"
|
||||
description = "Cools and calms you down. If overdosed it will deal significant Brain and Toxin damage. If addicted it will begin to deal fatal amounts of Brute damage as the subject's skin falls off."
|
||||
description = "Cools and calms you down. If overdosed it will deal significant Brain and Toxin damage."
|
||||
reagent_state = LIQUID
|
||||
color = "#0064B4"
|
||||
overdose_threshold = 20
|
||||
addiction_threshold = 15
|
||||
ph = 9
|
||||
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
|
||||
addiction_types = list(/datum/addiction/opiods = 18) //7.2 per 2 seconds
|
||||
|
||||
|
||||
/datum/reagent/drug/krokodil/on_mob_life(mob/living/carbon/M)
|
||||
@@ -141,6 +112,11 @@
|
||||
if(prob(5))
|
||||
to_chat(M, "<span class='notice'>[high_message]</span>")
|
||||
SEND_SIGNAL(M, COMSIG_ADD_MOOD_EVENT, "smacked out", /datum/mood_event/narcotic_heavy, name)
|
||||
if(current_cycle == 35 && creation_purity <= 0.6)
|
||||
if(!istype(M.dna.species, /datum/species/krokodil_addict))
|
||||
to_chat(M, "<span class='userdanger'>Your skin falls off easily!</span>")
|
||||
M.adjustBruteLoss(50*REM, 0) // holy shit your skin just FELL THE FUCK OFF
|
||||
M.set_species(/datum/species/krokodil_addict)
|
||||
..()
|
||||
|
||||
/datum/reagent/drug/krokodil/overdose_process(mob/living/M)
|
||||
@@ -149,34 +125,7 @@
|
||||
..()
|
||||
. = 1
|
||||
|
||||
/datum/reagent/drug/krokodil/addiction_act_stage1(mob/living/M)
|
||||
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 2*REM)
|
||||
M.adjustToxLoss(2*REM, 0)
|
||||
..()
|
||||
. = 1
|
||||
|
||||
/datum/reagent/drug/krokodil/addiction_act_stage2(mob/living/M)
|
||||
if(prob(25))
|
||||
to_chat(M, "<span class='danger'>Your skin feels loose...</span>")
|
||||
..()
|
||||
|
||||
/datum/reagent/drug/krokodil/addiction_act_stage3(mob/living/M)
|
||||
if(prob(25))
|
||||
to_chat(M, "<span class='danger'>Your skin starts to peel away...</span>")
|
||||
M.adjustBruteLoss(3*REM, 0)
|
||||
..()
|
||||
. = 1
|
||||
|
||||
/datum/reagent/drug/krokodil/addiction_act_stage4(mob/living/carbon/human/M)
|
||||
CHECK_DNA_AND_SPECIES(M)
|
||||
if(!istype(M.dna.species, /datum/species/krokodil_addict))
|
||||
to_chat(M, "<span class='userdanger'>Your skin falls off easily!</span>")
|
||||
M.adjustBruteLoss(50*REM, 0) // holy shit your skin just FELL THE FUCK OFF
|
||||
M.set_species(/datum/species/krokodil_addict)
|
||||
else
|
||||
M.adjustBruteLoss(5*REM, 0)
|
||||
..()
|
||||
. = 1
|
||||
|
||||
/datum/reagent/drug/methamphetamine
|
||||
name = "Methamphetamine"
|
||||
@@ -184,10 +133,10 @@
|
||||
reagent_state = LIQUID
|
||||
color = "#FAFAFA"
|
||||
overdose_threshold = 20
|
||||
addiction_threshold = 10
|
||||
metabolization_rate = 0.75 * REAGENTS_METABOLISM
|
||||
ph = 5
|
||||
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
|
||||
addiction_types = list(/datum/addiction/stimulants = 12) //4.8 per 2 seconds
|
||||
|
||||
/datum/reagent/drug/methamphetamine/on_mob_metabolize(mob/living/L)
|
||||
..()
|
||||
@@ -228,50 +177,14 @@
|
||||
M.adjustToxLoss(1, 0)
|
||||
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, pick(0.5, 0.6, 0.7, 0.8, 0.9, 1))
|
||||
. = 1
|
||||
|
||||
/datum/reagent/drug/methamphetamine/addiction_act_stage1(mob/living/M)
|
||||
M.Jitter(5)
|
||||
if(prob(20))
|
||||
M.emote(pick("twitch","drool","moan"))
|
||||
..()
|
||||
|
||||
/datum/reagent/drug/methamphetamine/addiction_act_stage2(mob/living/M)
|
||||
M.Jitter(10)
|
||||
M.Dizzy(10)
|
||||
if(prob(30))
|
||||
M.emote(pick("twitch","drool","moan"))
|
||||
..()
|
||||
|
||||
/datum/reagent/drug/methamphetamine/addiction_act_stage3(mob/living/M)
|
||||
if(!HAS_TRAIT(M, TRAIT_IMMOBILIZED) && !ismovable(M.loc))
|
||||
for(var/i = 0, i < 4, i++)
|
||||
step(M, pick(GLOB.cardinals))
|
||||
M.Jitter(15)
|
||||
M.Dizzy(15)
|
||||
if(prob(40))
|
||||
M.emote(pick("twitch","drool","moan"))
|
||||
..()
|
||||
|
||||
/datum/reagent/drug/methamphetamine/addiction_act_stage4(mob/living/carbon/human/M)
|
||||
if(!HAS_TRAIT(M, TRAIT_IMMOBILIZED) && !ismovable(M.loc))
|
||||
for(var/i = 0, i < 8, i++)
|
||||
step(M, pick(GLOB.cardinals))
|
||||
M.Jitter(20)
|
||||
M.Dizzy(20)
|
||||
M.adjustToxLoss(5, 0)
|
||||
if(prob(50))
|
||||
M.emote(pick("twitch","drool","moan"))
|
||||
..()
|
||||
. = 1
|
||||
|
||||
/datum/reagent/drug/bath_salts
|
||||
name = "Bath Salts"
|
||||
description = "Makes you impervious to stuns and grants a stamina regeneration buff, but you will be a nearly uncontrollable tramp-bearded raving lunatic."
|
||||
reagent_state = LIQUID
|
||||
color = "#FAFAFA"
|
||||
overdose_threshold = 20
|
||||
addiction_threshold = 10
|
||||
taste_description = "salt" // because they're bathsalts?
|
||||
addiction_types = list(/datum/addiction/stimulants = 25) //8 per 2 seconds
|
||||
var/datum/brain_trauma/special/psychotic_brawling/bath_salts/rage
|
||||
ph = 8.2
|
||||
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
|
||||
@@ -317,61 +230,13 @@
|
||||
M.drop_all_held_items()
|
||||
..()
|
||||
|
||||
/datum/reagent/drug/bath_salts/addiction_act_stage1(mob/living/M)
|
||||
M.hallucination += 10
|
||||
if(!HAS_TRAIT(M, TRAIT_IMMOBILIZED) && !ismovable(M.loc))
|
||||
for(var/i = 0, i < 8, i++)
|
||||
step(M, pick(GLOB.cardinals))
|
||||
M.Jitter(5)
|
||||
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 10)
|
||||
if(prob(20))
|
||||
M.emote(pick("twitch","drool","moan"))
|
||||
..()
|
||||
|
||||
/datum/reagent/drug/bath_salts/addiction_act_stage2(mob/living/M)
|
||||
M.hallucination += 20
|
||||
if(!HAS_TRAIT(M, TRAIT_IMMOBILIZED) && !ismovable(M.loc))
|
||||
for(var/i = 0, i < 8, i++)
|
||||
step(M, pick(GLOB.cardinals))
|
||||
M.Jitter(10)
|
||||
M.Dizzy(10)
|
||||
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 10)
|
||||
if(prob(30))
|
||||
M.emote(pick("twitch","drool","moan"))
|
||||
..()
|
||||
|
||||
/datum/reagent/drug/bath_salts/addiction_act_stage3(mob/living/M)
|
||||
M.hallucination += 30
|
||||
if(!HAS_TRAIT(M, TRAIT_IMMOBILIZED) && !ismovable(M.loc))
|
||||
for(var/i = 0, i < 12, i++)
|
||||
step(M, pick(GLOB.cardinals))
|
||||
M.Jitter(15)
|
||||
M.Dizzy(15)
|
||||
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 10)
|
||||
if(prob(40))
|
||||
M.emote(pick("twitch","drool","moan"))
|
||||
..()
|
||||
|
||||
/datum/reagent/drug/bath_salts/addiction_act_stage4(mob/living/carbon/human/M)
|
||||
M.hallucination += 30
|
||||
if(!HAS_TRAIT(M, TRAIT_IMMOBILIZED) && !ismovable(M.loc))
|
||||
for(var/i = 0, i < 16, i++)
|
||||
step(M, pick(GLOB.cardinals))
|
||||
M.Jitter(50)
|
||||
M.Dizzy(50)
|
||||
M.adjustToxLoss(5, 0)
|
||||
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 10)
|
||||
if(prob(50))
|
||||
M.emote(pick("twitch","drool","moan"))
|
||||
..()
|
||||
. = 1
|
||||
|
||||
/datum/reagent/drug/aranesp
|
||||
name = "Aranesp"
|
||||
description = "Amps you up, gets you going, and rapidly restores stamina damage. Side effects include breathlessness and toxicity."
|
||||
reagent_state = LIQUID
|
||||
color = "#78FFF0"
|
||||
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
|
||||
addiction_types = list(/datum/addiction/stimulants = 8)
|
||||
|
||||
/datum/reagent/drug/aranesp/on_mob_life(mob/living/carbon/M)
|
||||
var/high_message = pick("You feel amped up.", "You feel ready.", "You feel like you can push it to the limit.")
|
||||
@@ -390,10 +255,10 @@
|
||||
description = "Fills you with ecstasic numbness and causes minor brain damage. Highly addictive. If overdosed causes sudden mood swings."
|
||||
reagent_state = LIQUID
|
||||
color = "#EE35FF"
|
||||
addiction_threshold = 10
|
||||
overdose_threshold = 20
|
||||
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
|
||||
taste_description = "paint thinner"
|
||||
addiction_types = list(/datum/addiction/hallucinogens = 18)
|
||||
|
||||
/datum/reagent/drug/happiness/on_mob_metabolize(mob/living/L)
|
||||
..()
|
||||
@@ -430,39 +295,6 @@
|
||||
..()
|
||||
. = 1
|
||||
|
||||
/datum/reagent/drug/happiness/addiction_act_stage1(mob/living/M)// all work and no play makes jack a dull boy
|
||||
var/datum/component/mood/mood = M.GetComponent(/datum/component/mood)
|
||||
mood?.setSanity(min(mood.sanity, SANITY_DISTURBED))
|
||||
M.Jitter(5)
|
||||
if(prob(20))
|
||||
M.emote(pick("twitch","laugh","frown"))
|
||||
..()
|
||||
|
||||
/datum/reagent/drug/happiness/addiction_act_stage2(mob/living/M)
|
||||
var/datum/component/mood/mood = M.GetComponent(/datum/component/mood)
|
||||
mood?.setSanity(min(mood.sanity, SANITY_UNSTABLE))
|
||||
M.Jitter(10)
|
||||
if(prob(30))
|
||||
M.emote(pick("twitch","laugh","frown"))
|
||||
..()
|
||||
|
||||
/datum/reagent/drug/happiness/addiction_act_stage3(mob/living/M)
|
||||
var/datum/component/mood/mood = M.GetComponent(/datum/component/mood)
|
||||
mood?.setSanity(min(mood.sanity, SANITY_CRAZY))
|
||||
M.Jitter(15)
|
||||
if(prob(40))
|
||||
M.emote(pick("twitch","laugh","frown"))
|
||||
..()
|
||||
|
||||
/datum/reagent/drug/happiness/addiction_act_stage4(mob/living/carbon/human/M)
|
||||
var/datum/component/mood/mood = M.GetComponent(/datum/component/mood)
|
||||
mood?.setSanity(SANITY_INSANE)
|
||||
M.Jitter(20)
|
||||
if(prob(50))
|
||||
M.emote(pick("twitch","laugh","frown"))
|
||||
..()
|
||||
. = 1
|
||||
|
||||
/datum/reagent/drug/pumpup
|
||||
name = "Pump-Up"
|
||||
description = "Take on the world! A fast acting, hard hitting drug that pushes the limit on what you can handle."
|
||||
@@ -471,6 +303,7 @@
|
||||
metabolization_rate = 2 * REAGENTS_METABOLISM
|
||||
overdose_threshold = 30
|
||||
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
|
||||
addiction_types = list(/datum/addiction/stimulants = 6) //2.6 per 2 seconds
|
||||
|
||||
/datum/reagent/drug/pumpup/on_mob_metabolize(mob/living/L)
|
||||
..()
|
||||
@@ -509,35 +342,7 @@
|
||||
|
||||
/datum/reagent/drug/maint
|
||||
name = "Maintenance Drugs"
|
||||
addiction_type = /datum/reagent/drug/maint
|
||||
|
||||
/datum/reagent/drug/maint/addiction_act_stage1(mob/living/M)
|
||||
. = ..()
|
||||
M.Jitter(1)
|
||||
|
||||
/datum/reagent/drug/maint/addiction_act_stage2(mob/living/M)
|
||||
. = ..()
|
||||
M.Jitter(2)
|
||||
if(prob(15))
|
||||
M.emote(pick("twitch","drool"))
|
||||
|
||||
/datum/reagent/drug/maint/addiction_act_stage3(mob/living/M)
|
||||
. = ..()
|
||||
M.Jitter(1)
|
||||
M.adjustToxLoss(2)
|
||||
if(prob(5))
|
||||
M.drop_all_held_items()
|
||||
if(prob(15))
|
||||
M.emote(pick("twitch","drool"))
|
||||
|
||||
/datum/reagent/drug/maint/addiction_act_stage4(mob/living/M)
|
||||
. = ..()
|
||||
M.Jitter(2)
|
||||
M.adjustToxLoss(3)
|
||||
if(prob(10))
|
||||
M.drop_all_held_items()
|
||||
if(prob(30))
|
||||
M.emote(pick("twitch","drool"))
|
||||
chemical_flags = NONE
|
||||
|
||||
/datum/reagent/drug/maint/powder
|
||||
name = "Maintenance Powder"
|
||||
@@ -546,8 +351,9 @@
|
||||
color = "#ffffff"
|
||||
metabolization_rate = 0.5 * REAGENTS_METABOLISM
|
||||
overdose_threshold = 15
|
||||
addiction_threshold = 6
|
||||
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
|
||||
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
|
||||
addiction_types = list(/datum/addiction/maintenance_drugs = 14)
|
||||
|
||||
/datum/reagent/drug/maint/powder/on_mob_life(mob/living/carbon/M)
|
||||
. = ..()
|
||||
@@ -573,8 +379,8 @@
|
||||
color = "#203d2c"
|
||||
metabolization_rate = 2 * REAGENTS_METABOLISM
|
||||
overdose_threshold = 25
|
||||
addiction_threshold = 10
|
||||
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
|
||||
addiction_types = list(/datum/addiction/maintenance_drugs = 8)
|
||||
|
||||
/datum/reagent/drug/maint/sludge/on_mob_metabolize(mob/living/L)
|
||||
|
||||
@@ -606,8 +412,8 @@
|
||||
reagent_state = LIQUID
|
||||
color = "#000000"
|
||||
overdose_threshold = 30
|
||||
addiction_threshold = 10
|
||||
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
|
||||
addiction_types = list(/datum/addiction/maintenance_drugs = 5)
|
||||
|
||||
/datum/reagent/drug/maint/tar/on_mob_life(mob/living/carbon/M)
|
||||
. = ..()
|
||||
|
||||
@@ -419,6 +419,7 @@
|
||||
taste_description = "mushroom"
|
||||
ph = 11
|
||||
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
|
||||
addiction_types = list(/datum/addiction/hallucinogens = 12)
|
||||
|
||||
/datum/reagent/drug/mushroomhallucinogen/on_mob_life(mob/living/carbon/M)
|
||||
if(!M.slurring)
|
||||
|
||||
@@ -510,9 +510,9 @@
|
||||
color = "#D2FFFA"
|
||||
metabolization_rate = 0.5 * REAGENTS_METABOLISM
|
||||
overdose_threshold = 30
|
||||
addiction_threshold = 25
|
||||
ph = 12
|
||||
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
|
||||
addiction_types = list(/datum/addiction/stimulants = 4) //1.6 per 2 seconds
|
||||
|
||||
/datum/reagent/medicine/ephedrine/on_mob_metabolize(mob/living/L)
|
||||
..()
|
||||
@@ -552,53 +552,7 @@
|
||||
. = 1
|
||||
return TRUE
|
||||
|
||||
/datum/reagent/medicine/ephedrine/addiction_act_stage1(mob/living/M)
|
||||
if(prob(3) && iscarbon(M))
|
||||
M.visible_message("<span class='danger'>[M] starts having a seizure!</span>", "<span class='userdanger'>You have a seizure!</span>")
|
||||
M.Unconscious(100)
|
||||
M.Jitter(350)
|
||||
|
||||
if(prob(33))
|
||||
M.adjustToxLoss(2*REM, 0)
|
||||
M.losebreath += 2
|
||||
. = 1
|
||||
..()
|
||||
|
||||
/datum/reagent/medicine/ephedrine/addiction_act_stage2(mob/living/M)
|
||||
if(prob(6) && iscarbon(M))
|
||||
M.visible_message("<span class='danger'>[M] starts having a seizure!</span>", "<span class='userdanger'>You have a seizure!</span>")
|
||||
M.Unconscious(100)
|
||||
M.Jitter(350)
|
||||
|
||||
if(prob(33))
|
||||
M.adjustToxLoss(3*REM, 0)
|
||||
M.losebreath += 3
|
||||
. = 1
|
||||
..()
|
||||
|
||||
/datum/reagent/medicine/ephedrine/addiction_act_stage3(mob/living/M)
|
||||
if(prob(12) && iscarbon(M))
|
||||
M.visible_message("<span class='danger'>[M] starts having a seizure!</span>", "<span class='userdanger'>You have a seizure!</span>")
|
||||
M.Unconscious(100)
|
||||
M.Jitter(350)
|
||||
|
||||
if(prob(33))
|
||||
M.adjustToxLoss(4*REM, 0)
|
||||
M.losebreath += 4
|
||||
. = 1
|
||||
..()
|
||||
|
||||
/datum/reagent/medicine/ephedrine/addiction_act_stage4(mob/living/M)
|
||||
if(prob(24) && iscarbon(M))
|
||||
M.visible_message("<span class='danger'>[M] starts having a seizure!</span>", "<span class='userdanger'>You have a seizure!</span>")
|
||||
M.Unconscious(100)
|
||||
M.Jitter(350)
|
||||
|
||||
if(prob(33))
|
||||
M.adjustToxLoss(5*REM, 0)
|
||||
M.losebreath += 5
|
||||
. = 1
|
||||
..()
|
||||
|
||||
/datum/reagent/medicine/diphenhydramine
|
||||
name = "Diphenhydramine"
|
||||
@@ -623,9 +577,9 @@
|
||||
color = "#A9FBFB"
|
||||
metabolization_rate = 0.5 * REAGENTS_METABOLISM
|
||||
overdose_threshold = 30
|
||||
addiction_threshold = 25
|
||||
ph = 8.96
|
||||
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
|
||||
addiction_types = list(/datum/addiction/opiods = 10)
|
||||
|
||||
/datum/reagent/medicine/morphine/on_mob_metabolize(mob/living/L)
|
||||
..()
|
||||
@@ -655,38 +609,6 @@
|
||||
M.Jitter(2)
|
||||
..()
|
||||
|
||||
/datum/reagent/medicine/morphine/addiction_act_stage1(mob/living/M)
|
||||
if(prob(33))
|
||||
M.drop_all_held_items()
|
||||
M.Jitter(2)
|
||||
..()
|
||||
|
||||
/datum/reagent/medicine/morphine/addiction_act_stage2(mob/living/M)
|
||||
if(prob(33))
|
||||
M.drop_all_held_items()
|
||||
M.adjustToxLoss(1*REM, 0)
|
||||
. = 1
|
||||
M.Dizzy(3)
|
||||
M.Jitter(3)
|
||||
..()
|
||||
|
||||
/datum/reagent/medicine/morphine/addiction_act_stage3(mob/living/M)
|
||||
if(prob(33))
|
||||
M.drop_all_held_items()
|
||||
M.adjustToxLoss(2*REM, 0)
|
||||
. = 1
|
||||
M.Dizzy(4)
|
||||
M.Jitter(4)
|
||||
..()
|
||||
|
||||
/datum/reagent/medicine/morphine/addiction_act_stage4(mob/living/M)
|
||||
if(prob(33))
|
||||
M.drop_all_held_items()
|
||||
M.adjustToxLoss(3*REM, 0)
|
||||
. = 1
|
||||
M.Dizzy(5)
|
||||
M.Jitter(5)
|
||||
..()
|
||||
|
||||
/datum/reagent/medicine/oculine
|
||||
name = "Oculine"
|
||||
@@ -881,6 +803,15 @@
|
||||
color = "#C0C0C0" //ditto
|
||||
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
|
||||
|
||||
|
||||
/datum/reagent/medicine/neurine/on_mob_add(mob/living/L, amount)
|
||||
. = ..()
|
||||
ADD_TRAIT(L, TRAIT_ANTICONVULSANT, name)
|
||||
|
||||
/datum/reagent/medicine/neurine/on_mob_delete(mob/living/L)
|
||||
. = ..()
|
||||
REMOVE_TRAIT(L, TRAIT_ANTICONVULSANT, name)
|
||||
|
||||
/datum/reagent/medicine/neurine/on_mob_life(mob/living/carbon/C)
|
||||
if(holder.has_reagent(/datum/reagent/consumable/ethanol/neurotoxin))
|
||||
holder.remove_reagent(/datum/reagent/consumable/ethanol/neurotoxin, 5)
|
||||
@@ -932,6 +863,8 @@
|
||||
overdose_threshold = 60
|
||||
ph = 8.7
|
||||
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
|
||||
addiction_types = list(/datum/addiction/stimulants = 4) //0.8 per 2 seconds
|
||||
|
||||
|
||||
/datum/reagent/medicine/stimulants/on_mob_metabolize(mob/living/L)
|
||||
..()
|
||||
@@ -1052,6 +985,7 @@
|
||||
overdose_threshold = 25
|
||||
ph = 11
|
||||
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
|
||||
addiction_types = list(/datum/addiction/hallucinogens = 14)
|
||||
|
||||
/datum/reagent/medicine/earthsblood/on_mob_life(mob/living/carbon/M)
|
||||
if(current_cycle <= 25) //10u has to be processed before u get into THE FUN ZONE
|
||||
|
||||
@@ -1106,6 +1106,7 @@
|
||||
penetrates_skin = NONE
|
||||
ph = 4
|
||||
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
|
||||
addiction_types = list(/datum/addiction/alcohol = 4)
|
||||
|
||||
/datum/reagent/fuel/expose_mob(mob/living/exposed_mob, methods=TOUCH, reac_volume)//Splashing people with welding fuel to make them easy to ignite!
|
||||
. = ..()
|
||||
@@ -1194,6 +1195,7 @@
|
||||
taste_description = "numbness"
|
||||
ph = 9.1
|
||||
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
|
||||
addiction_types = list(/datum/addiction/opiods = 10)
|
||||
|
||||
/datum/reagent/impedrezene/on_mob_life(mob/living/carbon/M)
|
||||
M.jitteriness = max(M.jitteriness-5,0)
|
||||
@@ -1372,6 +1374,7 @@
|
||||
taste_description = "sourness"
|
||||
ph = 1.8
|
||||
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
|
||||
addiction_types = list(/datum/addiction/stimulants = 14)
|
||||
|
||||
/datum/reagent/stimulum/on_mob_metabolize(mob/living/L)
|
||||
..()
|
||||
@@ -1711,6 +1714,7 @@
|
||||
color = "#2D2D2D"
|
||||
taste_description = "oil"
|
||||
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
|
||||
addiction_types = null
|
||||
|
||||
/datum/reagent/stable_plasma
|
||||
name = "Stable Plasma"
|
||||
|
||||
@@ -289,6 +289,7 @@
|
||||
taste_description = "sourness"
|
||||
ph = 11
|
||||
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
|
||||
addiction_types = list(/datum/addiction/hallucinogens = 18) //7.2 per 2 seconds
|
||||
|
||||
/datum/reagent/toxin/mindbreaker/on_mob_life(mob/living/carbon/M)
|
||||
M.hallucination += 5
|
||||
@@ -597,6 +598,7 @@
|
||||
metabolization_rate = 0.5 * REAGENTS_METABOLISM
|
||||
toxpwr = 0
|
||||
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
|
||||
addiction_types = list(/datum/addiction/opiods = 25)
|
||||
|
||||
/datum/reagent/toxin/fentanyl/on_mob_life(mob/living/carbon/M)
|
||||
M.adjustOrganLoss(ORGAN_SLOT_BRAIN, 3*REM, 150)
|
||||
@@ -728,6 +730,14 @@
|
||||
toxpwr = 0
|
||||
chemical_flags = REAGENT_CAN_BE_SYNTHESIZED
|
||||
|
||||
/datum/reagent/medicine/sodium_thiopental/on_mob_add(mob/living/L, amount)
|
||||
. = ..()
|
||||
ADD_TRAIT(L, TRAIT_ANTICONVULSANT, name)
|
||||
|
||||
/datum/reagent/medicine/sodium_thiopental/on_mob_delete(mob/living/L)
|
||||
. = ..()
|
||||
REMOVE_TRAIT(L, TRAIT_ANTICONVULSANT, name)
|
||||
|
||||
/datum/reagent/toxin/sodium_thiopental/on_mob_life(mob/living/carbon/M)
|
||||
if(current_cycle >= 10)
|
||||
M.Sleeping(40)
|
||||
|
||||
@@ -0,0 +1,123 @@
|
||||
///base class for addiction, handles when you become addicted and what the effects of that are. By default you become addicted when you hit a certain threshold, and stop being addicted once you go below another one.
|
||||
/datum/addiction
|
||||
///Name of this addiction
|
||||
var/name = "cringe code"
|
||||
///Higher threshold, when you start being addicted
|
||||
var/addiction_gain_threshold = 600
|
||||
///Lower threshold, when you stop being addicted
|
||||
var/addiction_loss_threshold = 400
|
||||
///Messages for each stage of addictions.
|
||||
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)
|
||||
///Rate at which high sanity helps addiction loss
|
||||
var/high_sanity_addiction_loss = 2
|
||||
|
||||
///Called when you gain addiction points somehow. Takes a mind as argument and sees if you gained the addiction
|
||||
/datum/addiction/proc/on_gain_addiction_points(datum/mind/victim_mind)
|
||||
var/current_addiction_point_amount = victim_mind.addiction_points[type]
|
||||
if(current_addiction_point_amount < addiction_gain_threshold) //Not enough to become addicted
|
||||
return
|
||||
if(LAZYACCESS(victim_mind.active_addictions, type)) //Already addicted
|
||||
return
|
||||
become_addicted(victim_mind)
|
||||
|
||||
|
||||
///Called when you become addicted
|
||||
/datum/addiction/proc/become_addicted(datum/mind/victim_mind)
|
||||
LAZYSET(victim_mind.active_addictions, type, 1) //Start at first cycle.
|
||||
log_game("[key_name(victim_mind.current)] has become addicted to [name].")
|
||||
|
||||
|
||||
///Called when you lose addiction poitns somehow. Takes a mind as argument and sees if you lost the addiction
|
||||
/datum/addiction/proc/on_lose_addiction_points(datum/mind/victim_mind)
|
||||
var/current_addiction_point_amount = victim_mind.addiction_points[type]
|
||||
if(!LAZYACCESS(victim_mind.active_addictions, type)) //Not addicted
|
||||
return FALSE
|
||||
if(current_addiction_point_amount > addiction_loss_threshold) //Not enough to stop being addicted
|
||||
return FALSE
|
||||
lose_addiction(victim_mind)
|
||||
return TRUE
|
||||
|
||||
/datum/addiction/proc/lose_addiction(datum/mind/victim_mind)
|
||||
SEND_SIGNAL(victim_mind.current, COMSIG_CLEAR_MOOD_EVENT, "[type]_addiction")
|
||||
to_chat(victim_mind.current, "<span class='notice'>You feel like you've gotten over your need for drugs.</span>")
|
||||
LAZYREMOVE(victim_mind.active_addictions, type)
|
||||
|
||||
/datum/addiction/proc/process_addiction(mob/living/carbon/affected_carbon, delta_time = 2)
|
||||
var/current_addiction_cycle = LAZYACCESS(affected_carbon.mind.active_addictions, type) //If this is null, we're not addicted
|
||||
var/on_drug_of_this_addiction = FALSE
|
||||
for(var/datum/reagent/possible_drug as anything in affected_carbon.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
|
||||
if(current_addiction_cycle)
|
||||
LAZYSET(affected_carbon.mind.active_addictions, type, 1) //Keeps withdrawal at first cycle.
|
||||
on_drug_of_this_addiction = TRUE
|
||||
return
|
||||
|
||||
var/withdrawal_stage
|
||||
|
||||
switch(current_addiction_cycle)
|
||||
if(WITHDRAWAL_STAGE1_START_CYCLE to WITHDRAWAL_STAGE1_END_CYCLE)
|
||||
withdrawal_stage = 1
|
||||
if(WITHDRAWAL_STAGE2_START_CYCLE to WITHDRAWAL_STAGE2_END_CYCLE)
|
||||
withdrawal_stage = 2
|
||||
if(WITHDRAWAL_STAGE3_START_CYCLE to INFINITY)
|
||||
withdrawal_stage = 3
|
||||
else
|
||||
withdrawal_stage = 0
|
||||
|
||||
if(!on_drug_of_this_addiction)
|
||||
if(affected_carbon.mind.remove_addiction_points(type, addiction_loss_per_stage[withdrawal_stage + 1] * delta_time)) //If true was returned, we lost the addiction!
|
||||
return
|
||||
|
||||
if(!current_addiction_cycle) //Dont do the effects if were not on drugs
|
||||
return FALSE
|
||||
|
||||
switch(current_addiction_cycle)
|
||||
if(WITHDRAWAL_STAGE1_START_CYCLE)
|
||||
withdrawal_enters_stage_1(affected_carbon)
|
||||
if(WITHDRAWAL_STAGE2_START_CYCLE)
|
||||
withdrawal_enters_stage_2(affected_carbon)
|
||||
if(WITHDRAWAL_STAGE3_START_CYCLE)
|
||||
withdrawal_enters_stage_3(affected_carbon)
|
||||
|
||||
///One cycle is 2 seconds
|
||||
switch(withdrawal_stage)
|
||||
if(1)
|
||||
withdrawal_stage_1_process(affected_carbon, delta_time)
|
||||
if(2)
|
||||
withdrawal_stage_2_process(affected_carbon, delta_time)
|
||||
if(3)
|
||||
withdrawal_stage_3_process(affected_carbon, delta_time)
|
||||
|
||||
LAZYADDASSOC(affected_carbon.mind.active_addictions, type, 1 * delta_time) //Next cycle!
|
||||
|
||||
/// Called when addiction enters stage 1
|
||||
/datum/addiction/proc/withdrawal_enters_stage_1(mob/living/carbon/affected_carbon)
|
||||
SEND_SIGNAL(affected_carbon, COMSIG_ADD_MOOD_EVENT, "[type]_addiction", /datum/mood_event/withdrawal_light, name)
|
||||
|
||||
/// Called when addiction enters stage 2
|
||||
/datum/addiction/proc/withdrawal_enters_stage_2(mob/living/carbon/affected_carbon)
|
||||
SEND_SIGNAL(affected_carbon, COMSIG_ADD_MOOD_EVENT, "[type]_addiction", /datum/mood_event/withdrawal_medium, name)
|
||||
|
||||
/// Called when addiction enters stage 3
|
||||
/datum/addiction/proc/withdrawal_enters_stage_3(mob/living/carbon/affected_carbon)
|
||||
SEND_SIGNAL(affected_carbon, COMSIG_ADD_MOOD_EVENT, "[type]_addiction", /datum/mood_event/withdrawal_severe, name)
|
||||
|
||||
|
||||
/// Called when addiction is in stage 1 every process
|
||||
/datum/addiction/proc/withdrawal_stage_1_process(mob/living/carbon/affected_carbon, delta_time)
|
||||
if(DT_PROB(5, delta_time))
|
||||
to_chat(affected_carbon, "<span class='danger'>[withdrawal_stage_messages[1]]</span>")
|
||||
|
||||
/// Called when addiction is in stage 2 every process
|
||||
/datum/addiction/proc/withdrawal_stage_2_process(mob/living/carbon/affected_carbon, delta_time)
|
||||
if(DT_PROB(10, delta_time))
|
||||
to_chat(affected_carbon, "<span class='danger'>[withdrawal_stage_messages[2]]</span>")
|
||||
|
||||
|
||||
/// Called when addiction is in stage 3 every process
|
||||
/datum/addiction/proc/withdrawal_stage_3_process(mob/living/carbon/affected_carbon, delta_time)
|
||||
if(DT_PROB(15, delta_time))
|
||||
to_chat(affected_carbon, "<span class='danger'>[withdrawal_stage_messages[3]]</span>")
|
||||
@@ -0,0 +1,156 @@
|
||||
///Opiods
|
||||
/datum/addiction/opiods
|
||||
name = "opiod"
|
||||
withdrawal_stage_messages = list("I feel aches in my bodies..", "I need some pain relief...", "It aches all over...I need some opiods!")
|
||||
|
||||
/datum/addiction/opiods/withdrawal_stage_1_process(mob/living/carbon/affected_carbon, delta_time)
|
||||
. = ..()
|
||||
if(DT_PROB(10, delta_time))
|
||||
affected_carbon.emote("yawn")
|
||||
|
||||
/datum/addiction/opiods/withdrawal_enters_stage_2(mob/living/carbon/affected_carbon)
|
||||
. = ..()
|
||||
affected_carbon.apply_status_effect(STATUS_EFFECT_HIGHBLOODPRESSURE)
|
||||
|
||||
/datum/addiction/opiods/withdrawal_stage_3_process(mob/living/carbon/affected_carbon, delta_time)
|
||||
. = ..()
|
||||
if(affected_carbon.disgust < DISGUST_LEVEL_DISGUSTED && DT_PROB(7.5, delta_time))
|
||||
affected_carbon.adjust_disgust(12.5 * delta_time)
|
||||
|
||||
|
||||
/datum/addiction/opiods/lose_addiction(datum/mind/victim_mind)
|
||||
. = ..()
|
||||
victim_mind.current.remove_status_effect(STATUS_EFFECT_HIGHBLOODPRESSURE)
|
||||
|
||||
///Stimulants
|
||||
|
||||
/datum/addiction/stimulants
|
||||
name = "stimulant"
|
||||
withdrawal_stage_messages = list("You feel a bit tired...You could really use a pick me up.", "You are getting a bit woozy...", "So...Tired...")
|
||||
|
||||
/datum/addiction/stimulants/withdrawal_enters_stage_1(mob/living/carbon/affected_carbon)
|
||||
. = ..()
|
||||
affected_carbon.add_actionspeed_modifier(/datum/actionspeed_modifier/stimulants)
|
||||
|
||||
/datum/addiction/stimulants/withdrawal_enters_stage_2(mob/living/carbon/affected_carbon)
|
||||
. = ..()
|
||||
affected_carbon.apply_status_effect(STATUS_EFFECT_WOOZY)
|
||||
|
||||
/datum/addiction/stimulants/withdrawal_enters_stage_3(mob/living/carbon/affected_carbon)
|
||||
. = ..()
|
||||
affected_carbon.add_movespeed_modifier(/datum/movespeed_modifier/stimulants)
|
||||
|
||||
/datum/addiction/stimulants/lose_addiction(datum/mind/victim_mind)
|
||||
. = ..()
|
||||
victim_mind.current.remove_actionspeed_modifier(ACTIONSPEED_ID_STIMULANTS)
|
||||
victim_mind.current.remove_status_effect(STATUS_EFFECT_WOOZY)
|
||||
victim_mind.current.remove_movespeed_modifier(MOVESPEED_ID_STIMULANTS)
|
||||
|
||||
///Alcohol
|
||||
/datum/addiction/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/withdrawal_stage_1_process(mob/living/carbon/affected_carbon, delta_time)
|
||||
. = ..()
|
||||
affected_carbon.Jitter(5 * delta_time)
|
||||
|
||||
/datum/addiction/alcohol/withdrawal_stage_2_process(mob/living/carbon/affected_carbon, delta_time)
|
||||
. = ..()
|
||||
affected_carbon.Jitter(10 * delta_time)
|
||||
affected_carbon.hallucination = max(5 SECONDS, affected_carbon.hallucination)
|
||||
|
||||
/datum/addiction/alcohol/withdrawal_stage_3_process(mob/living/carbon/affected_carbon, delta_time)
|
||||
. = ..()
|
||||
affected_carbon.Jitter(15 * delta_time)
|
||||
affected_carbon.hallucination = max(5 SECONDS, affected_carbon.hallucination)
|
||||
if(DT_PROB(4, delta_time))
|
||||
if(!HAS_TRAIT(affected_carbon, TRAIT_ANTICONVULSANT))
|
||||
affected_carbon.apply_status_effect(STATUS_EFFECT_SEIZURE)
|
||||
|
||||
/datum/addiction/hallucinogens
|
||||
name = "hallucinogen"
|
||||
withdrawal_stage_messages = list("I feel so empty...", "I wonder what the machine elves are up to?..", "I need to see the beautiful colors again!!")
|
||||
|
||||
/datum/addiction/hallucinogens/withdrawal_enters_stage_2(mob/living/carbon/affected_carbon)
|
||||
. = ..()
|
||||
var/atom/movable/plane_master_controller/game_plane_master_controller = affected_carbon.hud_used.plane_master_controllers[PLANE_MASTERS_GAME]
|
||||
game_plane_master_controller.add_filter("hallucinogen_wave", 10, wave_filter(300, 300, 3, 0, WAVE_SIDEWAYS))
|
||||
game_plane_master_controller.add_filter("hallucinogen_blur", 10, angular_blur_filter(0, 0, 3))
|
||||
|
||||
|
||||
/datum/addiction/hallucinogens/withdrawal_enters_stage_3(mob/living/carbon/affected_carbon)
|
||||
. = ..()
|
||||
affected_carbon.apply_status_effect(/datum/status_effect/trance, 40 SECONDS, TRUE)
|
||||
|
||||
/datum/addiction/hallucinogens/lose_addiction(datum/mind/victim_mind)
|
||||
. = ..()
|
||||
var/atom/movable/plane_master_controller/game_plane_master_controller = victim_mind.current.hud_used.plane_master_controllers[PLANE_MASTERS_GAME]
|
||||
game_plane_master_controller.remove_filter("hallucinogen_blur")
|
||||
game_plane_master_controller.remove_filter("hallucinogen_wave")
|
||||
victim_mind.current.remove_status_effect(/datum/status_effect/trance, 40 SECONDS, TRUE)
|
||||
|
||||
/datum/addiction/maintenance_drugs
|
||||
name = "maintenance drug"
|
||||
|
||||
/datum/addiction/maintenance_drugs/withdrawal_enters_stage_1(mob/living/carbon/affected_carbon)
|
||||
. = ..()
|
||||
affected_carbon.hal_screwyhud = SCREWYHUD_HEALTHY
|
||||
|
||||
/datum/addiction/maintenance_drugs/withdrawal_stage_1_process(mob/living/carbon/affected_carbon, delta_time)
|
||||
. = ..()
|
||||
if(DT_PROB(7.5, delta_time))
|
||||
affected_carbon.emote("growls")
|
||||
|
||||
/datum/addiction/maintenance_drugs/withdrawal_enters_stage_2(mob/living/carbon/affected_carbon)
|
||||
. = ..()
|
||||
if(!ishuman(affected_carbon))
|
||||
return
|
||||
var/mob/living/carbon/human/affected_human = affected_carbon
|
||||
if(affected_human.gender == MALE)
|
||||
to_chat(affected_human, "<span class='warning'>Your chin itches.</span>")
|
||||
affected_human.facial_hairstyle = "Beard (Full)"
|
||||
affected_human.update_hair()
|
||||
//Only like gross food
|
||||
affected_human.dna?.species.liked_food = GROSS
|
||||
affected_human.dna?.species.disliked_food = NONE
|
||||
affected_human.dna?.species.toxic_food = ~GROSS
|
||||
|
||||
/datum/addiction/maintenance_drugs/withdrawal_enters_stage_3(mob/living/carbon/affected_carbon)
|
||||
. = ..()
|
||||
if(!ishuman(affected_carbon))
|
||||
return
|
||||
|
||||
var/mob/living/carbon/human/affected_human
|
||||
var/obj/item/organ/eyes/eyes = affected_human.getorgan(/obj/item/organ/eyes)
|
||||
|
||||
ADD_TRAIT(affected_human, TRAIT_NIGHT_VISION, type)
|
||||
eyes.refresh()
|
||||
|
||||
/datum/addiction/maintenance_drugs/withdrawal_stage_3_process(mob/living/carbon/affected_carbon, delta_time)
|
||||
if(!ishuman(affected_carbon))
|
||||
return
|
||||
var/mob/living/carbon/human/affected_human = affected_carbon
|
||||
var/turf/T = get_turf(affected_human)
|
||||
var/lums = T.get_lumcount()
|
||||
if(lums >= 0.4)
|
||||
SEND_SIGNAL(affected_human, COMSIG_ADD_MOOD_EVENT, "too_bright", /datum/mood_event/bright_light)
|
||||
affected_human.dizziness = min(40, affected_human.dizziness + 3)
|
||||
affected_human.set_confusion(min(affected_human.get_confusion() + (0.5 * delta_time), 20))
|
||||
else
|
||||
SEND_SIGNAL(affected_carbon, COMSIG_CLEAR_MOOD_EVENT, "too_bright")
|
||||
|
||||
/datum/addiction/maintenance_drugs/lose_addiction(datum/mind/victim_mind)
|
||||
. = ..()
|
||||
if(iscarbon(victim_mind.current))
|
||||
var/mob/living/carbon/affected_carbon = victim_mind.current
|
||||
affected_carbon.hal_screwyhud = SCREWYHUD_NONE
|
||||
if(!ishuman(victim_mind.current))
|
||||
return
|
||||
var/mob/living/carbon/human/affected_human = victim_mind.current
|
||||
affected_human.dna?.species.liked_food = initial(affected_human.dna?.species.liked_food)
|
||||
affected_human.dna?.species.disliked_food = initial(affected_human.dna?.species.disliked_food)
|
||||
affected_human.dna?.species.toxic_food = initial(affected_human.dna?.species.toxic_food)
|
||||
REMOVE_TRAIT(affected_human, TRAIT_NIGHT_VISION, type)
|
||||
var/obj/item/organ/eyes/eyes = affected_human.getorgan(/obj/item/organ/eyes)
|
||||
eyes.refresh()
|
||||
Reference in New Issue
Block a user