From 6f7585f53b3e7c388768c2c9eca3bee97719d2ff Mon Sep 17 00:00:00 2001 From: Pinta <68373373+softcerv@users.noreply.github.com> Date: Tue, 23 Nov 2021 11:14:31 -0500 Subject: [PATCH] [MODULAR] Rebinds Hypospray Controls (#9558) * god * Update hyposprays_II.dm * finally * a bit of clean up * it's just like a gun * Update hyposprays_II.dm * Update modular_skyrat/modules/hyposprays/code/hyposprays_II.dm Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com> Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com> --- .../modules/hyposprays/code/hyposprays_II.dm | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/modular_skyrat/modules/hyposprays/code/hyposprays_II.dm b/modular_skyrat/modules/hyposprays/code/hyposprays_II.dm index 94aafc6415a..84db5ad14ab 100644 --- a/modular_skyrat/modules/hyposprays/code/hyposprays_II.dm +++ b/modular_skyrat/modules/hyposprays/code/hyposprays_II.dm @@ -99,7 +99,6 @@ . += "[vial] has [vial.reagents.total_volume]u remaining." else . += "It has no vial loaded in." - . += "[src] is set to [mode ? "Inject" : "Spray"] contents on application." /obj/item/hypospray/mkii/proc/unload_hypo(obj/item/hypo, mob/user) if((istype(hypo, /obj/item/reagent_containers/glass/vial))) @@ -149,12 +148,18 @@ insert_vial(used_item, user) return TRUE -/obj/item/hypospray/mkii/AltClick(mob/user) +/obj/item/hypospray/mkii/attack_self(mob/user) . = ..() if(vial) vial.attack_self(user) return TRUE +/obj/item/hypospray/mkii/attack_self_secondary(mob/user) + . = ..() + if(vial) + vial.attack_self_secondary(user) + return TRUE + /obj/item/hypospray/mkii/emag_act(mob/user) . = ..() if(obj_flags & EMAGGED) @@ -170,12 +175,14 @@ obj_flags |= EMAGGED return TRUE -/obj/item/hypospray/mkii/attack_hand(mob/user) - . = ..() //Don't bother changing this or removing it from containers will break. - /obj/item/hypospray/mkii/attack(obj/item/hypo, mob/user, params) + mode = HYPO_INJECT return +/obj/item/hypospray/mkii/attack_secondary(obj/item/hypo, mob/user, params) + mode = HYPO_SPRAY + return SECONDARY_ATTACK_CONTINUE_CHAIN + /obj/item/hypospray/mkii/afterattack(atom/target, mob/living/user, proximity) if(istype(target, /obj/item/reagent_containers/glass/vial)) insert_vial(target, user, vial) @@ -231,31 +238,24 @@ to_chat(user, span_notice("You [fp_verb] [vial.amount_per_transfer_from_this] units of the solution. The hypospray's cartridge now contains [vial.reagents.total_volume] units.")) update_appearance() -/obj/item/hypospray/mkii/attack_self(mob/living/user) - if(user) +/obj/item/hypospray/mkii/afterattack_secondary(atom/target, mob/living/user, proximity) + return SECONDARY_ATTACK_CALL_NORMAL + +/obj/item/hypospray/mkii/attack_hand(mob/living/user) + if(user && loc == user && user.is_holding(src)) if(user.incapacitated()) return else if(!vial) - to_chat(user, "This Hypo needs to be loaded first!") + . = ..() return else unload_hypo(vial,user) - -/obj/item/hypospray/mkii/CtrlClick(mob/living/user) - . = ..() - if(user.canUseTopic(src, FALSE) && user.get_active_held_item(src)) - switch(mode) - if(HYPO_SPRAY) - mode = HYPO_INJECT - to_chat(user, "[src] is now set to inject contents on application.") - if(HYPO_INJECT) - mode = HYPO_SPRAY - to_chat(user, "[src] is now set to spray contents on application.") - return TRUE + else + . = ..() /obj/item/hypospray/mkii/examine(mob/user) . = ..() - . += span_notice("Ctrl-Click it to toggle its mode from spraying to injecting and vice versa.") + . += span_notice("Left-Click on patients to inject, Right-Click to spray.") #undef HYPO_SPRAY #undef HYPO_INJECT