mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-18 10:33:30 +01:00
Merge remote-tracking branch 'refs/remotes/ParadiseSS13/master'
# Conflicts: # icons/mob/human_face.dmi
This commit is contained in:
@@ -24,6 +24,11 @@ var/list/organ_cache = list()
|
||||
var/datum/dna/dna
|
||||
var/datum/species/species
|
||||
|
||||
// Stuff for tracking if this is on a tile with an open freezer or not
|
||||
var/last_freezer_update_time = 0
|
||||
var/freezer_update_period = 100
|
||||
var/is_in_freezer = 0
|
||||
|
||||
/obj/item/organ/Destroy()
|
||||
if(!owner)
|
||||
return ..()
|
||||
@@ -106,8 +111,7 @@ var/list/organ_cache = list()
|
||||
if(status & ORGAN_DEAD)
|
||||
return
|
||||
|
||||
// Don't process if we're in a freezer, an MMI or a stasis bag. //TODO: ambient temperature?
|
||||
if(istype(loc,/obj/item/device/mmi) || istype(loc,/obj/item/bodybag/cryobag) || istype(loc,/obj/structure/closet/crate/freezer))
|
||||
if(is_preserved())
|
||||
return
|
||||
|
||||
//Process infections
|
||||
@@ -121,8 +125,11 @@ var/list/organ_cache = list()
|
||||
if(B && prob(40))
|
||||
reagents.remove_reagent("blood",0.1)
|
||||
blood_splatter(src,B,1)
|
||||
|
||||
germ_level += rand(2,6)
|
||||
// Maybe scale it down a bit, have it REALLY kick in once past the basic infection threshold
|
||||
// Another mercy for surgeons preparing transplant organs
|
||||
germ_level++
|
||||
if(germ_level >= INFECTION_LEVEL_ONE)
|
||||
germ_level += rand(2,6)
|
||||
if(germ_level >= INFECTION_LEVEL_TWO)
|
||||
germ_level += rand(2,6)
|
||||
if(germ_level >= INFECTION_LEVEL_THREE)
|
||||
@@ -140,6 +147,30 @@ var/list/organ_cache = list()
|
||||
if(damage >= max_damage)
|
||||
die()
|
||||
|
||||
/obj/item/organ/proc/is_preserved()
|
||||
if(istype(loc,/obj/item/device/mmi))
|
||||
germ_level = max(0, germ_level - 1) // So a brain can slowly recover from being left out of an MMI
|
||||
return 1
|
||||
if(is_found_within(/obj/item/bodybag/cryobag))
|
||||
return 1
|
||||
if(is_found_within(/obj/structure/closet/crate/freezer))
|
||||
return 1
|
||||
if(istype(loc,/turf))
|
||||
if(world.time - last_freezer_update_time > freezer_update_period)
|
||||
// I don't want to loop through everything in the tile constantly, especially since it'll be a pile of organs
|
||||
// if the virologist releases gibbingtons again or something
|
||||
// There's probably a much less silly way of doing this, but BYOND native algorithms are stupidly naive
|
||||
is_in_freezer = 0
|
||||
for(var/obj/structure/closet/crate/freezer/F in loc.contents)
|
||||
if(F.opened)
|
||||
is_in_freezer = 1 // on the same tile, close enough, should keep organs much fresher on avg
|
||||
break
|
||||
last_freezer_update_time = world.time
|
||||
return is_in_freezer // I'd like static varibles, please
|
||||
|
||||
// You can do your cool location temperature organ preserving effects here!
|
||||
return 0
|
||||
|
||||
/obj/item/organ/examine(mob/user)
|
||||
..(user)
|
||||
if(status & ORGAN_DEAD)
|
||||
@@ -175,6 +206,7 @@ var/list/organ_cache = list()
|
||||
|
||||
/obj/item/organ/proc/rejuvenate()
|
||||
damage = 0
|
||||
germ_level = 0
|
||||
|
||||
/obj/item/organ/proc/is_damaged()
|
||||
return damage > 0
|
||||
@@ -189,15 +221,16 @@ var/list/organ_cache = list()
|
||||
/obj/item/organ/proc/handle_antibiotics()
|
||||
var/antibiotics = owner.reagents.get_reagent_amount("spaceacillin")
|
||||
|
||||
if (!germ_level || antibiotics < 5)
|
||||
if (!germ_level || antibiotics <= 0.4)
|
||||
return
|
||||
|
||||
if (germ_level < INFECTION_LEVEL_ONE)
|
||||
germ_level = 0 //cure instantly
|
||||
else if (germ_level < INFECTION_LEVEL_TWO)
|
||||
germ_level -= 6 //at germ_level == 500, this should cure the infection in a minute
|
||||
germ_level -= 24 //at germ_level == 500, this should cure the infection in 15 seconds
|
||||
else
|
||||
germ_level -= 2 //at germ_level == 1000, this will cure the infection in 5 minutes
|
||||
germ_level -= 8 // at germ_level == 1000, this will cure the infection in 1 minute, 15 seconds
|
||||
// Let's not drag this on, medbay has only so much antibiotics
|
||||
|
||||
//Adds autopsy data for used_weapon.
|
||||
/obj/item/organ/proc/add_autopsy_data(var/used_weapon, var/damage)
|
||||
@@ -256,13 +289,14 @@ var/list/organ_cache = list()
|
||||
take_damage(0,3)
|
||||
|
||||
/obj/item/organ/proc/removed(var/mob/living/user)
|
||||
|
||||
if(!istype(owner))
|
||||
return
|
||||
|
||||
owner.internal_organs_by_name[organ_tag] = null
|
||||
owner.internal_organs_by_name -= organ_tag
|
||||
owner.internal_organs_by_name -= null
|
||||
if(is_primary_organ())
|
||||
owner.internal_organs_by_name[organ_tag] = null
|
||||
owner.internal_organs_by_name -= organ_tag
|
||||
owner.internal_organs_by_name -= null // uh what does this line even do this seems silly
|
||||
|
||||
owner.internal_organs -= src
|
||||
|
||||
var/obj/item/organ/external/affected = owner.get_organ(parent_organ)
|
||||
@@ -275,7 +309,7 @@ var/list/organ_cache = list()
|
||||
if(!organ_blood || !organ_blood.data["blood_DNA"])
|
||||
owner.vessel.trans_to(src, 5, 1, 1)
|
||||
|
||||
if(owner && vital)
|
||||
if(owner && vital && is_primary_organ()) // I'd do another check for species or whatever so that you couldn't "kill" an IPC by removing a human head from them, but it doesn't matter since they'll come right back from the dead
|
||||
if(user)
|
||||
user.attack_log += "\[[time_stamp()]\]<font color='red'> removed a vital organ ([src]) from [key_name(owner)] (INTENT: [uppertext(user.a_intent)])</font>"
|
||||
owner.attack_log += "\[[time_stamp()]\]<font color='orange'> had a vital organ ([src]) removed by [key_name(user)] (INTENT: [uppertext(user.a_intent)])</font>"
|
||||
@@ -291,7 +325,8 @@ var/list/organ_cache = list()
|
||||
processing_objects -= src
|
||||
target.internal_organs |= src
|
||||
affected.internal_organs |= src
|
||||
target.internal_organs_by_name[organ_tag] = src
|
||||
if (!(organ_tag in target.internal_organs_by_name))
|
||||
target.internal_organs_by_name[organ_tag] = src // In case multiple of the same type are inserted, only the first one is the primary organ
|
||||
src.loc = target
|
||||
if(robotic)
|
||||
status |= ORGAN_ROBOT
|
||||
@@ -326,4 +361,16 @@ var/list/organ_cache = list()
|
||||
qdel(src)
|
||||
|
||||
/obj/item/organ/proc/surgeryize()
|
||||
return
|
||||
return
|
||||
|
||||
/*
|
||||
Returns 1 if this is the organ that is handling all the functionalities of that particular organ slot
|
||||
Returns 0 if it isn't
|
||||
I use this so that this can be made better once the organ overhaul rolls out -- Crazylemon
|
||||
*/
|
||||
/obj/item/organ/proc/is_primary_organ(var/mob/living/carbon/human/O = null)
|
||||
if (isnull(O))
|
||||
O = owner
|
||||
if (!istype(owner)) // You're not the primary organ of ANYTHING, bucko
|
||||
return 0
|
||||
return src == O.internal_organs_by_name[organ_tag]
|
||||
|
||||
@@ -79,24 +79,28 @@
|
||||
switch(stage)
|
||||
if(0)
|
||||
if(istype(W,/obj/item/weapon/scalpel))
|
||||
spread_germs_to_organ(src,user)
|
||||
user.visible_message("<span class='danger'><b>[user]</b> cuts [src] open with [W]!")
|
||||
stage++
|
||||
return
|
||||
if(1)
|
||||
if(istype(W,/obj/item/weapon/retractor))
|
||||
spread_germs_to_organ(src,user)
|
||||
user.visible_message("<span class='danger'><b>[user]</b> cracks [src] open like an egg with [W]!")
|
||||
stage++
|
||||
return
|
||||
if(2)
|
||||
if(istype(W,/obj/item/weapon/hemostat))
|
||||
spread_germs_to_organ(src,user)
|
||||
if(contents.len)
|
||||
var/obj/item/removing = pick(contents)
|
||||
removing.loc = get_turf(user.loc)
|
||||
var/obj/item/organ/O = removing
|
||||
if(istype(O))
|
||||
O.status |= ORGAN_CUT_AWAY
|
||||
spread_germs_to_organ(O,user) // This wouldn't be any cleaner than the actual surgery
|
||||
O.removed(user)
|
||||
else if(!(user.l_hand && user.r_hand))
|
||||
if(!(user.l_hand && user.r_hand))
|
||||
user.put_in_hands(removing)
|
||||
user.visible_message("<span class='danger'><b>[user]</b> extracts [removing] from [src] with [W]!")
|
||||
else
|
||||
@@ -855,7 +859,8 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
|
||||
release_restraints(victim)
|
||||
victim.organs -= src
|
||||
victim.organs_by_name[limb_name] = null // Remove from owner's vars.
|
||||
if(is_primary_organ(victim))
|
||||
victim.organs_by_name[limb_name] = null // Remove from owner's vars.
|
||||
|
||||
//Robotic limbs explode if sabotaged.
|
||||
if(is_robotic && sabotaged)
|
||||
@@ -885,3 +890,10 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
"\red <b>Your [name] melts away!</b>", \
|
||||
"\red You hear a sickening sizzle.")
|
||||
disfigured = 1
|
||||
|
||||
/obj/item/organ/external/is_primary_organ(var/mob/living/carbon/human/O = null)
|
||||
if (isnull(O))
|
||||
O = owner
|
||||
if (!istype(O)) // You're not the primary organ of ANYTHING, bucko
|
||||
return 0
|
||||
return src == O.organs_by_name[limb_name]
|
||||
|
||||
@@ -137,7 +137,9 @@
|
||||
|
||||
/obj/item/organ/external/head/removed()
|
||||
if(owner)
|
||||
name = "[owner.real_name]'s head"
|
||||
if(!istype(dna))
|
||||
dna = owner.dna.Clone()
|
||||
name = "[dna.real_name]'s head"
|
||||
owner.unEquip(owner.glasses)
|
||||
owner.unEquip(owner.head)
|
||||
owner.unEquip(owner.l_ear)
|
||||
|
||||
Reference in New Issue
Block a user