From 8e0e6f31912fbb08040f81a8e489b0522b1b8d45 Mon Sep 17 00:00:00 2001 From: c0 Date: Sun, 2 Aug 2015 00:37:29 +0300 Subject: [PATCH] Tweaks and fixes --- .../items/weapons/implants/implant_chem.dm | 3 +- .../weapons/implants/implant_explosive.dm | 2 +- .../items/weapons/implants/implant_freedom.dm | 3 +- code/modules/surgery/helpers.dm | 88 +++++++++---------- .../surgery/multiple_location_example.dm | 54 ------------ 5 files changed, 47 insertions(+), 103 deletions(-) delete mode 100644 code/modules/surgery/multiple_location_example.dm diff --git a/code/game/objects/items/weapons/implants/implant_chem.dm b/code/game/objects/items/weapons/implants/implant_chem.dm index b419c15df27..6f85742039b 100644 --- a/code/game/objects/items/weapons/implants/implant_chem.dm +++ b/code/game/objects/items/weapons/implants/implant_chem.dm @@ -18,8 +18,7 @@ Special Features: Micro-Capsule- Can be loaded with any sort of chemical agent via the common syringe and can hold 50 units.
Can only be loaded while still in its original case.
- Integrity: Implant will last so long as the subject is alive. However, if the subject suffers from malnutrition,
- the implant may become unstable and either pre-maturely inject the subject or simply break."} + Integrity: Implant will last so long as the subject is alive."} return dat /obj/item/weapon/implant/chem/New() diff --git a/code/game/objects/items/weapons/implants/implant_explosive.dm b/code/game/objects/items/weapons/implants/implant_explosive.dm index 70749dc537c..719666b47b2 100644 --- a/code/game/objects/items/weapons/implants/implant_explosive.dm +++ b/code/game/objects/items/weapons/implants/implant_explosive.dm @@ -17,7 +17,7 @@ Implant Details:
Function: Contains a compact, electrically detonated explosive that detonates upon receiving a specially encoded signal or upon host death.
Special Features: Explodes
- Integrity: Implant will occasionally be degraded by the body's immune system and thus will occasionally malfunction."} + "} return dat /obj/item/weapon/implant/explosive/trigger(emote, mob/source) diff --git a/code/game/objects/items/weapons/implants/implant_freedom.dm b/code/game/objects/items/weapons/implants/implant_freedom.dm index f395bf87489..e3e70e982a2 100644 --- a/code/game/objects/items/weapons/implants/implant_freedom.dm +++ b/code/game/objects/items/weapons/implants/implant_freedom.dm @@ -28,8 +28,7 @@ mechanisms
Special Features:
Neuro-Scan- Analyzes certain shadow signals in the nervous system
-Integrity: The battery is extremely weak and commonly after injection its -life can drive down to only 1 use.
+
No Implant Specifics"} return dat diff --git a/code/modules/surgery/helpers.dm b/code/modules/surgery/helpers.dm index c4ba5c2680d..021eddeb277 100644 --- a/code/modules/surgery/helpers.dm +++ b/code/modules/surgery/helpers.dm @@ -2,58 +2,58 @@ if(istype(M)) var/mob/living/carbon/human/H var/obj/item/organ/limb/affecting + var/selected_zone = user.zone_sel.selecting + if(istype(M, /mob/living/carbon/human)) H = M - affecting = H.get_organ(check_zone(user.zone_sel.selecting)) + affecting = H.get_organ(check_zone(selected_zone)) if(M.lying || isslime(M)) //if they're prone or a slime - var/list/all_surgeries = surgeries_list.Copy() - var/list/available_surgeries = list() - for(var/i in all_surgeries) - var/datum/surgery/S = all_surgeries[i] - if(!S.possible_locs.Find(user.zone_sel.selecting)) - continue - if(locate(S.type) in M.surgeries) - continue - if(affecting && S.requires_organic_bodypart && affecting.status == ORGAN_ROBOTIC) - continue - if(!S.can_start(user, M)) - continue - - for(var/path in S.species) - if(istype(M, path)) - available_surgeries[S.name] = S - break + var/datum/surgery/current_surgery for(var/datum/surgery/S in M.surgeries) - if(S.status == 1 && !S.step_in_progress) - available_surgeries["cancel " + S.name] = S + if(S.location == selected_zone) + current_surgery = S - var/P = input("Begin which procedure?", "Surgery", null, null) as null|anything in available_surgeries - if(P) - var/datum/surgery/S = available_surgeries[P] - if(S in M.surgeries) - M.surgeries -= S - qdel(S) - return 1 + if(!current_surgery) + var/list/all_surgeries = surgeries_list.Copy() + var/list/available_surgeries = list() + for(var/i in all_surgeries) + var/datum/surgery/S = all_surgeries[i] + if(!S.possible_locs.Find(selected_zone)) + continue + if(affecting && S.requires_organic_bodypart && affecting.status == ORGAN_ROBOTIC) + continue + if(!S.can_start(user, M)) + continue - var/datum/surgery/procedure = new S.type - if(procedure) - procedure.location = user.zone_sel.selecting - if(procedure.ignore_clothes || get_location_accessible(M, procedure.location)) - M.surgeries += procedure - if(affecting) + for(var/path in S.species) + if(istype(M, path)) + available_surgeries[S.name] = S + break + + var/P = input("Begin which procedure?", "Surgery", null, null) as null|anything in available_surgeries + if(P && user.Adjacent(M) && (I in user)) + var/datum/surgery/S = available_surgeries[P] + var/datum/surgery/procedure = new S.type + if(procedure) + procedure.location = selected_zone + if(procedure.ignore_clothes || get_location_accessible(M, selected_zone)) + M.surgeries += procedure procedure.organ = affecting - user.visible_message("[user] drapes [I] over [M]'s [parse_zone(procedure.location)] to prepare for \an [procedure.name].", \ - "You drape [I] over [M]'s [parse_zone(procedure.location)] to prepare for \an [procedure.name].") + user.visible_message("[user] drapes [I] over [M]'s [parse_zone(selected_zone)] to prepare for \an [procedure.name].", \ + "You drape [I] over [M]'s [parse_zone(selected_zone)] to prepare for \an [procedure.name].") - add_logs(user, M, "operated", addition="Operation type: [procedure.name]") - return 1 - else - user << "You need to expose [M]'s [procedure.location] first!" - return 1 //return 1 so we don't slap the guy in the dick with the drapes. - else - return 1 //once the input menu comes up, cancelling it shouldn't hit the guy with the drapes either. + add_logs(user, M, "operated", addition="Operation type: [procedure.name], location: [selected_zone]") + else + user << "You need to expose [M]'s [parse_zone(selected_zone)] first!" + + else if(current_surgery.status == 1 && !current_surgery.step_in_progress) + M.surgeries -= current_surgery + user.visible_message("[user] removes the drapes from [M]'s [parse_zone(selected_zone)].", \ + "You remove the drapes from [M]'s [parse_zone(selected_zone)].") + qdel(current_surgery) + return 1 return 0 @@ -79,13 +79,13 @@ proc/get_location_modifier(mob/M) for(var/obj/item/clothing/I in list(C.back, C.wear_mask, C.head)) covered_locations |= I.body_parts_covered face_covered |= I.flags_inv - eyesmouth_covered |= I.flags + eyesmouth_covered |= I.flags_cover if(ishuman(C)) var/mob/living/carbon/human/H = C for(var/obj/item/I in list(H.wear_suit, H.w_uniform, H.shoes, H.belt, H.gloves, H.glasses, H.ears)) covered_locations |= I.body_parts_covered face_covered |= I.flags_inv - eyesmouth_covered |= I.flags + eyesmouth_covered |= I.flags_cover switch(location) if("head") diff --git a/code/modules/surgery/multiple_location_example.dm b/code/modules/surgery/multiple_location_example.dm deleted file mode 100644 index e5e331843e5..00000000000 --- a/code/modules/surgery/multiple_location_example.dm +++ /dev/null @@ -1,54 +0,0 @@ -/* -//CONTENTS// -Multiple location example surgery - - - -//THE SURGERY// -it is very similar to a normal surgery. -Location = "anywhere" is the unique difference. - -/datum/surgery/multiLocExample - name = "Multiple Location Surgery Example" - steps = list(/datum/surgery_step/multiLocExampleStep) - species = list(/mob/living/carbon) - location = "anywhere" //A Location "Anywhere" is handled in /code/modules/surgery/helpers attempt_initiate_surgery(), it is converted into a User.zone_sel.selecting. - has_multi_loc = 1 //Needed to handle Multilocation - -//THE STEPS// -The block of "If's" is necessary, add or remove so you have just the areas you want, and set them to convert L(or your subsitute) to what you want it to be -EG: a zone on a mob (where user is targetting) to the limb thats actually there. - - -/datum/surgery_step/multiLocExampleStep - implements = list() - time = 9001 - allowed_organs = list("r_arm","l_arm","r_leg","l_leg","chest","head", "etc") - // allowed_organs is a list of organs this operation works with, it is defined in the earliest instance of the surgery_step (Eg, datum/surgery_step/multiLocExampleStep) - // allowed_organs is handled in Handle_Multi_Loc() in surgery_step.dm - - -/datum/surgery_step/multiLocExampleStep/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) - L = new_organ //new_organ is a variable in /datum/surgery_step, it is null by default, and is given a value in Handle_Multi_Loc() - //Although Handle_Multi_Loc() is /datum/surgery_step/SURGERYNAME/Handle_Multi_Loc() you do not need to rewrite it in the surgery - if(L) - user.visible_message("Generic Statement.") - else - user.visible_message("Generic Statement 2.") - - -/datum/surgery_step/multiLocExampleStep/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery) -You can use whatever you substituted "L" for here for useful things, swapping limbs for other limbs, etc. -if the surgery is intended to be MultiLoc but should only be performable once per limb, add this -"surgery.invalid_locations += user.zone_sel.selecting" -Just after you have swapped limbs around, see limb augmentation for an example of this - -*/ - -//This file is commented out as to avoid: -// a snowflakey removal of it 100% of the time -// it's an example, it doesn't work perfectly due to just being the multiple locations section. -// It is also not set to compile, due to being Empty (according to the compiler) - -//Enjoy making Multi-location operations! (if you understood my Rambling) -//If you didn't understand this, Ask for RobRichards in Coderbus \ No newline at end of file