mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-21 02:57:48 +01:00
Revives Organ Datumization (#23397)
* first runthrough lol * okay make this shit actually work * nerfs slime people * fixes * more changes * fix * bim bim bam bam * ok back in the head becuz i dont give a shit * Sirryan review * Sirryan review * Fixes CI * Stealthy CI fail --------- Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com>
This commit is contained in:
@@ -3,8 +3,10 @@
|
||||
pressure_resistance = 15
|
||||
var/list/stomach_contents
|
||||
var/list/processing_patches
|
||||
var/list/internal_organs = list()
|
||||
var/list/internal_organs_slot = list() //Same as above, but stores "slot ID" - "organ" pairs for easy access.
|
||||
var/list/internal_organs = list()
|
||||
var/list/internal_organs_slot = list() //Same as above, but stores "slot ID" - "organ" pairs for easy access.
|
||||
/// An associated list of strings that associate it with the organ datum, e.g. [ORGAN_DATUM_HEART] = /datum/organ/heart
|
||||
var/list/internal_organ_datums = list()
|
||||
|
||||
var/life_tick = 0 // The amount of life ticks that have processed on this mob.
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
if(status_flags & GODMODE)
|
||||
return FALSE
|
||||
|
||||
var/lungs = get_organ_slot("lungs")
|
||||
var/lungs = get_int_organ_datum(ORGAN_DATUM_LUNGS)
|
||||
if(!lungs)
|
||||
adjustOxyLoss(2)
|
||||
|
||||
@@ -201,6 +201,9 @@
|
||||
for(var/thing in internal_organs)
|
||||
var/obj/item/organ/internal/O = thing
|
||||
O.on_life()
|
||||
for(var/organ_tag in internal_organ_datums)
|
||||
var/datum/organ/datum_organ_var_name_idk = internal_organ_datums[organ_tag]
|
||||
datum_organ_var_name_idk.on_life()
|
||||
|
||||
/mob/living/carbon/handle_diseases()
|
||||
for(var/thing in viruses)
|
||||
|
||||
@@ -131,31 +131,31 @@
|
||||
|
||||
/mob/living/carbon/human/check_breath(datum/gas_mixture/breath)
|
||||
|
||||
var/obj/item/organ/internal/L = get_organ_slot("lungs")
|
||||
var/datum/organ/lungs/lung_datum = get_int_organ_datum(ORGAN_DATUM_LUNGS)
|
||||
|
||||
if(!L || L && (L.status & ORGAN_DEAD))
|
||||
if(health >= HEALTH_THRESHOLD_CRIT)
|
||||
adjustOxyLoss(HUMAN_MAX_OXYLOSS + 1)
|
||||
else if(!HAS_TRAIT(src, TRAIT_NOCRITDAMAGE))
|
||||
adjustOxyLoss(HUMAN_MAX_OXYLOSS)
|
||||
if(lung_datum && !(lung_datum.linked_organ.status & ORGAN_DEAD))
|
||||
lung_datum.check_breath(breath, src)
|
||||
return
|
||||
|
||||
if(dna.species)
|
||||
var/datum/species/S = dna.species
|
||||
// We have no lungs, or our lungs are dead!
|
||||
if(health >= HEALTH_THRESHOLD_CRIT)
|
||||
adjustOxyLoss(HUMAN_MAX_OXYLOSS + 1)
|
||||
else if(!HAS_TRAIT(src, TRAIT_NOCRITDAMAGE))
|
||||
adjustOxyLoss(HUMAN_MAX_OXYLOSS)
|
||||
|
||||
if(S.breathid == "o2")
|
||||
if(dna.species)
|
||||
var/datum/species/S = dna.species
|
||||
|
||||
switch(S.breathid)
|
||||
if("o2")
|
||||
throw_alert("not_enough_oxy", /obj/screen/alert/not_enough_oxy)
|
||||
else if(S.breathid == "tox")
|
||||
if("tox")
|
||||
throw_alert("not_enough_tox", /obj/screen/alert/not_enough_tox)
|
||||
else if(S.breathid == "co2")
|
||||
if("co2") // currently unused
|
||||
throw_alert("not_enough_co2", /obj/screen/alert/not_enough_co2)
|
||||
else if(S.breathid == "n2")
|
||||
if("n2")
|
||||
throw_alert("not_enough_nitro", /obj/screen/alert/not_enough_nitro)
|
||||
|
||||
return FALSE
|
||||
else
|
||||
if(istype(L, /obj/item/organ/internal/lungs))
|
||||
var/obj/item/organ/internal/lungs/lun = L
|
||||
lun.check_breath(breath, src)
|
||||
return FALSE
|
||||
|
||||
// USED IN DEATHWHISPERS
|
||||
/mob/living/carbon/human/proc/isInCrit()
|
||||
@@ -796,14 +796,13 @@
|
||||
H.fakevomit()
|
||||
|
||||
/mob/living/carbon/human/proc/handle_heartbeat()
|
||||
var/client/C = src.client
|
||||
if(C && C.prefs.sound & SOUND_HEARTBEAT) //disable heartbeat by pref
|
||||
var/obj/item/organ/internal/heart/H = get_int_organ(/obj/item/organ/internal/heart)
|
||||
if(client && client.prefs.sound & SOUND_HEARTBEAT) //disable heartbeat by pref
|
||||
var/datum/organ/heart/H = get_int_organ_datum(ORGAN_DATUM_HEART)
|
||||
|
||||
if(!H) //H.status will runtime if there is no H (obviously)
|
||||
return
|
||||
|
||||
if(H.is_robotic()) //Handle robotic hearts specially with a wuuuubb. This also applies to machine-people.
|
||||
if(H.linked_organ.is_robotic()) //Handle robotic hearts specially with a wuuuubb. This also applies to machine-people.
|
||||
if(isinspace())
|
||||
//PULSE_THREADY - maximum value for pulse, currently it 5.
|
||||
//High pulse value corresponds to a fast rate of heartbeat.
|
||||
@@ -816,7 +815,6 @@
|
||||
|
||||
else
|
||||
heartbeat++
|
||||
return
|
||||
return
|
||||
|
||||
if(pulse == PULSE_NONE)
|
||||
@@ -851,21 +849,18 @@
|
||||
if(!can_heartattack())
|
||||
return FALSE
|
||||
|
||||
var/obj/item/organ/internal/heart/heart = get_int_organ(/obj/item/organ/internal/heart)
|
||||
if(!istype(heart) || (heart.status & ORGAN_DEAD) || !heart.beating)
|
||||
var/datum/organ/heart/heart_datum = get_int_organ_datum(ORGAN_DATUM_HEART)
|
||||
if(!istype(heart_datum) || (heart_datum.linked_organ.status & ORGAN_DEAD))
|
||||
return TRUE
|
||||
|
||||
return FALSE
|
||||
return !heart_datum.beating
|
||||
|
||||
|
||||
/mob/living/carbon/human/proc/set_heartattack(status)
|
||||
if(!can_heartattack())
|
||||
return FALSE
|
||||
|
||||
var/obj/item/organ/internal/heart/heart = get_int_organ(/obj/item/organ/internal/heart)
|
||||
if(!istype(heart))
|
||||
return FALSE
|
||||
|
||||
heart.beating = !status
|
||||
var/datum/organ/heart/heart_datum = get_int_organ_datum(ORGAN_DATUM_HEART)
|
||||
heart_datum?.change_beating(!status)
|
||||
|
||||
/mob/living/carbon/human/handle_heartattack()
|
||||
if(!can_heartattack() || !undergoing_cardiac_arrest() || reagents.has_reagent("corazone"))
|
||||
|
||||
@@ -1207,20 +1207,16 @@
|
||||
..()
|
||||
|
||||
/mob/living/carbon/human/proc/is_lung_ruptured()
|
||||
var/obj/item/organ/internal/lungs/L = get_int_organ(/obj/item/organ/internal/lungs)
|
||||
if(!L)
|
||||
return 0
|
||||
var/datum/organ/lungs/L = get_int_organ_datum(ORGAN_DATUM_LUNGS)
|
||||
|
||||
return L.is_bruised()
|
||||
return L?.linked_organ.is_bruised()
|
||||
|
||||
/mob/living/carbon/human/proc/rupture_lung()
|
||||
var/obj/item/organ/internal/lungs/L = get_int_organ(/obj/item/organ/internal/lungs)
|
||||
if(!L)
|
||||
return 0
|
||||
|
||||
if(!L.is_bruised())
|
||||
L.custom_pain("You feel a stabbing pain in your chest!")
|
||||
L.damage = L.min_bruised_damage
|
||||
var/datum/organ/lungs/L = get_int_organ_datum(ORGAN_DATUM_LUNGS)
|
||||
if(L && !L.linked_organ.is_bruised())
|
||||
var/obj/item/organ/external/affected = get_organ("chest")
|
||||
affected.custom_pain("You feel a stabbing pain in your chest!")
|
||||
L.linked_organ.damage = L.linked_organ.min_bruised_damage
|
||||
|
||||
/mob/living/carbon/human/cuff_resist(obj/item/I)
|
||||
if(HAS_TRAIT(src, TRAIT_HULK))
|
||||
|
||||
@@ -162,17 +162,6 @@ old_ue: Set this to a UE string, and this proc will overwrite the dna of organs
|
||||
if(assimilate || O.dna.unique_enzymes == ue_to_compare)
|
||||
O.set_dna(dna)
|
||||
|
||||
/*
|
||||
Given the name of an organ, returns the external organ it's contained in
|
||||
I use this to standardize shadowling dethrall code
|
||||
-- Crazylemon
|
||||
*/
|
||||
/mob/living/carbon/human/proc/named_organ_parent(organ_name)
|
||||
if(!get_int_organ_tag(organ_name))
|
||||
return null
|
||||
var/obj/item/organ/internal/O = get_int_organ_tag(organ_name)
|
||||
return O.parent_organ
|
||||
|
||||
/mob/living/carbon/human/has_organic_damage()
|
||||
var/robo_damage = 0
|
||||
var/perma_injury_damage = 0
|
||||
|
||||
@@ -67,10 +67,10 @@
|
||||
return TRUE
|
||||
// how do species that don't breathe talk? magic, that's what.
|
||||
var/breathes = (!HAS_TRAIT(src, TRAIT_NOBREATH))
|
||||
var/obj/item/organ/internal/L = get_organ_slot("lungs")
|
||||
var/datum/organ/lungs/L = get_int_organ_datum(ORGAN_DATUM_LUNGS)
|
||||
if(HAS_TRAIT(src, TRAIT_MUTE))
|
||||
return FALSE
|
||||
if((breathes && !L) || breathes && L && (L.status & ORGAN_DEAD))
|
||||
if(breathes && (!L || L.linked_organ.status & ORGAN_DEAD))
|
||||
return FALSE
|
||||
if(mind)
|
||||
return !mind.miming
|
||||
|
||||
@@ -49,9 +49,7 @@
|
||||
|
||||
vision_organ = null
|
||||
has_organ = list(
|
||||
"heart" = /obj/item/organ/internal/heart/slime,
|
||||
"brain" = /obj/item/organ/internal/brain/slime,
|
||||
"lungs" = /obj/item/organ/internal/lungs/slime
|
||||
"brain" = /obj/item/organ/internal/brain/slime
|
||||
)
|
||||
mutantears = null
|
||||
suicide_messages = list(
|
||||
|
||||
Reference in New Issue
Block a user