Tweaks to previous commits.

More tweaks to IPC fixes.
Merge resolution/compile fixes.

Further work on properly integrating, updating and fixing prosthetic options.

Repathed internal organs to organ/internal.

More work on full synthetics, changelings, overheating.

Working on getting organs to qdel properly and spawn properly when robotized.

Finalized some overheating values, added remaining prosthetic icons.

Finalizing the testing version of the full prosthetic bodies branch.

Added suit cyclers to the autolathe and map.

Fixing runtime errors.

Fixing errors.

Changelog.

Replacing limb and organ strings with constants.

Prevented brainless species from becoming full cyborgs.

Fixed issues with brain/MMIs renaming themselves inappropriately.

Various fixes and oversights.
This commit is contained in:
Zuhayr
2015-12-24 21:13:40 +10:30
parent 87afd2feb2
commit f93ea6a78f
161 changed files with 1384 additions and 1352 deletions
+2 -2
View File
@@ -52,7 +52,7 @@
if (!hasorgans(target))
return 0
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return affected && affected.name != "head" && !(affected.status & ORGAN_ROBOT) && affected.open >= 2 && affected.stage == 1
return affected && affected.organ_tag != BP_HEAD && !(affected.status & ORGAN_ROBOT) && affected.open >= 2 && affected.stage == 1
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
@@ -91,7 +91,7 @@
if (!hasorgans(target))
return 0
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return affected && affected.name == "head" && !(affected.status & ORGAN_ROBOT) && affected.open >= 2 && affected.stage == 1
return affected && affected.organ_tag == BP_HEAD && !(affected.status & ORGAN_ROBOT) && affected.open >= 2 && affected.stage == 1
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user] is beginning to piece together [target]'s skull with \the [tool]." , \
+2 -2
View File
@@ -12,7 +12,7 @@
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if (!affected || (affected.status & ORGAN_ROBOT))
return 0
return target_zone == "mouth"
return target_zone == O_MOUTH
/datum/surgery_step/generic/cut_face
allowed_tools = list(
@@ -25,7 +25,7 @@
max_duration = 110
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
return ..() && target_zone == "mouth" && target.op_stage.face == 0
return ..() && target_zone == O_MOUTH && target.op_stage.face == 0
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user] starts to cut open [target]'s face and neck with \the [tool].", \
+14 -14
View File
@@ -8,7 +8,7 @@
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (isslime(target))
return 0
if (target_zone == "eyes") //there are specific steps for eye surgery
if (target_zone == O_EYES) //there are specific steps for eye surgery
return 0
if (!hasorgans(target))
return 0
@@ -35,7 +35,7 @@
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(..())
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return affected && affected.open == 0 && target_zone != "mouth"
return affected && affected.open == 0 && target_zone != O_MOUTH
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
@@ -73,7 +73,7 @@
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(..())
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return affected && affected.open == 0 && target_zone != "mouth"
return affected && affected.open == 0 && target_zone != O_MOUTH
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
@@ -88,7 +88,7 @@
"\blue You have constructed a prepared incision on and within [target]'s [affected.name] with \the [tool].",)
affected.open = 1
if(istype(target) && target.should_have_organ("heart"))
if(istype(target) && target.should_have_organ(O_HEART))
affected.status |= ORGAN_BLEEDING
affected.createwound(CUT, 1)
@@ -115,7 +115,7 @@
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(..())
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return affected && affected.open == 0 && target_zone != "mouth"
return affected && affected.open == 0 && target_zone != O_MOUTH
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
@@ -130,7 +130,7 @@
"\blue You have made an incision on [target]'s [affected.name] with \the [tool].",)
affected.open = 1
if(istype(target) && target.should_have_organ("heart"))
if(istype(target) && target.should_have_organ(O_HEART))
affected.status |= ORGAN_BLEEDING
affected.createwound(CUT, 1)
@@ -195,10 +195,10 @@
var/obj/item/organ/external/affected = target.get_organ(target_zone)
var/msg = "[user] starts to pry open the incision on [target]'s [affected.name] with \the [tool]."
var/self_msg = "You start to pry open the incision on [target]'s [affected.name] with \the [tool]."
if (target_zone == "chest")
if (target_zone == BP_TORSO)
msg = "[user] starts to separate the ribcage and rearrange the organs in [target]'s torso with \the [tool]."
self_msg = "You start to separate the ribcage and rearrange the organs in [target]'s torso with \the [tool]."
if (target_zone == "groin")
if (target_zone == BP_GROIN)
msg = "[user] starts to pry open the incision and rearrange the organs in [target]'s lower abdomen with \the [tool]."
self_msg = "You start to pry open the incision and rearrange the organs in [target]'s lower abdomen with \the [tool]."
user.visible_message(msg, self_msg)
@@ -209,10 +209,10 @@
var/obj/item/organ/external/affected = target.get_organ(target_zone)
var/msg = "\blue [user] keeps the incision open on [target]'s [affected.name] with \the [tool]."
var/self_msg = "\blue You keep the incision open on [target]'s [affected.name] with \the [tool]."
if (target_zone == "chest")
if (target_zone == BP_TORSO)
msg = "\blue [user] keeps the ribcage open on [target]'s torso with \the [tool]."
self_msg = "\blue You keep the ribcage open on [target]'s torso with \the [tool]."
if (target_zone == "groin")
if (target_zone == BP_GROIN)
msg = "\blue [user] keeps the incision open on [target]'s lower abdomen with \the [tool]."
self_msg = "\blue You keep the incision open on [target]'s lower abdomen with \the [tool]."
user.visible_message(msg, self_msg)
@@ -222,10 +222,10 @@
var/obj/item/organ/external/affected = target.get_organ(target_zone)
var/msg = "\red [user]'s hand slips, tearing the edges of the incision on [target]'s [affected.name] with \the [tool]!"
var/self_msg = "\red Your hand slips, tearing the edges of the incision on [target]'s [affected.name] with \the [tool]!"
if (target_zone == "chest")
if (target_zone == BP_TORSO)
msg = "\red [user]'s hand slips, damaging several organs in [target]'s torso with \the [tool]!"
self_msg = "\red Your hand slips, damaging several organs in [target]'s torso with \the [tool]!"
if (target_zone == "groin")
if (target_zone == BP_GROIN)
msg = "\red [user]'s hand slips, damaging several organs in [target]'s lower abdomen with \the [tool]"
self_msg = "\red Your hand slips, damaging several organs in [target]'s lower abdomen with \the [tool]!"
user.visible_message(msg, self_msg)
@@ -245,7 +245,7 @@
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(..())
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return affected && affected.open && target_zone != "mouth"
return affected && affected.open && target_zone != O_MOUTH
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
@@ -278,7 +278,7 @@
max_duration = 160
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (target_zone == "eyes") //there are specific steps for eye surgery
if (target_zone == O_EYES) //there are specific steps for eye surgery
return 0
if (!hasorgans(target))
return 0
+1 -1
View File
@@ -153,7 +153,7 @@
max_duration = 100
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/brain/sponge = target.internal_organs_by_name["brain"]
var/obj/item/organ/internal/brain/sponge = target.internal_organs_by_name["brain"]
return ..() && (!sponge || !sponge.damage)
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
+17 -28
View File
@@ -35,7 +35,7 @@
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return ..() && affected && embryo && affected.open == 3 && target_zone == "chest"
return ..() && affected && embryo && affected.open == 3 && target_zone == BP_TORSO
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/msg = "[user] starts to pull something out from [target]'s ribcage with \the [tool]."
@@ -218,8 +218,8 @@
var/list/removable_organs = list()
for(var/organ in target.internal_organs_by_name)
var/obj/item/organ/I = target.internal_organs_by_name[organ]
if((I.status & ORGAN_CUT_AWAY) && I.parent_organ == target_zone)
var/obj/item/organ/internal/I = target.internal_organs_by_name[organ]
if(istype(I) && (I.status & ORGAN_CUT_AWAY) && I.parent_organ == target_zone)
removable_organs |= organ
var/organ_to_remove = input(user, "Which organ do you want to remove?") as null|anything in removable_organs
@@ -262,7 +262,7 @@
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/O = tool
var/obj/item/organ/internal/O = tool
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if(!affected) return
var/organ_compatible
@@ -275,35 +275,24 @@
user << "<span class='danger'>You cannot install a naked organ into a robotic body.</span>"
return SURGERY_FAILURE
if(!target.species)
user << "<span class='danger'>You have no idea what species this person is. Report this on the bug tracker.</span>"
return SURGERY_FAILURE
var/o_is = (O.gender == PLURAL) ? "are" : "is"
var/o_a = (O.gender == PLURAL) ? "" : "a "
var/o_do = (O.gender == PLURAL) ? "don't" : "doesn't"
if(O.organ_tag == "limb")
return 0
else if(target.should_have_organ(O.organ_tag))
if(O.damage > (O.max_damage * 0.75))
user << "<span class='warning'>\The [O.organ_tag] [o_is] in no state to be transplanted.</span>"
return SURGERY_FAILURE
if(O.damage > (O.max_damage * 0.75))
user << "<span class='warning'>\The [O.organ_tag] [o_is] in no state to be transplanted.</span>"
return SURGERY_FAILURE
if(!target.internal_organs_by_name[O.organ_tag])
organ_missing = 1
else
user << "<span class='warning'>\The [target] already has [o_a][O.organ_tag].</span>"
return SURGERY_FAILURE
if(O && affected.limb_name == O.parent_organ)
organ_compatible = 1
else
user << "<span class='warning'>\The [O.organ_tag] [o_do] normally go in \the [affected.name].</span>"
return SURGERY_FAILURE
if(!target.internal_organs_by_name[O.organ_tag])
organ_missing = 1
else
user << "<span class='warning'>You're pretty sure [target.species.name_plural] don't normally have [o_a][O.organ_tag].</span>"
user << "<span class='warning'>\The [target] already has [o_a][O.organ_tag].</span>"
return SURGERY_FAILURE
if(O && affected.organ_tag == O.parent_organ)
organ_compatible = 1
else
user << "<span class='warning'>\The [O.organ_tag] [o_do] normally go in \the [affected.name].</span>"
return SURGERY_FAILURE
return ..() && organ_missing && organ_compatible
@@ -350,7 +339,7 @@
var/list/removable_organs = list()
for(var/organ in target.internal_organs_by_name)
var/obj/item/organ/I = target.internal_organs_by_name[organ]
if(I && (I.status & ORGAN_CUT_AWAY) && !(I.status & ORGAN_ROBOT) && I.parent_organ == target_zone)
if(istype(I) && (I.status & ORGAN_CUT_AWAY) && !(I.status & ORGAN_ROBOT) && I.parent_organ == target_zone)
removable_organs |= organ
var/organ_to_replace = input(user, "Which organ do you want to reattach?") as null|anything in removable_organs
+3 -3
View File
@@ -70,7 +70,7 @@
if(!hasorgans(target))
return 0
if (target_zone == "mouth" || target_zone == "eyes")
if (target_zone == O_MOUTH || target_zone == O_EYES)
return 0
var/obj/item/organ/external/affected = target.get_organ(target_zone)
@@ -123,7 +123,7 @@
if(!hasorgans(target))
return 0
if (target_zone == "mouth" || target_zone == "eyes")
if (target_zone == O_MOUTH || target_zone == O_EYES)
return 0
var/obj/item/organ/external/affected = target.get_organ(target_zone)
@@ -188,7 +188,7 @@
var/obj/item/weapon/weldingtool/welder = tool
if(!welder.isOn() || !welder.remove_fuel(1,user))
return 0
return (target_zone == "chest") && istype(target.back, /obj/item/weapon/rig) && !(target.back.canremove)
return (target_zone == BP_TORSO) && istype(target.back, /obj/item/weapon/rig) && !(target.back.canremove)
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user] starts cutting through the support systems of [target]'s [target.back] with \the [tool]." , \
+15 -18
View File
@@ -8,7 +8,7 @@
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (isslime(target))
return 0
if (target_zone == "eyes") //there are specific steps for eye surgery
if (target_zone == O_EYES) //there are specific steps for eye surgery
return 0
if (!hasorgans(target))
return 0
@@ -34,7 +34,7 @@
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(..())
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return affected && affected.open == 0 && target_zone != "mouth"
return affected && affected.open == 0 && target_zone != O_MOUTH
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
@@ -78,7 +78,7 @@
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("<span class='notice'>[user] opens the maintenance hatch on [target]'s [affected.name] with \the [tool].</span>", \
"<span class='notice'>You open the maintenance hatch on [target]'s [affected.name] with \the [tool].</span>")
affected.open = 2
affected.open = 3
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
@@ -98,7 +98,7 @@
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(..())
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return affected && affected.open && target_zone != "mouth"
return affected && affected.open && target_zone != O_MOUTH
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
@@ -134,7 +134,7 @@
var/obj/item/weapon/weldingtool/welder = tool
if(!welder.isOn() || !welder.remove_fuel(1,user))
return 0
return affected && affected.open == 2 && affected.brute_dam > 0 && target_zone != "mouth"
return affected && affected.open == 3 && (affected.disfigured || affected.brute_dam > 0) && target_zone != O_MOUTH
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
@@ -147,7 +147,7 @@
user.visible_message("<span class='notice'>[user] finishes patching damage to [target]'s [affected.name] with \the [tool].</span>", \
"<span class='notice'>You finish patching damage to [target]'s [affected.name] with \the [tool].</span>")
affected.heal_damage(rand(30,50),0,1,1)
affected.disfigured = 0
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("<span class='warning'>[user]'s [tool.name] slips, damaging the internal structure of [target]'s [affected.name].</span>",
@@ -166,7 +166,7 @@
if(..())
var/obj/item/stack/cable_coil/C = tool
var/obj/item/organ/external/affected = target.get_organ(target_zone)
var/limb_can_operate = (affected && affected.open == 2 && affected.burn_dam > 0 && target_zone != "mouth")
var/limb_can_operate = (affected && affected.open == 2 && (affected.disfigured || affected.burn_dam > 0) && target_zone != O_MOUTH)
if(limb_can_operate)
if(istype(C))
if(!C.get_amount() >= 3)
@@ -193,6 +193,7 @@
user.visible_message("<span class='warning'>[user] causes a short circuit in [target]'s [affected.name]!</span>",
"<span class='warning'>You cause a short circuit in [target]'s [affected.name]!</span>")
target.apply_damage(rand(5,10), BURN, affected)
affected.disfigured = 0
/datum/surgery_step/robotics/fix_organ_robotic //For artificial organs
allowed_tools = list(
@@ -215,7 +216,7 @@
if(I.damage > 0 && (I.status & ORGAN_ROBOT))
is_organ_damaged = 1
break
return affected.open == 2 && is_organ_damaged
return affected.open == 3 && is_organ_damaged
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
@@ -276,7 +277,7 @@
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if(!(affected && (affected.status & ORGAN_ROBOT)))
return 0
if(affected.open != 2)
if(affected.open < 3)
return 0
target.op_stage.current_organ = null
@@ -304,7 +305,7 @@
user.visible_message("<span class='notice'>[user] has decoupled [target]'s [target.op_stage.current_organ] with \the [tool].</span>" , \
"<span class='notice'>You have decoupled [target]'s [target.op_stage.current_organ] with \the [tool].</span>")
var/obj/item/organ/I = target.internal_organs_by_name[target.op_stage.current_organ]
var/obj/item/organ/internal/I = target.internal_organs_by_name[target.op_stage.current_organ]
if(I && istype(I))
I.status |= ORGAN_CUT_AWAY
@@ -325,7 +326,7 @@
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if(!(affected && (affected.status & ORGAN_ROBOT)))
return 0
if(affected.open != 2)
if(affected.open < 3)
return 0
target.op_stage.current_organ = null
@@ -370,12 +371,12 @@
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(target_zone != "head")
if(target_zone != BP_HEAD)
return
var/obj/item/device/mmi/M = tool
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if(!(affected && affected.open == 2))
if(!(affected && affected.open == 3))
return 0
if(!istype(M))
@@ -389,10 +390,6 @@
user << "<span class='danger'>You cannot install a computer brain into a meat skull.</span>"
return SURGERY_FAILURE
if(!target.species)
user << "<span class='danger'>You have no idea what species this person is. Report this on the bug tracker.</span>"
return SURGERY_FAILURE
if(!target.should_have_organ("brain"))
user << "<span class='danger'>You're pretty sure [target.species.name_plural] don't normally have a brain.</span>"
return SURGERY_FAILURE
@@ -415,7 +412,7 @@
"<span class='notice'>You have installed \the [tool] into [target]'s [affected.name].</span>")
var/obj/item/device/mmi/M = tool
var/obj/item/organ/mmi_holder/holder = new(target, 1)
var/obj/item/organ/internal/mmi_holder/holder = new(target, 1)
target.internal_organs_by_name["brain"] = holder
user.drop_from_inventory(tool)
tool.loc = holder