From e9cd29b91b8390e8d055da1cf99470d5e81dec7a Mon Sep 17 00:00:00 2001 From: mikomyazaki <47489928+mikomyazaki@users.noreply.github.com> Date: Wed, 19 Feb 2020 22:18:42 +0000 Subject: [PATCH] Prosthetic and Robot limb fabrication is now separate. (#8300) --- code/game/machinery/mecha_fabricator.dm | 2 +- code/game/objects/items/robot/robot_parts.dm | 2 +- .../items/weapons/surgery_limbattachment.dm | 71 ------------------- .../designs/mechfab/prosthetics/external.dm | 27 ++++--- html/changelogs/prosthetic_printing.yml | 6 ++ 5 files changed, 24 insertions(+), 84 deletions(-) delete mode 100644 code/game/objects/items/weapons/surgery_limbattachment.dm create mode 100644 html/changelogs/prosthetic_printing.yml diff --git a/code/game/machinery/mecha_fabricator.dm b/code/game/machinery/mecha_fabricator.dm index d620493643f..c623d84f4f8 100644 --- a/code/game/machinery/mecha_fabricator.dm +++ b/code/game/machinery/mecha_fabricator.dm @@ -300,7 +300,7 @@ if(D.build_path) var/loc_offset = get_step(src, dir) var/obj/new_item = D.Fabricate(loc_offset, src) - visible_message("\The [src] pings, indicating that \the [D] is complete.", "You hear a ping.") + visible_message("\The [src] pings, indicating that \the [new_item] is complete.", "You hear a ping.") if(mat_efficiency != 1) if(new_item.matter && new_item.matter.len > 0) for(var/i in new_item.matter) diff --git a/code/game/objects/items/robot/robot_parts.dm b/code/game/objects/items/robot/robot_parts.dm index 32097dc96cf..4e1cc4c7633 100644 --- a/code/game/objects/items/robot/robot_parts.dm +++ b/code/game/objects/items/robot/robot_parts.dm @@ -20,7 +20,7 @@ model_info = model var/datum/robolimb/R = all_robolimbs[model] if(R) - name = "[R.company] [initial(name)]" + name = "[R.company] robot [initial(name)]" desc = "[R.desc]" linked_frame = R.linked_frame if(icon_state in icon_states(R.icon)) diff --git a/code/game/objects/items/weapons/surgery_limbattachment.dm b/code/game/objects/items/weapons/surgery_limbattachment.dm deleted file mode 100644 index eb0a8e407b2..00000000000 --- a/code/game/objects/items/weapons/surgery_limbattachment.dm +++ /dev/null @@ -1,71 +0,0 @@ -/obj/item/robot_parts/attack(mob/living/carbon/human/M as mob, mob/living/carbon/user as mob) - var/limbloc = null - - if(!istype(M)) - return ..() - - if(!((locate(/obj/machinery/optable, M.loc) && M.resting) || (locate(/obj/structure/bed/roller, M.loc) && (M.buckled || M.lying || M.weakened || M.stunned || M.paralysis || M.sleeping || M.stat)) && prob(75) || (locate(/obj/structure/table/, M.loc) && (M.lying || M.weakened || M.stunned || M.paralysis || M.sleeping || M.stat) && prob(66)))) - return ..() - - if(!istype(M, /mob/living/carbon/human)) - return ..() - - if((user.zone_sel.selecting == BP_L_ARM) && (istype(src, /obj/item/robot_parts/l_arm))) - limbloc = BP_L_HAND - else if((user.zone_sel.selecting == BP_R_ARM) && (istype(src, /obj/item/robot_parts/r_arm))) - limbloc = BP_R_HAND - else if((user.zone_sel.selecting == BP_R_LEG) && (istype(src, /obj/item/robot_parts/r_leg))) - limbloc = BP_R_FOOT - else if((user.zone_sel.selecting == BP_L_LEG) && (istype(src, /obj/item/robot_parts/l_leg))) - limbloc = BP_L_FOOT - else - to_chat(user, "That doesn't fit there!") - return ..() - - var/mob/living/carbon/human/H = M - var/datum/organ/external/S = H.organs[user.zone_sel.selecting] - if(S.status & ORGAN_DESTROYED) - if(!(S.status & ORGAN_ATTACHABLE)) - to_chat(user, "The wound is not ready for a replacement!") - return 0 - if(M != user) - M.visible_message( \ - "\The [user] is beginning to attach \the [src] where [H]'s [S.display_name] used to be.", \ - "\The [user] begins to attach \the [src] where your [S.display_name] used to be.") - else - M.visible_message( \ - "\The [user] begins to attach a robotic limb where \his [S.display_name] used to be with [src].", \ - "You begin to attach \the [src] where your [S.display_name] used to be.") - - if(do_mob(user, H, 100)) - if(M != user) - M.visible_message( \ - "\The [user] finishes attaching [H]'s new [S.display_name].", \ - "\The [user] finishes attaching your new [S.display_name].") - else - M.visible_message( \ - "\The [user] finishes attaching \his new [S.display_name].", \ - "You finish attaching your new [S.display_name].") - - if(H == user && prob(25)) - to_chat(user, "You mess up!") - S.take_damage(15) - - S.status &= ~ORGAN_BROKEN - S.status &= ~ORGAN_SPLINTED - S.status &= ~ORGAN_ATTACHABLE - S.status &= ~ORGAN_DESTROYED - S.status |= ORGAN_ROBOT - var/datum/organ/external/T = H.organs["[limbloc]"] - T.status &= ~ORGAN_BROKEN - T.status &= ~ORGAN_SPLINTED - T.status &= ~ORGAN_ATTACHABLE - T.status &= ~ORGAN_DESTROYED - T.status |= ORGAN_ROBOT - H.update_body() - M.updatehealth() - M.UpdateDamageIcon() - qdel(src) - - return 1 - return 0 diff --git a/code/modules/research/designs/mechfab/prosthetics/external.dm b/code/modules/research/designs/mechfab/prosthetics/external.dm index e0fd0a598da..59b5f713378 100644 --- a/code/modules/research/designs/mechfab/prosthetics/external.dm +++ b/code/modules/research/designs/mechfab/prosthetics/external.dm @@ -1,38 +1,43 @@ /datum/design/item/mechfab/prosthetic category = "Prosthetic (External)" -//if the fabricator is a mech fab pass the manufacturer info over to the robot part constructor +//if the fabricator is a mech fab we need to construct the proper typepath for the manufacturer /datum/design/item/mechfab/prosthetic/Fabricate(var/newloc, var/fabricator) if(istype(fabricator, /obj/machinery/mecha_part_fabricator)) var/obj/machinery/mecha_part_fabricator/mechfab = fabricator - return new build_path(newloc, mechfab.manufacturer) + for(var/model_path in subtypesof(build_path)) + var/obj/item/organ/external/E = new model_path + if(E.robotize_type == mechfab.manufacturer) + return E.forceMove(newloc) + else + qdel(E) + return new build_path(newloc) // We didn't find our manufacturer in the list, so return an unbranded one return ..() -// Copied from robot.dm, but reflavoured to be more fitting to prosthetics. /datum/design/item/mechfab/prosthetic/l_arm name = "Prosthetic left arm" - id = "robot_l_arm" - build_path = /obj/item/robot_parts/l_arm + id = "prosthetic_l_arm" + build_path = /obj/item/organ/external/arm/industrial time = 20 materials = list(DEFAULT_WALL_MATERIAL = 18000) /datum/design/item/mechfab/prosthetic/r_arm name = "Prosthetic right arm" - id = "robot_r_arm" - build_path = /obj/item/robot_parts/r_arm + id = "prosthetic_r_arm" + build_path = /obj/item/organ/external/arm/right/industrial time = 20 materials = list(DEFAULT_WALL_MATERIAL = 18000) /datum/design/item/mechfab/prosthetic/l_leg name = "Prosthetic left leg" - id = "robot_l_leg" - build_path = /obj/item/robot_parts/l_leg + id = "prosthetic_l_leg" + build_path = /obj/item/organ/external/leg/industrial time = 20 materials = list(DEFAULT_WALL_MATERIAL = 15000) /datum/design/item/mechfab/prosthetic/r_leg name = "Prosthetic right leg" - id = "robot_r_leg" - build_path = /obj/item/robot_parts/r_leg + id = "prosthetic_r_leg" + build_path = /obj/item/organ/external/leg/right/industrial time = 20 materials = list(DEFAULT_WALL_MATERIAL = 15000) \ No newline at end of file diff --git a/html/changelogs/prosthetic_printing.yml b/html/changelogs/prosthetic_printing.yml new file mode 100644 index 00000000000..6729fc9889b --- /dev/null +++ b/html/changelogs/prosthetic_printing.yml @@ -0,0 +1,6 @@ +author: mikomyazaki + +delete-after: True + +changes: + - bugfix: "Prosthetic external organs from the Prosthetics (External) tab of the mechfab are now only for surgery on human-mobs, and are now properly attachable. For robots use the robotic limbs that are now in the 'Robot' tab of the fabber."