Merge pull request #9895 from Thalpy/OrganQoL
[READY] Organ quality of life fixes. Adds Organ fridges with items, Tweaks scanner, new surgery, tweaks chems
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
slot = ORGAN_SLOT_HEART
|
||||
|
||||
healing_factor = STANDARD_ORGAN_HEALING
|
||||
decay_factor = 3 * STANDARD_ORGAN_DECAY //designed to fail about 5 minutes after death
|
||||
decay_factor = 2.5 * STANDARD_ORGAN_DECAY //designed to fail about 5 minutes after death
|
||||
|
||||
low_threshold_passed = "<span class='info'>Prickles of pain appear then die out from within your chest...</span>"
|
||||
high_threshold_passed = "<span class='warning'>Something inside your chest hurts, and the pain isn't subsiding. You notice yourself breathing far faster than before.</span>"
|
||||
|
||||
@@ -95,13 +95,12 @@
|
||||
|
||||
//Checks to see if the organ is frozen from temperature
|
||||
/obj/item/organ/proc/is_cold()
|
||||
var/freezing_objects = list(/obj/structure/closet/crate/freezer, /obj/structure/closet/secure_closet/freezer, /obj/structure/bodycontainer, /obj/item/autosurgeon)
|
||||
if(istype(loc, /obj/))//Freezer of some kind, I hope.
|
||||
if(is_type_in_list(loc, freezing_objects))
|
||||
if(is_type_in_typecache(loc, GLOB.freezing_objects))
|
||||
if(!(organ_flags & ORGAN_FROZEN))//Incase someone puts them in when cold, but they warm up inside of the thing. (i.e. they have the flag, the thing turns it off, this rights it.)
|
||||
organ_flags |= ORGAN_FROZEN
|
||||
return TRUE
|
||||
return
|
||||
return (organ_flags & ORGAN_FROZEN) //Incase something else toggles it
|
||||
|
||||
var/local_temp
|
||||
if(istype(loc, /turf/))//Only concern is adding an organ to a freezer when the area around it is cold.
|
||||
@@ -111,7 +110,7 @@
|
||||
|
||||
else if(istype(loc, /mob/) && !owner)
|
||||
var/mob/M = loc
|
||||
if(is_type_in_list(M.loc, freezing_objects))
|
||||
if(is_type_in_typecache(M.loc, GLOB.freezing_objects))
|
||||
if(!(organ_flags & ORGAN_FROZEN))
|
||||
organ_flags |= ORGAN_FROZEN
|
||||
return TRUE
|
||||
@@ -121,7 +120,7 @@
|
||||
|
||||
if(owner)
|
||||
//Don't interfere with bodies frozen by structures.
|
||||
if(is_type_in_list(owner.loc, freezing_objects))
|
||||
if(is_type_in_typecache(owner.loc, GLOB.freezing_objects))
|
||||
if(!(organ_flags & ORGAN_FROZEN))
|
||||
organ_flags |= ORGAN_FROZEN
|
||||
return TRUE
|
||||
@@ -232,6 +231,8 @@
|
||||
if(delta > 0)
|
||||
if(damage >= maxHealth)
|
||||
organ_flags |= ORGAN_FAILING
|
||||
if(owner)
|
||||
owner.med_hud_set_status()
|
||||
return now_failing
|
||||
if(damage > high_threshold && prev_damage <= high_threshold)
|
||||
return high_threshold_passed
|
||||
@@ -239,6 +240,8 @@
|
||||
return low_threshold_passed
|
||||
else
|
||||
organ_flags &= ~ORGAN_FAILING
|
||||
if(owner)
|
||||
owner.med_hud_set_status()
|
||||
if(!owner)//Processing is stopped when the organ is dead and outside of someone. This hopefully should restart it if a removed organ is repaired outside of a body.
|
||||
START_PROCESSING(SSobj, src)
|
||||
if(prev_damage > low_threshold && damage <= low_threshold)
|
||||
@@ -273,6 +276,12 @@
|
||||
var/has_liver = (!(NOLIVER in dna.species.species_traits))
|
||||
var/has_stomach = (!(NOSTOMACH in dna.species.species_traits))
|
||||
|
||||
for(var/obj/item/organ/O in internal_organs)
|
||||
if(O.organ_flags & ORGAN_FAILING)
|
||||
O.setOrganDamage(0)
|
||||
if(only_one)
|
||||
return TRUE
|
||||
|
||||
if(has_liver && !getorganslot(ORGAN_SLOT_LIVER))
|
||||
var/obj/item/organ/liver/LI
|
||||
|
||||
@@ -362,3 +371,15 @@
|
||||
tail.Insert(src)
|
||||
if(only_one)
|
||||
return TRUE
|
||||
|
||||
|
||||
/obj/item/organ/random
|
||||
name = "Illegal organ"
|
||||
desc = "Something hecked up"
|
||||
|
||||
/obj/item/organ/random/Initialize()
|
||||
..()
|
||||
var/list = list(/obj/item/organ/tongue, /obj/item/organ/brain, /obj/item/organ/heart, /obj/item/organ/liver, /obj/item/organ/ears, /obj/item/organ/eyes, /obj/item/organ/tail, /obj/item/organ/stomach)
|
||||
var/newtype = pick(list)
|
||||
new newtype(loc)
|
||||
return INITIALIZE_HINT_QDEL
|
||||
|
||||
Reference in New Issue
Block a user