From a9cb60d6902c01613ebbf7038c2fcc6c5150b691 Mon Sep 17 00:00:00 2001 From: PKPenguin321 Date: Sun, 1 Nov 2015 01:58:34 -0700 Subject: [PATCH 1/3] adds removing chainsaws + indentation cleanup changes indenting on chainsaw augmentation from a bunch of spaces to nice and neat tabs adds a surgery to remove surgically attached chainsaws --- code/modules/surgery/limb augmentation.dm | 71 ++++++++++++++++------- 1 file changed, 51 insertions(+), 20 deletions(-) diff --git a/code/modules/surgery/limb augmentation.dm b/code/modules/surgery/limb augmentation.dm index d333e8ee5a1..bfc3333ddda 100644 --- a/code/modules/surgery/limb augmentation.dm +++ b/code/modules/surgery/limb augmentation.dm @@ -77,31 +77,62 @@ /datum/surgery/chainsaw - name = "chainsaw augmentation" - steps = list(/datum/surgery_step/incise, /datum/surgery_step/retract_skin, /datum/surgery_step/saw, /datum/surgery_step/clamp_bleeders, - /datum/surgery_step/incise, /datum/surgery_step/chainsaw) - species = list(/mob/living/carbon/human) - possible_locs = list("r_arm", "l_arm") - requires_organic_bodypart = 0 + name = "chainsaw augmentation" + steps = list(/datum/surgery_step/incise, /datum/surgery_step/retract_skin, /datum/surgery_step/saw, /datum/surgery_step/clamp_bleeders, + /datum/surgery_step/incise, /datum/surgery_step/chainsaw) + species = list(/mob/living/carbon/human) + possible_locs = list("r_arm", "l_arm") + requires_organic_bodypart = 0 /datum/surgery_step/chainsaw - time = 64 - name = "insert chainsaw" - implements = list(/obj/item/weapon/twohanded/required/chainsaw = 100) + time = 64 + name = "insert chainsaw" + implements = list(/obj/item/weapon/twohanded/required/chainsaw = 100) /datum/surgery_step/chainsaw/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) - user.visible_message("[user] begins to install the chainsaw onto [target].", "You begin to install the chainsaw onto [target]...") + user.visible_message("[user] begins to install the chainsaw onto [target].", "You begin to install the chainsaw onto [target]...") /datum/surgery_step/chainsaw/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) - if(target.l_hand && target.r_hand) - user << "You can't fit the chainsaw in while [target]'s hands are full!" - return 0 - else - user.visible_message("[user] finshes installing the chainsaw!", "You install the chainsaw.") - user.unEquip(tool) - qdel(tool) - var/obj/item/weapon/mounted_chainsaw/sawarms = new(target) - target.put_in_hands(sawarms) + if(target.l_hand && target.r_hand) + user << "You can't fit the chainsaw in while [target]'s hands are full!" + return 0 + else + user.visible_message("[user] finshes installing the chainsaw!", "You install the chainsaw.") + user.unEquip(tool) + qdel(tool) + var/obj/item/weapon/mounted_chainsaw/sawarms = new(target) + target.put_in_hands(sawarms) - return 1 + return 1 + +/datum/surgery/chainsaw_removal + name = "chainsaw removal" + steps = list(/datum/surgery_step/chainsaw_removal) + species = list(/mob/living/carbon/human) + possible_locs = list("r_arm", "l_arm") + requires_organic_bodypart = 0 + +/datum/surgery/chainsaw_removal/can_start(mob/user, mob/living/carbon/target) + var/list/hands = get_both_hands(target) + var/M = locate(/obj/item/weapon/mounted_chainsaw) in hands + if(M) + return 1//can continue surgery + else + return 0//surgery will never be available + +/datum/surgery_step/chainsaw_removal + time = 128 + name = "saw off chainsaw" + implements = list(/obj/item/weapon/circular_saw = 100, /obj/item/weapon/melee/energy/sword/cyborg/saw = 100, /obj/item/weapon/melee/arm_blade = 75, /obj/item/weapon/mounted_chainsaw = 65, /obj/item/weapon/twohanded/fireaxe = 50, /obj/item/weapon/twohanded/required/chainsaw = 50, /obj/item/weapon/hatchet = 35, /obj/item/weapon/kitchen/knife/butcher = 25) + +/datum/surgery_step/chainsaw_removal/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + user.visible_message("[user] begins to check [target] for a chainsaw to remove.", "You check [target] for a chainsaw to remove...") + +/datum/surgery_step/chainsaw_removal/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) + var/list/hands = get_both_hands(target) + for(var/obj/item/weapon/mounted_chainsaw/V in hands) + qdel(V) + new /obj/item/weapon/twohanded/required/chainsaw(get_turf(target)) + user.visible_message("[user] carefully saws [target]'s arms free of the chainsaw.", "You remove the chainsaw.") + return 1 From cb55c84c354facbd96546eacd4c9be64963cff54 Mon Sep 17 00:00:00 2001 From: PKPenguin321 Date: Sun, 1 Nov 2015 01:18:44 -0800 Subject: [PATCH 2/3] changes messages to be more clear I forgot to change the messages to make them more clear, they were previously "checking for a chainsaw" since the way i checked for chainsaws was much more hacky in the original version of this code --- code/modules/surgery/limb augmentation.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/surgery/limb augmentation.dm b/code/modules/surgery/limb augmentation.dm index bfc3333ddda..e18431e9d8a 100644 --- a/code/modules/surgery/limb augmentation.dm +++ b/code/modules/surgery/limb augmentation.dm @@ -127,7 +127,7 @@ implements = list(/obj/item/weapon/circular_saw = 100, /obj/item/weapon/melee/energy/sword/cyborg/saw = 100, /obj/item/weapon/melee/arm_blade = 75, /obj/item/weapon/mounted_chainsaw = 65, /obj/item/weapon/twohanded/fireaxe = 50, /obj/item/weapon/twohanded/required/chainsaw = 50, /obj/item/weapon/hatchet = 35, /obj/item/weapon/kitchen/knife/butcher = 25) /datum/surgery_step/chainsaw_removal/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) - user.visible_message("[user] begins to check [target] for a chainsaw to remove.", "You check [target] for a chainsaw to remove...") + user.visible_message("[user] begins sawing the chainsaw off of [target]'s arms.", "You begin removing [target]'s chainsaw...") /datum/surgery_step/chainsaw_removal/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) var/list/hands = get_both_hands(target) From d2f3b0fd4a332d245d9cdac51f24e949fe1d7c8d Mon Sep 17 00:00:00 2001 From: PKPenguin321 Date: Sun, 1 Nov 2015 01:23:14 -0800 Subject: [PATCH 3/3] fixes critical bugs finishes -> finshes arms -> arm sorry for clogging commits :( --- code/modules/surgery/limb augmentation.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/surgery/limb augmentation.dm b/code/modules/surgery/limb augmentation.dm index e18431e9d8a..ee1293db5c5 100644 --- a/code/modules/surgery/limb augmentation.dm +++ b/code/modules/surgery/limb augmentation.dm @@ -98,7 +98,7 @@ user << "You can't fit the chainsaw in while [target]'s hands are full!" return 0 else - user.visible_message("[user] finshes installing the chainsaw!", "You install the chainsaw.") + user.visible_message("[user] finishes installing the chainsaw!", "You install the chainsaw.") user.unEquip(tool) qdel(tool) var/obj/item/weapon/mounted_chainsaw/sawarms = new(target) @@ -134,5 +134,5 @@ for(var/obj/item/weapon/mounted_chainsaw/V in hands) qdel(V) new /obj/item/weapon/twohanded/required/chainsaw(get_turf(target)) - user.visible_message("[user] carefully saws [target]'s arms free of the chainsaw.", "You remove the chainsaw.") + user.visible_message("[user] carefully saws [target]'s arm free of the chainsaw.", "You remove the chainsaw.") return 1