Merge remote-tracking branch 'refs/remotes/Citadel-Station-13/master' into syntheticbloods
This commit is contained in:
@@ -17,9 +17,10 @@
|
||||
if(starting_organ)
|
||||
insert_organ(new starting_organ(src))
|
||||
|
||||
/obj/item/autosurgeon/proc/insert_organ(var/obj/item/I)
|
||||
/obj/item/autosurgeon/proc/insert_organ(var/obj/item/organ/I)
|
||||
storedorgan = I
|
||||
I.forceMove(src)
|
||||
I.organ_flags |= ORGAN_FROZEN //Stops decay
|
||||
name = "[initial(name)] ([storedorgan.name])"
|
||||
|
||||
/obj/item/autosurgeon/attack_self(mob/user)//when the object it used...
|
||||
@@ -125,4 +126,4 @@
|
||||
/obj/item/autosurgeon/womb
|
||||
desc = "A single use autosurgeon that contains a womb. A screwdriver can be used to remove it, but implants can't be placed back in."
|
||||
uses = 1
|
||||
starting_organ = /obj/item/organ/genital/womb
|
||||
starting_organ = /obj/item/organ/genital/womb
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
slot = ORGAN_SLOT_HEART
|
||||
|
||||
healing_factor = STANDARD_ORGAN_HEALING
|
||||
decay_factor = 4 * STANDARD_ORGAN_DECAY //designed to fail about 5 minutes after death
|
||||
decay_factor = 3 * 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>"
|
||||
@@ -61,6 +61,7 @@
|
||||
return S
|
||||
|
||||
/obj/item/organ/heart/on_life()
|
||||
..()
|
||||
if(owner.client && beating)
|
||||
failed = FALSE
|
||||
var/sound/slowbeat = sound('sound/health/slowbeat.ogg', repeat = TRUE)
|
||||
|
||||
@@ -12,10 +12,12 @@
|
||||
var/operated = FALSE //whether we can still have our damages fixed through surgery
|
||||
|
||||
//health
|
||||
maxHealth = LUNGS_MAX_HEALTH
|
||||
maxHealth = 3 * STANDARD_ORGAN_THRESHOLD
|
||||
|
||||
healing_factor = STANDARD_ORGAN_HEALING
|
||||
decay_factor = STANDARD_ORGAN_DECAY
|
||||
high_threshold = 0.6 * LUNGS_MAX_HEALTH //threshold at 180
|
||||
low_threshold = 0.3 * LUNGS_MAX_HEALTH //threshold at 90
|
||||
|
||||
high_threshold_passed = "<span class='warning'>You feel some sort of constriction around your chest as your breathing becomes shallow and rapid.</span>"
|
||||
now_fixed = "<span class='warning'>Your lungs seem to once again be able to hold air.</span>"
|
||||
|
||||
@@ -41,6 +41,9 @@
|
||||
else
|
||||
qdel(replaced)
|
||||
|
||||
//Hopefully this doesn't cause problems
|
||||
organ_flags &= ~ORGAN_FROZEN
|
||||
|
||||
owner = M
|
||||
M.internal_organs |= src
|
||||
M.internal_organs_slot[slot] = src
|
||||
@@ -64,30 +67,88 @@
|
||||
A.Remove(M)
|
||||
START_PROCESSING(SSobj, src)
|
||||
|
||||
|
||||
/obj/item/organ/proc/on_find(mob/living/finder)
|
||||
return
|
||||
|
||||
/obj/item/organ/process()
|
||||
/obj/item/organ/process() //runs decay when outside of a person AND ONLY WHEN OUTSIDE (i.e. long obj).
|
||||
on_death() //Kinda hate doing it like this, but I really don't want to call process directly.
|
||||
|
||||
/obj/item/organ/proc/on_death() //runs decay when outside of a person
|
||||
if(organ_flags & (ORGAN_SYNTHETIC | ORGAN_FROZEN | ORGAN_NO_SPOIL))
|
||||
//Sources; life.dm process_organs
|
||||
/obj/item/organ/proc/on_death() //Runs when outside AND inside.
|
||||
decay()
|
||||
|
||||
//Applys the slow damage over time decay
|
||||
/obj/item/organ/proc/decay()
|
||||
if(!can_decay())
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
return
|
||||
is_cold()
|
||||
if(organ_flags & ORGAN_FROZEN)
|
||||
return
|
||||
applyOrganDamage(maxHealth * decay_factor)
|
||||
|
||||
/obj/item/organ/proc/can_decay()
|
||||
if(CHECK_BITFIELD(organ_flags, ORGAN_NO_SPOIL | ORGAN_SYNTHETIC | ORGAN_FAILING))
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
//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(!(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
|
||||
|
||||
var/local_temp
|
||||
if(istype(loc, /turf/))//Only concern is adding an organ to a freezer when the area around it is cold.
|
||||
var/turf/T = loc
|
||||
var/datum/gas_mixture/enviro = T.return_air()
|
||||
local_temp = enviro.temperature
|
||||
|
||||
else if(istype(loc, /mob/) && !owner)
|
||||
var/mob/M = loc
|
||||
if(is_type_in_list(M.loc, freezing_objects))
|
||||
if(!(organ_flags & ORGAN_FROZEN))
|
||||
organ_flags |= ORGAN_FROZEN
|
||||
return TRUE
|
||||
var/turf/T = M.loc
|
||||
var/datum/gas_mixture/enviro = T.return_air()
|
||||
local_temp = enviro.temperature
|
||||
|
||||
if(owner)
|
||||
//Don't interfere with bodies frozen by structures.
|
||||
if(is_type_in_list(owner.loc, freezing_objects))
|
||||
if(!(organ_flags & ORGAN_FROZEN))
|
||||
organ_flags |= ORGAN_FROZEN
|
||||
return TRUE
|
||||
local_temp = owner.bodytemperature
|
||||
|
||||
if(!local_temp)//Shouldn't happen but in case
|
||||
return
|
||||
if(local_temp < 154)//I have a pretty shaky citation that states -120 allows indefinite cyrostorage
|
||||
organ_flags |= ORGAN_FROZEN
|
||||
return TRUE
|
||||
organ_flags &= ~ORGAN_FROZEN
|
||||
return FALSE
|
||||
|
||||
/obj/item/organ/proc/on_life() //repair organ damage if the organ is not failing
|
||||
if(!(organ_flags & ORGAN_FAILING))
|
||||
///Damage decrements by a percent of its maxhealth
|
||||
var/healing_amount = -(maxHealth * healing_factor)
|
||||
///Damage decrements again by a percent of its maxhealth, up to a total of 4 extra times depending on the owner's health
|
||||
healing_amount -= owner.satiety > 0 ? 4 * healing_factor * owner.satiety / MAX_SATIETY : 0
|
||||
applyOrganDamage(healing_amount) //to FERMI_TWEAK
|
||||
//Make it so each threshold is stuck.
|
||||
if(organ_flags & ORGAN_FAILING)
|
||||
return
|
||||
if(is_cold())
|
||||
return
|
||||
///Damage decrements by a percent of its maxhealth
|
||||
var/healing_amount = -(maxHealth * healing_factor)
|
||||
///Damage decrements again by a percent of its maxhealth, up to a total of 4 extra times depending on the owner's health
|
||||
healing_amount -= owner.satiety > 0 ? 4 * healing_factor * owner.satiety / MAX_SATIETY : 0
|
||||
applyOrganDamage(healing_amount) //to FERMI_TWEAK
|
||||
//Make it so each threshold is stuck.
|
||||
|
||||
/obj/item/organ/examine(mob/user)
|
||||
. = ..()
|
||||
if(!organ_flags & ORGAN_FAILING)
|
||||
if(organ_flags & ORGAN_FAILING)
|
||||
if(status == ORGAN_ROBOTIC)
|
||||
. += "<span class='warning'>[src] seems to be broken!</span>"
|
||||
return
|
||||
@@ -177,6 +238,8 @@
|
||||
return low_threshold_passed
|
||||
else
|
||||
organ_flags &= ~ORGAN_FAILING
|
||||
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)
|
||||
return low_threshold_cleared
|
||||
if(prev_damage > high_threshold && damage <= high_threshold)
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
low_threshold_cleared = "<span class='info'>The last bouts of pain in your stomach have died out.</span>"
|
||||
|
||||
/obj/item/organ/stomach/on_life()
|
||||
..()
|
||||
var/datum/reagent/consumable/nutriment/Nutri
|
||||
if(ishuman(owner))
|
||||
var/mob/living/carbon/human/H = owner
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
/datum/language/aphasia,
|
||||
/datum/language/slime,
|
||||
))
|
||||
healing_factor = STANDARD_ORGAN_HEALING*5 //Fast!!
|
||||
decay_factor = STANDARD_ORGAN_DECAY/2
|
||||
|
||||
/obj/item/organ/tongue/Initialize(mapload)
|
||||
. = ..()
|
||||
@@ -209,6 +211,8 @@
|
||||
phomeme_type = pick(phomeme_types)
|
||||
|
||||
/obj/item/organ/tongue/bone/applyOrganDamage(var/d, var/maximum = maxHealth)
|
||||
if(d < 0)
|
||||
return
|
||||
if(!owner)
|
||||
return
|
||||
var/target = owner.get_bodypart(BODY_ZONE_HEAD)
|
||||
|
||||
Reference in New Issue
Block a user