Files
VMSolidus e934c818c1 The Medical Stasis Refactoring (#21311)
This PR implements a variety pack of new interactions for Medical Stasis
(stasis beds, stasis bags, and cryogenics), which should broadly extend
their utility. Not all of it is necessarily a good thing to have around,
such as for instance stasis slowing down the rate at which the liver
removes toxins. A few more organs have by extension been time
differentiated to allow for this change to take place.

As a general rule of thumb, most organ effects that are handled "per
second" are proportionally slowed down by the stasis rating of a given
source of medical stasis. This can be a good or a bad thing depending on
the context.

**Good effects of Stasis:**
- Slowing down appendicitis.
- Reducing the damage organs take per second from most per-second
sources.
- Making kidneys and livers deal less dangerous effects to their owner
when severely damaged.
- (Not in this PR, but was done in a previous PR): Brains lose BA
slower.

**Bad effects of Stasis:**
- Organs also heal slower from all per-second sources, this includes
chems. So while they take less damage, they're also taking less healing.
- The liver's rate at which it filters the blood is reduced. You get to
stay black-out drunk for 10x longer if placed in stasis.
- (Not in this PR, but was done in a previous PR): Brains heal their BA
slower.

---------

Signed-off-by: VMSolidus <evilexecutive@gmail.com>
2025-11-03 08:13:03 +00:00

73 lines
2.3 KiB
Plaintext

/obj/item/organ/internal/appendix
name = "appendix"
icon_state = "appendix"
parent_organ = BP_GROIN
organ_tag = BP_APPENDIX
possible_modifications = list ("Normal","Removed")
/**
* The amount of seconds that have passed since starting an appendicitis event.
* This number is set initially to 1 by the event, and increments by 1 each real life second.
* While its at 0, no appendix calculations are performed.
*/
var/inflamed = 0
/// The amount of pain to take per second while in stage 1 of appendicitis.
var/stage_one_pain_per_second = 1
/// The amount of pain to take per second while in stage 2 of appendicitis.
var/stage_two_pain_per_second = 1.5
/// The amount of damage an appendix takes per second while in stage 2 of appendicitis.
var/stage_two_organ_damage_per_second = 0.006
/obj/item/organ/internal/appendix/update_icon()
..()
if(inflamed)
icon_state = "[icon_state]inflamed"
name = "inflamed [name]"
/obj/item/organ/internal/appendix/process(seconds_per_tick)
..()
if(!owner || !inflamed || !BP_IS_ROBOTIC(src))
return
if(owner.stasis_value > 0)
// Decrease the effective tickrate when in stasis.
// Basically, you die of appendicitis slower while in stasis.
seconds_per_tick /= owner.stasis_value
var/can_feel_pain = ORGAN_CAN_FEEL_PAIN(src)
inflamed += seconds_per_tick
if(can_feel_pain)
if(prob(5))
owner.custom_pain("You feel a stinging pain in your abdomen!")
owner.visible_message("<B>\The [owner]</B> winces slightly.")
var/obj/item/organ/external/O = owner.get_organ(parent_organ)
if(O)
O.add_pain(stage_one_pain_per_second * seconds_per_tick)
if(inflamed > 400)
take_internal_damage(stage_two_organ_damage_per_second * seconds_per_tick)
if(can_feel_pain)
if(prob(3))
owner.visible_message("<B>\The [owner]</B> winces painfully.")
var/obj/item/organ/external/O = owner.get_organ(parent_organ)
if(O)
O.add_pain(stage_two_pain_per_second * seconds_per_tick)
owner.adjustToxLoss(1)
if(inflamed > 800 && prob(1))
germ_level += rand(2,6)
owner.vomit()
if(inflamed > 1200 && prob(1))
if(can_feel_pain)
owner.custom_pain("You feel a stinging pain in your abdomen!")
owner.Weaken(10)
var/obj/item/organ/external/E = owner.get_organ(parent_organ)
E.sever_artery()
E.germ_level = max(INFECTION_LEVEL_TWO, E.germ_level)
owner.adjustToxLoss(25)
removed()
qdel(src)