Allows cyborgs to perform limb augmentation (#32233)

* allows organ storage bags to be used to augment limbs

* replaces hardcoded stuff with intiial()
This commit is contained in:
swindly
2017-11-02 23:21:14 -04:00
committed by CitadelStationBot
parent 910e6b6396
commit 4f04256e46
3 changed files with 13 additions and 6 deletions

View File

@@ -15,15 +15,17 @@
/datum/surgery_step/add_limb
name = "replace limb"
implements = list(/obj/item/bodypart = 100)
implements = list(/obj/item/bodypart = 100, /obj/item/organ_storage = 100)
time = 32
var/obj/item/bodypart/L = null // L because "limb"
/datum/surgery_step/add_limb/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
if(istype(tool, /obj/item/organ_storage) && istype(tool.contents[1], /obj/item/bodypart))
tool = tool.contents[1]
var/obj/item/bodypart/aug = tool
if(aug.status != BODYPART_ROBOTIC)
to_chat(user, "<span class='warning'>that's not an augment silly!</span>")
to_chat(user, "<span class='warning'>That's not an augment, silly!</span>")
return -1
if(aug.body_zone != target_zone)
to_chat(user, "<span class='warning'>[tool] isn't the right type for [parse_zone(target_zone)].</span>")
@@ -49,6 +51,11 @@
/datum/surgery_step/add_limb/success(mob/user, mob/living/carbon/target, target_zone, obj/item/bodypart/tool, datum/surgery/surgery)
if(L)
user.visible_message("[user] successfully augments [target]'s [parse_zone(target_zone)]!", "<span class='notice'>You successfully augment [target]'s [parse_zone(target_zone)].</span>")
if(istype(tool, /obj/item/organ_storage))
tool.icon_state = initial(tool.icon_state)
tool.desc = initial(tool.desc)
tool.cut_overlays()
tool = tool.contents[1]
L.change_bodypart_status(BODYPART_ROBOTIC, TRUE)
L.icon = tool.icon
L.max_damage = tool.max_damage

View File

@@ -152,8 +152,8 @@
if(current_type == "insert")
if(istype(tool, /obj/item/organ_storage))
I = tool.contents[1]
tool.icon_state = "evidenceobj"
tool.desc = "A container for holding body parts."
tool.icon_state = initial(tool.icon_state)
tool.desc = initial(tool.desc)
tool.cut_overlays()
tool = I
else

View File

@@ -60,8 +60,8 @@
/datum/surgery_step/add_prosthetic/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
if(istype(tool, /obj/item/organ_storage))
tool.icon_state = "evidenceobj"
tool.desc = "A container for holding body parts."
tool.icon_state = initial(tool.icon_state)
tool.desc = initial(tool.desc)
tool.cut_overlays()
tool = tool.contents[1]
if(istype(tool, /obj/item/bodypart) && user.temporarilyRemoveItemFromInventory(tool))