From 52a7ebcbffdbf66b59ec81456239de624232c118 Mon Sep 17 00:00:00 2001 From: Dax Dupont Date: Fri, 27 Apr 2018 20:12:41 +0200 Subject: [PATCH] Refactors and fixes RPEDs (#37380) * Refactors and fixes RPEDs * Fixes storage related memes * beams should probably always play --- code/datums/components/storage/concrete/rped.dm | 10 ++++++---- code/game/machinery/Sleeper.dm | 2 -- code/game/machinery/autolathe.dm | 3 --- code/game/machinery/cloning.dm | 3 --- code/game/machinery/dna_scanner.dm | 3 --- code/game/machinery/hologram.dm | 3 --- code/game/machinery/launch_pad.dm | 3 --- code/game/machinery/limbgrower.dm | 3 --- code/game/machinery/quantum_pad.dm | 3 --- code/game/machinery/recharger.dm | 2 -- code/game/machinery/rechargestation.dm | 3 --- code/game/machinery/recycler.dm | 3 --- code/game/machinery/spaceheater.dm | 2 +- .../machinery/telecomms/machine_interactions.dm | 4 ---- code/game/machinery/teleporter.dm | 5 ----- code/game/mecha/mech_bay.dm | 3 --- code/game/mecha/mech_fabricator.dm | 3 --- .../machinery/components/unary_devices/cryo.dm | 2 +- .../components/unary_devices/thermomachine.dm | 2 -- .../kitchen_machinery/deep_fryer.dm | 2 -- .../food_and_drinks/kitchen_machinery/gibber.dm | 5 +---- .../kitchen_machinery/microwave.dm | 2 -- .../kitchen_machinery/monkeyrecycler.dm | 3 --- .../kitchen_machinery/processor.dm | 3 --- .../kitchen_machinery/smartfridge.dm | 3 --- code/modules/hydroponics/biogenerator.dm | 3 --- code/modules/hydroponics/gene_modder.dm | 2 -- code/modules/hydroponics/hydroponics.dm | 3 --- code/modules/hydroponics/seed_extractor.dm | 3 --- code/modules/mining/machine_redemption.dm | 2 -- code/modules/power/port_gen.dm | 3 --- code/modules/power/rtg.dm | 4 +--- code/modules/power/singularity/emitter.dm | 3 --- code/modules/power/smes.dm | 4 ---- code/modules/power/tesla/coil.dm | 6 ------ code/modules/power/turbine.dm | 6 ------ .../chemistry/machinery/chem_dispenser.dm | 3 --- .../reagents/chemistry/machinery/chem_heater.dm | 3 --- .../reagents/chemistry/machinery/chem_master.dm | 2 -- code/modules/research/rdmachines.dm | 2 -- code/modules/research/stock_parts.dm | 15 +++++++++++++-- 41 files changed, 23 insertions(+), 121 deletions(-) diff --git a/code/datums/components/storage/concrete/rped.dm b/code/datums/components/storage/concrete/rped.dm index 7e017273365..eb895fd74ff 100644 --- a/code/datums/components/storage/concrete/rped.dm +++ b/code/datums/components/storage/concrete/rped.dm @@ -10,8 +10,9 @@ /datum/component/storage/concrete/rped/can_be_inserted(obj/item/I, stop_messages, mob/M) . = ..() - if(!I.get_part_rating() && !stop_messages) - to_chat(M, "[parent] only accepts machine parts!") + if(!I.get_part_rating()) + if (!stop_messages) + to_chat(M, "[parent] only accepts machine parts!") return FALSE /datum/component/storage/concrete/bluespace/rped @@ -26,6 +27,7 @@ /datum/component/storage/concrete/bluespace/rped/can_be_inserted(obj/item/I, stop_messages, mob/M) . = ..() - if(!I.get_part_rating() && !stop_messages) - to_chat(M, "[parent] only accepts machine parts!") + if(!I.get_part_rating()) + if (!stop_messages) + to_chat(M, "[parent] only accepts machine par ts!") return FALSE diff --git a/code/game/machinery/Sleeper.dm b/code/game/machinery/Sleeper.dm index 1b5605f8f31..d745df25fbf 100644 --- a/code/game/machinery/Sleeper.dm +++ b/code/game/machinery/Sleeper.dm @@ -93,8 +93,6 @@ return if(default_change_direction_wrench(user, I)) return - if(exchange_parts(user, I)) - return if(default_pry_open(I)) return if(default_deconstruction_crowbar(I)) diff --git a/code/game/machinery/autolathe.dm b/code/game/machinery/autolathe.dm index 2c8fa467c2f..d6154aeb8b5 100644 --- a/code/game/machinery/autolathe.dm +++ b/code/game/machinery/autolathe.dm @@ -93,9 +93,6 @@ updateUsrDialog() return TRUE - if(exchange_parts(user, O)) - return TRUE - if(default_deconstruction_crowbar(O)) return TRUE diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index c5212061aaa..b386088f575 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -279,9 +279,6 @@ if(default_deconstruction_screwdriver(user, "[icon_state]_maintenance", "[initial(icon_state)]",W)) return - if(exchange_parts(user, W)) - return - if(default_deconstruction_crowbar(W)) return diff --git a/code/game/machinery/dna_scanner.dm b/code/game/machinery/dna_scanner.dm index 9296e0807d2..2a8868cb4f1 100644 --- a/code/game/machinery/dna_scanner.dm +++ b/code/game/machinery/dna_scanner.dm @@ -133,9 +133,6 @@ update_icon()//..since we're updating the icon here, since the scanner can be unpowered when opened/closed return - if(exchange_parts(user, I)) - return - if(default_pry_open(I)) return diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm index d6b35136b63..ab2694769f1 100644 --- a/code/game/machinery/hologram.dm +++ b/code/game/machinery/hologram.dm @@ -146,9 +146,6 @@ Possible to do for anyone motivated enough: if(default_deconstruction_screwdriver(user, "holopad_open", "holopad0", P)) return - if(exchange_parts(user, P)) - return - if(default_pry_open(P)) return diff --git a/code/game/machinery/launch_pad.dm b/code/game/machinery/launch_pad.dm index a53aaf47e15..93a6cfca620 100644 --- a/code/game/machinery/launch_pad.dm +++ b/code/game/machinery/launch_pad.dm @@ -37,9 +37,6 @@ to_chat(user, "You save the data in the [I.name]'s buffer.") return 1 - if(exchange_parts(user, I)) - return - if(default_deconstruction_crowbar(I)) return diff --git a/code/game/machinery/limbgrower.dm b/code/game/machinery/limbgrower.dm index 77cb3e32d1f..2fd8a22ce61 100644 --- a/code/game/machinery/limbgrower.dm +++ b/code/game/machinery/limbgrower.dm @@ -70,9 +70,6 @@ updateUsrDialog() return - if(exchange_parts(user, O)) - return - if(panel_open && default_deconstruction_crowbar(O)) return diff --git a/code/game/machinery/quantum_pad.dm b/code/game/machinery/quantum_pad.dm index 86452720460..eebab940bac 100644 --- a/code/game/machinery/quantum_pad.dm +++ b/code/game/machinery/quantum_pad.dm @@ -60,9 +60,6 @@ to_chat(user, "You link [src] to the one in [I]'s buffer.") return 1 - if(exchange_parts(user, I)) - return - if(default_deconstruction_crowbar(I)) return diff --git a/code/game/machinery/recharger.dm b/code/game/machinery/recharger.dm index 774846276ce..ea317b74e59 100755 --- a/code/game/machinery/recharger.dm +++ b/code/game/machinery/recharger.dm @@ -68,8 +68,6 @@ default_deconstruction_crowbar(G) return - if(exchange_parts(user, G)) - return return ..() /obj/machinery/recharger/attack_hand(mob/user) diff --git a/code/game/machinery/rechargestation.dm b/code/game/machinery/rechargestation.dm index 790158515fa..f46b957c4cb 100644 --- a/code/game/machinery/rechargestation.dm +++ b/code/game/machinery/rechargestation.dm @@ -53,9 +53,6 @@ if(default_deconstruction_screwdriver(user, "borgdecon2", "borgcharger0", P)) return - if(exchange_parts(user, P)) - return - if(default_pry_open(P)) return diff --git a/code/game/machinery/recycler.dm b/code/game/machinery/recycler.dm index 16a83dc929d..ec20efbf842 100644 --- a/code/game/machinery/recycler.dm +++ b/code/game/machinery/recycler.dm @@ -55,9 +55,6 @@ if(default_deconstruction_screwdriver(user, "grinder-oOpen", "grinder-o0", I)) return - if(exchange_parts(user, I)) - return - if(default_pry_open(I)) return diff --git a/code/game/machinery/spaceheater.dm b/code/game/machinery/spaceheater.dm index 9fbe2b412b6..872c5b8f1d6 100644 --- a/code/game/machinery/spaceheater.dm +++ b/code/game/machinery/spaceheater.dm @@ -156,7 +156,7 @@ update_icon() if(panel_open) interact(user) - else if(exchange_parts(user, I) || default_deconstruction_crowbar(I)) + else if(default_deconstruction_crowbar(I)) return else return ..() diff --git a/code/game/machinery/telecomms/machine_interactions.dm b/code/game/machinery/telecomms/machine_interactions.dm index 584bae9de33..1ad80ccbeda 100644 --- a/code/game/machinery/telecomms/machine_interactions.dm +++ b/code/game/machinery/telecomms/machine_interactions.dm @@ -18,10 +18,6 @@ if(default_deconstruction_screwdriver(user, icon_open, icon_closed, P)) return - - else if(exchange_parts(user, P)) - return - // Using a multitool lets you access the receiver's interface else if(istype(P, /obj/item/multitool)) attack_hand(user) diff --git a/code/game/machinery/teleporter.dm b/code/game/machinery/teleporter.dm index 9e901a628a2..7b66a57f59a 100644 --- a/code/game/machinery/teleporter.dm +++ b/code/game/machinery/teleporter.dm @@ -55,8 +55,6 @@ power_station.engaged = 0 //hub with panel open is off, so the station must be informed. update_icon() return - if(exchange_parts(user, W)) - return if(default_deconstruction_crowbar(W)) return return ..() @@ -169,9 +167,6 @@ update_icon() return - else if(exchange_parts(user, W)) - return - else if(default_deconstruction_crowbar(W)) return diff --git a/code/game/mecha/mech_bay.dm b/code/game/mecha/mech_bay.dm index 90234b97b5f..b2c771cb216 100644 --- a/code/game/mecha/mech_bay.dm +++ b/code/game/mecha/mech_bay.dm @@ -62,9 +62,6 @@ recharging_turf = get_step(loc, dir) return - if(exchange_parts(user, I)) - return - if(default_deconstruction_crowbar(I)) return return ..() diff --git a/code/game/mecha/mech_fabricator.dm b/code/game/mecha/mech_fabricator.dm index 7815014891f..49f29b5969e 100644 --- a/code/game/mecha/mech_fabricator.dm +++ b/code/game/mecha/mech_fabricator.dm @@ -401,9 +401,6 @@ if(default_deconstruction_screwdriver(user, "fab-o", "fab-idle", W)) return TRUE - if(exchange_parts(user, W)) - return TRUE - if(default_deconstruction_crowbar(W)) return TRUE diff --git a/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm b/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm index 16d6cb9fd0c..90c56410024 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm @@ -298,7 +298,7 @@ var/reagentlist = pretty_string_from_reagent_list(I.reagents.reagent_list) log_game("[key_name(user)] added an [I] to cyro containing [reagentlist]") return - if(!on && !occupant && !state_open && (default_deconstruction_screwdriver(user, "pod-off", "pod-off", I) || exchange_parts(user, I)) \ + if(!on && !occupant && !state_open && (default_deconstruction_screwdriver(user, "pod-off", "pod-off", I)) \ || default_change_direction_wrench(user, I) \ || default_pry_open(I) \ || default_deconstruction_crowbar(I)) diff --git a/code/modules/atmospherics/machinery/components/unary_devices/thermomachine.dm b/code/modules/atmospherics/machinery/components/unary_devices/thermomachine.dm index ce365bdab86..2ff19218f54 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/thermomachine.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/thermomachine.dm @@ -80,8 +80,6 @@ return if(default_deconstruction_crowbar(I)) return - if(exchange_parts(user, I)) - return return ..() /obj/machinery/atmospherics/components/unary/thermomachine/default_change_direction_wrench(mob/user, obj/item/I) diff --git a/code/modules/food_and_drinks/kitchen_machinery/deep_fryer.dm b/code/modules/food_and_drinks/kitchen_machinery/deep_fryer.dm index 369b5529efa..ebea3933973 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/deep_fryer.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/deep_fryer.dm @@ -89,8 +89,6 @@ God bless America. return if(default_unfasten_wrench(user, I)) return - else if(exchange_parts(user, I)) - return else if(default_deconstruction_screwdriver(user, "fryer_off", "fryer_off" ,I)) //where's the open maint panel icon?! return else diff --git a/code/modules/food_and_drinks/kitchen_machinery/gibber.dm b/code/modules/food_and_drinks/kitchen_machinery/gibber.dm index 5da7975a05b..784cf22ccd2 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/gibber.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/gibber.dm @@ -99,10 +99,7 @@ /obj/machinery/gibber/attackby(obj/item/P, mob/user, params) if(default_deconstruction_screwdriver(user, "grinder_open", "grinder", P)) return - - else if(exchange_parts(user, P)) - return - + else if(default_pry_open(P)) return diff --git a/code/modules/food_and_drinks/kitchen_machinery/microwave.dm b/code/modules/food_and_drinks/kitchen_machinery/microwave.dm index 8330c9feed2..7363f262b4b 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/microwave.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/microwave.dm @@ -50,8 +50,6 @@ return if(default_unfasten_wrench(user, O)) return - if(exchange_parts(user, O)) - return if(default_deconstruction_crowbar(O)) return diff --git a/code/modules/food_and_drinks/kitchen_machinery/monkeyrecycler.dm b/code/modules/food_and_drinks/kitchen_machinery/monkeyrecycler.dm index 23466305f14..397f5c7a6dc 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/monkeyrecycler.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/monkeyrecycler.dm @@ -29,9 +29,6 @@ if(default_deconstruction_screwdriver(user, "grinder_open", "grinder", O)) return - if(exchange_parts(user, O)) - return - if(default_pry_open(O)) return diff --git a/code/modules/food_and_drinks/kitchen_machinery/processor.dm b/code/modules/food_and_drinks/kitchen_machinery/processor.dm index e07a957cfb0..91a73eececd 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/processor.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/processor.dm @@ -46,9 +46,6 @@ if(default_deconstruction_screwdriver(user, "processor", "processor1", O)) return - if(exchange_parts(user, O)) - return - if(default_pry_open(O)) return diff --git a/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm b/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm index a09f1afd5d0..2522ec9cf2e 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/smartfridge.dm @@ -55,9 +55,6 @@ if(default_deconstruction_screwdriver(user, "smartfridge_open", "smartfridge", O)) return - if(exchange_parts(user, O)) - return - if(default_pry_open(O)) return diff --git a/code/modules/hydroponics/biogenerator.dm b/code/modules/hydroponics/biogenerator.dm index 65aaba95e79..624394f8787 100644 --- a/code/modules/hydroponics/biogenerator.dm +++ b/code/modules/hydroponics/biogenerator.dm @@ -83,9 +83,6 @@ update_icon() return - if(exchange_parts(user, O)) - return - if(default_deconstruction_crowbar(O)) return diff --git a/code/modules/hydroponics/gene_modder.dm b/code/modules/hydroponics/gene_modder.dm index 6bb000ebe20..dd1d1777d8e 100644 --- a/code/modules/hydroponics/gene_modder.dm +++ b/code/modules/hydroponics/gene_modder.dm @@ -69,8 +69,6 @@ if(default_deconstruction_screwdriver(user, "dnamod", "dnamod", I)) update_icon() return - if(exchange_parts(user, I)) - return if(default_deconstruction_crowbar(I)) return if(iscyborg(user)) diff --git a/code/modules/hydroponics/hydroponics.dm b/code/modules/hydroponics/hydroponics.dm index 0f1a43bd684..3890c8e3178 100644 --- a/code/modules/hydroponics/hydroponics.dm +++ b/code/modules/hydroponics/hydroponics.dm @@ -59,9 +59,6 @@ if(default_deconstruction_screwdriver(user, "hydrotray3", "hydrotray3", I)) return - if(exchange_parts(user, I)) - return - if(default_pry_open(I)) return diff --git a/code/modules/hydroponics/seed_extractor.dm b/code/modules/hydroponics/seed_extractor.dm index f188466434e..3d0ffdfd533 100644 --- a/code/modules/hydroponics/seed_extractor.dm +++ b/code/modules/hydroponics/seed_extractor.dm @@ -62,9 +62,6 @@ if(default_deconstruction_screwdriver(user, "sextractor_open", "sextractor", O)) return - if(exchange_parts(user, O)) - return - if(default_pry_open(O)) return diff --git a/code/modules/mining/machine_redemption.dm b/code/modules/mining/machine_redemption.dm index 6f663d19afa..63e00f5a387 100644 --- a/code/modules/mining/machine_redemption.dm +++ b/code/modules/mining/machine_redemption.dm @@ -148,8 +148,6 @@ send_console_message() /obj/machinery/mineral/ore_redemption/attackby(obj/item/W, mob/user, params) - if(exchange_parts(user, W)) - return GET_COMPONENT(materials, /datum/component/material_container) if(default_pry_open(W)) materials.retrieve_all() diff --git a/code/modules/power/port_gen.dm b/code/modules/power/port_gen.dm index cc4000fd42b..7cea950ccc7 100644 --- a/code/modules/power/port_gen.dm +++ b/code/modules/power/port_gen.dm @@ -173,9 +173,6 @@ return else if(!active) - if(exchange_parts(user, O)) - return - if(istype(O, /obj/item/wrench)) if(!anchored && !isinspace()) diff --git a/code/modules/power/rtg.dm b/code/modules/power/rtg.dm index d458fbf7e2d..7266a3e8a0a 100644 --- a/code/modules/power/rtg.dm +++ b/code/modules/power/rtg.dm @@ -38,9 +38,7 @@ power_gen = initial(power_gen) * part_level /obj/machinery/power/rtg/attackby(obj/item/I, mob/user, params) - if(exchange_parts(user, I)) - return - else if(default_deconstruction_screwdriver(user, "[initial(icon_state)]-open", initial(icon_state), I)) + if(default_deconstruction_screwdriver(user, "[initial(icon_state)]-open", initial(icon_state), I)) return else if(default_deconstruction_crowbar(I)) return diff --git a/code/modules/power/singularity/emitter.dm b/code/modules/power/singularity/emitter.dm index d6a27f1483e..da2fc9dc949 100644 --- a/code/modules/power/singularity/emitter.dm +++ b/code/modules/power/singularity/emitter.dm @@ -291,9 +291,6 @@ wires.interact(user) return - else if(exchange_parts(user, I)) - return - return ..() /obj/machinery/power/emitter/emag_act(mob/user) diff --git a/code/modules/power/smes.dm b/code/modules/power/smes.dm index 95b78ff0b50..d514a2c4e99 100644 --- a/code/modules/power/smes.dm +++ b/code/modules/power/smes.dm @@ -98,10 +98,6 @@ update_icon() return - //exchanging parts using the RPE - if(exchange_parts(user, I)) - return - //building and linking a terminal if(istype(I, /obj/item/stack/cable_coil)) var/dir = get_dir(user,src) diff --git a/code/modules/power/tesla/coil.dm b/code/modules/power/tesla/coil.dm index d8dbb6d2466..fbd389e7c5a 100644 --- a/code/modules/power/tesla/coil.dm +++ b/code/modules/power/tesla/coil.dm @@ -56,9 +56,6 @@ if(default_deconstruction_screwdriver(user, "coil_open[anchored]", "coil[anchored]", W)) return - if(exchange_parts(user, W)) - return - if(default_unfasten_wrench(user, W)) return @@ -169,9 +166,6 @@ if(default_deconstruction_screwdriver(user, "grounding_rod_open[anchored]", "grounding_rod[anchored]", W)) return - if(exchange_parts(user, W)) - return - if(default_unfasten_wrench(user, W)) return diff --git a/code/modules/power/turbine.dm b/code/modules/power/turbine.dm index 7e73c1c9c18..22777e4fcf4 100644 --- a/code/modules/power/turbine.dm +++ b/code/modules/power/turbine.dm @@ -112,9 +112,6 @@ stat |= BROKEN return - if(exchange_parts(user, I)) - return - default_deconstruction_crowbar(I) /obj/machinery/power/compressor/process() @@ -243,9 +240,6 @@ stat |= BROKEN return - if(exchange_parts(user, I)) - return - default_deconstruction_crowbar(I) /obj/machinery/power/turbine/ui_interact(mob/user) diff --git a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm index 02d6bb9152f..2db60588520 100644 --- a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm +++ b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm @@ -292,9 +292,6 @@ obj/machinery/chem_dispenser/proc/work_animation() update_icon() return - if(exchange_parts(user, I)) - return - if(default_deconstruction_crowbar(I)) return if(istype(I, /obj/item/reagent_containers) && !(I.flags_1 & ABSTRACT_1) && I.is_open_container()) diff --git a/code/modules/reagents/chemistry/machinery/chem_heater.dm b/code/modules/reagents/chemistry/machinery/chem_heater.dm index fa88cab8017..73413a5e7bc 100644 --- a/code/modules/reagents/chemistry/machinery/chem_heater.dm +++ b/code/modules/reagents/chemistry/machinery/chem_heater.dm @@ -60,9 +60,6 @@ if(default_deconstruction_screwdriver(user, "mixer0b", "mixer0b", I)) return - if(exchange_parts(user, I)) - return - if(default_deconstruction_crowbar(I)) return diff --git a/code/modules/reagents/chemistry/machinery/chem_master.dm b/code/modules/reagents/chemistry/machinery/chem_master.dm index b1c150e4bb3..22bd7131d7b 100644 --- a/code/modules/reagents/chemistry/machinery/chem_master.dm +++ b/code/modules/reagents/chemistry/machinery/chem_master.dm @@ -79,8 +79,6 @@ if(default_deconstruction_screwdriver(user, "mixer0_nopower", "mixer0", I)) return - else if(exchange_parts(user, I)) - return else if(default_deconstruction_crowbar(I)) return diff --git a/code/modules/research/rdmachines.dm b/code/modules/research/rdmachines.dm index 0ce53f0e071..47f34a9b150 100644 --- a/code/modules/research/rdmachines.dm +++ b/code/modules/research/rdmachines.dm @@ -43,8 +43,6 @@ if(linked_console) disconnect_console() return - if(exchange_parts(user, O)) - return if(default_deconstruction_crowbar(O)) return if(is_refillable() && O.is_drainable()) diff --git a/code/modules/research/stock_parts.dm b/code/modules/research/stock_parts.dm index 96e7656fbc5..4bd318de21e 100644 --- a/code/modules/research/stock_parts.dm +++ b/code/modules/research/stock_parts.dm @@ -14,13 +14,24 @@ If you create T5+ please take a pass at gene_modder.dm [L40]. Max_values MUST fi var/pshoom_or_beepboopblorpzingshadashwoosh = 'sound/items/rped.ogg' var/alt_sound = null -/obj/item/storage/part_replacer/afterattack(obj/machinery/T, mob/living/carbon/human/user, flag, params) +/obj/item/storage/part_replacer/pre_attack(obj/machinery/T, mob/living/user, params) if(!istype(T) || !T.component_parts) return ..() - if(works_from_distance || user.Adjacent(T)) + if(user.Adjacent(T)) // no TK upgrading. + if(works_from_distance) + user.Beam(T, icon_state = "rped_upgrade", time = 5) T.exchange_parts(user, src) + return FALSE + return ..() + +/obj/item/storage/part_replacer/afterattack(obj/machinery/T, mob/living/user, adjacent, params) + if(adjacent || !istype(T) || !T.component_parts) + return ..() if(works_from_distance) user.Beam(T, icon_state = "rped_upgrade", time = 5) + T.exchange_parts(user, src) + return + return ..() /obj/item/storage/part_replacer/proc/play_rped_sound() //Plays the sound for RPED exhanging or installing parts.