mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
[MIRROR] Reagent Addictions (#10888)
Co-authored-by: Will <7099514+Willburd@users.noreply.github.com> Co-authored-by: Cameron Lennox <killer65311@gmail.com>
This commit is contained in:
committed by
GitHub
parent
ca7345cb67
commit
dc9ccc60c2
@@ -85,6 +85,9 @@
|
||||
SSinternal_wiki.add_icon(subdata, initial(beaker_path.icon), initial(beaker_path.icon_state), R.color)
|
||||
// Get internal data
|
||||
subdata["description"] = R.description
|
||||
subdata["addictive"] = 0
|
||||
if(R.id in get_addictive_reagents(ADDICT_ALL))
|
||||
subdata["addictive"] = TRUE
|
||||
subdata["flavor"] = R.taste_description
|
||||
subdata["allergen"] = SSinternal_wiki.assemble_allergens(R.allergen_type)
|
||||
subdata["beakerAmount"] = found_reagents[ID]
|
||||
|
||||
@@ -1248,3 +1248,10 @@
|
||||
result = REAGENT_ID_PROTEIN
|
||||
required_reagents = list(REAGENT_ID_ENZYME = 1, REAGENT_ID_SPIDERTOXIN = 1, REAGENT_ID_SIFSAP = 1)
|
||||
result_amount = 1
|
||||
|
||||
/decl/chemical_reaction/instant/artificial_sustenance
|
||||
name = REAGENT_ASUSTENANCE
|
||||
id = REAGENT_ID_ASUSTENANCE
|
||||
result = REAGENT_ID_ASUSTENANCE
|
||||
required_reagents = list(REAGENT_ID_NUTRIMENT = 1, REAGENT_ID_MUTAGEN = 1, REAGENT_ID_PHORON = 1)
|
||||
result_amount = 1
|
||||
|
||||
@@ -431,3 +431,7 @@
|
||||
matter = list(MAT_WOOD = 50)
|
||||
drop_sound = 'sound/items/drop/wooden.ogg'
|
||||
pickup_sound = 'sound/items/pickup/wooden.ogg'
|
||||
|
||||
/obj/item/reagent_containers/glass/beaker/vial/sustenance
|
||||
name = "vial (artificial sustenance)"
|
||||
prefill = list(REAGENT_ID_ASUSTENANCE = 30)
|
||||
|
||||
@@ -214,6 +214,75 @@
|
||||
to_chat(usr, span_notice("The solution dissolves the ink on the book."))
|
||||
return
|
||||
|
||||
/datum/reagent/ethanol/handle_addiction(var/mob/living/carbon/M, var/alien)
|
||||
// A copy of the base with withdrawl, but with much less effects, such as vomiting.
|
||||
var/current_addiction = M.get_addiction_to_reagent(id)
|
||||
var/realistic_addiction = FALSE //DEFAULT set to FALSE. Toggle to TRUE for a more realistic addiction with potentially fatal side effects.
|
||||
// slow degrade
|
||||
if(prob(8))
|
||||
current_addiction -= 1
|
||||
// withdrawl mechanics
|
||||
if(!(CE_STABLE in M.chem_effects)) //Without stabilization effects
|
||||
if(current_addiction <= 60)
|
||||
M.pulse = PULSE_2FAST
|
||||
if(prob(2))
|
||||
if(current_addiction < 90 && prob(10))
|
||||
to_chat(M, span_warning("[pick("You feel miserable.","You feel nauseous.","You get a raging headache.")]"))
|
||||
M.adjustHalLoss(7)
|
||||
M.make_jittery(25) //Restlessness.
|
||||
else if(current_addiction <= 20)
|
||||
to_chat(M, span_danger("You feel absolutely awful. You need some some liquor. Now."))
|
||||
if(realistic_addiction && prob(20)) //1 in 5 on a 1 in 50, so 1 in 250 chance. DTs
|
||||
to_chat(src, span_red("You have a seizure!"))
|
||||
for(var/mob/O in viewers(M, null))
|
||||
if(O == src)
|
||||
continue
|
||||
O.show_message(span_danger("[M] starts having a seizure!"), 1)
|
||||
M.Paralyse(10)
|
||||
M.make_jittery(1000)
|
||||
else if(current_addiction <= 50)
|
||||
to_chat(M, span_warning("You're really craving some alcohol. You feel nauseated."))
|
||||
if(realistic_addiction)
|
||||
M.emote("vomit")
|
||||
M.AdjustConfused(10) // Disorientation.
|
||||
else if(current_addiction <= 100)
|
||||
to_chat(M, span_notice("You're feeling the need for some booze."))
|
||||
// effects
|
||||
if(current_addiction < 60 && prob(20)) // 1 in 50 x 1 in 5 = 1 in 250
|
||||
M.emote(pick("pale","shiver","twitch"))
|
||||
M.drop_item() //Hand tremors
|
||||
if(realistic_addiction)
|
||||
M.add_chemical_effect(CE_WITHDRAWL, rand(4,10) * REM)
|
||||
else //Stabilization effects
|
||||
if(current_addiction <= 60)
|
||||
M.pulse = PULSE_FAST
|
||||
if(prob(2))
|
||||
if(current_addiction < 90 && prob(10))
|
||||
to_chat(M, span_warning("[pick("You feel a light throbbing in your head.","Your stomach feels upset.","Your .")]"))
|
||||
M.adjustHalLoss(3)
|
||||
M.make_jittery(10) //Restlessness.
|
||||
else if(current_addiction <= 20)
|
||||
to_chat(M, span_warning("You feel nauseated."))
|
||||
if(realistic_addiction)
|
||||
M.emote("vomit")
|
||||
M.AdjustConfused(10) // Disorientation.
|
||||
else if(current_addiction <= 50)
|
||||
to_chat(M, span_warning("Your head throbs and the room spins."))
|
||||
if(realistic_addiction)
|
||||
M.AdjustConfused(3) // Disorientation.
|
||||
else if(current_addiction <= 100)
|
||||
to_chat(M, span_notice("A drink would be nice."))
|
||||
// effects
|
||||
if(current_addiction < 60 && prob(5)) // 1 in 50 x 1 in 20 = 1 in 1000
|
||||
M.emote(pick("pale","shiver","twitch"))
|
||||
M.drop_item() //Hand tremors
|
||||
if(current_addiction <= 0) //safety
|
||||
current_addiction = 0
|
||||
return current_addiction
|
||||
|
||||
/datum/reagent/ethanol/addiction_cure_message()
|
||||
return span_notice("You feel your symptoms end, you no longer feel the craving for alcohol.")
|
||||
|
||||
/datum/reagent/fluorine
|
||||
name = REAGENT_FLUORINE
|
||||
id = REAGENT_ID_FLUORINE
|
||||
|
||||
@@ -210,6 +210,37 @@
|
||||
color = "#181818"
|
||||
high_messages = FALSE
|
||||
|
||||
/datum/reagent/drugs/nicotine/handle_addiction(var/mob/living/carbon/M, var/alien)
|
||||
// A copy of the base with withdrawl, but with much less effects, such as vomiting.
|
||||
var/current_addiction = M.get_addiction_to_reagent(id)
|
||||
// slow degrade
|
||||
if(prob(8))
|
||||
current_addiction -= 1
|
||||
// withdrawl mechanics
|
||||
if(prob(2))
|
||||
if(!(CE_STABLE in M.chem_effects)) //Without stabilization effects
|
||||
if(current_addiction < 90 && prob(10))
|
||||
to_chat(M, span_warning("[pick("You feel miserable.","You feel nauseous.","You get a raging headache.")]"))
|
||||
M.adjustHalLoss(5)
|
||||
else if(current_addiction <= 20)
|
||||
to_chat(M, span_danger("You feel absolutely awful. You need some [name]. Now."))
|
||||
if(prob(10)) //1 in 10 on top of a 1 in 50, so thats a 1 in 500 chance. Seems low enough to not be disruptive.
|
||||
M.emote("vomit")
|
||||
else if(current_addiction <= 50)
|
||||
to_chat(M, span_warning("You're really craving some [name]."))
|
||||
else if(current_addiction <= 100)
|
||||
to_chat(M, span_notice("You're feeling the need for some [name]."))
|
||||
// effects
|
||||
if(current_addiction < 60 && prob(20))
|
||||
M.emote(pick("pale","shiver","twitch", "cough"))
|
||||
else
|
||||
if(current_addiction < 90 && prob(10))
|
||||
to_chat(M, span_warning("[pick("You feel a slight craving for some [name].","Your stomach feels slightly upset.","You feel a slight pain in your head.")]"))
|
||||
if(current_addiction <= 0) //safety
|
||||
current_addiction = 0
|
||||
return current_addiction
|
||||
|
||||
|
||||
/*///////////////////////////////////////////////////////////////////////////
|
||||
/// PSYCHIATRIC DRUGS /////
|
||||
/// /////
|
||||
|
||||
@@ -1634,6 +1634,28 @@
|
||||
//M.apply_effect(3, STUTTER) //VOREStation Edit end
|
||||
M.make_jittery(5)
|
||||
|
||||
/datum/reagent/drink/coffee/handle_addiction(var/mob/living/carbon/M, var/alien)
|
||||
// A copy of the base with withdrawl, but with much less effects, no vomiting and sometimes halloss
|
||||
var/current_addiction = M.get_addiction_to_reagent(id)
|
||||
// slow degrade
|
||||
if(prob(8))
|
||||
current_addiction -= 1
|
||||
// withdrawl mechanics
|
||||
if(prob(2))
|
||||
if(current_addiction < 90 && prob(10))
|
||||
to_chat(M, span_warning("[pick("You feel miserable.","You feel sluggish.","You get a small headache.")]"))
|
||||
M.adjustHalLoss(2)
|
||||
else if(current_addiction <= 50)
|
||||
to_chat(M, span_warning("You're really craving some [name]."))
|
||||
else if(current_addiction <= 100)
|
||||
to_chat(M, span_notice("You're feeling the need for some [name]."))
|
||||
// effects
|
||||
if(current_addiction < 60 && prob(20))
|
||||
M.emote(pick("pale","shiver","twitch"))
|
||||
if(current_addiction <= 0) //safety
|
||||
current_addiction = 0
|
||||
return current_addiction
|
||||
|
||||
/datum/reagent/drink/coffee/icecoffee
|
||||
name = REAGENT_ICECOFFEE
|
||||
id = REAGENT_ID_ICECOFFEE
|
||||
|
||||
@@ -1425,3 +1425,64 @@
|
||||
M.druggy = max(M.druggy, 20)
|
||||
M.hallucination = max(M.hallucination, 3)
|
||||
M.adjustBrainLoss(1 * removed) //your life for your mind. The Earthmother's Tithe.
|
||||
|
||||
|
||||
// Vat clone stablizer
|
||||
/datum/reagent/acid/artificial_sustenance
|
||||
name = REAGENT_ASUSTENANCE
|
||||
id = REAGENT_ID_ASUSTENANCE
|
||||
description = "A drug used to stablize vat grown bodies. Often used to control the lifespan of biological experiments." // Who else remembers Cybersix?
|
||||
taste_description = "burning metal"
|
||||
reagent_state = LIQUID
|
||||
color = "#31d422"
|
||||
overdose = 15
|
||||
overdose_mod = 1.2
|
||||
scannable = 1
|
||||
|
||||
/datum/reagent/acid/artificial_sustenance/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed)
|
||||
// You need me...
|
||||
if(M.get_addiction_to_reagent(REAGENT_ID_ASUSTENANCE))
|
||||
return
|
||||
// Continue to acid damage, no changes on injection or splashing, as this is meant to be edible only to those pre-addicted to it! Not a snowflake acid that doesn't hurt you!
|
||||
. = ..()
|
||||
|
||||
/datum/reagent/acid/artificial_sustenance/handle_addiction(var/mob/living/carbon/M, var/alien)
|
||||
// A copy of the base with withdrawl, but with death, and different messages
|
||||
var/current_addiction = M.get_addiction_to_reagent(id)
|
||||
// slow degrade
|
||||
if(prob(2))
|
||||
current_addiction -= 1
|
||||
// withdrawl mechanics
|
||||
if(prob(2))
|
||||
if(current_addiction <= 40)
|
||||
to_chat(M, span_danger("You're dying for some [name]!"))
|
||||
else if(current_addiction <= 60)
|
||||
to_chat(M, span_warning("You're really craving some [name]."))
|
||||
else if(current_addiction <= 100)
|
||||
to_chat(M, span_notice("You're feeling the need for some [name]."))
|
||||
// effects
|
||||
if(current_addiction < 60 && prob(20))
|
||||
M.emote(pick("pale","shiver","twitch"))
|
||||
// Agony and death!
|
||||
if(current_addiction <= 20)
|
||||
if(prob(12))
|
||||
M.adjustToxLoss( rand(1,4) )
|
||||
M.adjustBruteLoss( rand(1,4) )
|
||||
M.adjustOxyLoss( rand(1,4) )
|
||||
// proc side effect
|
||||
if(current_addiction <= 30)
|
||||
if(prob(3))
|
||||
M.Weaken(2)
|
||||
M.emote("vomit")
|
||||
M.add_chemical_effect(CE_WITHDRAWL, rand(9,14) * REM)
|
||||
else if(current_addiction <= 40)
|
||||
if(prob(3))
|
||||
M.emote("vomit")
|
||||
M.add_chemical_effect(CE_WITHDRAWL, rand(5,9) * REM)
|
||||
else if(current_addiction <= 50)
|
||||
if(prob(2))
|
||||
M.emote("vomit")
|
||||
// Sustenance requirements cannot be escaped!
|
||||
if(current_addiction <= 0)
|
||||
current_addiction = 40
|
||||
return current_addiction
|
||||
|
||||
64
code/modules/reagents/reagents/withdrawl.dm
Normal file
64
code/modules/reagents/reagents/withdrawl.dm
Normal file
@@ -0,0 +1,64 @@
|
||||
/datum/reagent/proc/handle_addiction(var/mob/living/carbon/M, var/alien)
|
||||
// overridable proc for custom withdrawl behaviors, standard is chills, cravings, vomiting, weakness and CE_WITHDRAWL organ damage
|
||||
if(alien == IS_DIONA)
|
||||
return 0
|
||||
var/current_addiction = M.get_addiction_to_reagent(id)
|
||||
// slow degrade
|
||||
if(prob(8))
|
||||
current_addiction -= 1
|
||||
// withdrawl mechanics
|
||||
if(current_addiction < 10)
|
||||
if(prob(2))
|
||||
M.Weaken(1)
|
||||
else if(current_addiction > 10)
|
||||
if(CE_STABLE in M.chem_effects) // Inaprovaline can be used to treat addiction
|
||||
if(prob(1))
|
||||
switch(rand(1,3))
|
||||
if(1)
|
||||
to_chat(M, span_notice("You feel sluggish."))
|
||||
if(2)
|
||||
to_chat(M, span_notice("You feel awful."))
|
||||
if(3)
|
||||
to_chat(M, span_notice("Everything feels sore."))
|
||||
// effects
|
||||
if(current_addiction < 100 && prob(10))
|
||||
M.emote(pick("pale","shiver","twitch"))
|
||||
if(current_addiction <= 60)
|
||||
if(prob(1))
|
||||
M.Weaken(2)
|
||||
if(prob(5) && prob(1))
|
||||
M.emote("vomit")
|
||||
else
|
||||
// send a message to notify players
|
||||
if(prob(2))
|
||||
if(current_addiction <= 40)
|
||||
to_chat(M, span_danger("You're dying for some [name]!"))
|
||||
else if(current_addiction <= 60)
|
||||
to_chat(M, span_warning("You're really craving some [name]."))
|
||||
else if(current_addiction <= 100)
|
||||
to_chat(M, span_notice("You're feeling the need for some [name]."))
|
||||
// effects
|
||||
if(current_addiction < 100 && prob(20))
|
||||
M.emote(pick("pale","shiver","twitch"))
|
||||
// proc side effect
|
||||
if(current_addiction <= 30)
|
||||
if(prob(3))
|
||||
M.Weaken(2)
|
||||
M.emote("vomit")
|
||||
M.add_chemical_effect(CE_WITHDRAWL, rand(2,4) * REM)
|
||||
else if(current_addiction <= 50)
|
||||
if(prob(3))
|
||||
M.emote("vomit")
|
||||
M.add_chemical_effect(CE_WITHDRAWL, rand(1,3) * REM)
|
||||
else if(current_addiction <= 70)
|
||||
if(prob(2))
|
||||
M.emote("vomit")
|
||||
if(current_addiction <= 0) //safety
|
||||
current_addiction = 0
|
||||
return current_addiction
|
||||
|
||||
/datum/reagent/proc/addiction_cure_message()
|
||||
return span_notice("You feel your symptoms end, you no longer feel the craving for [name].")
|
||||
|
||||
/datum/reagent/proc/addiction_refresh_message()
|
||||
return span_notice("You feel rejuvenated as the [name] rushes through you.")
|
||||
Reference in New Issue
Block a user