Files
Polaris/code/modules/organs/internal/kidneys.dm
Frenjo 20cdc4b676 Converts move intents to /decl/move_intent (#8993)
* Converts move intents to /decl/move_intent

Adds /decl/move_intent/walk and /decl/move_intent/run.

Switches all move intent checks to use the new IS_RUNNING and IS_WALKING macros.

Renames and refactors /mob/living/proc/set_m_intent() to /mob/living/proc/set_move_intent(decl/move_intent/intent).

Removes the unnecessary /mob/var/m_int and associated code.

Updates all move intent setters to use set_move_intent().

* Swaps incorrect config values

Swaps incorrect move delays since I got them backwards somehow, oopsies.

* Adds suggested ?. operator

Compactifies two if statements using the ?. operator instead.
2023-03-04 14:28:10 -08:00

54 lines
1.6 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)
/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)
if(!IS_WALKING(owner))
owner.set_move_intent(/decl/move_intent/walk)
/obj/item/organ/internal/kidneys/grey
icon_state = "kidneys_grey"
/obj/item/organ/internal/kidneys/grey/colormatch/Initialize()
. = ..()
var/mob/living/carbon/human/H = null
spawn(15)
if(ishuman(owner))
H = owner
color = H.species.blood_color