Nuke Limb Processing (#22814)

<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.
This commit is contained in:
VMSolidus
2026-07-12 20:45:24 +00:00
committed by GitHub
parent 48d8a06d1c
commit e117ef3f87
44 changed files with 310 additions and 216 deletions
@@ -249,7 +249,7 @@
for(var/obj/item/organ/internal/I in H.internal_organs)
if(!BP_IS_ROBOTIC(I))
if(I.organ_tag == BP_BRAIN)
var/brain_activity = 100 - ((I.damage / I.max_damage) * 100) //converts brain damage to a percentage, to calculate BA
var/brain_activity = 100 - ((I.get_damage() / I.max_damage) * 100) //converts brain damage to a percentage, to calculate BA
if(brain_activity >= 61) //will only treat brain activity below 61% brain activity
continue
I.heal_damage(4*removed)
@@ -283,7 +283,7 @@
for(var/obj/item/organ/internal/I in H.internal_organs)
if(!BP_IS_ROBOTIC(I))
if(I.organ_tag == BP_BRAIN)
var/brain_activity = 100 - ((I.damage / I.max_damage) * 100) //converts brain damage to a percentage, to calculate BA
var/brain_activity = 100 - ((I.get_damage() / I.max_damage) * 100) //converts brain damage to a percentage, to calculate BA
if(brain_activity >= 61) //will only treat brain activity below 61% brain activity
continue
I.heal_damage(4*removed)
@@ -658,10 +658,10 @@
var/mob/living/carbon/human/H = M
var/obj/item/organ/internal/eyes/E = H.get_eyes(no_synthetic = TRUE)
if(E && istype(E))
if(E.damage > 0)
E.damage = max(E.damage - 5 * removed, 0)
if(E.get_damage() > 0)
E.set_damage(max(E.get_damage() - 5 * removed, 0))
if(isvaurca(H))
if(E.damage < E.min_broken_damage && H.sdisabilities & BLIND)
if(E.get_damage() < E.min_broken_damage && H.sdisabilities & BLIND)
H.sdisabilities -= BLIND
/singleton/reagent/oculine/affect_chem_effect(var/mob/living/carbon/M, var/alien, var/removed, var/datum/reagents/holder)
@@ -691,17 +691,17 @@
for(var/obj/item/organ/internal/I in H.internal_organs)
if(I.organ_tag == BP_BRAIN)
if(I.damage >= I.min_bruised_damage)
if(I.get_damage() >= I.min_bruised_damage)
continue
if((I.damage > 0) && (I.robotic != 2)) //Peridaxon heals only non-robotic organs
if((I.get_damage() > 0) && (I.robotic != 2)) //Peridaxon heals only non-robotic organs
var/damage_healed = ((M.bodytemperature < 186) && M.chem_effects[CE_CRYO]) ? 2 : 1 //2x effective if administered in cryogenic conditions
I.damage = max(I.damage - damage_healed*removed, 0)
I.set_damage(max(I.get_damage() - damage_healed*removed, 0))
if((M.bodytemperature < 153) && M.chem_effects[CE_ANTIBIOTIC]) //peridaxon in extracool cryogenic conditions alongside antibiotics will have a chance to de-nercotise liver and kidneys, though will incur overdose symptoms
H.infest_with_parasite(H, BP_TUMOUR_NONSPREADING, pick(H.organs), 10)
for(var/obj/item/organ/internal/O in H.internal_organs)
if((O.organ_tag == BP_LIVER) || (O.organ_tag == BP_KIDNEYS))
if(O.damage && prob(5))
if(O.get_damage() && prob(5))
if((O.status & ORGAN_DEAD) && !BP_IS_ROBOTIC(O))
if(O.can_recover())
O.status &= ~ORGAN_DEAD
@@ -1485,12 +1485,14 @@
var/obj/item/organ/internal/brain = M.internal_organs_by_name[BP_BRAIN]
if((M.bodytemperature < 179) && (M.chem_effects[CE_CRYO])) //best use in cryogenics, experiment with Balanced or Prioritising Metabolisation settings, aiming for a gas cooler temperature target that minimises the cryostasis multiplier. remember the cryotube heats slowly when someone is inside.
if(brain)
if(brain.damage && brain.damage < brain.max_damage && !(M.chem_effects[CE_NEUROTOXIC])) //skips the oxygenation check under brain.dm
brain.damage = max(brain.damage - 16*removed, 0) //high number, as cryo slows metabolism. also needs to slightly outpace rough injuries to actually make it worthwhile to use.
var/brain_damage = brain.get_damage()
if(brain_damage && brain_damage < brain.max_damage && !(M.chem_effects[CE_NEUROTOXIC])) //skips the oxygenation check under brain.dm
brain.set_damage(max(brain_damage - 16*removed, 0)) //high number, as cryo slows metabolism. also needs to slightly outpace rough injuries to actually make it worthwhile to use.
else //without cryogenics. skips the oxygen check, however has large downsides if not pushed thorugh an IV to moderate volume in blood.
if(brain)
if(brain.damage && brain.damage < brain.max_damage && !(M.chem_effects[CE_NEUROTOXIC]) && prob(75))
brain.damage = max(brain.damage - 8*removed, 0) //pretty slow, non-guaranteed brain healing - 75% chance of restoring 2.5% brain activity per tick. only really useful during apocalyptic scenarios.
var/brain_damage = brain.get_damage()
if(brain_damage && brain_damage < brain.max_damage && !(M.chem_effects[CE_NEUROTOXIC]) && prob(75))
brain.set_damage(max(brain_damage - 8*removed, 0)) //pretty slow, non-guaranteed brain healing - 75% chance of restoring 2.5% brain activity per tick. only really useful during apocalyptic scenarios.
M.dizziness = max(200, M.dizziness + 15)
M.hallucination = max(M.hallucination, 100)
M.add_chemical_effect(CE_BLOODTHIN, 40) //treat (arterial) bleeding first
@@ -1780,7 +1782,7 @@
M.add_chemical_effect(CE_CARDIOTOXIC, -removed*2)
var/obj/item/organ/internal/heart/H = M.internal_organs_by_name[BP_HEART]
if(istype(H) && !BP_IS_ROBOTIC(H))
H.damage = max(H.damage - (removed * 2), 0)
H.set_damage(max(H.get_damage() - (removed * 2), 0))
..()
/singleton/reagent/adipemcina/overdose(var/mob/living/carbon/human/M, var/alien, var/datum/reagents/holder)
@@ -25,7 +25,7 @@
if(target_organ)
var/obj/item/organ/internal/I = H.internal_organs_by_name[target_organ]
if(I)
var/can_damage = I.max_damage - I.damage
var/can_damage = I.max_damage - I.get_damage()
if(can_damage > 0)
if(dam > can_damage)
I.take_internal_damage(can_damage, silent=TRUE)