Files
VOREStation/code/modules/organs/internal/kidneys.dm
Will c213dbcd21 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>
2025-05-15 10:57:41 -07:00

60 lines
2.0 KiB
Plaintext

/obj/item/organ/internal/kidneys
name = "kidneys"
icon_state = "kidneys"
gender = PLURAL
organ_tag = O_KIDNEYS
parent_organ = BP_GROIN
/obj/item/organ/internal/kidneys/process()
..()
if(!owner) return
// Coffee is really bad for you with busted kidneys.
// This should probably be expanded in some way, but fucked if I know
// what else kidneys can process in our reagent list.
var/datum/reagent/coffee = locate(/datum/reagent/drink/coffee) in owner.reagents.reagent_list
if(coffee)
if(is_bruised())
owner.adjustToxLoss(0.1 * PROCESS_ACCURACY)
else if(is_broken())
owner.adjustToxLoss(0.3 * PROCESS_ACCURACY)
// General organ damage from withdraw, kidneys do a lot of the work
if(prob(70) && owner.chem_effects[CE_WITHDRAWL])
take_damage(owner.chem_effects[CE_WITHDRAWL] * 0.05 * PROCESS_ACCURACY, prob(1)) // Chance to warn them
owner.adjustToxLoss(owner.chem_effects[CE_WITHDRAWL] * 0.3 * PROCESS_ACCURACY)
/obj/item/organ/internal/kidneys/handle_organ_proc_special()
. = ..()
if(owner && owner.getToxLoss() <= owner.getMaxHealth() * 0.1) // If you have less than 10 tox damage (for a human), your kidneys can help purge it.
if(prob(owner.getToxLoss()))
owner.adjustToxLoss(rand(-1,-3))
/obj/item/organ/internal/kidneys/handle_germ_effects()
. = ..() //Up should return an infection level as an integer
if(!.) return
//Pyelonephritis
if (. >= 1)
if(prob(1))
owner.custom_pain("There's a stabbing pain in your lower back!",1)
if (. >= 2)
if(prob(1))
owner.custom_pain("You feel extremely tired, like you can't move!",1)
owner.m_intent = I_WALK
owner.hud_used.move_intent.icon_state = "walking"
/obj/item/organ/internal/kidneys/grey
icon_state = "kidneys_grey"
/obj/item/organ/internal/kidneys/grey/colormatch/Initialize(mapload, internal)
..()
return INITIALIZE_HINT_LATELOAD
/obj/item/organ/internal/kidneys/grey/colormatch/LateInitialize()
if(ishuman(loc))
var/mob/living/carbon/human/H = loc
color = H.species.blood_color