Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enables Frankensteins #17623

Merged
merged 1 commit into from May 21, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 9 additions & 3 deletions code/modules/surgery/prosthetic_replacement.dm
Expand Up @@ -18,6 +18,7 @@
name = "add prosthetic"
implements = list(/obj/item/robot_parts = 100, /obj/item/bodypart = 100)
time = 32
var/organ_rejection_dam = 0

/datum/surgery_step/add_prosthetic/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
var/tool_body_zone
Expand All @@ -27,8 +28,9 @@
else if(istype(tool, /obj/item/bodypart))
var/obj/item/bodypart/L = tool
if(L.status != ORGAN_ROBOTIC)
user << "<span class='warning'>You need a robotic limb for this.</span>"
return -1 //fail
organ_rejection_dam = 10
if(target.dna.species.id != L.species_id)
organ_rejection_dam = 30
tool_body_zone = L.body_zone
if(target_zone == tool_body_zone) //so we can't replace a leg with an arm.
user.visible_message("[user] begins to replace [target]'s [parse_zone(target_zone)].", "<span class ='notice'>You begin to replace [target]'s [parse_zone(target_zone)]...</span>")
Expand All @@ -43,6 +45,10 @@
qdel(tool)
else
L = tool
user.drop_item()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

woops, my bad

L.attach_limb(target)
if(organ_rejection_dam)
target.adjustToxLoss(organ_rejection_dam)
user.visible_message("[user] successfully replaces [target]'s [parse_zone(target_zone)]!", "<span class='notice'>You succeed in replacing [target]'s [parse_zone(target_zone)].</span>")
return 1
return 1