Reagent Addictions (#17498)

* Addictions

* improvements to addiction code

* some small revamps

* some polishing to reagent code

* some more fixes

* wiki updated for addiction

* proper addiction sync on respawn

* final cleanup, config

* coffee handle addiction proc

* fixed global var

* Addictions and

Gives alcohol special effects
Disables the harder addictions
Gives nicotine an a special effect

* remove >0

* safety

* Update medicine.dm

* Update medicine.dm

* Update food_drinks.dm

* update lazydefines

* disable alcohol addiction on virgo

* use lazylen, proper addiction end messages

* cure message bugfix

* use right args

* proper macro

---------

Co-authored-by: C.L. <killer65311@gmail.com>
This commit is contained in:
Will
2025-05-15 10:57:41 -07:00
committed by GitHub
co-authored by C.L.
parent 45470701a0
commit c213dbcd21
30 changed files with 580 additions and 9 deletions
@@ -285,6 +285,29 @@
dat += "<br>"
if(ishuman(M))
var/mob/living/carbon/human/H = M
// Addictions
if(H.get_addiction_to_reagent(REAGENT_ID_ASUSTENANCE) > 0)
dat += span_warning("Biologically unstable, requires [REAGENT_ASUSTENANCE] to function properly.")
dat += "<br>"
for(var/addic in H.get_all_addictions())
if(H.get_addiction_to_reagent(addic) > 0 && (advscan >= 2 || H.get_addiction_to_reagent(addic) <= 120)) // high enough scanner upgrade detects addiction even if not almost withdrawling
var/datum/reagent/R = SSchemistry.chemical_reagents[addic]
if(R.id == REAGENT_ID_ASUSTENANCE)
continue
if(advscan >= 1)
// Shows multiple
if(advscan >= 2 && H.get_addiction_to_reagent(addic) <= 80)
dat += span_warning("Experiencing withdrawls from [R.name], [REAGENT_INAPROVALINE] treatment recomended.")
dat += "<br>"
else
dat += span_warning("Chemical dependance detected: [R.name].")
dat += "<br>"
else
// Shows single
dat += span_warning("Chemical dependance detected.")
dat += "<br>"
break
// Appendix
for(var/obj/item/organ/internal/appendix/a in H.internal_organs)
var/severity = ""
if(a.inflamed > 3)
@@ -229,6 +229,7 @@
M.client.prefs.copy_to(new_character)
new_character.dna.ResetUIFrom(new_character)
new_character.sync_organ_dna()
new_character.sync_addictions()
new_character.key = M.key
new_character.mind.loaded_from_ckey = picked_ckey
new_character.mind.loaded_from_slot = picked_slot
@@ -304,6 +304,7 @@
prob(2);/obj/item/selectable_item/chemistrykit/size,
prob(2);/obj/item/selectable_item/chemistrykit/gender,
prob(2);/obj/item/clothing/gloves/bluespace/emagged,
prob(2);/obj/item/reagent_containers/glass/beaker/vial/sustenance,
prob(1);/obj/item/clothing/suit/storage/vest/heavy/merc,
prob(1);/obj/item/nif/bad,
prob(1);/obj/item/radio_jammer,