Merge branch 'master' of https://github.com/ParadiseSS13/Paradise into mitocholide_organ_rejuv

This commit is contained in:
Crazylemon64
2016-03-18 20:17:39 -07:00
24 changed files with 171 additions and 36 deletions
+1 -1
View File
@@ -84,7 +84,7 @@ var/list/organ_cache = list()
return
//Process infections
if ((status & ORGAN_ROBOT) || (sterile) ||(owner && owner.species && (owner.species.flags & IS_PLANT)))
if ((status & ORGAN_ROBOT) || sterile ||(owner && owner.species && (owner.species.flags & IS_PLANT)))
germ_level = 0
return
+23 -6
View File
@@ -30,8 +30,9 @@
var/cannot_amputate
var/cannot_break
var/s_tone
var/list/s_col = list()
var/list/s_col = null // If this is instantiated, it should be a list of length 3
var/list/wounds = list()
var/list/child_icons = list()
var/number_wounds = 0 // cache the number of wounds, which is NOT wounds.len!
var/perma_injury = 0
// 0: Don't fail when at full damage
@@ -64,6 +65,7 @@
var/amputation_point // Descriptive string used in amputation.
var/can_grasp
var/can_stand
var/wound_cleanup_timer
/obj/item/organ/external/Destroy()
if(parent && parent.children)
@@ -78,6 +80,10 @@
for(var/obj/item/organ/external/C in children)
qdel(C)
if(wound_cleanup_timer)
deltimer(wound_cleanup_timer)
wound_cleanup_timer = null
return ..()
/obj/item/organ/external/attackby(obj/item/weapon/W as obj, mob/user as mob)
@@ -392,6 +398,11 @@ This function completely restores a damaged organ to perfect condition.
last_dam = brute_dam + burn_dam
if(germ_level)
return 1
if(!wound_cleanup_timer)
wound_cleanup_timer = addtimer(src, "cleanup_wounds", SecondsToTicks(600), 1, wounds)
if (update_icon())
owner.UpdateDamageIcon(1)
return 0
/obj/item/organ/external/process()
@@ -525,11 +536,6 @@ Note that amputating the affected organ does in fact remove the infection from t
return
for(var/datum/wound/W in wounds)
// wounds can disappear after 10 minutes at the earliest
if(W.damage <= 0 && W.created + 10 * 10 * 60 <= world.time)
wounds -= W
continue
// let the GC handle the deletion of the wound
// Internal wounds get worse over time. Low temperatures (cryo) stop them.
if(W.internal && !W.can_autoheal() && owner.bodytemperature >= 170)
@@ -941,3 +947,14 @@ Note that amputating the affected organ does in fact remove the infection from t
if (!istype(O)) // You're not the primary organ of ANYTHING, bucko
return 0
return src == O.organs_by_name[limb_name]
// The callback we use to remove wounds from an un-processed limb
/obj/item/organ/external/proc/cleanup_wounds(var/list/slated_wounds)
wound_cleanup_timer = null
for(var/datum/wound/W in slated_wounds)
if(!W)
continue
if(W.damage > 0)
continue
wounds -= W
qdel(W)
+13 -5
View File
@@ -1,34 +1,42 @@
var/global/list/limb_icon_cache = list()
/obj/item/organ/external/proc/compile_icon()
overlays.Cut()
// I do this so the head's overlays don't get obliterated
for(var/child_i in child_icons)
overlays -= child_i
child_icons.Cut()
// This is a kludge, only one icon has more than one generation of children though.
for(var/obj/item/organ/external/organ in contents)
if(organ.children && organ.children.len)
for(var/obj/item/organ/external/child in organ.children)
overlays += child.mob_icon
child_icons += child.mob_icon
overlays += organ.mob_icon
child_icons += organ.mob_icon
/obj/item/organ/external/proc/sync_colour_to_human(var/mob/living/carbon/human/human)
s_tone = null
s_col = null
if(status & ORGAN_ROBOT && !(species && species.name == "Machine")) //machine people get skin color
return
if(species && human.species && species.name != human.species.name)
return
if(dna.unique_enzymes != human.dna.unique_enzymes) // This isn't MY arm
sync_colour_to_dna()
return
if(!isnull(human.s_tone) && (human.species.bodyflags & HAS_SKIN_TONE))
s_col = null
s_tone = human.s_tone
if(human.species.bodyflags & HAS_SKIN_COLOR)
s_tone = null
s_col = list(human.r_skin, human.g_skin, human.b_skin)
/obj/item/organ/external/proc/sync_colour_to_dna()
s_tone = null
s_col = null
if(status & ORGAN_ROBOT)
return
if(!isnull(dna.GetUIValue(DNA_UI_SKIN_TONE)) && (species.flags & HAS_SKIN_TONE))
s_col = null
s_tone = dna.GetUIValue(DNA_UI_SKIN_TONE)
if(species.flags & HAS_SKIN_COLOR)
s_tone = null
s_col = list(dna.GetUIValue(DNA_UI_SKIN_R), dna.GetUIValue(DNA_UI_SKIN_G), dna.GetUIValue(DNA_UI_SKIN_B))
/obj/item/organ/external/head/sync_colour_to_human(var/mob/living/carbon/human/human)
@@ -194,6 +194,24 @@
parent_organ = "head"
slot = "eyes"
/obj/item/organ/internal/diona_receptor/remove(var/mob/living/user,special = 0)
if(!special)
owner.disabilities |= NEARSIGHTED
owner.sdisabilities |= BLIND
owner.eye_blind = 20
owner.eye_blurry = 40
..()
/obj/item/organ/internal/diona_receptor/surgeryize()
if(!owner)
return
owner.disabilities &= ~NEARSIGHTED
owner.sdisabilities &= ~BLIND
owner.eye_blurry = 0
owner.eye_blind = 0
//TODO:Make absorb rads on insert
/obj/item/organ/internal/liver/diona
@@ -129,6 +129,26 @@
robotize()
..()
/obj/item/organ/internal/optical_sensor/remove(var/mob/living/user,special = 0)
if(!special)
owner.disabilities |= NEARSIGHTED
owner.sdisabilities |= BLIND
owner.eye_blind = 20
owner.eye_blurry = 40
owner << "Error 404:Optical Sensors not found."
..()
/obj/item/organ/internal/optical_sensor/surgeryize()
if(!owner)
return
owner.disabilities &= ~NEARSIGHTED
owner.sdisabilities &= ~BLIND
owner.eye_blurry = 0
owner.eye_blind = 0
// Used for an MMI or posibrain being installed into a human.
/obj/item/organ/internal/brain/mmi_holder
name = "brain"