From bbac4006b559cd8eeaade01dd7b0de4e3a9f183b Mon Sep 17 00:00:00 2001 From: Aurorablade Date: Tue, 23 Feb 2016 02:48:13 -0500 Subject: [PATCH] fixc all the things. --- code/_onclick/hud/action.dm | 3 ++ .../changeling/powers/augmented_eyesight.dm | 2 +- .../crates_lockers/closets/secure/medical.dm | 1 + code/modules/mob/living/carbon/brain/brain.dm | 1 - .../living/carbon/human/human_attackhand.dm | 2 +- code/modules/surgery/implant.dm | 51 +++++++++++++++++++ code/modules/surgery/organs/augments_eyes.dm | 2 +- code/modules/surgery/tools.dm | 2 +- 8 files changed, 59 insertions(+), 5 deletions(-) diff --git a/code/_onclick/hud/action.dm b/code/_onclick/hud/action.dm index f4f96b555e7..4461e1c8539 100644 --- a/code/_onclick/hud/action.dm +++ b/code/_onclick/hud/action.dm @@ -215,6 +215,9 @@ /datum/action/item_action check_flags = AB_CHECK_RESTRAINED|AB_CHECK_STUNNED|AB_CHECK_LYING|AB_CHECK_ALIVE|AB_CHECK_INSIDE +/datum/action/item_action/CheckRemoval(mob/living/user) + return !(target in user) + /datum/action/item_action/hands_free check_flags = AB_CHECK_ALIVE|AB_CHECK_INSIDE diff --git a/code/game/gamemodes/changeling/powers/augmented_eyesight.dm b/code/game/gamemodes/changeling/powers/augmented_eyesight.dm index 35e50ff8b77..edd318ae4e6 100644 --- a/code/game/gamemodes/changeling/powers/augmented_eyesight.dm +++ b/code/game/gamemodes/changeling/powers/augmented_eyesight.dm @@ -47,7 +47,7 @@ /obj/item/organ/internal/cyberimp/eyes/shield/ling/on_life() ..() var/obj/item/organ/internal/eyes/E = owner.get_int_organ(/obj/item/organ/internal/eyes) - if(owner.eye_blind || owner.eye_blurry || (owner.disabilities & BLIND) || (owner.disabilities & NEARSIGHTED) || (E.damage > 0)) + if(owner.eye_blind || owner.eye_blurry || (owner.sdisabilities & BLIND) || (owner.disabilities & NEARSIGHTED) || (E.damage > 0)) owner.reagents.add_reagent("oculine", 1) /obj/item/organ/internal/cyberimp/eyes/shield/ling/prepare_eat() diff --git a/code/game/objects/structures/crates_lockers/closets/secure/medical.dm b/code/game/objects/structures/crates_lockers/closets/secure/medical.dm index 2de9a2adf45..c37428eff97 100644 --- a/code/game/objects/structures/crates_lockers/closets/secure/medical.dm +++ b/code/game/objects/structures/crates_lockers/closets/secure/medical.dm @@ -185,6 +185,7 @@ new /obj/item/weapon/storage/belt/medical(src) new /obj/item/device/flash(src) new /obj/item/weapon/reagent_containers/hypospray/CMO(src) + new /obj/item/organ/internal/cyberimp/eyes/hud/medical(src) return diff --git a/code/modules/mob/living/carbon/brain/brain.dm b/code/modules/mob/living/carbon/brain/brain.dm index 047c45f3642..8e6da1eca78 100644 --- a/code/modules/mob/living/carbon/brain/brain.dm +++ b/code/modules/mob/living/carbon/brain/brain.dm @@ -19,7 +19,6 @@ if(key) //If there is a mob connected to this thing. Have to check key twice to avoid false death reporting. if(stat!=DEAD) //If not dead. death(1) //Brains can die again. AND THEY SHOULD AHA HA HA HA HA HA - world << "Brain.dm" ghostize() //Ghostize checks for key so nothing else is necessary. return ..() diff --git a/code/modules/mob/living/carbon/human/human_attackhand.dm b/code/modules/mob/living/carbon/human/human_attackhand.dm index 42b07e778e0..cf453ed7909 100644 --- a/code/modules/mob/living/carbon/human/human_attackhand.dm +++ b/code/modules/mob/living/carbon/human/human_attackhand.dm @@ -63,7 +63,7 @@ if(health >= config.health_threshold_crit) if(src.surgeries.len) for(var/datum/surgery/S in src.surgeries) - if(istype(S.get_surgery_step(), /datum/surgery_step/cavity/place_item)) + if(istype(S.get_surgery_step(), /datum/surgery_step/cavity/place_item) || istype(S.get_surgery_step(),/datum/surgery_step/remove_object)) if(S.next_step(M, src)) return 1 else diff --git a/code/modules/surgery/implant.dm b/code/modules/surgery/implant.dm index 5c773aa983c..da573c13574 100644 --- a/code/modules/surgery/implant.dm +++ b/code/modules/surgery/implant.dm @@ -322,3 +322,54 @@ imp.activate() return 0 + +////////////////////////////////////////////////////////////////// +// EMBEDDED ITEM REOMOVAL // +////////////////////////////////////////////////////////////////// + +/datum/surgery/embedded_removal + name = "removal of embedded objects" + steps = list(/datum/surgery_step/generic/cut_open,/datum/surgery_step/generic/clamp_bleeders, /datum/surgery_step/generic/retract_skin,/datum/surgery_step/remove_object) + possible_locs = list("r_arm","l_arm","r_leg","l_leg","r_hand","r_foot","l_hand","l_foot","groin","chest","head") + + +/datum/surgery/embedded_removal/can_start(mob/user, mob/living/carbon/target) + if(target.get_species() == "Machine") + return 0 + return 1 + +/datum/surgery_step/remove_object + name = "remove embedded objects" + max_duration = 32 + accept_hand = 1 + var/obj/item/organ/external/L = null + + +/datum/surgery_step/remove_object/begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool, datum/surgery/surgery) + L = target.get_organ(target_zone) + if(L) + user.visible_message("[user] looks for objects embedded in [target]'s [target_zone].", "You look for objects embedded in [target]'s [target_zone]...") + else + user.visible_message("[user] looks for [target]'s [target_zone].", "You look for [target]'s [target_zone]...") + + +/datum/surgery_step/remove_object/end_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool, datum/surgery/surgery) + if(L) + if(ishuman(target)) + var/mob/living/carbon/human/H = target + var/objects = 0 + for(var/obj/item/I in L.implants) + if(!istype(I,/obj/item/weapon/implant)) + objects++ + I.forceMove(get_turf(H)) + L.implants -= I + + if(objects > 0) + user.visible_message("[user] sucessfully removes [objects] objects from [H]'s [L.limb_name]!", "You sucessfully remove [objects] objects from [H]'s [L.limb_name].") + else + user << "You find no objects embedded in [H]'s [L.limb_name]!" + + else + user << "You can't find [target]'s [target_zone], let alone any objects embedded in it!" + + return 1 \ No newline at end of file diff --git a/code/modules/surgery/organs/augments_eyes.dm b/code/modules/surgery/organs/augments_eyes.dm index 02ece0fc22c..a2460bf3a2b 100644 --- a/code/modules/surgery/organs/augments_eyes.dm +++ b/code/modules/surgery/organs/augments_eyes.dm @@ -66,7 +66,7 @@ spawn(60 / severity) if(owner) owner.sight |= save_sight - owner.disabilities ^= BLIND + owner.sdisabilities ^= BLIND diff --git a/code/modules/surgery/tools.dm b/code/modules/surgery/tools.dm index 74d0cb05ffd..c02b48abd8e 100644 --- a/code/modules/surgery/tools.dm +++ b/code/modules/surgery/tools.dm @@ -100,7 +100,7 @@ /obj/item/weapon/scalpel/laser3 name = "laser scalpel" - desc = "A scalpel augmented with a directed laser.. This one looks to be the pinnacle of precision energy cutlery!" + desc = "A scalpel augmented with a directed laser. This one looks to be the pinnacle of precision energy cutlery!" icon_state = "scalpel_laser3_on" item_state = "scalpel" damtype = "fire"