From b4369f3a1d37ada09fa6f2a3b32988ea255820e6 Mon Sep 17 00:00:00 2001 From: James Smith Date: Sat, 10 Sep 2016 18:39:41 -0400 Subject: [PATCH] RPE fixes/upgrades (#890) The RPED now functions properly in more cases, including the destructive analyzer. It can also now intake beakers for rapid exchange on machines that use them. --- code/defines/obj/weapon.dm | 2 +- code/game/machinery/machinery.dm | 25 ++++++++++++++++--- .../reagents/reagent_containers/glass.dm | 6 ++++- code/modules/research/destructive_analyzer.dm | 2 +- html/changelogs/nadrew-PR-890.yml | 14 +++++++++++ 5 files changed, 42 insertions(+), 7 deletions(-) create mode 100644 html/changelogs/nadrew-PR-890.yml diff --git a/code/defines/obj/weapon.dm b/code/defines/obj/weapon.dm index d5abf7d9cfb..f3c5507ec83 100644 --- a/code/defines/obj/weapon.dm +++ b/code/defines/obj/weapon.dm @@ -418,7 +418,7 @@ icon_state = "RPED" item_state = "RPED" w_class = 5 - can_hold = list(/obj/item/weapon/stock_parts) + can_hold = list(/obj/item/weapon/stock_parts,/obj/item/weapon/reagent_containers/glass/beaker) storage_slots = 50 use_to_pickup = 1 allow_quick_gather = 1 diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index 97d92903c01..872249ce5f3 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -309,6 +309,23 @@ Class Procs: if(panel_open) var/obj/item/weapon/circuitboard/CB = locate(/obj/item/weapon/circuitboard) in component_parts var/P + for(var/obj/item/weapon/reagent_containers/glass/G in component_parts) + for(var/D in CB.req_components) + var/T = text2path(D) + if(ispath(G.type, T)) + P = T + break + for(var/obj/item/weapon/reagent_containers/glass/B in R.contents) + if(B.reagents && B.reagents.total_volume > 0) continue + if(istype(B, P) && istype(G, P)) + if(B.volume > G.volume) + R.remove_from_storage(B, src) + R.handle_item_insertion(G, 1) + component_parts -= G + component_parts += B + B.loc = src + user << "[G.name] replaced with [B.name]." + break for(var/obj/item/weapon/stock_parts/A in component_parts) for(var/D in CB.req_components) var/T = text2path(D) @@ -322,11 +339,11 @@ Class Procs: R.handle_item_insertion(A, 1) component_parts -= A component_parts += B - B.loc = null + B.loc = src user << "[A.name] replaced with [B.name]." break - update_icon() - RefreshParts() + update_icon() + RefreshParts() else user << "Following parts detected in the machine:" for(var/var/obj/item/C in component_parts) @@ -344,4 +361,4 @@ Class Procs: I.crit_fail = 1 I.loc = loc qdel(src) - return 1 + return 1 \ No newline at end of file diff --git a/code/modules/reagents/reagent_containers/glass.dm b/code/modules/reagents/reagent_containers/glass.dm index 359e6b2c99e..2eec68c9829 100644 --- a/code/modules/reagents/reagent_containers/glass.dm +++ b/code/modules/reagents/reagent_containers/glass.dm @@ -43,7 +43,8 @@ /obj/machinery/smartfridge/, /obj/machinery/biogenerator, /obj/machinery/constructable_frame, - /obj/machinery/radiocarbon_spectrometer + /obj/machinery/radiocarbon_spectrometer, + /obj/item/weapon/storage/part_replacer ) New() @@ -92,6 +93,9 @@ return attackby(obj/item/weapon/W as obj, mob/user as mob) + if(istype(W,/obj/item/weapon/storage/part_replacer)) + if(!reagents || !reagents.total_volume) + return ..() if(istype(W, /obj/item/weapon/pen) || istype(W, /obj/item/device/flashlight/pen)) var/tmp_label = sanitizeSafe(input(user, "Enter a label for [name]", "Label", label_text), MAX_NAME_LEN) if(length(tmp_label) > 10) diff --git a/code/modules/research/destructive_analyzer.dm b/code/modules/research/destructive_analyzer.dm index b8d0fca2094..18987d8cc01 100644 --- a/code/modules/research/destructive_analyzer.dm +++ b/code/modules/research/destructive_analyzer.dm @@ -29,7 +29,7 @@ Note: Must be placed within 3 tiles of the R&D Console /obj/machinery/r_n_d/destructive_analyzer/RefreshParts() var/T = 0 - for(var/obj/item/weapon/stock_parts/S in src) + for(var/obj/item/weapon/stock_parts/S in component_parts) T += S.rating decon_mod = T * 0.1 min_reliability = 93 - T diff --git a/html/changelogs/nadrew-PR-890.yml b/html/changelogs/nadrew-PR-890.yml new file mode 100644 index 00000000000..84089e197ff --- /dev/null +++ b/html/changelogs/nadrew-PR-890.yml @@ -0,0 +1,14 @@ +# Your name. +author: Nadrew + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - bugfix: "The Rapid Part Exchanger didn't properly update the Destructive Analyzer when used." + - rscadd: "The Rapid Part Exchanger can now utilize beakers."