mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-13 00:47:31 +01:00
e117ef3f87
<img width="1549" height="857" alt="image" src="https://github.com/user-attachments/assets/3830233d-0635-4942-b2aa-024651e6cffa" /> Limbs make up roughly half of the "Per additional player" processing overhead, while Organs make up most of the other half. Not every organ is an easy candidate for "Event-only processing", but external limbs are significantly easier to do so. So this PR makes it so that External Limbs no longer require Processing unless an event happens that would justify them requiring processing. Which SIGNIFICANTLY reduces the overall additional cost to the Processing subsystem per player that joins the server. Oh and I also made the Appendix and Kidneys not require constant processing. The Appendix will only process if it is hit by an Appendicitis event, and the Kidneys will only process if they are either damaged, or you get poisoned.
81 lines
2.6 KiB
Plaintext
81 lines
2.6 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
|
|
|
|
/**
|
|
* Override so that the appendix will never process on its own.
|
|
* It is instead added to processing via the spontaneous_appendicitis event.
|
|
*/
|
|
/obj/item/organ/internal/appendix/process_initialize()
|
|
return
|
|
|
|
/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 PROCESS_KILL
|
|
|
|
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)
|
|
if(E)
|
|
E.sever_artery()
|
|
E.germ_level = max(INFECTION_LEVEL_TWO, E.germ_level)
|
|
owner.adjustToxLoss(25)
|
|
removed()
|
|
qdel(src)
|